Specific embodiment
Embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the certain of the disclosure in attached drawing
Embodiment, it should be understood that, the disclosure can be realized by various forms, and should not be construed as being limited to this
In the embodiment that illustrates, providing these embodiments on the contrary is in order to more thorough and be fully understood by the disclosure.It should be understood that
It is that being given for example only property of the accompanying drawings and embodiments effect of the disclosure is not intended to limit the protection scope of the disclosure.
It should be appreciated that each step recorded in disclosed method embodiment can execute in a different order,
And/or parallel execution.In addition, method implementation may include additional step and/or omit the step of execution is shown.This public affairs
The range opened is not limited in this respect.
Terms used herein " comprising " and its deformation are that opening includes, i.e., " including but not limited to ".Term "based"
It is " being based at least partially on ".Term " one embodiment " expression " at least one embodiment ";Term " another embodiment " indicates
" at least one other embodiment ";Term " some embodiments " expression " at least some embodiments ".The correlation of other terms is fixed
Justice provides in will be described below.
It is noted that the concepts such as " first " that refers in the disclosure, " second " are only used for different devices, module or list
Member distinguishes, and is not intended to limit the sequence or relation of interdependence of function performed by these devices, module or unit.
It is noted that referred in the disclosure "one", the modification of " multiple " be schematically and not restrictive this field
It will be appreciated by the skilled person that being otherwise construed as " one or more " unless clearly indicate otherwise in context.
The being merely to illustrate property of title of the message or information that are interacted between multiple devices in disclosure embodiment
Purpose, and be not used to limit the range of these message or information.
The alternative embodiment of the disclosure is described in detail with reference to the accompanying drawing.
To the first embodiment that the disclosure provides, i.e., a kind of embodiment of the method for smooth restarting service.The disclosure is implemented
Example is applied to first progress of work established before server resets.
For example, Nginx is the high efficiency Web service end program based on asynchronous event driven;QUIC is based on UDP
Multiplexing, 0-1RTT is supported to build the Internet transport protocol of connection;That is, QUIC is an application layer protocol, only exist
TCP, HTTP2 technology such as reliable data transmission, congestion control, data multiplex are realized on the basis of UDP;Nginx with
It is described including host process (i.e. Master process) and the progress of work (i.e. Worker process) in Nginx in the joint framework of QUIC
First progress of work i.e. Worker process;Master process is mainly responsible for management Worker process, receives outer signals;
Master process and Worker process all respectively have a main event circulation, are exactly an endless loop;The main event of Worker process
Circulation then mainly calls ngx_process_events_and_timers (), handles event and timer expiry processing;One
It may include one or more QUIC connections in a Worker process, each QUIC connection namely corresponds to a UDP socket.
The embodiment of the present disclosure is described in detail below with reference to Fig. 1, wherein Fig. 1 provides flat for the embodiment of the present disclosure
The flow chart of the sliding method for restarting service.
Step S101 obtains first service restarting information.
For example, continuing above-mentioned example, the Master process that Nginx is managed after restarting to it sends smooth restarting order, so
Afterwards, the new Worker process of Master process creation, and first service is sent to each Worker process established before restarting
Restarting information (such as NGX_SHUTDOWN_SINGAL information).
Step S102 discharges first timer according to the first service restarting information, and each UDP set monitored is arranged
The characteristic variable for connecing word saves first set of words mark.
Wherein, the first set of words mark is different from the second socket mark;The second socket mark is service
The information saved in the characteristic variable for the UDP socket that second progress of work is monitored is created after restarting;The first timer is used
It is more than the UDP socket of default first time in the response time that release is monitored.
Each first progress of work includes one or more UDP sockets, and each first progress of work has one the
One timer.
In the case where normal use, when the first timer is used to discharge the response time monitored more than default first
Between UDP socket, that is, when the request response time of some UDP socket is more than default first time, then first is fixed
When device think the UDP socket communication abnormality, to no longer manage the UDP socket, that is, do not reprocess the UDP socket
Communication information.The resource occupation that system can be reduced in this way improves response time and the processing capacity of system.
It, can be in order to improve the management to UDP socket for example, since UDP socket is a connectionless socket
A protocol stack is established, the information of each UDP socket is stored in the protocol stack, first timer is by managing the protocol stack
UDP socket in management work process, after first timer thinks the UDP socket communication abnormality, by the UDP socket
It is cleared up away from the protocol stack.
The embodiment of the present disclosure shows that first progress of work will no longer be built by the first timer of first progress of work of release
New UDP socket is found, but still continues the work of existing UDP socket in first progress of work, until all UDP are socketed
Until the work of word terminates.
The characteristic variable of each UDP socket by monitoring is set as first set of words mark;Wherein, described first
The second socket that socket mark is different from the UDP socket for creating the monitoring of second progress of work after server resets identifies,
It is exactly that UDP socket work is being distinguished in the first work by the difference of first set of words mark and the second socket mark
In process or second progress of work, to avoid new UDP socket request scheduling into first progress of work.
For example, continue above-mentioned example, in combining in framework for Nginx and QUIC, the characteristic variable of UDP socket is QUIC
The SOL_SOCKET descriptor rank of UDP socket in connection;After restarting, first progress of work by all UDP sockets
SOL_SOCKET descriptor rank is set as first set of words and identifies (such as SOL_LOCK_SOCKET), and second progress of work
The SOL_SOCKET descriptor ranks of all UDP sockets be set as first set of words mark (such as SO_LOCK_
FILTER), then the kernel module of QUIC according to the SOL_SOCKET descriptor of UDP socket identifies whether the socket is first
The progress of work, so that avoiding will be in new QUIC request scheduling to first progress of work.
In order to guarantee smooth restarting service, the embodiment of the present disclosure provides the first storage variable and the second storage variable.?
After the acquisition first service restarting information, further includes:
Step S101-1, according to first service restarting information setting the first storage variable save server resets mark.
First progress of work identifies the main flow to first progress of work by the server resets of the first storage variable save
Transmit the information of server resets.After the main flow of first progress of work obtains the information of server resets, first progress of work
The storage variable save non-serving of setting first is restarted into mark, so that first progress of work can restart to receive new first
Server resets information.
The method, further includes:
Step S103 obtains the first storage variable.
Step S104, judges whether the preservation information of the first storage variable matches with server resets mark.
Step S105, if so, setting the second storage variable save exits mark.
First progress of work is transmitted by the mark that exits of the second storage variable save to the main flow of first progress of work
The operation information exited.
The method, further includes:
Step S106 obtains the second storage variable.
Step S107, judges whether the preservation information of the second storage variable matches with the mark that exits.
Step S108 discharges UDP socket and corresponding second fixed if so, after the communication of each UDP socket
When device after, into wait closed state.
After mark is exited in the main flow acquisition of first progress of work, first progress of work continues to first progress of work prison
The each UDP socket communication work listened.Each UDP socket has a second timer, which is used for
The exception information for handling UDP socket, when the operation of UDP socket exceeds preset time, then second timer is by UDP socket
Release, that is, stop the communication of the UDP socket, the resource occupation of system can be reduced in this way, when improving the response of system
Between and processing capacity.
After the UDP socket communication in first progress of work, the release release UDP socket of first progress of work
Word and corresponding second timer.
When first progress of work detects no longer remaining first timer and second timer in process, then into waiting pass
Closed state.
Disclosure application embodiment provides the method for two kinds of first progresses of work of closing.First method, the entrance
Wait closed state, comprising:
Step S108-1, setting third store variable save mark to be released.
This method waits host process to obtain third and stores variable save mark to be released, then, is closed and is corresponded to by host process
First progress of work.
Second method, described into after waiting closed state, comprising:
Step S108-1, discharges this progress of work.
This method closes own process by first progress of work.
After the second storage of setting variable save exits mark, further includes:
Step S105-1, setting the first storage variable save non-serving restart mark.
So that first progress of work restarts to receive new first service restarting information.
The method of the embodiment of the present disclosure can realize configuration upgrading in the case where not influencing service object, reduce system
Resource occupation improves response time and the processing capacity of system.
Corresponding with the first embodiment that the disclosure provides, the disclosure additionally provides second embodiment, i.e., a kind of smooth weight
Open the device of service.Since second embodiment is substantially similar to first embodiment, so describe fairly simple, relevant part
Refer to the corresponding explanation of first embodiment.Installation practice described below is only schematical.
Fig. 2 shows a kind of embodiments of the device of smooth restarting service of disclosure offer.Fig. 2 is the embodiment of the present disclosure
The unit block diagram of the device of the smooth restarting service of offer.
Shown in Figure 2, the disclosure provides a kind of device of smooth restarting service, comprising: first acquisition unit 201,
First processing units 202.
First acquisition unit 201, for obtaining first service restarting information;
First processing units 202 for discharging first timer according to the first service restarting information, and are arranged and monitor
Each UDP socket characteristic variable save first set of words mark;Wherein, the first set of words mark is different from second
Socket mark;Second socket mark is that the spy for the UDP socket that second progress of work is monitored is created after server resets
The information saved in sign variable;The first timer is used to discharge the UDP that the response time monitored is more than default first time
Socket.
Optionally, in the first acquisition unit 201, further includes:
Server resets are set and identify subelement, for being protected according to first service restarting information setting the first storage variable
Deposit server resets mark.
Optionally, in said device, further includes:
The first storage variable cell is obtained, for obtaining the first storage variable;
Judge first storage variable cell, for judge it is described first storage variable preservation information whether with the service
Restart mark to match;
Setting the second storage variable cell, if for the output result for judging the first storage variable cell for "Yes",
Then the second storage of setting variable save exits mark.
Optionally, in said device, further includes:
The second storage variable cell is obtained, for obtaining the second storage variable;
The second storage variable cell is judged, for judging whether the preservation information of the second storage variable exits with described
Mark matches;
Closing unit, if for the output result for judging the second storage variable cell for "Yes", when each UDP covers
After connecing word communication end and discharging corresponding second timer, into waiting closed state.
Optionally, in the closing unit, comprising:
Subelement is set, for third storage variable save mark to be released to be arranged.
Optionally, in the closing unit, comprising:
Subelement is discharged, for discharging this progress of work.
Optionally, in the second storage of setting variable cell, further includes:
Setting non-serving restarts mark subelement, restarts mark for the first storage variable save non-serving to be arranged.
The method of the embodiment of the present disclosure can realize configuration upgrading in the case where not influencing service object, reduce system
Resource occupation improves response time and the processing capacity of system.
The 3rd embodiment that the disclosure provides, i.e., a kind of embodiment of the method for smooth restarting service are applied to service weight
The host process established after opening.Since 3rd embodiment is associated with first embodiment, so describe fairly simple, relevant portion
Divide the corresponding explanation for referring to first embodiment.
The embodiment of the present disclosure is described in detail below with reference to Fig. 3, wherein Fig. 3 is shown according to the embodiment of the present disclosure
Another smooth restarting service method flow chart.
Step S301 obtains second service restarting information.
The second service restarting information is to send the information for the host process established after server resets to by the service restarted.
Step S302 establishes second progress of work according to the second service restarting information, and respectively to before server resets
First progress of work of each of foundation sends first service restarting information.
Second progress of work is the new progress of work established after server resets, is different from and establishes before server resets
First progress of work.
It is described to send first service restarting information to each of establishing first progress of work before server resets respectively, that is,
First progress of work is notified to execute server resets operation.
Optionally, the method also includes:
Step S303 obtains the third storage variable of each first progress of work respectively.
The information saved in third storage variable is arranged by first progress of work.It is tied when each UDP socket communicates
Beam and after discharging corresponding second timer, first progress of work is arranged third and stores variable save mark to be released.
Step S304, judge respectively each third storage variable preservation information whether with mark phase to be released
Match.
Step S305, if so, corresponding first progress of work of release.
This method host process obtains the mark to be released of third storage variable save, and then, host process closes corresponding the
One progress of work.The method for generalling use positive closing closes first progress of work.
The method of the embodiment of the present disclosure can realize configuration upgrading in the case where not influencing service object, reduce system
Resource occupation improves response time and the processing capacity of system.
Corresponding with the 3rd embodiment that the disclosure provides, the disclosure additionally provides fourth embodiment, i.e., a kind of smooth weight
Open the device of service.Since fourth embodiment is substantially similar to 3rd embodiment, so describe fairly simple, relevant part
Refer to the corresponding explanation of 3rd embodiment.Installation practice described below is only schematical.
Fig. 4 shows a kind of embodiment of the device of smooth restarting service of disclosure offer.Fig. 4 is shown according to this public affairs
Open the unit block diagram of the device of another smooth restarting service of embodiment.
Shown in Figure 4, the disclosure provides a kind of device of smooth restarting service, comprising: second acquisition unit 401,
The second processing unit 402.
Second acquisition unit 401, for obtaining second service restarting information;
The second processing unit 402, for establishing second progress of work according to the second service restarting information, and respectively to
First progress of work each of is established before server resets sends first service restarting information.
Optionally, in said device, further includes:
It obtains third and stores variable subelement, the third for obtaining each first progress of work respectively stores variable;
Judge mark subelement to be released, for judge respectively each third storage variable preservation information whether with
Mark to be released matches;
The first progress of work subelement is discharged, if for the output for judging mark subelement to be released for "Yes",
Discharge corresponding first progress of work.
The method of the embodiment of the present disclosure can realize configuration upgrading in the case where not influencing service object, reduce system
Resource occupation improves response time and the processing capacity of system.
The embodiment of the present disclosure provides the 5th embodiment, i.e. a kind of electronic equipment, and the equipment is for smooth restarting service
Method, the electronic equipment, comprising: at least one processor;And the storage being connect at least one described processor communication
Device;Wherein,
The memory is stored with the instruction that can be executed by one processor, and described instruction is by described at least one
It manages device to execute, so that the method that at least one described processor is able to carry out smooth restarting service as in the first embodiment.
The embodiment of the present disclosure provides sixth embodiment, i.e. a kind of electronic equipment, and the equipment is for smooth restarting service
Method, the electronic equipment, comprising: at least one processor;And the storage being connect at least one described processor communication
Device;Wherein,
The memory is stored with the instruction that can be executed by one processor, and described instruction is by described at least one
It manages device to execute, so that the method that at least one described processor is able to carry out the smooth restarting service as described in 3rd embodiment.
The embodiment of the present disclosure provides the 7th embodiment, i.e., a kind of computer readable storage medium, the computer storage
Media storage has computer executable instructions, the computer executable instructions it is executable as described in the first embodiment described in put down
The sliding method for restarting service.
The embodiment of the present disclosure provides the 8th embodiment, i.e., a kind of computer readable storage medium, the computer storage
Media storage has computer executable instructions, the executable smooth restarting as described in the third embodiment of the computer executable instructions
The method of service.
For the fifth embodiment of the present disclosure, sixth embodiment, the 7th embodiment and the 8th embodiment.Below with reference to Fig. 5,
Show the structural schematic diagram for being suitable for the electronic equipment for being used to realize the embodiment of the present disclosure.Terminal device in the embodiment of the present disclosure
It can include but is not limited to such as mobile phone, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD
The mobile terminal of (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle mounted guidance terminal) etc. with
And the fixed terminal of such as number TV, desktop computer etc..Electronic equipment shown in Fig. 5 is only an example, should not be right
The function and use scope of the embodiment of the present disclosure bring any restrictions.
As shown in figure 5, electronic equipment may include processing unit (such as central processing unit, graphics processor etc.) 501,
Random access storage device can be loaded into according to the program being stored in read-only memory (ROM) 502 or from storage device 508
(RAM) program in 503 and execute various movements appropriate and processing.In RAM 503, it is also stored with electronic device institute
The various programs and data needed.Processing unit 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/defeated
(I/O) interface 505 is also connected to bus 504 out.
In general, following device can connect to I/O interface 505: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph
As the input unit 506 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration
The output device 507 of dynamic device etc.;Storage device 508 including such as tape, hard disk etc.;And communication device 509.Communication device
509, which can permit electronic equipment, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 5, which is shown, to be had respectively
The electronic equipment of kind device, it should be understood that being not required for implementing or having all devices shown.It can be alternatively real
Apply or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising being carried on non-transient computer can
The computer program on medium is read, which includes the program code for method shown in execution flow chart.At this
In the embodiment of sample, which can be downloaded and installed from network by communication device 509, or be filled from storage
It sets 508 to be mounted, or is mounted from ROM 502.When the computer program is executed by processing unit 501, the disclosure is executed
The above-mentioned function of being limited in the method for embodiment.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated,
In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to
Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit
Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned
Any appropriate combination.
In some embodiments, client, server can use such as HTTP (HyperText Transfer
Protocol, hypertext transfer protocol) etc the network protocols of any currently known or following research and development communicated, and can
To be interconnected with the digital data communications (for example, communication network) of arbitrary form or medium.The example of communication network includes local area network
(" LAN "), wide area network (" WAN "), Internet (for example, internet) and ad-hoc network are (for example, the end-to-end net of ad hoc
Network) and any currently known or following research and development network.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not
It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity
When sub- equipment executes, so that the electronic equipment: obtaining at least two internet protocol addresses;Send to Node evaluation equipment includes institute
State the Node evaluation request of at least two internet protocol addresses, wherein the Node evaluation equipment is internet from described at least two
In protocol address, chooses internet protocol address and return;Receive the internet protocol address that the Node evaluation equipment returns;Its
In, the fringe node in acquired internet protocol address instruction content distributing network.
Alternatively, above-mentioned computer-readable medium carries one or more program, when said one or multiple programs
When being executed by the electronic equipment, so that the electronic equipment: receiving the Node evaluation including at least two internet protocol addresses and request;
From at least two internet protocol address, internet protocol address is chosen;Return to the internet protocol address selected;Wherein,
The fringe node in internet protocol address instruction content distributing network received.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof
Machine program code, above procedure design language include but is not limited to object oriented program language-such as Java,
Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language
Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence
Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or
It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet
It includes local area network (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as benefit
It is connected with ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard
The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the
One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
Function described herein can be executed at least partly by one or more hardware logic components.Example
Such as, without limitation, the hardware logic component for the exemplary type that can be used include: field programmable gate array (FPGA), specially
With integrated circuit (ASIC), Application Specific Standard Product (ASSP), system on chip (SOC), complex programmable logic equipment (CPLD) etc.
Deng.
In the context of the disclosure, machine readable media can be tangible medium, may include or is stored for
The program that instruction execution system, device or equipment are used or is used in combination with instruction execution system, device or equipment.Machine can
Reading medium can be machine-readable signal medium or machine-readable storage medium.Machine readable media can include but is not limited to electricity
Son, magnetic, optical, electromagnetism, infrared or semiconductor system, device or equipment or above content any conjunction
Suitable combination.The more specific example of machine readable storage medium will include the electrical connection of line based on one or more, portable meter
Calculation machine disk, hard disk, random access memory (RAM), read-only memory (ROM), Erasable Programmable Read Only Memory EPROM (EPROM
Or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage facilities or
Any appropriate combination of above content.
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature
Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure
Can technical characteristic replaced mutually and the technical solution that is formed.
Although this is not construed as requiring these operations with institute in addition, depicting each operation using certain order
The certain order that shows executes in sequential order to execute.Under certain environment, multitask and parallel processing may be advantageous
's.Similarly, although containing several specific implementation details in being discussed above, these are not construed as to this public affairs
The limitation for the range opened.Certain features described in the context of individual embodiment can also be realized in combination single real
It applies in example.On the contrary, the various features described in the context of single embodiment can also be individually or with any suitable
The mode of sub-portfolio is realized in various embodiments.
Although having used specific to this theme of the language description of structure feature and/or method logical action, answer
When understanding that theme defined in the appended claims is not necessarily limited to special characteristic described above or movement.On on the contrary,
Special characteristic described in face and movement are only to realize the exemplary forms of claims.