CN104461628A - Method and device for controlling updating of server programs - Google Patents
Method and device for controlling updating of server programs Download PDFInfo
- Publication number
- CN104461628A CN104461628A CN201410748052.7A CN201410748052A CN104461628A CN 104461628 A CN104461628 A CN 104461628A CN 201410748052 A CN201410748052 A CN 201410748052A CN 104461628 A CN104461628 A CN 104461628A
- Authority
- CN
- China
- Prior art keywords
- server program
- connection request
- legacy server
- legacy
- program
- 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
Links
Landscapes
- Information Transfer Between Computers (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method and a device for controlling updating of server programs. The method includes that a host process of an old server program is utilized to load a new server program so as to control the new server program to acquire related attribute and parameters of a currently-monitored socket from the old server program, so that the new server program and the old server program can be bound with the same IP and the same port at the same time, in other words, the old server program and the new server program can be executed at the same time. In this way, a new connecting request is subjected to processing of a new server, and a connecting request which realizes connection is subjected to processing of an old server, so that service of a client side is ensured not to be interrupted.
Description
Technical field
The application relates to system update field, more particularly, relates to a kind of method and apparatus of Control Server program updates.
Background technology
The realization of current back-end server program mainly contains two kinds of modes: one is based on http protocol, uses dynamic script language development, is common in Web network application based on browser operation as excellent cruel, microblogging etc.; Another is based on TCP/IP transport layer protocol, and use static instruction as C, C++ exploitation, common application is as the back-end server program of PC end game.
Use the server program that the above-mentioned second way realizes, the socket of server program binds certain IP and port usually, with daemon mode operation in backstage.Use TCP length to be connected between client with server program, namely after client's side link to server, keep this connection until close connection when server exception or client initiatively exit always.Because linux system does not provide multiple socket to bind the support of same IP and port for TCP connection simultaneously, when thus server program performs renewal rewards theory, need old server program to close, then start new server program.But close the connection that old server program can close client and server, client will be forced to the service disruption that rolls off the production line simultaneously, have to reconnect server again to obtain service.
Summary of the invention
In view of this, the application provides a kind of method and apparatus of Control Server program updates, and when server program is upgraded, the service of client can not be interrupted.
To achieve these goals, the existing scheme proposed is as follows:
A method for Control Server program updates, comprising:
The host process of legacy server program is utilized to load new server program;
Control association attributes and parameter that described new server program obtains the socket of current monitoring from described legacy server program, same IP and port can be bound with new server program and legacy server program simultaneously;
The progress of work controlling legacy server program stops the connection request receiving client transmission, and allows the progress of work of legacy server program to process the connection request received;
The progress of work controlling new server program receives the connection request of client transmission.
Preferably, the described host process of legacy server program that utilizes loads new server program, comprising:
Under leaving described new server program in assigned catalogue, the host process to legacy server program issues program updates instruction, calls execve function from assigned catalogue, load new server program with the host process triggering legacy server program.
Preferably, the described new server program of described control obtains association attributes and the parameter of the socket of current monitoring from described legacy server program, comprising:
Control described new server program and call association attributes and the parameter that getsockname function and getsockopt function obtain the socket of current monitoring from described legacy server program.
Preferably, the progress of work of described control legacy server program stops the connection request receiving client transmission, and allows the progress of work of described legacy server program to process the connection request received, and also comprises afterwards:
When the number of the connection request in the progress of work of described legacy server program is zero, controls described legacy server program and exit.
Preferably, when the number of described connection request in the progress of work of described legacy server program is zero, controls described legacy server program and exit, comprising:
Obtain the sum of the connection request in all working process of legacy server program;
Whether the sum judging described connection request is zero;
If so, then control described legacy server program to exit;
If not, then continue to process described connection request.
A device for Control Server program updates, comprising:
Program loading unit, loads new server program for utilizing the host process of legacy server program;
Socket parameter acquiring unit, obtains association attributes and the parameter of the socket of current monitoring from described legacy server program for controlling described new server program;
First control module, the progress of work for controlling legacy server program stops the connection request receiving client transmission, and allows the progress of work of legacy server program to process the connection request received;
Second control module, the progress of work for controlling new server program receives the connection request that client sends.
Preferably, described program loading unit comprises:
Storing sub-units, for storing new server program;
Update instruction issues subelement, and for issuing program updates instruction to the host process of legacy server program, wherein, described program updates instruction is called execve function for the host process triggering legacy server program from storage unit, loaded new server program.
Preferably, described socket parameter acquiring unit comprises:
Function storing sub-units, for storing getsockname function and getsockopt function;
Function transfers subelement, calls for controlling described new server program association attributes and the parameter that getsockname function and getsockopt function obtain the socket of current monitoring from described legacy server program.
Preferably, also comprise:
Performance element, when the number of the connection request in the progress of work when described legacy server program is zero, controls described legacy server program and exits.
Preferably, described performance element comprises:
Quantity gathers subelement, the sum of the connection request in all working process obtaining legacy server program;
Judgment sub-unit, for judging whether the sum of connection request is zero;
If so, then control described legacy server program to exit;
If not, then continue to process described connection request.
Through as shown from the above technical solution, the invention discloses a kind of method and apparatus of Control Server program updates.The method utilizes the host process of legacy server program to load new server program, and then control association attributes and the parameter that new server program obtains the socket of current monitoring from legacy server program, thus make new server program and legacy server program can bind same IP and port simultaneously, legacy server program and new server program can be performed simultaneously.Like this, for new connection request then by new server process, the connection request connected then is had been friends in the past server process, thus ensures that the service of client can not be interrupted.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
Fig. 1 shows the schematic flow sheet of an embodiment of the method for a kind of Control Server program updates of the present invention;
Fig. 2 shows the structural representation of an embodiment of the device of a kind of Control Server program updates of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The schematic flow sheet of an embodiment of the method that a kind of Control Server of the present invention upgrades is shown see Fig. 1.
As shown in Figure 1, the method specifically comprises in the present embodiment:
101: utilize the host process of legacy server program to load new server program.
The realization of server program based on the mode of operation of master/woker, i.e. the mode of operation of host process/progress of work.Host process is responsible for generating the progress of work and is monitored progress of work state, the order of process user side, carries out reboot operation or out of service according to user side order.The progress of work is generated by main, for the treatment of the connection request that user side issues, and from the order that user side or host process send.Communicated by socket between host process and the progress of work.
New server program is loaded by the host process of legacy server program.When server program upgrades, under new server program is left in the catalogue of specifying by user.Send User Defined signal (USER1 or USER2) and QUIT (or WINCH) signal by terminal to the host process of the legacy server program of current operation, notice legacy server program performs renewal rewards theory.After the host process of legacy server program receives signal, call function execve loads new server program from assigned catalogue.
102: control association attributes and parameter that described new server program obtains the socket of current monitoring from described legacy server program.
Legacy server program is while loading new server program, new server program obtains the filec descriptor of current monitoring socket by system environment variable, namely obtain socket association attributes and the parameter of current monitoring, thus new server program and legacy server program can bind same IP and port simultaneously.Optionally, association attributes and parameter that getsockname function and getsockopt function obtain the socket of current monitoring from described legacy server program is called when new server program starts.
103: the progress of work controlling legacy server program stops the connection request receiving client transmission, and allows the progress of work of legacy server program to process the connection request received.
104: the progress of work controlling new server program receives the connection request of client transmission.
When after the loading that legacy server program completes new server program, the connection request that all working process controlling legacy server program stops reception client to issue, and allow the progress of work of legacy server program to continue process to the request connected, after the request connected when legacy server routine processes is complete, control legacy server program and exit.Optionally, the sum of the connection request in all working process of legacy server program can be obtained, and then whether the sum judging connection request is zero.If so, then control legacy server program to exit; If not, then continue to process connection request.
When legacy server program carries out processor to the request connected, the new connection request that client issues then has new server program process.
This method, by inheriting server socket monitoring file descriptor and linux system signaling mechanism, proposes a kind of method of Control Server program updates, for enterprise provides stable service to provide convenience to client.First, because server update can not the connection of hard closing client and server, do not affect and connected the normal use of client to service, the operation carrying out reconnecting server in client is not needed yet, enhance the stability of service, improve Consumer's Experience, also reduce the difficulty of client staff development client.Because only use same IP and port, in the process of server update, new and old edition server program can provide service to client simultaneously, avoid operation maintenance personnel and will shield the inconvenience that port carries out upgrading when update server program successively, the possibility of misoperation when simple renewal rewards theory decreases operation maintenance personnel update server program.Exploitation, maintenance and management complexity reduce, and reduce the waste of human resources, related personnel puts into there being more energy in the core business of project.
A kind of method upgraded with Control Server adapts, and the invention also discloses the device that a kind of Control Server upgrades.
The structural representation of an embodiment of the device that a kind of Control Server of the present invention upgrades is shown see Fig. 2.
As shown in Figure 2, this device comprises:
Program loading unit 1, loads new server program for utilizing the host process of legacy server program.
Wherein, this program loading unit 1 can comprise: storing sub-units and update instruction issue subelement.Concrete, this storing sub-units is for storing new server program; Update instruction issues subelement, and for issuing program updates instruction to the host process of legacy server program, wherein, described program updates instruction is called execve function for the host process triggering legacy server program from storage unit, loaded new server program.
Socket parameter acquiring unit 2, obtains association attributes and the parameter of the socket of current monitoring from described legacy server program for controlling described new server program.Wherein, socket parameter acquiring unit comprises: for storing the function storing sub-units of getsockname function and getsockopt function, and the function calling the association attributes and parameter that getsockname function and getsockopt function obtain the socket of current monitoring from described legacy server program for controlling described new server program transfers subelement.
First control module 3, the progress of work for controlling legacy server program stops the connection request receiving client transmission, and allows the progress of work of legacy server program to process the connection request received;
Second control module 4, the progress of work for controlling new server program receives the connection request that client sends.
It should be noted that, this device also comprises performance element, when the number of the connection request in the progress of work when described legacy server program is zero, controls described legacy server program and exits.
Optionally, this performance element comprises: quantity gathers subelement, the sum of the connection request in all working process obtaining legacy server program;
Judgment sub-unit, for judging whether the sum of connection request is zero.If so, then control described legacy server program to exit; If not, then continue to process described connection request.
Finally, also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (10)
1. a method for Control Server program updates, is characterized in that, comprising:
The host process of legacy server program is utilized to load new server program;
Control association attributes and parameter that described new server program obtains the socket of current monitoring from described legacy server program, same IP and port can be bound to make new server program and legacy server program simultaneously;
The progress of work controlling legacy server program stops the connection request receiving client transmission, and allows the progress of work of legacy server program to process the connection request received;
The progress of work controlling new server program receives the connection request of client transmission.
2. method according to claim 1, is characterized in that, the described host process of legacy server program that utilizes loads new server program, comprising:
Under leaving described new server program in assigned catalogue, the host process to legacy server program issues program updates instruction, calls execve function from assigned catalogue, load new server program with the host process triggering legacy server program.
3. method according to claim 1, is characterized in that, the described new server program of described control obtains association attributes and the parameter of the socket of current monitoring from described legacy server program, comprising:
Control described new server program and call association attributes and the parameter that getsockname function and getsockopt function obtain the socket of current monitoring from described legacy server program.
4. method according to claim 1, it is characterized in that, the progress of work of described control legacy server program stops the connection request receiving client transmission, and allows the progress of work of described legacy server program to process the connection request received, and also comprises afterwards:
When the number of the connection request in the progress of work of described legacy server program is zero, controls described legacy server program and exit.
5. method according to claim 4, is characterized in that, when the number of described connection request in the progress of work of described legacy server program is zero, controls described legacy server program and exits, comprising:
Obtain the sum of the connection request in all working process of legacy server program;
Whether the sum judging described connection request is zero;
If so, then control described legacy server program to exit;
If not, then continue to process described connection request.
6. a device for Control Server program updates, is characterized in that, comprising:
Program loading unit, loads new server program for utilizing the host process of legacy server program;
Socket parameter acquiring unit, obtains association attributes and the parameter of the socket of current monitoring from described legacy server program for controlling described new server program;
First control module, the progress of work for controlling legacy server program stops the connection request receiving client transmission, and allows the progress of work of legacy server program to process the connection request received;
Second control module, the progress of work for controlling new server program receives the connection request that client sends.
7. device according to claim 6, is characterized in that, described program loading unit comprises:
Storing sub-units, for storing new server program;
Update instruction issues subelement, and for issuing program updates instruction to the host process of legacy server program, wherein, described program updates instruction is called execve function for the host process triggering legacy server program from storage unit, loaded new server program.
8. device according to claim 6, is characterized in that, described socket parameter acquiring unit comprises:
Function storing sub-units, for storing getsockname function and getsockopt function;
Function transfers subelement, calls for controlling described new server program association attributes and the parameter that getsockname function and getsockopt function obtain the socket of current monitoring from described legacy server program.
9. device according to claim 6, is characterized in that, also comprises:
Performance element, when the number of the connection request in the progress of work when described legacy server program is zero, controls described legacy server program and exits.
10. device according to claim 9, is characterized in that, described performance element comprises:
Quantity gathers subelement, the sum of the connection request in all working process obtaining legacy server program;
Judgment sub-unit, for judging whether the sum of connection request is zero;
If so, then control described legacy server program to exit;
If not, then continue to process described connection request.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410748052.7A CN104461628A (en) | 2014-12-09 | 2014-12-09 | Method and device for controlling updating of server programs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410748052.7A CN104461628A (en) | 2014-12-09 | 2014-12-09 | Method and device for controlling updating of server programs |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104461628A true CN104461628A (en) | 2015-03-25 |
Family
ID=52907733
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410748052.7A Pending CN104461628A (en) | 2014-12-09 | 2014-12-09 | Method and device for controlling updating of server programs |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104461628A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450782A (en) * | 2016-01-15 | 2016-03-30 | 网宿科技股份有限公司 | A method and system for restart network service without package losses and machine halt |
CN105677433A (en) * | 2016-03-15 | 2016-06-15 | 深圳创维-Rgb电子有限公司 | Hot upgrading method and device for server program |
CN105930191A (en) * | 2016-04-28 | 2016-09-07 | 网宿科技股份有限公司 | System service reloading method and apparatus |
WO2016184315A1 (en) * | 2015-05-15 | 2016-11-24 | 阿里巴巴集团控股有限公司 | Service upgrading method and device based on network connection |
CN106598648A (en) * | 2016-11-10 | 2017-04-26 | 北京三快在线科技有限公司 | Control method and device for upgrade of server program |
CN106909410A (en) * | 2015-12-23 | 2017-06-30 | 鼎捷软件股份有限公司 | A kind of update method and server system for server system |
CN110990039A (en) * | 2019-11-29 | 2020-04-10 | 北京金山云网络技术有限公司 | Application program updating method, device and system and computer readable storage medium |
US10671376B2 (en) | 2016-03-15 | 2020-06-02 | Shenzhen Skyworth-Rgb Electronic Co., Ltd. | Server program hot upgrading method and device |
CN111258739A (en) * | 2020-01-20 | 2020-06-09 | 上海米哈游天命科技有限公司 | Server process updating method, device, server and medium |
CN111352642A (en) * | 2020-02-27 | 2020-06-30 | 厦门网宿有限公司 | Service equipment and service software upgrading method |
CN113778475A (en) * | 2020-06-18 | 2021-12-10 | 北京京东振世信息技术有限公司 | Information processing method and device |
CN106909410B (en) * | 2015-12-23 | 2024-04-30 | 鼎捷软件股份有限公司 | Updating method for server system and server system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101079767A (en) * | 2006-09-26 | 2007-11-28 | 腾讯科技(深圳)有限公司 | An upgrade method and system of Web service system |
CN103164236A (en) * | 2011-12-16 | 2013-06-19 | 深圳市腾讯计算机系统有限公司 | Method and system of online update of remote server |
CN103546500A (en) * | 2012-07-11 | 2014-01-29 | 中国银联股份有限公司 | Method and system for switching servers |
-
2014
- 2014-12-09 CN CN201410748052.7A patent/CN104461628A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101079767A (en) * | 2006-09-26 | 2007-11-28 | 腾讯科技(深圳)有限公司 | An upgrade method and system of Web service system |
CN103164236A (en) * | 2011-12-16 | 2013-06-19 | 深圳市腾讯计算机系统有限公司 | Method and system of online update of remote server |
CN103546500A (en) * | 2012-07-11 | 2014-01-29 | 中国银联股份有限公司 | Method and system for switching servers |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016184315A1 (en) * | 2015-05-15 | 2016-11-24 | 阿里巴巴集团控股有限公司 | Service upgrading method and device based on network connection |
CN106301820A (en) * | 2015-05-15 | 2017-01-04 | 阿里巴巴集团控股有限公司 | A kind of upgrade method based on network connection service and device |
CN106909410A (en) * | 2015-12-23 | 2017-06-30 | 鼎捷软件股份有限公司 | A kind of update method and server system for server system |
CN106909410B (en) * | 2015-12-23 | 2024-04-30 | 鼎捷软件股份有限公司 | Updating method for server system and server system |
CN105450782A (en) * | 2016-01-15 | 2016-03-30 | 网宿科技股份有限公司 | A method and system for restart network service without package losses and machine halt |
WO2017121063A1 (en) * | 2016-01-15 | 2017-07-20 | 网宿科技股份有限公司 | Method and system for use in restarting network service without packet loss and downtime |
CN105450782B (en) * | 2016-01-15 | 2018-11-06 | 网宿科技股份有限公司 | The method and system of network service is restarted in a kind of shutdown of no packet loss zero |
US10348558B2 (en) | 2016-01-15 | 2019-07-09 | Wangsu Science & Technology Co., Ltd | Method and system for restarting network service without packet loss and with zero downtime |
CN105677433A (en) * | 2016-03-15 | 2016-06-15 | 深圳创维-Rgb电子有限公司 | Hot upgrading method and device for server program |
US10671376B2 (en) | 2016-03-15 | 2020-06-02 | Shenzhen Skyworth-Rgb Electronic Co., Ltd. | Server program hot upgrading method and device |
CN105930191A (en) * | 2016-04-28 | 2016-09-07 | 网宿科技股份有限公司 | System service reloading method and apparatus |
WO2017185718A1 (en) * | 2016-04-28 | 2017-11-02 | 网宿科技股份有限公司 | Method and device for reloading system service |
CN105930191B (en) * | 2016-04-28 | 2019-01-04 | 网宿科技股份有限公司 | The overloaded method and device of system service |
CN106598648A (en) * | 2016-11-10 | 2017-04-26 | 北京三快在线科技有限公司 | Control method and device for upgrade of server program |
CN110990039B (en) * | 2019-11-29 | 2023-09-05 | 北京金山云网络技术有限公司 | Application program updating method, device and system and computer readable storage medium |
CN110990039A (en) * | 2019-11-29 | 2020-04-10 | 北京金山云网络技术有限公司 | Application program updating method, device and system and computer readable storage medium |
CN111258739A (en) * | 2020-01-20 | 2020-06-09 | 上海米哈游天命科技有限公司 | Server process updating method, device, server and medium |
CN111352642A (en) * | 2020-02-27 | 2020-06-30 | 厦门网宿有限公司 | Service equipment and service software upgrading method |
CN111352642B (en) * | 2020-02-27 | 2023-08-18 | 厦门网宿有限公司 | Service equipment and service software upgrading method |
CN113778475A (en) * | 2020-06-18 | 2021-12-10 | 北京京东振世信息技术有限公司 | Information processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104461628A (en) | Method and device for controlling updating of server programs | |
US20140189648A1 (en) | Facilitated quality testing | |
CN100514943C (en) | An upgrade management method and system for instant message client | |
US10649765B2 (en) | Systems and methods for preventing service disruption during software updates | |
US10120673B2 (en) | Method and device for remotely updating application program | |
CN109495433A (en) | Data download method and device, storage medium and electronic device | |
CN105208127A (en) | Webpage caching processing method and system and intelligent terminal | |
CN104699499B (en) | A kind of heterogeneous terminals method for upgrading software | |
CN111083058A (en) | Content distribution network service current limiting method and electronic equipment | |
CN106685723A (en) | Remote upgrading method and system for embedded network devices | |
WO2016026329A1 (en) | Terminal upgrade method and apparatus | |
CN110427214A (en) | A kind of dissemination method of application program, device, equipment and storage medium | |
CN102087599A (en) | J2EE-based Web application system development method and device | |
JP2010182260A (en) | Thin client system, management server, thin client terminal, and thin client server | |
CN105430435A (en) | Method and system for pushing video file download in IOS system | |
CN109740342A (en) | Obtain method, system, computer installation and storage medium that shell executes permission | |
CN103810419A (en) | Application uninstall preventing method and equipment | |
CN103297514A (en) | Virtual machine management platform and virtual machine management method based on cloud infrastructure | |
CN105187391B (en) | APP and its logging in network access point methods, server and system | |
WO2020098457A1 (en) | Narrow band device upgrading method, mobile terminal and readable storage medium | |
CN103095532A (en) | System and method for online game pug-in prevention and plug-in prevention server-side | |
CN104090805B (en) | A kind of method, equipment and system for updating terminal operating system | |
CN106452848A (en) | Method and system for remotely upgrading thin access point | |
CN106331774A (en) | Equipment connection method and device and intelligent television system | |
CN108037940A (en) | The online upgrading method and device of book self-help equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150325 |