CN110381042B - Graceful restart service method, device, medium and electronic equipment - Google Patents

Graceful restart service method, device, medium and electronic equipment Download PDF

Info

Publication number
CN110381042B
CN110381042B CN201910586266.1A CN201910586266A CN110381042B CN 110381042 B CN110381042 B CN 110381042B CN 201910586266 A CN201910586266 A CN 201910586266A CN 110381042 B CN110381042 B CN 110381042B
Authority
CN
China
Prior art keywords
service
socket
identifier
restart
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910586266.1A
Other languages
Chinese (zh)
Other versions
CN110381042A (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.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910586266.1A priority Critical patent/CN110381042B/en
Publication of CN110381042A publication Critical patent/CN110381042A/en
Application granted granted Critical
Publication of CN110381042B publication Critical patent/CN110381042B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Abstract

The present disclosure provides a graceful restart service method, apparatus, medium, and electronic device. The method comprises the following steps: acquiring first service restart information; releasing a first timer according to the first service restart information, and setting a characteristic variable of each monitored UDP socket to store a first socket identifier; wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time. The method can realize configuration upgrading without influencing the service object, reduce the resource occupation of the system and improve the response time and the processing capacity of the system.

Description

Graceful restart service method, device, medium and electronic equipment
Technical Field
The present disclosure relates to the field of data communications, and in particular, to a graceful restart service method, apparatus, medium, and electronic device.
Background
QUIC is an Internet transport protocol supporting multiplexing, 0-1RTT concatenation based on UDP proposed by Google. That is, QUIC is an application layer protocol, and realizes reliable data transmission, congestion control, data multiplexing and other TCP and HTTP2 technologies on the basis of UDP. QUIC code opens source code in the chromosome project.
Nginx is an asynchronous event-driven open-source high-efficiency Web server. The Graceful restart (Graceful restart) function of nginnx supports restarting a nginnx server without interrupting existing services. After graceful restart execution, the nginnx host process (Master process) generates a new work process (Worker process) and loads a new configuration, meanwhile, if a request is in execution, the old Worker process does not exit but continues to execute until all requests are completely executed, and the nginnx simultaneously ensures that the new request is not dispatched to the old Worker process. The smooth restart may enable configuration upgrades and the like without shutting down the service.
In the implementation of accessing the QUIC to the Nginx under the Linux environment, because the Worker process of the Nginx needs to monitor a UDP socket corresponding to the bottom layer of the UDP port. When the graceful restart is executed, on one hand, it is ensured that the new connection is not scheduled to the old Worker process, and on the other hand, it is ensured that the old thread exits in time after the processing is completed. The QUIC has a Connection Migration (Connection Migration) function, which is to maintain Connection without interruption even after the client switches the network IP. However, this function changes the quadruplet (for example, changes the IP port of the client), so if a new QUIC connection is determined by checking the UDP packet quintuple during graceful restart, the migrated connection is scheduled as a new connection to a new Worker process, resulting in a failure of the connection migration.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
An object of the present disclosure is to provide a graceful restart service method, apparatus, medium, and electronic device, which can solve at least one of the above-mentioned technical problems. The specific scheme is as follows:
according to a specific implementation manner of the present disclosure, in a first aspect, the present disclosure provides a graceful restart service method, which is applied to a first work process established before service restart, and includes:
acquiring first service restart information;
releasing a first timer according to the first service restart information, and setting a characteristic variable of each monitored UDP socket to store a first socket identifier; wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time.
According to a second aspect, the present disclosure provides an apparatus for smoothly restarting a service, including:
a first obtaining unit, configured to obtain first service restart information;
the first processing unit is used for releasing a first timer according to the first service restart information, and setting a characteristic variable of each monitored UDP socket to store a first socket identifier; wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time.
According to a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of graceful restart service according to any one of the first aspects.
According to a fourth aspect thereof, the present disclosure provides an electronic device, comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of graceful restart service as claimed in any one of the first aspects.
According to a fifth aspect of the present disclosure, there is provided a graceful restart service method applied to a host process established after a service is restarted, including:
acquiring second service restart information;
and establishing a second working process according to the second service restarting information, and respectively sending first service restarting information to each first working process established before service restarting.
According to a sixth aspect, the present disclosure provides an apparatus for smoothly restarting a service, including:
a second obtaining unit, configured to obtain second service restart information;
and the second processing unit is used for establishing a second working process according to the second service restarting information and respectively sending the first service restarting information to each first working process established before the service restarting.
According to a seventh aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of graceful restart service according to any one of the fifth aspects.
According to an eighth aspect thereof, the present disclosure provides an electronic device, comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of graceful restart service of any of the fifth aspects.
Compared with the prior art, the scheme of the embodiment of the disclosure at least has the following beneficial effects:
the present disclosure provides a graceful restart service method, apparatus, medium, and electronic device. The method comprises the following steps: acquiring first service restart information; releasing a first timer according to the first service restart information, and setting a characteristic variable of each monitored UDP socket to store a first socket identifier; wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time. The method can realize configuration upgrading without influencing the service object, reduce the resource occupation of the system and improve the response time and the processing capacity of the system.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 illustrates a flow chart of a method of graceful restart service according to an embodiment of the present disclosure;
FIG. 2 illustrates a block diagram of elements of an apparatus for graceful restart services, according to an embodiment of the present disclosure;
FIG. 3 illustrates a flow chart of yet another method of graceful restart service according to an embodiment of the present disclosure;
FIG. 4 illustrates a block diagram of elements of an apparatus for graceful restart services in accordance with an embodiment of the present disclosure;
fig. 5 shows an electronic device connection structure schematic according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
A first embodiment provided by the present disclosure is an embodiment of a method for graceful restart services. The embodiment of the disclosure is applied to a first work process established before service restart.
For example, Nginx is an efficient Web server based on asynchronous event driven; QUIC is an internet transmission protocol supporting multiplexing and 0-1RTT connection based on UDP; that is, QUIC is an application layer protocol, and only realizes reliable data transmission, congestion control, data multiplexing and other TCP and HTTP2 technologies on the basis of UDP; in the joint architecture of Nginx and QUIC, Nginx comprises a main process (Master process) and a working process (Worker process), wherein the first working process is the Worker process; the Master process is mainly responsible for managing the Worker process and receiving external signals; the Master process and the Worker process are respectively provided with a main event cycle which is a dead cycle; the main event cycle of the Worker process mainly calls ngx _ process _ events _ and _ timers (), processes events and timer timeout; one Worker process may include one or more QUIC connections, each QUIC connection corresponding to a UDP socket.
The following describes an embodiment of the present disclosure in detail with reference to fig. 1, where fig. 1 is a flowchart of a method for graceful restart service provided by the embodiment of the present disclosure.
Step S101, obtaining first service restarting information.
For example, continuing the above example, the Nginx reboot sends a graceful restart command to the Master process it manages, and then the Master process creates a new Worker process and sends first service restart information (such as NGX _ SHUTDOWN _ single information) to each of the Worker processes that were created before the reboot.
And step S102, releasing a first timer according to the first service restart information, and setting a characteristic variable of each monitored UDP socket to store a first socket identifier.
Wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time.
Each first work process includes one or more UDP sockets and each first work process has a first timer.
Under the condition of normal application, the first timer is used for releasing the UDP socket whose monitored response time exceeds the preset first time, that is, when the request response time of a certain UDP socket exceeds the preset first time, the first timer considers that the UDP socket is abnormal in communication, so that the UDP socket is not managed any more, that is, the communication information of the UDP socket is not processed any more. Therefore, the resource occupation of the system can be reduced, and the response time and the processing capacity of the system can be improved.
For example, since the UDP socket is a connectionless socket, in order to improve management of the UDP socket, a protocol stack may be established, where information of each UDP socket is stored in the protocol stack, the first timer manages the UDP socket in the working process by managing the protocol stack, and when the first timer determines that the UDP socket is abnormal in communication, the UDP socket is cleared from the protocol stack.
The disclosed embodiment indicates that the first work process will not establish a new UDP socket by releasing the first timer of the first work process, but still continues the work of the existing UDP sockets in the first work process until the work of all UDP sockets is finished.
Setting a characteristic variable of each monitored UDP socket as a first socket identifier; the first socket identifier is different from a second socket identifier of a UDP socket monitored by a new second working process after the service is restarted, that is, the UDP socket is distinguished from working in the first working process or the second working process by the difference between the first socket identifier and the second socket identifier, so that a new UDP socket request is prevented from being dispatched to the first working process.
For example, continuing the example above, in the federated architecture of Nginx and QUIC, the feature variable for a UDP SOCKET is the SOL _ SOCKET descriptor level of the UDP SOCKET in the QUIC connection; after restarting, the SOL _ SOCKET descriptor level of all UDP SOCKETs of the first work process is set as the first SOCKET identification (such as SOL _ LOCK _ SOCKET), and the SOL _ SOCKET descriptor level of all UDP SOCKETs of the second work process is set as the first SOCKET identification (such as SO _ LOCK _ FILTER), the kernel module of QUIC identifies whether the SOCKET is the first work process according to the SOL _ SOCKET descriptor of the UDP SOCKET, thereby avoiding dispatching a new QUIC request to the first work process.
In order to guarantee a smooth restart service, the disclosed embodiments provide a first storage variable and a second storage variable. After the obtaining of the first service restart information, the method further includes:
and step S101-1, setting a first storage variable storage service restart identifier according to the first service restart information.
And the first work process transmits the information of service restart to the main process of the first work process through the service restart identifier saved by the first storage variable. Once the main process of the first work process obtains the information of the service restart, the first work process sets a first storage variable saving non-service restart identifier so that the first work process can restart to receive new first service restart information.
The method further comprises the following steps:
step S103, a first storage variable is obtained.
And step S104, judging whether the stored information of the first storage variable is matched with the service restart identifier.
And step S105, if yes, setting a second storage variable saving exit mark.
And the first working process transmits the operation information for exiting to the main process of the first working process through the exit identification stored in the second storage variable.
The method further comprises the following steps:
step S106, a second storage variable is obtained.
Step S107, determining whether the storage information of the second storage variable matches the exit identifier.
And step S108, if yes, after each UDP socket communication is finished, releasing the UDP sockets and the corresponding second timers, and entering a waiting closing state.
After the main process of the first work process obtains the exit identifier, the first work process still continues the communication work of each UDP socket monitored by the first work process. Each UDP socket has a second timer, the second timer is used for processing the abnormal information of the UDP socket, when the operation of the UDP socket exceeds the preset time, the second timer releases the UDP socket, namely the communication of the UDP socket is stopped, thus the resource occupation of the system can be reduced, and the response time and the processing capacity of the system can be improved.
And when one UDP socket in the first work progress is communicated, the first work progress releases the UDP socket and the corresponding second timer.
And when the first working process detects that the first timer and the second timer are not left in the process, entering a waiting closing state.
The embodiment of the disclosure provides two methods for closing a first work process. A first method, said entering a wait for shutdown state, comprising:
and step S108-1, setting a third storage variable to store the identifier to be released.
The method waits for the main process to acquire a third storage variable to store the identifier to be released, and then the main process closes the corresponding first work process.
A second method, after said entering a wait for shutdown state, comprising:
and step S108-1, releasing the work process.
The method comprises the step of closing the self process by the first work process.
After the second storage variable saving exit identifier is set, the method further comprises the following steps:
and step S105-1, setting a first storage variable saving non-service restart identifier.
So that the first work process resumes receiving new first service restart information.
The method of the embodiment of the disclosure can realize configuration upgrade without influencing the service object, reduce the resource occupation of the system, and improve the response time and the processing capacity of the system.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, that is, an apparatus for graceful restart service. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 illustrates an embodiment of an apparatus for graceful restart service provided by the present disclosure. Fig. 2 is a block diagram of elements of an apparatus for graceful restart services provided by an embodiment of the present disclosure.
Referring to fig. 2, the present disclosure provides a device for graceful restart service, including: a first acquisition unit 201 and a first processing unit 202.
A first obtaining unit 201, configured to obtain first service restart information;
a first processing unit 202, configured to release a first timer according to the first service restart information, and set a feature variable of each monitored UDP socket to store a first socket identifier; wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time.
Optionally, in the first obtaining unit 201, the method further includes:
and the service restart identifier setting subunit is used for setting a first storage variable storage service restart identifier according to the first service restart information.
Optionally, in the apparatus, the apparatus further includes:
the first storage variable acquiring unit is used for acquiring a first storage variable;
a first storage variable judging unit, configured to judge whether storage information of the first storage variable matches the service restart identifier;
and setting a second storage variable unit, which is used for setting a second storage variable saving exit identifier if the output result of the first storage variable unit is judged to be 'yes'.
Optionally, in the apparatus, the apparatus further includes:
the second storage variable acquiring unit is used for acquiring a second storage variable;
a second storage variable judging unit, configured to judge whether storage information of the second storage variable matches the exit identifier;
and the closing unit is used for entering a waiting closing state after the end of the communication of each UDP socket and the release of the corresponding second timer if the output result of the second storage variable unit is judged to be 'yes'.
Optionally, in the closing unit, the method includes:
and the setting subunit is used for setting a third storage variable to store the identifier to be released.
Optionally, in the closing unit, the method includes:
and the release subunit is used for releasing the work process.
Optionally, in the setting the second storage variable unit, the method further includes:
and the non-service restart identifier setting subunit is used for setting a first storage variable to store the non-service restart identifier.
The method of the embodiment of the disclosure can realize configuration upgrade without influencing the service object, reduce the resource occupation of the system, and improve the response time and the processing capacity of the system.
The third embodiment provided by the present disclosure, that is, the embodiment of the method for graceful restart service, is applied to a host process established after service restart. Since the third embodiment is related to the first embodiment, the description is relatively simple, and the relevant portions only need to refer to the corresponding description of the first embodiment.
An embodiment of the present disclosure is described in detail below with reference to fig. 3, where fig. 3 shows a flowchart of another method for smoothly restarting a service according to an embodiment of the present disclosure.
Step S301, second service restart information is acquired.
The second service restart information is information transmitted by the restarted service to a host process established after the service restart.
Step S302, a second working process is established according to the second service restarting information, and first service restarting information is respectively sent to each first working process established before service restarting.
The second work process is a new work process established after the service is restarted and is different from the first work process established before the service is restarted.
And respectively sending first service restart information to each first work process established before the service restart, namely informing the first work process to execute the service restart operation.
Optionally, the method further includes:
step S303, respectively obtaining a third storage variable of each first work process.
The information held in the third storage variable is set by the first work process. And after the communication of each UDP socket is finished and the corresponding second timer is released, the first working process sets a third storage variable to store the identifier to be released.
Step S304, respectively determining whether the stored information of each third storage variable matches the identifier to be released.
In step S305, if yes, the corresponding first work process is released.
According to the method, a main process obtains the identifier to be released, which is stored by a third storage variable, and then the main process closes a corresponding first working process. The first work process is usually closed by a forced closing method.
The method of the embodiment of the disclosure can realize configuration upgrade without influencing the service object, reduce the resource occupation of the system, and improve the response time and the processing capacity of the system.
Corresponding to the third embodiment provided by the present disclosure, the present disclosure also provides a fourth embodiment, that is, an apparatus for graceful restart service. Since the fourth embodiment is basically similar to the third embodiment, the description is simple, and the related portions should be referred to the corresponding description of the third embodiment. The device embodiments described below are merely illustrative.
Fig. 4 illustrates an embodiment of an apparatus for graceful restart service provided by the present disclosure. FIG. 4 illustrates a block diagram of elements of an apparatus for graceful restart services in accordance with an embodiment of the present disclosure.
Referring to fig. 4, the present disclosure provides a device for graceful restart service, including: a second acquisition unit 401 and a second processing unit 402.
A second obtaining unit 401, configured to obtain second service restart information;
the second processing unit 402 is configured to establish a second work process according to the second service restart information, and send the first service restart information to each first work process established before the service restart, respectively.
Optionally, in the apparatus, the apparatus further includes:
acquiring a third storage variable quantum unit for respectively acquiring a third storage variable of each first working process;
the identifier to be released sub-unit is used for respectively judging whether the stored information of each third storage variable is matched with the identifier to be released;
and the release first work process subunit is used for releasing the corresponding first work process if the output of the to-be-released identifier subunit is judged to be 'yes'.
The method of the embodiment of the disclosure can realize configuration upgrade without influencing the service object, reduce the resource occupation of the system, and improve the response time and the processing capacity of the system.
The fifth embodiment of the present disclosure provides an electronic device, which is a method for graceful restart service, where the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of graceful restart service as described in the first embodiment.
The disclosed embodiment provides a sixth embodiment, which is an electronic device, and the device is used in a graceful restart service method, and the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of graceful restart service of the third embodiment.
The disclosed embodiments provide a seventh embodiment, which is a computer-readable storage medium storing computer-executable instructions that can execute the method of graceful restart service as described in the first embodiment.
An eighth embodiment of the present disclosure is a computer-readable storage medium storing computer-executable instructions that can execute the method of graceful restart service as described in the third embodiment.
The present disclosure is directed to a fifth embodiment, a sixth embodiment, a seventh embodiment, and an eighth embodiment. Referring now to FIG. 5, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, the electronic device may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A graceful restart service method is applied to a first work process established before service restart, and is characterized by comprising the following steps:
acquiring first service restart information;
releasing a first timer according to the first service restart information, and setting a characteristic variable of each monitored UDP socket to store a first socket identifier; wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time.
2. The method of claim 1, further comprising, after the obtaining the first service restart information:
and setting a first storage variable storage service restart identifier according to the first service restart information.
3. The method of claim 2, further comprising:
acquiring a first storage variable;
judging whether the stored information of the first storage variable is matched with the service restart identifier;
if yes, setting a second storage variable saving exit mark.
4. The method of claim 3, further comprising:
acquiring a second storage variable;
judging whether the stored information of the second storage variable is matched with the exit identifier;
if yes, entering a waiting closing state after each UDP socket communication is finished and the corresponding second timer is released.
5. The method of claim 4, wherein entering the wait for close state comprises:
and setting a third storage variable to store the identifier to be released.
6. The method of claim 4, after said entering a wait for shutdown state, comprising:
and releasing the work process.
7. The method of claim 3, after the setting the second storage variable save exit flag, further comprising:
and setting a first storage variable to store the non-service restart identifier.
8. An apparatus for graceful restart services, comprising:
a first obtaining unit, configured to obtain first service restart information;
the first processing unit is used for releasing a first timer according to the first service restart information, and setting a characteristic variable of each monitored UDP socket to store a first socket identifier; wherein the first socket identification is distinct from the second socket identification; the second socket identifier is information stored in a feature variable of a UDP socket monitored by a newly-built second working process after the service is restarted; the first timer is used for releasing the UDP socket with the response time of the monitoring exceeding the preset first time.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 7.
CN201910586266.1A 2019-07-01 2019-07-01 Graceful restart service method, device, medium and electronic equipment Active CN110381042B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910586266.1A CN110381042B (en) 2019-07-01 2019-07-01 Graceful restart service method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910586266.1A CN110381042B (en) 2019-07-01 2019-07-01 Graceful restart service method, device, medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110381042A CN110381042A (en) 2019-10-25
CN110381042B true CN110381042B (en) 2021-11-12

Family

ID=68251513

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910586266.1A Active CN110381042B (en) 2019-07-01 2019-07-01 Graceful restart service method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110381042B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132065A (en) * 2019-12-30 2021-07-16 西安诺瓦星云科技股份有限公司 Data communication method, device and system, storage medium and video processing equipment
CN111756776B (en) * 2020-07-28 2023-03-24 支付宝(杭州)信息技术有限公司 Server, message distribution device, program handover system, and program handover method
CN114915669A (en) * 2021-02-08 2022-08-16 北京金山云网络技术有限公司 Service upgrading method and device based on QUIC protocol and electronic equipment
CN113973130A (en) * 2021-11-19 2022-01-25 杭州安恒信息技术股份有限公司 Smooth service publishing method based on haproxy and related device
CN114827096B (en) * 2022-03-14 2023-10-24 网宿科技股份有限公司 RTMP connection migration method, device, equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103117923A (en) * 2013-01-18 2013-05-22 杭州华三通信技术有限公司 Process management method and process management equipment
CN106209469A (en) * 2016-07-21 2016-12-07 杭州迪普科技有限公司 The method and device that process is restarted
CN106603272A (en) * 2016-11-17 2017-04-26 上海斐讯数据通信技术有限公司 Controller protection method and system based on smooth restart
CN106844137A (en) * 2016-12-08 2017-06-13 腾讯科技(深圳)有限公司 The monitoring method and device of server
CN107147573A (en) * 2016-03-01 2017-09-08 中兴通讯股份有限公司 Smooth restarting processing method and processing device
CN109918115A (en) * 2019-03-07 2019-06-21 成都品果科技有限公司 A kind of method and system of software function publication

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10153973B2 (en) * 2016-06-29 2018-12-11 Nicira, Inc. Installation of routing tables for logical router in route server mode

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103117923A (en) * 2013-01-18 2013-05-22 杭州华三通信技术有限公司 Process management method and process management equipment
CN107147573A (en) * 2016-03-01 2017-09-08 中兴通讯股份有限公司 Smooth restarting processing method and processing device
CN106209469A (en) * 2016-07-21 2016-12-07 杭州迪普科技有限公司 The method and device that process is restarted
CN106603272A (en) * 2016-11-17 2017-04-26 上海斐讯数据通信技术有限公司 Controller protection method and system based on smooth restart
CN106844137A (en) * 2016-12-08 2017-06-13 腾讯科技(深圳)有限公司 The monitoring method and device of server
CN109918115A (en) * 2019-03-07 2019-06-21 成都品果科技有限公司 A kind of method and system of software function publication

Also Published As

Publication number Publication date
CN110381042A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN110381042B (en) Graceful restart service method, device, medium and electronic equipment
CN108737270B (en) Resource management method and device for server cluster
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN110233880B (en) UDP (user Datagram protocol) data packet transmission method, system, medium and electronic equipment
CN109725950B (en) Method, device and storage medium for realizing single-instance operation of client
CN110716945A (en) Data updating method, data updating system, server and storage medium
CN115328741A (en) Exception handling method, device, equipment and storage medium
CN115237589A (en) SR-IOV-based virtualization method, device and equipment
CN116302271A (en) Page display method and device and electronic equipment
CN115129429B (en) Container application management method and device, electronic equipment and storage medium
CN115756877A (en) Resource synchronization method, device, equipment and storage medium
CN113360348B (en) Abnormal request processing method and device, electronic equipment and storage medium
CN113596328B (en) Camera calling method and device and electronic equipment
CN115269063A (en) Process creation method, system, device and medium
CN110502891B (en) Method, device, medium and electronic equipment for acquiring process memory leakage
CN110365839B (en) Shutdown method, shutdown device, shutdown medium and electronic equipment
CN116360802A (en) Middleware processing method, middleware processing device, electronic equipment and storage medium
CN114051024A (en) File background continuous transmission method and device, storage medium and electronic equipment
CN109426572B (en) Task processing method and device and electronic equipment
CN112817701A (en) Timer processing method and device, electronic equipment and computer readable medium
CN110633141A (en) Memory management method and device of application program, terminal equipment and medium
CN111625326A (en) Task pipeline execution method and device and electronic equipment
CN111309367A (en) Method, device, medium and electronic equipment for managing service discovery
CN112579247A (en) Method and device for determining task state

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder