Embodiment
Fig. 1 is a kind of schematic diagram of the communication system of C/S frameworks in correlation technique.The communication system can include:Clothes
It is engaged in device 10, some client devices 30, some connection management equipment (or " front-end machine ", " cm device ", " front-end processing
Machine ") 20 and data buffer storage layer 40.Wherein, the server 10 can be responsible for the server of all kinds of service operations, such as:Branch
Pay Platform Server, immediate communication platform server etc..For ease of description, herein by each connecting tube in above-mentioned communication system
The cluster of reason equipment composition is referred to as " CM clusters ".In above-mentioned communication system, between each client device 30 and server 10
Communication process be that maintenance is responsible for by CM clusters, so, server 10 would not be bothered constantly by client device 30 so that
Discharge the process resource of server 10, lifting system performance.Connection management equipment included in said system, CM clusters
Quantity, the quantity of each maintainable client device of connection management equipment can be adjusted according to system actual demand.It is above-mentioned
Data buffer storage layer 40 is used to store the log-on message generated after a certain connection management equipment of each client device login, i.e.
Log-on message in all connection management equipment of " CM clusters " can be stored in data buffer storage layer 40.Data buffer storage layer
40 can be used for reducing the number of times of reading database by data cached in internal memory, so as to improve systematic function, the data are delayed
Depositing layer 40 can be one piece of memory space that system is individually opened up or be integrated in interior in a certain server or subsystem
Space is deposited, the application is not restricted.It should be noted that, the data in above-mentioned data buffer storage layer 40 can automatically surpass according to predetermined
Constantly length is updated, i.e., each pen data be present in above-mentioned data buffer storage layer 40 duration be typically not greater than it is above-mentioned automatic
Overtime duration, the auto-timeout duration can be set according to system actual demand.
In the process of running, when a certain client device needs to interact between server, the client device
A certain connection management equipment (can be chosen according to the actual loading situation of each connection management equipment) can first be logged in, with it is a certain
Connection management equipment sets up connection.After client device success and a certain connection management equipment, which are set up, to be connected, the connecting tube
Reason equipment needs to generate the log-on message of existing customer end equipment and stored into data buffer storage layer 40, after server 10
It is continuous when needing to client device PUSH message, can by searching corresponding log-on message from above-mentioned data buffer storage layer 40,
The specified connection management equipment being connected is set up with the client device to find, and specifies connection management equipment to be disappeared by this
Breath is delivered.In a kind of example, log-on message may include:Client device ID is (such as:The user's account logged on client device
Number) and with client device set up the mark of connection management equipment being connected (such as:" 001 "), for example, { client device a is logged in
Connection management device A }.
In the related art, in " CM clusters " connection management equipment it is unavoidable because of various factors (such as:Mechanical disorder, machine of delaying,
Using renewal etc.) need to restart, after a certain connection management equipment is restarted, server 10 is easily caused from data buffer storage
The log-on messages that find of layer 40 are incorrect, and then cause server 10 according to the erroneous logons information of lookup, to specifying
Connection management equipment deliver message failure the problem of, bring the unnecessary wasting of resources, had undesirable effect to systematic function.
For example, it is assumed that a certain connection management device A starts at the t1 moment, and normal operating conditions to the t2 moment is maintained to delay
Machine, hereafter starts and recovers normal operating conditions again at the t3 moment.In above process, it is assumed that a certain client device a
Some time point between t1 moment~t2 moment logs in the connection management device A and established a connection, then slow in data
The log-on message in layer 40 for client device a is deposited to can be for example:{ client device a logs in connection management device A }.Base
In above-mentioned example, it is possible that following situation:
1. some time point of server 10 after the t3 moment needs to push first message to client device a, now
Server 10 from the data buffer storage log-on message for client device a that finds of layer if:{ client device a is logged in
Connection management device A }.However, in fact, machine and restart because connection management device A is delayed at the t2 moment at the t3 moment,
After this process, client device a no longer may set up be connected with connection management device A (or to be entered by connection management device A
Row is logged in), for example:Client device a is offline or client device a and CM clusters in another connection management equipment B build
Vertical connection to log-on message but without being updated, etc..For this case, if server 10 is still according to above-mentioned login
Information if:{ client device a logs in connection management device A }, delivers for being forwarded to client to connection management device A
Message on equipment a, then certainly will cause message dilivery to fail.
2. some time point of server 10 between t2 the and t3 moment needs to push first message to client device a,
Now server 10 from the data buffer storage log-on message for client device a that finds of layer if:{ client device a
Log in connection management device A }.However, in fact, because connection management device A is delayed machine at the t2 moment, causing in t2 to t3
Between moment can not normal work, even if so server 10 is delivered for being forwarded to client device a to connection management device A
On message, will also result in message dilivery failure.
For above-mentioned two situations, due to restarting for connection management equipment, server 10 can be caused to the company being restarted
The failure that management equipment delivers message is connect, unnecessary resource consumption is caused, technical scheme is exactly asked for solution is above-mentioned
Inscribe and propose.
Fig. 2 is a kind of flow chart of information-pushing method in the embodiment of the application one, and Fig. 3, Fig. 4 show the application one
For the Startup time process that is recorded and changed of connection management equipment in embodiment, come pair below with reference to Fig. 2~Fig. 4
This programme is described.Join shown in Fig. 2, the information-pushing method can apply to above-mentioned server 10, comprise the steps 101
~103, wherein:
In a step 101, the log-on message of target client device is searched, wherein the log-on message includes:With it is described
Target client device sets up the mark of the connection management equipment of connection, and the very first time of the connection management equipment stabs;Its
Described in the very first time stamp to identify the target client device and the connection management equipment foundation be connected at the time of
Before, at the time of described connection management equipment the last time starts.
In one embodiment, for ease of description, it is assumed that target client device is designated a, builds with client device a
The connection management equipment of vertical connection is designated CM-A.After client device a and connection management equipment CM-A set up and are connected,
The log-on message of the storage client device a in data buffer storage layer is needed, is, for example,:
{ being logged on CM-A, CM-A Startup time is t1 };
In which it is assumed that client device a is t0 at the time of setting up and be connected with connection management equipment CM-A, then t1 is in t0
At the time of connection management equipment the last time before quarter starts.Connection management equipment is after each start, Ke Yiji
At the time of record starts itself each time, so, after thering is client device a to set up connection therewith, it just can obtain corresponding nearest
At the time of one-shot and corresponding with moment very first time stamp is generated, be then stored into data buffer storage layer.Hereafter, service is worked as
, then can be based on the data stored in data buffer storage layer, from data buffer storage layer when device is needed to client device a PUSH messages
The log-on message of target client device is searched, and carries out message dilivery process.It should be noted that, in other possible embodiments
In, log-on message is not limited to storage into above-mentioned data buffer storage layer, can also be stored in other memory spaces.
In a step 102, according to the mark, the second timestamp corresponding with the mark of server record is obtained;
At the time of wherein described second timestamp listens to the connection management equipment startup to identify described server the last time.
In the present embodiment, except needing the storage in data buffer storage layer to be stabbed comprising the very first time (to identify cm device
Startup time) log-on message outside, in addition it is also necessary to server passes through each the connection management equipment monitored in " CM clusters "
Working condition is (such as:Start, machine of delaying, failure, restart), to record the second timestamp of each connection management equipment, wherein institute
At the time of stating the second timestamp and listen to the connection management equipment to identify described server the last time and start.
Coordinate reference picture 3- Fig. 4, illustrate so that a certain connection management equipment CM-A delays machine and the scene restarted as an example.
Wherein shown in Fig. 3 is the information storage condition that connection management equipment CM-A delays before machine, and shown in Fig. 4 is connection management
Equipment CM-A delays machine and the information storage condition after restarting.It is assumed that connection management equipment CM-A starts one at the t1 moment
It is secondary, and maintain normal work to the t2 moment to delay machine, hereafter recover starting state at the t3 moment.As shown in Figure 3, it is assumed that in t1
Some time point between moment and t2 moment, client device a sets up with connection management equipment CM-A and is connected, then needs in number
According to cache layer memory storage client device a log-on message:{ logged on connection management equipment CM-A, CM-A Startup time
It is t1 }, simultaneously, start once at the t1 moment because server listens to connection management equipment CM-A, and setting up connection
The current time of completion, this startup is the Startup time for server the last time listening to CM-A, then server needs record:
{ CM-A Startup time is t1 }.As shown in figure 4, when server listen to CM-A delayed at the t2 moment machine after, can be by
Originally the information recorded:{ CM-A Startup time be t1 } is deleted, and is listened to CM-A in server and restarted at the t3 moment
Afterwards, it can record:{ CM-A Startup time is t3 }.It can be seen that, server is by constantly monitoring each connection management equipment
State, the Startup time for the connection management equipment that the last time is listened to is defined as the second timestamp, and is recorded.
In one embodiment, when the connection management equipment is restarted, the connection management equipment restarted is needed in server
Upper to be re-registered, i.e., server can receive the note for including second timestamp that the connection management equipment is sent
Volume instruction.Wherein described second timestamp is determined at the time of being restarted according to the connection management equipment.When the connecting tube
Manage after facility registration success, second timestamp is identified (such as with described:CM-A) correspond to and record.Certainly, server
At the time of obtaining its last time and start, and second time can be defined as by monitoring the state of connection management equipment
Stab and record.
In step 103, when very first time stamp and inconsistent second timestamp, refuse to the connecting tube
Reason equipment is pushed for sending to the information to be pushed in the target client device.
Process based on figure 3 above and Fig. 4, when server needs to deliver message to a certain client device a, Ke Yitong
Cross and search above-mentioned very first time stamp and the second timestamp and whether compare the two timestamps consistent, when inconsistent, then refuse
PUSH message is treated to the push of corresponding connection management equipment is above-mentioned;If consistent, pushed to corresponding connection management equipment above-mentioned
Treat PUSH message.
Usually, above-mentioned very first time stamp and the inconsistent situation of the second timestamp is caused mainly to include:
Certain time point of client device a before the CM-A machines of delaying are restarted sets up with CM-A and is connected, when CM-A is at the t3 moment
After restarting completion, the actually already off connections with CM-A of client device a, however, still being stored in data buffer storage layer
Client device a log-on message is:{ being logged on connection management equipment CM-A, CM-A Startup time is t1 }, and this
When server record information be:{ CM-A Startup time is t3 }.
For above-mentioned situation, it can be seen that if server is still delivered for being forwarded on client device a to CM-A
PUSH message is treated, then will certainly deliver and fail, cause unnecessary resource consumption.
In one embodiment, methods described can also include:
When listen to the connection management equipment delay machine or closing when, delete recording with the mark on the server
Corresponding second timestamp.
Continue to continue to use above-mentioned example, due to delaying machine in the t2~t3 periods for restarting completion in CM-A, the server
The information corresponding with the mark CM-A of upper record is empty (deleted), so within this period section, if server is needed
Will by CM-A to client device a PUSH messages, because server does not get the second timestamp corresponding with the mark,
Then refuse to push the information to be pushed to the connection management equipment, so that the unnecessary money for avoiding message dilivery from unsuccessfully causing
Source is consumed.Similarly, in some cases, when the log-on message for not finding the target client device (generally indicates that mesh
Mark client device offline) when, also refuse to push the information to be pushed to the connection management equipment.
It is visible based on above content, the application by data buffer storage layer store target client device log-on message with
And the second timestamp corresponding with the connection management equipment is recorded on the server, the log-on message is included and the target
Client device sets up the very first time stamp of the connection management equipment of connection.Wherein, because the application is entering to be about to message
, it is necessary to judge whether above-mentioned very first time stamp is consistent with the second timestamp before being delivered to connection management equipment, and described the
When one timestamp and inconsistent second timestamp, refuse to push corresponding information to be pushed to the connection management equipment,
So as to avoid after connection management equipment is restarted, server mistakenly delivers message to connection management equipment, causes to disappear
The problem of breath delivers failure, the application can effectively reduce the unnecessary message dilivery of server, reduce server unnecessary
Resource consumption.
Fig. 5 shows the schematic configuration diagram of the electronic equipment of the exemplary embodiment according to the application.It refer to Fig. 5,
In hardware view, the electronic equipment includes processor, internal bus, network interface, internal memory and nonvolatile memory, certainly
It is also possible that the hardware required for other business.Processor read from nonvolatile memory corresponding computer program to
Then run in internal memory, information push-delivery apparatus is formed on logic level.Certainly, in addition to software realization mode, the application
It is not precluded from other implementations, such as the mode of logical device or software and hardware combining etc., that is to say, that following processing stream
The executive agent of journey is not limited to each logic unit or hardware or logical device.
Fig. 6 is refer to, in Software Implementation, the information push-delivery apparatus can include searching unit 201, acquiring unit
202 and refusal push unit 203.Wherein:
Searching unit 201, the log-on message for searching target client device.The log-on message includes:With it is described
Target client device sets up the mark of the connection management equipment of connection, and the very first time of the connection management equipment stabs;Its
Described in the very first time stamp to identify the target client device and the connection management equipment foundation be connected at the time of
At the time of foregoing description connection management equipment the last time starts;
Acquiring unit 202, for according to the mark, obtaining the second time corresponding with the mark of server record
Stamp;Wherein described second timestamp to identify that described server the last time listens to that the connection management equipment starts when
Carve.
Refuse push unit 203, for when the very first time, stamp was inconsistent with second timestamp, refusing to institute
Connection management equipment is stated to push for sending to the information to be pushed in the target client device.
Optionally, the searching unit 201 can be used for:
The log-on message of target client device is searched from data buffer storage layer;Wherein described log-on message is in target visitor
Family end equipment is written into the data buffer storage layer when setting up and be connected with the connection management equipment.
Optionally, described device may also include:
Timestamp recording unit 204, for when listening to the connection management equipment and restarting, obtaining and the connecting tube
Reason equipment corresponding second timestamp and corresponding with mark at the time of restart.
Optionally, described device may also include:
Timestamp deletes unit 205, for when listen to the connection management equipment delay machine or closing when, delete the clothes
The second timestamp corresponding with the mark recorded on business device.
Optionally, above-mentioned timestamp recording unit 204 may particularly include:
Receiving unit 2041, for when the connection management equipment is restarted, receiving what the connection management equipment was sent
Include the register instruction of second timestamp;Wherein described second timestamp be according to the connection management equipment restart when
Carve what is determined;
Corresponding unit 2042, for when the connection management facility registration success after, by second timestamp with it is described
Mark correspondence is simultaneously recorded.
Optionally, the refusal push unit 203 can be additionally used in:
When not getting with corresponding second timestamp of the mark, refuse described to connection management equipment push
Information to be pushed.
Optionally, the refusal push unit 203 can be additionally used in:
When not finding the log-on message of the target client device, refuse to push institute to the connection management equipment
State information to be pushed.
System, device, module or unit that above-described embodiment is illustrated, can specifically be realized by computer chip or entity,
Or realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cell phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet PC, wearable device or these equipment
The combination of any several equipment.
For convenience of description, it is divided into various units during description apparatus above with function to describe respectively.Certainly, this is being implemented
The function of each unit can be realized in same or multiple softwares and/or hardware during application.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can be used in one or more computers for wherein including computer usable program code
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved
State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, the information that can be accessed by a computing device available for storage.Define, calculate according to herein
Machine computer-readable recording medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising so that process, method, commodity or equipment including a series of key elements are not only including those key elements, but also wrap
Include other key elements being not expressly set out, or also include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanted including described
Also there is other identical element in process, method, commodity or the equipment of element.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program product.
Therefore, the application can be using the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Form.Deposited moreover, the application can use to can use in one or more computers for wherein including computer usable program code
The shape for the computer program product that storage media is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The application can be described in the general context of computer executable instructions, such as program
Module.Usually, program module includes performing particular task or realizes routine, program, object, the group of particular abstract data type
Part, data structure etc..The application can also be put into practice in a distributed computing environment, in these DCEs, by
Remote processing devices connected by communication network perform task.In a distributed computing environment, program module can be with
Positioned at including in the local and remote computer-readable storage medium including storage device.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment was stressed is the difference with other embodiment.It is real especially for system
Apply for example, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method
Part explanation.
Embodiments herein is the foregoing is only, the application is not limited to.For those skilled in the art
For, the application can have various modifications and variations.It is all any modifications made within spirit herein and principle, equivalent
Replace, improve etc., it should be included within the scope of claims hereof.