CN107104822A - Server preparedness processing method, device, storage medium and electronic equipment - Google Patents

Server preparedness processing method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN107104822A
CN107104822A CN201710197356.2A CN201710197356A CN107104822A CN 107104822 A CN107104822 A CN 107104822A CN 201710197356 A CN201710197356 A CN 201710197356A CN 107104822 A CN107104822 A CN 107104822A
Authority
CN
China
Prior art keywords
server
message
queue
standby
master server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710197356.2A
Other languages
Chinese (zh)
Other versions
CN107104822B (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.)
Hundsun Technologies Inc
Original Assignee
Hangzhou Ji Ji 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 Hangzhou Ji Ji Network Technology Co Ltd filed Critical Hangzhou Ji Ji Network Technology Co Ltd
Priority to CN201710197356.2A priority Critical patent/CN107104822B/en
Publication of CN107104822A publication Critical patent/CN107104822A/en
Application granted granted Critical
Publication of CN107104822B publication Critical patent/CN107104822B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

Present disclose provides a kind of server preparedness processing method, server preparedness processing unit, storage medium and electronic equipment, this method includes:The arbitration machine monitors the running status of the master server and the standby server by a heartbeat channel and judges whether the master server delays machine;Judge the master server do not delay machine when, control the master server to start the default queue of the master server to handle the message of a Message Processing terminal;Judge the master server delay machine when, control the standby server to switch to the master server and start the default queue of the standby server to handle the message of the Message Processing terminal.The disclosure improves the speed and efficiency of Message Processing, while improving reliability.

Description

Server preparedness processing method, device, storage medium and electronic equipment
Technical field
This disclosure relates to message processing technique field, in particular to a kind of server preparedness processing method, server Preparedness processing unit, storage medium and electronic equipment.
Background technology
With the development of the communication technology, to the requirement more and more higher of the Performance And Reliability of Message Processing.Drill at present Many efficient preparedness technological means are dissolved, such as communication protocol (reliable multicast), message based on udp broadcast or multicast are reissued The means such as mechanism, active and standby deployment can reach very high Message Processing speed while high reliability is ensured.But it is due to The stateful characteristic of message, the performance of Message Processing can be constrained while reliability is improved.
In order to reach the requirement of reliability, existing server preparedness technical field typically can all dispose active and standby two services Device, using the design of active/standby server synchronous communication, it is desirable to strict data syn-chronization is carried out between active/standby server, i.e., it is each Into the message of server, mutually confirmation will be forwarded once between active/standby server.
This mode can have problems with:First, because the design that active/standby server message synchronization communicates, in standby server Delay in the case of machine, originally intact master server disappears as can not receive standby response of the server to message synchronization request Breath and it is out of service, until arbitrating server confirms that standby server is delayed after machine, can just be resumed work;Although the 2, to request message Active and standby synchronization has been carried out, but often have ignored and response message is synchronized, standby server is delayed machine rear tube in master server, But can not accurate decision message processing state, often lead to retransmit during losing active-standby switch or leakage hair message;3rd, In order to reach the requirement of reliability, it is desirable to carry out strict data syn-chronization between active/standby server, the message each come and gone Once mutually confirmation is forwarded between active/standby server, the speed of Message Processing can be caused to decline, so as to cause efficiency low.
It should be noted that information is only used for strengthening the reason of background of this disclosure disclosed in above-mentioned background section Solution, therefore can include not constituting the information to prior art known to persons of ordinary skill in the art.
The content of the invention
The purpose of the disclosure is to provide a kind of server preparedness processing method, server preparedness processing unit, storage Jie Matter and electronic equipment, so at least overcome to a certain extent caused by limitation and the defect due to correlation technique one or Multiple problems.
According to the first aspect of the disclosure there is provided a kind of server preparedness processing method, applied to master server, standby service The system of device and arbitration machine composition, wherein, the master server is used to handle message, and the standby server is used for synchronization message, Methods described includes:
The arbitration machine monitors the running status of the master server and the standby server by a heartbeat channel and sentenced Whether the master server that breaks delays machine;
Judge the master server do not delay machine when, control the master server to start the default queue of the master server To handle the message of a Message Processing terminal;
Judge the master server delay machine when, control the standby server to switch to the master server and start described The default queue of standby server is to handle the message of the Message Processing terminal;
Wherein, the default queue of the master server and the standby server includes not reporting queue, pending queue and Certainly queue, it is described do not report queue be used for record receive but the message that does not send, the pending queue is used for record and sent but not The message of acknowledgement, the queue of having determined is used for the message for recording acknowledgement.
In a kind of exemplary embodiment of the disclosure, starting the default queue of the master server includes:
Receive the message of the Message Processing terminal and do not report queue by what the message moved on to the master server;
The message is moved on to the master server do not report queue after report and submit message;
Judge whether the master server receives the response message of external server, if the message then is moved on into institute State master server determine queue and from the master server determine queue in delete message, if otherwise the message is moved on to The pending queue of the master server.
In a kind of exemplary embodiment of the disclosure, starting the default queue of the standby server includes:
Receive the message of the Message Processing terminal and the message is moved on to the pending queue of the standby server;
After the message to be moved on to the pending queue of the standby server, judge whether the standby server receives outer The response message of portion's server;
If so, the message then to be moved on to the queue and from the queue of determining of the standby server of determining of the standby server Middle deletion message.
It is described when the standby server switches to the master server in a kind of exemplary embodiment of the disclosure Method also includes:
After the master server delays machine, pending message is judged whether;
If so, then pending message described in priority treatment;
After the pending message is handled, start the default queue of the standby server to handle message.
In a kind of exemplary embodiment of the disclosure, the standby server is controlled to switch to the master server to include:
Receive the message of the Message Processing terminal and do not report queue by what the message moved on to the standby server;
Determine whether each pending message reports and submits success by inquiring about server according to the numbering of each message;
By by the queue of determining for reporting and submitting successful message to move on to the standby server, the message do not reported being moved on to described standby The mode for not reporting queue of server clears up the pending queue for server;
After the pending queue of the standby server is cleared up, report and submit message to control the standby server to switch to the master Server.
In a kind of exemplary embodiment of the disclosure, judge whether the machine of delaying includes the master server:
The arbitration machine judges whether to receive the heartbeat of the master server by the heartbeat channel;
When judging that continuous preset times do not receive the heartbeat of the master server, judge that the master server is delayed machine.
In a kind of exemplary embodiment of the disclosure, methods described also includes:
Recover to delay the master server or the standby server of machine;
It regard the master server after recovery or the standby server as standby startup of server.
In a kind of exemplary embodiment of the disclosure, methods described also includes:
The server first started is defined as the master server, the server of rear startup is defined as the standby service Device.
In a kind of exemplary embodiment of the disclosure, methods described also includes:
Judge the master server and the standby server do not delay machine when, the master server and the standby server are same When receive the message of the Message Processing terminal and the response message of the external server.
According to the second aspect of the disclosure there is provided a kind of server preparedness processing unit, applied to master server, standby service The system of device and arbitration machine composition, wherein, the master server is used to handle message, and the standby server is used for synchronization message, Described device includes:
Delay machine judge module, passing through a heartbeat channel for the arbitration machine monitors the master server and the standby service The running status of device simultaneously judges whether the master server delays machine;
Master server module, for judge the master server do not delay machine when, control the master server to start described The default queue of master server is to handle the message of a Message Processing terminal;
Active-standby switch module, for judge the master server delay machine when, control the standby server to switch to described Master server simultaneously starts the default queue of the standby server to handle the message of the Message Processing terminal;
Wherein, the default queue of the master server and the standby server includes not reporting queue, pending queue and Certainly queue, it is described do not report queue be used for record receive but the message that does not send, the pending queue is used for record and sent but not The message of acknowledgement, the queue of having determined is used for the message for recording acknowledgement.
According to the third aspect of the disclosure there is provided a kind of storage medium, computer program, the computer are stored thereon with The server preparedness processing method described in above-mentioned any one is realized when program is executed by processor.
According to the fourth aspect of the disclosure there is provided a kind of electronic equipment, including:
Processor;And
Memory, the executable instruction for storing the processor;
Wherein, the processor is configured to perform the clothes described in above-mentioned any one via the executable instruction is performed Business device preparedness processing method.
A kind of server preparedness processing method, server preparedness processing unit, storage medium and electronics that the disclosure is provided In equipment, judge whether the master server delays machine by the arbitration machine;Judge the master server do not delay machine when, control The master server starts the default queue of the master server to handle the message of the Message Processing terminal;Judging described Master server delay machine when, control the standby server to switch to the master server and start the default queue of the standby server To handle the message of the Message Processing terminal.On the one hand, when master server delays machine, based on the standby server switching of control Server, so as to ensure master server delay machine it is former what is the need cease all without disappear, also will not repeat send;On the other hand, Eliminate the synchronous communication between active/standby server, it is to avoid the message of each entrance server will be in master server and standby clothes It is engaged in forwarding mutually confirmation between device, improves the speed of Message Processing;On the other hand, eliminate master server and standby server it Between synchronous communication, eliminate standby server delay machine when influence to master server running status, improve Message Processing efficiency And reliability.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not The disclosure can be limited.
Brief description of the drawings
Accompanying drawing herein is merged in specification and constitutes the part of this specification, shows the implementation for meeting the disclosure Example, and be used to together with specification to explain the principle of the disclosure.It should be evident that drawings in the following description are only the disclosure Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis These accompanying drawings obtain other accompanying drawings.
Fig. 1 schematically shows a kind of schematic flow sheet of server preparedness processing method in disclosure exemplary embodiment;
Fig. 2 schematically shows a kind of internal structure schematic diagram of message processing server in disclosure exemplary embodiment;
Fig. 3 schematically shows a kind of operating structure schematic diagram of master server in disclosure exemplary embodiment;
Fig. 4 schematically shows a kind of operating structure schematic diagram of standby server in disclosure exemplary embodiment;
Fig. 5 schematically shows a kind of schematic diagram of Message Processing flow in disclosure exemplary embodiment;
Fig. 6 schematically show a kind of master server in disclosure exemplary embodiment delay machine when the signal of Message Processing flow Figure;
Fig. 7 schematically shows a kind of block diagram of server preparedness processing unit in disclosure exemplary embodiment;
Fig. 8 schematically shows the block diagram of a kind of electronic equipment in disclosure exemplary embodiment.
Embodiment
Example embodiment is described more fully with referring now to accompanying drawing.However, example embodiment can be real in a variety of forms Apply, and be not understood as limited to embodiment set forth herein;On the contrary, thesing embodiments are provided so that the disclosure will be comprehensively and complete It is whole, and the design of example embodiment is comprehensively conveyed into those skilled in the art.Identical reference is represented in figure Same or similar part, thus repetition thereof will be omitted.
Implement in addition, described feature, structure or characteristic can be combined in any suitable manner one or more In example.In the following description there is provided many details so as to provide fully understanding for embodiment of this disclosure.However, It will be appreciated by persons skilled in the art that the technical scheme of the disclosure can be put into practice without one in the specific detail or more It is many, or can be using other methods, constituent element, material, device, step etc..In other cases, it is not shown in detail or describes Known features, method, device, realization, material operate to avoid each side of the fuzzy disclosure.
Block diagram shown in accompanying drawing is only functional entity, not necessarily must be corresponding with physically separate entity. I.e., it is possible to realize these functional entitys using software form, or these are realized in the module that one or more softwares are hardened A part for functional entity or functional entity, or realized in heterogeneous networks and/or processor device and/or microcontroller device These functional entitys.
A kind of server preparedness processing method is provide firstly in this example embodiment, applied to master server, standby clothes The system of business device and arbitration machine composition, wherein, the master server is used to handle message, described to be used for synchronous disappear for server Breath.The master server and the standby server can be two-node cluster hot backup pattern, after a master server delays machine, standby server Automatically switch to master server, it is not necessary to artificial to go switching, the recovery of data can be realized by the transfer of trouble point, therefore The continuity of data can be ensured.The switching mode of two-node cluster hot backup can be in activation shape for the server of active/standby mode, i.e., one State and another server is in stand-by state;It can also be double host mode, i.e. two-servers activestandby state each other.It is described System can also include Message Processing terminal, external server or other parts.With reference to shown in Fig. 1, the server preparedness Processing method may comprise steps of:
The operation that machine monitors the master server and the standby server by a heartbeat channel is arbitrated described in step S110. State simultaneously judges whether the master server delays machine;
Step S120. judge the master server do not delay machine when, control the master server to start the master server Default queue to handle the message of a Message Processing terminal;
Step S130. judge the master server delay machine when, control the standby server to switch to the master server And start the default queue of the standby server to handle the message of the Message Processing terminal;
Wherein, the default queue of the master server and the standby server includes not reporting queue, pending queue and Certainly queue, it is described do not report queue be used for record receive but the message that does not send, the pending queue is used for record and sent but not The message of acknowledgement, the queue of having determined is used for the message for recording acknowledgement.
In a kind of server preparedness processing method that the disclosure is provided, judge that the master server is by the arbitration machine No machine of delaying;Judge the master server do not delay machine when, control the master server to start the default queue of the master server To handle the message of the Message Processing terminal;Judge the master server delay machine when, control the standby server to switch to The master server simultaneously starts the default queue of the standby server to handle the message of the Message Processing terminal.On the one hand, When master server delays machine, master server is switched to by the standby server of control, so as to ensure that master server machine of delaying is former What is the need cease all without disappearance;On the other hand, the synchronous communication between active/standby server is eliminated, it is to avoid each entrance server Message will forward and mutually confirm between master server and standby server, improve the speed of Message Processing;On the other hand, Eliminate the synchronous communication between master server and standby server, eliminate standby server delay machine when influence to master server, Improve Message Processing efficiency and reliability.
Below, by referring to figs. 2 to shown in Fig. 6 in this example embodiment server preparedness processing method make furtherly It is bright.
In step s 110, the arbitration machine monitors the master server and the standby server by a heartbeat channel Running status simultaneously judges whether the master server delays machine.
In this example embodiment, the arbitration machine can arbitrate machine for cold standby, or hot standby arbitration machine, described secondary Sanction machine can be used for the running status for monitoring master server and standby server, can be used for the role of distribution server, may be used also For the switching between control master server and standby server.For example, arbitration machine can send the heart by heartbeat channel Bag is jumped, to detect the running status of master server and standby server, wherein, heartbeat packet can be fixed between client and server The signal of Shi Tongzhi other side oneself state, the content of heartbeat packet can be customized command word or code or only include This is not particularly limited in the empty bag in packet header, the present exemplary embodiment.For example, some communication softwares are for a long time without using just Heartbeat packet can be regularly sent, the state that it is judged with this is online or offline.Arbitration machine may be referred to opening for server The information such as dynamic order, hardware configuration, IP sizes and server performance are each server-assignment role.Master server and standby clothes The internal structure of business device is identical, but can start different modules according to different mode, runs different logics.Originally show In example embodiment, heartbeat packet can also be sent by arbitrating machine, by with judging that whether the delay identical of machine of master server is sentenced Disconnected method judges described whether delayed machine for server.
In addition, in this example embodiment, judging whether the machine of delaying can include the master server:
The arbitration machine monitors the running status of the master server by the heartbeat channel and judges whether to receive The heartbeat of the master server;
When judging that continuous preset times do not receive the heartbeat of the master server, judge that the master server is delayed machine.
In this example embodiment, heartbeat packet sender can be master server, and recipient can be client.In main clothes Business device has been sent after heartbeat packet, can judge whether to receive the heartbeat of master server by the heartbeat channel.In this mistake Cheng Zhong, master server can continuously transmit multiple heartbeat packets according to default time interval.If receiving one or more masters The heartbeat packet that server is sent, then it is considered that master server is online, now can send message to master server;If continuous When preset times do not receive the heartbeat of master server transmission, it is believed that master server has gone offline, i.e., master server has been Delay machine.When judging not receiving the heartbeat of master server, one preset times of self-defined setting can be needed according to user, for example 5 times or 10 times;One specifically preset time can also be set, can also be by other such as 2 minutes or 5 minutes Mode judges whether server delays machine, and this is not particularly limited in this example embodiment.When continuing to exceed 5 times, or it is super When spending 2 minutes and being all not detected by the heartbeat of master server, it may be determined that master server is delayed machine., can be with when user requires higher By set less of preset times or by preset time set it is shorter.
, can also be according to judging whether whether the delay method of machine of master server determines standby server in this example embodiment Delay machine.When continuous n times do not receive the master server heartbeat, then judge that the master server is delayed machine, when continuous N time does not receive institute Standby server heartbeat is stated, then judges that the standby server is delayed machine, wherein N, M is natural number, and N is not more than M, and M, N can also be identical. In addition to this it is possible to combined whether monitoring current server delays machine with heartbeat detection by hardware detection, can also be by secondary Sanction machine combines whether the dual confirmation current server of machine server of not delaying delays machine.For example, judging that master server is doubted in arbitration machine Seemingly delay after machine, order intact standby server to attempt the contact master server, if main clothes described in the standby server contacts It is engaged in device continuously failure 3 times, then can be determined that the master server is delayed machine.
In the step s 120, judge the master server do not delay machine when, control the master server to start the main clothes Be engaged in device default queue to handle the message of a Message Processing terminal.
In this example embodiment, when being not detected by the heartbeat of master server not less than preset times either not less than pre- If during the time, determining that the master server is online, while control master server to start default queue corresponding with master server, should Default queue can the solicited message to receive and handle external message processing terminal corresponding with message processing module.Cross herein Cheng Zhong, standby server can be normal condition, or machine state of delaying.In this example embodiment, standby server delay machine when, The running status of master server will not be had any impact, i.e., master server still can be with normal work.It can avoid the occurrence of In the prior art, caused due to the design that active and standby message synchronization communicates in the case where standby server delays machine, in normal shape The master server of state is because can not receive the standby server situation out of service to the response message of message synchronization request, so as to carry The high efficiency of server process message.
In addition, in this example embodiment, starting the default queue of the master server can include:
Receive the message of the Message Processing terminal and do not report queue by what the message moved on to the master server;
The message is moved on to the master server do not report queue after report and submit message;
Judge whether the master server receives the response message of external server, if the message then is moved on into institute State master server determine queue and from the master server determine queue in delete message, if otherwise the message is moved on to The pending queue of the master server.
In this example embodiment, the default queue of the master server can correspond to the Message Processing mould of master server Block, the message processing module of master server can report and submit module, the first pending processing module, at first message including first message The first message managed in module, the message processing module of the master server reports and submits module, the first pending processing module, first to disappear Breath processing module respectively correspond to master server do not report queue, pending queue, determine queue;Wherein, master server can pass through Do not report queue record to receive the message of Message Processing terminal, sent by pending queue's record but do not received outside clothes The message of business device response, the message for having been acknowledged reception that external server is responded is received by queue record of determining.
,, can when master server receives the message of Message Processing terminal with reference to shown in Fig. 3 in this example embodiment With first by the message be moved to it is described do not report queue and start first message report and submit module, the message is being moved to institute The message for not reporting and reporting and submitting and receiving after queue is stated, next can decide whether to receive the response message of external server;Enter One step, when receiving the response message of external server, it can confirm that message has been sent to external server, and it is outside The received message of server, therefore first message processing module can be started and move on to message in queue of determining.To Message is moved on to after queue of determining, shows that the message passes through processing, master server can be to disappearing in corresponding queue of having determined Breath carries out real-time update, when receiving the final response message of external server at the same time, can be from corresponding queue of having determined Delete the message, the whole process of completion message processing.In this process, the message in queue of determining can be deleted one by one, It can carry out not making this special in batch deletion, the present exemplary embodiment when the message in queue of determining exceedes certain amount Limit.Further, when not receiving the response message of external server, due to not knowing it is outer whether message has been sent to Portion's server, therefore message can be moved on to pending queue but do not start the first pending processing module.This example embodiment party In formula, by the way that the message received is classified with different queues, master server is handled message at full speed, improve The efficiency of Message Processing.
In step s 130, judge the master server delay machine when, control the standby server to switch to the main clothes Business device simultaneously starts the default queue of the standby server to handle the message of the Message Processing terminal.
In this example embodiment, the heartbeat for not receiving master server in detection exceedes preset times or preset time When, it may be determined that master server is delayed machine or in off-line state, while standby server can be controlled to switch to current main service Device, and start the message of the default queue processing message terminal of standby server.Wherein, the default queue of the standby server can be with It is corresponding with message processing module.The default queue of standby server can be identical with the default queue of the master server, that is, wraps Include and do not report queue, pending queue, queue of determining.When standby server switches to master server, the message newly received can be handled, The untreated message of master server for the machine of delaying can also be handled.In this example embodiment, by when master server delays machine, inciting somebody to action Standby server switches to the pattern of master server, it is to avoid the leakage hair message that occurs in the prior art when master server delays machine or Person is the situation for repeating to send message, improves the reliability of Message Processing.
In addition, in this example embodiment, when the standby server switches to the master server, methods described may be used also With including:
After the master server delays machine, pending message is judged whether;
If so, then pending message described in priority treatment;
After the pending message is handled, start the default queue of the standby server to handle message.This example is implemented In mode, after standby server switches to master server, inquiry external server can be first passed through and judge that master server is delayed machine The message whether treated with the presence or absence of uncertain master server afterwards, i.e., pending message.Judging there is the pending message When, the pending message do not reported and submitted can be supplemented and sent with priority treatment pending message to be reported and submitted by standby server;In pending message After the completion of processing, standby server can start master server schema component, start the default queue of the standby server, perform just Message Processing flow after normal active-standby switch.In this example embodiment, pass through the pending message of priority treatment, it is to avoid existing There is the situation of the leakage hair message occurred in technology when master server delays machine, improve the accuracy rate and reliability of message transmission.
In addition, in this example embodiment, starting the default queue of the standby server can include:
Receive the message of the Message Processing terminal and the message is moved on to the pending queue of the standby server;
After the message to be moved on to the pending queue of the standby server, judge whether the standby server receives outer The response message of portion's server;
If so, the message then to be moved on to the queue and from the queue of determining of the standby server of determining of the standby server Middle deletion message.
In this example embodiment, the default queue of the standby server can be with the message processing module phase for server Correspondence, message processing module can report and submit module, the second pending processing module, the second message processing module including the second message, Second message reports and submits module, the second pending processing module, the second message processing module to correspond to not reporting for standby server respectively Queue, pending queue, queue of determining.The second message in message processing module due to not starting standby server reports and submits module, Therefore the message that standby server can only record the message received and can not offset breath processing terminal is reported and submitted.With reference to Fig. 4 institutes Show, when standby server receives the message of Message Processing terminal, the message directly can be moved to the standby server Pending queue, then can start the response that the second pending module judges whether standby server receives external server and disappear Breath;Further, when receiving the response message of external server, it can confirm that message has been sent to external server, and The received message of external server, therefore the second message processing module can be started and move on to message in queue of determining. After message to be moved on to queue of determining, show that the message passes through processing, standby server can have been determined to correspondence in queue Message carry out real-time update, when receiving the final response message of external server at the same time, can from it is corresponding determine team The message, the whole process of completion message processing are deleted in row.In this process, disappearing in queue of determining can be deleted one by one Breath, can also carry out batch deletion, in the present exemplary embodiment to this not when the message in queue of determining exceedes certain amount Make particular determination.
In this example embodiment, self-corresponding queue, pending queue, are not reported by the way that master server and standby server are each Certainly the message queue mechanism such as queue, by the different mode of active/standby server, the message received is moved on to different message teams In row, and enable different operation modules and queue mechanism processing message.This mode avoids standby server from master server The step of obtaining message and synchronization message, but use black box rule instead, regard master server as an opaque black box, main clothes Being engaged between device and standby server can not direct communication, it is only necessary to the input from the external interface of message processing server system from Output, using pending queue, certainly queue mechanism maintains the delayed uniformity of data, has reached the purpose of synchrodata.This In example embodiment, master server can full speed processing message, the presence of standby server, standby server need not be considered completely Synchrodata can be absorbed in.This mode had both eliminated the burden of master server synchrodata, and the delayed of message is maintained again Uniformity, has reached that message does not repeat the high reliability not abandoned, so that whole message handling system has accomplished both efficient It is again reliable, while the performance of Message Processing has been accomplished to maximize.
In addition, in this example embodiment, controlling the standby server to switch to the master server to include:
Receive the message of the Message Processing terminal and do not report queue by what the message moved on to the standby server;
Determine whether each pending message reports and submits success by inquiring about server according to the numbering of each message;
By by the queue of determining for reporting and submitting successful message to move on to the standby server, the message do not reported being moved on to described standby The mode for not reporting queue of server clears up the pending queue for server;
After the pending queue of the standby server is cleared up, report and submit message to control the standby server to switch to the master Server.
In this example embodiment, as shown in fig. 6, after the master server delays machine, controlling the standby server switching During for master server, due to not can determine that whether master server treats the message, therefore the second Izvestia can be directly initiated Module is sent, queue is not reported by what the message newly received moved on to the standby server.Next external inquiry server can be passed through According to the corresponding unique number of each message for receiving and storing in pending queue, in the pending queue to determine standby server Whether each pending message has reported and submitted success, that is, judges whether each message has been successfully transmitted to external server.True When determining message and being successfully transmitted to server and received the response message of server, the message standby server has been moved on into Certainly queue;When it is determined that message is not reported and submitted successfully, the message is moved on to and does not report queue for server.It should be noted that this Not reporting and submitting for place successfully can not receive external service not reported and submitted to message and message report and submit The response message of device.After pending queue has been cleared up, the second message can be started and report and submit module progress message to report and submit, it is controlled Preceding standby server switches to current master server completely, and according to the message that receives of operational mode processing of master server.
In this example embodiment, in active/standby server handoff procedure, the beginning and end at the beginning of circulation or function pair can be passed through Certainly pending message all in queue is judged and classified one by one, and the purpose of cleaning pending queue is realized with this.In main service Device is delayed after machine, by handling the classification of pending message, can ensure during active-standby switch any a piece of news all without losing, Also it will not reprocess, so as to better ensure that the integrality of message transmission, improve Message Processing efficiency.
In addition, in this example embodiment, methods described can also include:
Recover to delay the master server or the standby server of machine;
It regard the master server after recovery or the standby server as standby startup of server.
, can be by restarting power supply either when master server or standby server delay machine in this example embodiment Hardware detection or other modes carry out automatically or manually recovering the server in machine state of delaying manually.In the service for the machine of delaying After device recovers normal, the server after recovery is defined as standby server.For example, detect master server delay machine when, Standby server can be controlled to switch to current master server to run through the above way, then by restart power supply either other Any-mode recovers the master server of machine of delaying, after the master server for the machine of delaying recovers normal mode of operation, the main service of script Device will be used as standby server;Detect standby server delay machine when, will not have any influence, main clothes on the operation of master server Business device still can normally be run, and can recover the standby server of machine of delaying by restarting power supply either other any-modes, Delay after the standby server recovery normally of machine, the standby server of script is still used as standby server.
In addition, in this example embodiment, methods described can also include:
The server first started is defined as the master server, the server of rear startup is defined as the standby service Device.
, i.e., can be by elder generation when master server and standby server start to start when system starts in this example embodiment The server of startup is defined as master server, and the server of rear startup is defined as into standby server.In this example embodiment, Master server and standby server are not changeless, but are changed according to startup with respect to sequencing, i.e., in system Server active-standby mode each other.For example, after initial master server delays machine, it is believed that initial standby server first starts, and delays Machine recover after initial master server after start, therefore can by it is initial for server be defined as current master server and the machine that will delay Initial master server after recovery is defined as current standby server.The determination of master server and standby server can be that system is normal Determine, can also either be determined in message processing procedure during the interruption ends caused by other failures due to having a power failure during startup, It can also be determined when a certain server delays machine, the present exemplary embodiment is not particularly limited to this.
In addition, in this example embodiment, methods described can also include:
Judge the master server and the standby server do not delay machine when, the master server and the standby server are same When receive the message of the Message Processing terminal and the response message of the external server.
In this example embodiment, when master server and standby server all do not delay machine and normal work, master server and Standby server can receive the message of same Message Processing terminal simultaneously, and the response that external server can also be received simultaneously disappears Breath, ensures that active/standby server receives the uniformity of data with this.Master server can be reported and submitted to the message received, also may be used To record, standby server may only be recorded to the message received and can not reported and submitted.But master server and standby server By carrying out method that is pending, certainly classifying to message, the delayed uniformity of data is safeguarded, although that is, data are not that the moment is consistent , but after delay random time, consistent state is may eventually reach, so as to ensure that the uniformity for sending data, herein Time delay is generally millisecond.In this way, time loss during active-standby switch can be used, Message Processing speed is lifted, So as to improve Message Processing efficiency.
In addition, above-mentioned accompanying drawing is only the schematic theory of the processing included by method according to an exemplary embodiment of the present invention It is bright, rather than limitation purpose.It can be readily appreciated that the time that above-mentioned processing shown in the drawings was not intended that or limited these processing is suitable Sequence.In addition, being also easy to understand, these processing for example can be performed either synchronously or asynchronously in multiple modules.
A kind of server preparedness processing unit is additionally provided in this example embodiment, can apply to a master server, One system constituted for server and an arbitration machine, the server preparedness processing unit 200 can include:
Delay machine judge module 201, can be used for monitoring the master server and the standby server by a heartbeat channel Running status and judge whether the master server delays machine;
Master server module 202, can be used for judge the master server do not delay machine when, control the master server to open The default queue of the master server is moved to handle the message of a Message Processing terminal;
Active-standby switch module 203, can be used for judge the master server delay machine when, control the standby server switching For the master server and start the default queue of the standby server to handle the message of the Message Processing terminal.
The detail of each module is in corresponding server preparedness processing side in above-mentioned server preparedness processing unit It is described in detail in method, therefore here is omitted.
A kind of storage medium is additionally provided in this example embodiment, computer program is stored thereon with, the computer journey Above-mentioned server preparedness processing method is realized when sequence is executed by processor.
Storage medium can be included in a base band or as the data-signal of carrier wave part propagation, can wherein carrying Reader code.The data-signal of this propagation can take various forms, including but not limited to electromagnetic signal, optical signal or on Any appropriate combination stated.Storage medium can be sent, propagated or be transmitted for by instruction execution system, device or device Part is used or program in connection.
The program code included in storage medium can be transmitted with any appropriate medium, including but not limited to wirelessly, be had Line, optical cable, radio frequency etc., or above-mentioned any appropriate combination.
A kind of electronic equipment is additionally provided in this example embodiment, with reference to shown in Fig. 8, the electronic equipment 10 includes:Place Component 11 is managed, it can further include one or more processors, and as the memory resource representated by memory 12, used The instruction that can be performed in storage by processing assembly 11, such as application program.The application program stored in memory 12 can include It is one or more each correspond to the module of one group of instruction.In addition, processing assembly 11 is configured as execute instruction, with Perform the above method.
The electronic equipment 10 can also include:One power supply module, power supply module is configured to performing electronic equipment 10 Carry out power management;One wired or wireless network interface 13, is configured to electronic equipment 10 being connected to network;And one Input and output (I/O) interface 14.The electronic equipment 10 can be operated based on the operating system for being stored in memory 12, for example Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
In addition, above-mentioned accompanying drawing is only the schematic theory of the processing included by method according to an exemplary embodiment of the present invention It is bright, rather than limitation purpose.It can be readily appreciated that the time that above-mentioned processing shown in the drawings was not intended that or limited these processing is suitable Sequence.In addition, being also easy to understand, these processing for example can be performed either synchronously or asynchronously in multiple modules.
Although it should be noted that being referred to some modules or list of the equipment for action executing in above-detailed Member, but this division is not enforceable.In fact, according to embodiment of the present disclosure, it is above-described two or more Module or the feature and function of unit can embody in a module or unit.Conversely, an above-described mould The feature and function of block or unit can be further divided into being embodied by multiple modules or unit.
In addition, although each step of method in the disclosure is described with particular order in the accompanying drawings, this does not really want These steps must be performed according to the particular order by asking or implying, or the step having to carry out shown in whole could be realized Desired result.It is additional or alternative, it is convenient to omit some steps, multiple steps are merged into a step and performed, and/ Or a step is decomposed into execution of multiple steps etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented Mode can be realized by software, can also be realized by way of software combines necessary hardware.Therefore, according to the disclosure The technical scheme of embodiment can be embodied in the form of software product, the software product can be stored in one it is non-volatile Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are to cause a calculating Equipment (can be personal computer, server, mobile terminal or network equipment etc.) is performed according to disclosure embodiment Method.
Those skilled in the art will readily occur to its of the disclosure after considering specification and putting into practice invention disclosed herein Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or Person's adaptations follow the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by appended Claim is pointed out.

Claims (12)

1. a kind of server preparedness processing method, applied to the system of master server, standby server and arbitration machine composition, wherein, The master server is used to handle message, and the standby server is used for synchronization message, it is characterised in that methods described includes:
The arbitration machine monitors the running status of the master server and the standby server by a heartbeat channel and judges institute Master server is stated whether to delay machine;
Judge the master server do not delay machine when, control the master server to start the default queue of the master server to locate Manage the message of a Message Processing terminal;
Judge the master server delay machine when, control the standby server to switch to the master server and start the standby clothes Be engaged in device default queue to handle the message of the Message Processing terminal;
Wherein, the default queue of the master server and the standby server includes not reporting queue, pending queue and the team that determines Row, it is described do not report queue be used for record receive but the message that does not send, the pending queue is used for record and sent but non-acknowledgement Message, the queue of having determined is used for the message for recording acknowledgement.
2. server preparedness processing method according to claim 1, it is characterised in that start the default of the master server Queue includes:
Receive the message of the Message Processing terminal and do not report queue by what the message moved on to the master server;
The message is moved on to the master server do not report queue after report and submit message;
Judge whether the master server receives the response message of external server, if the message then is moved on into the master Determining for server and deletes message at queue from the queue of determining of the master server, if otherwise moving on to the message described The pending queue of master server.
3. server preparedness processing method according to claim 1, it is characterised in that start the default of the standby server Queue includes:
Receive the message of the Message Processing terminal and the message is moved on to the pending queue of the standby server;
After the message to be moved on to the pending queue of the standby server, judge whether the standby server receives outside clothes The response message of business device;
Queue and deleted if so, the message then is moved on into determining for the standby server from the queue of determining of the standby server Except message.
4. server preparedness processing method according to claim 1, it is characterised in that switch to institute in the standby server When stating master server, methods described also includes:
After the master server delays machine, pending message is judged whether;
If so, then pending message described in priority treatment;
After the pending message is handled, start the default queue of the standby server to handle message.
5. server preparedness processing method according to claim 1, it is characterised in that the control standby server is switched to The master server includes:
Receive the message of the Message Processing terminal and do not report queue by what the message moved on to the standby server;
Determine whether each pending message reports and submits success by inquiring about server according to the numbering of each message;
By the way that by the queue of determining for reporting and submitting successful message to move on to the standby server, the message do not reported is moved on into the standby service The mode for not reporting queue of device clears up the pending queue for server;
After the pending queue of the standby server is cleared up, report and submit message to control the standby server to switch to the main service Device.
6. server preparedness processing method according to claim 1, it is characterised in that judge whether the master server delays Machine includes:
The arbitration machine judges whether to receive the heartbeat of the master server by the heartbeat channel;
When judging that continuous preset times do not receive the heartbeat of the master server, judge that the master server is delayed machine.
7. server preparedness processing method according to claim 1, it is characterised in that methods described also includes:
Recover to delay the master server or the standby server of machine;
It regard the master server after recovery or the standby server as standby startup of server.
8. server preparedness processing method according to claim 1, it is characterised in that methods described also includes:
The server first started is defined as the master server, the server of rear startup is defined as the standby server.
9. server preparedness processing method according to claim 1, it is characterised in that methods described also includes:
Judge the master server and the standby server do not delay machine when, the master server and the standby server connect simultaneously Receive the message of the Message Processing terminal and the response message of the external server.
10. a kind of server preparedness processing unit, applied to the system of master server, standby server and arbitration machine composition, wherein, The master server is used to handle message, and the standby server is used for synchronization message, it is characterised in that described device includes:
Delay machine judge module, the master server and the standby server are monitored by a heartbeat channel for the arbitration machine Running status simultaneously judges whether the master server delays machine;
Master server module, for judge the master server do not delay machine when, control the master server to start the main clothes Be engaged in device default queue to handle the message of a Message Processing terminal;
Active-standby switch module, for judge the master server delay machine when, control the standby server to switch to the main clothes Business device simultaneously starts the default queue of the standby server to handle the message of the Message Processing terminal;
Wherein, the default queue of the master server and the standby server includes not reporting queue, pending queue and the team that determines Row, it is described do not report queue be used for record receive but the message that does not send, the pending queue is used for record and sent but non-acknowledgement Message, the queue of having determined is used for the message for recording acknowledgement.
11. a kind of storage medium, is stored thereon with computer program, it is characterised in that the computer program is held by processor The server preparedness processing method described in claim any one of 1-9 is realized during row.
12. a kind of electronic equipment, it is characterised in that including:
Processor;And
Memory, the executable instruction for storing the processor;
Wherein, the processor is configured to come described in perform claim requirement any one of 1-9 via the execution executable instruction Server preparedness processing method.
CN201710197356.2A 2017-03-29 2017-03-29 Server disaster recovery processing method and device, storage medium and electronic equipment Active CN107104822B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710197356.2A CN107104822B (en) 2017-03-29 2017-03-29 Server disaster recovery processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710197356.2A CN107104822B (en) 2017-03-29 2017-03-29 Server disaster recovery processing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN107104822A true CN107104822A (en) 2017-08-29
CN107104822B CN107104822B (en) 2020-09-08

Family

ID=59675452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710197356.2A Active CN107104822B (en) 2017-03-29 2017-03-29 Server disaster recovery processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN107104822B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388487A (en) * 2018-03-01 2018-08-10 上海达梦数据库有限公司 A kind of data loading process, device, equipment and storage medium
CN110515741A (en) * 2018-05-21 2019-11-29 北京京东尚科信息技术有限公司 A kind of degradation processing method and device based on local task queue
CN110661599A (en) * 2018-06-28 2020-01-07 中兴通讯股份有限公司 HA implementation method, device and storage medium between main node and standby node
CN113467999A (en) * 2021-07-08 2021-10-01 西安航天动力试验技术研究所 Active thermal redundancy monitoring dual-computer switching system and method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005025244A2 (en) * 2003-09-09 2005-03-17 Avaya Technology Corp. Systems and methods for the schedule alignment of a packet flow
CN101262325A (en) * 2008-04-21 2008-09-10 深圳南瑞科技有限公司 Switching device for monitoring dual hosts at translation station
CN101561767A (en) * 2008-04-16 2009-10-21 上海聚力传媒技术有限公司 Method and device for executing tasks based on operating system
CN102314463A (en) * 2010-07-07 2012-01-11 北京瑞信在线系统技术有限公司 Distributed crawler system and webpage data extraction method for the same
CN102868560A (en) * 2012-09-28 2013-01-09 南京恩瑞特实业有限公司 System and method for realizing hot standby of servers
CN103532822A (en) * 2012-07-02 2014-01-22 北京神州泰岳软件股份有限公司 Management method for message delivery, server and system thereof
CN103685387A (en) * 2012-09-12 2014-03-26 中国移动通信集团公司 Method for scheduling HTTP (hyper text transport protocol) request and browser device
CN104391751A (en) * 2014-10-16 2015-03-04 广州天宁信息技术有限公司 Synchronization method and device for algorithmic data processing
CN105573840A (en) * 2015-12-08 2016-05-11 东软集团股份有限公司 Event processing method and device in workflow operating period

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005025244A2 (en) * 2003-09-09 2005-03-17 Avaya Technology Corp. Systems and methods for the schedule alignment of a packet flow
CN101561767A (en) * 2008-04-16 2009-10-21 上海聚力传媒技术有限公司 Method and device for executing tasks based on operating system
CN101262325A (en) * 2008-04-21 2008-09-10 深圳南瑞科技有限公司 Switching device for monitoring dual hosts at translation station
CN102314463A (en) * 2010-07-07 2012-01-11 北京瑞信在线系统技术有限公司 Distributed crawler system and webpage data extraction method for the same
CN103532822A (en) * 2012-07-02 2014-01-22 北京神州泰岳软件股份有限公司 Management method for message delivery, server and system thereof
CN103685387A (en) * 2012-09-12 2014-03-26 中国移动通信集团公司 Method for scheduling HTTP (hyper text transport protocol) request and browser device
CN102868560A (en) * 2012-09-28 2013-01-09 南京恩瑞特实业有限公司 System and method for realizing hot standby of servers
CN104391751A (en) * 2014-10-16 2015-03-04 广州天宁信息技术有限公司 Synchronization method and device for algorithmic data processing
CN105573840A (en) * 2015-12-08 2016-05-11 东软集团股份有限公司 Event processing method and device in workflow operating period

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388487A (en) * 2018-03-01 2018-08-10 上海达梦数据库有限公司 A kind of data loading process, device, equipment and storage medium
CN108388487B (en) * 2018-03-01 2020-09-04 上海达梦数据库有限公司 Data loading method, device, equipment and storage medium
CN110515741A (en) * 2018-05-21 2019-11-29 北京京东尚科信息技术有限公司 A kind of degradation processing method and device based on local task queue
CN110661599A (en) * 2018-06-28 2020-01-07 中兴通讯股份有限公司 HA implementation method, device and storage medium between main node and standby node
CN113467999A (en) * 2021-07-08 2021-10-01 西安航天动力试验技术研究所 Active thermal redundancy monitoring dual-computer switching system and method
CN113467999B (en) * 2021-07-08 2022-12-09 西安航天动力试验技术研究所 Active thermal redundancy monitoring dual-computer switching system and method

Also Published As

Publication number Publication date
CN107104822B (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN107104822A (en) Server preparedness processing method, device, storage medium and electronic equipment
US6401136B1 (en) Methods, systems and computer program products for synchronization of queue-to-queue communications
WO2017219779A1 (en) Device active/standby switchover method and apparatus based on link protocol, and storage medium
WO2020038308A1 (en) Switching method, device and transfer control separation system of control plane device
US11863370B2 (en) High availability using multiple network elements
CN107612754B (en) Bidirectional forwarding link fault detection method and device and network node equipment
JP2004032224A (en) Server takeover system and method thereof
CN110324375B (en) Information backup method and related equipment
WO2021057526A1 (en) Disaster recovery method for gateway device, and communication device
CN113315665B (en) Message sending method, device, equipment and medium of dual-network-card terminal equipment
CN104579746A (en) Method and device for controlling dual-link transmission
KR20170087161A (en) Apparatus and method for controlling transmission in a high thoughput werelless network
CN112291819A (en) Radio link failure recovery method and user equipment
JPH1056479A (en) Packet communication system
JP2003337717A (en) Fault recovery synchronizing system of online transaction process
CN103391324A (en) Hot backup method based on TFTP (trivial file transfer protocol)
JP2024508557A (en) Communication route switching method, device and terminal
JP3493035B2 (en) Dynamic path switching method
CN114422428A (en) Restarting method and apparatus for service node, electronic device and storage medium
JP2004179909A (en) Radio lan system, radio terminal, and access point
CN108599903A (en) Single board starting control method and device
JPH04256147A (en) Device for correcting switching error which may occur in computer i/o system
WO2023098726A1 (en) Communication path configuration method and apparatus, and terminal
WO2023185841A1 (en) Method and apparatus for selecting relay user equipment, and user equipment and storage medium
WO2023116836A1 (en) Image frame acquisition method and apparatus, and communication device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200731

Address after: 11, building 310053, Hang Seng tower, 3588 Jiangnan Avenue, Hangzhou, Zhejiang, Binjiang District

Applicant after: HUNDSUN TECHNOLOGIES Inc.

Address before: 310053 Hang Seng mansion, No. 3588, main road, the south of the River, Binjiang District, Hangzhou, Zhejiang province city

Applicant before: HANGZHOU YUNJI NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant