CN104301423A - Heartbeat message sending method, device and system - Google Patents

Heartbeat message sending method, device and system Download PDF

Info

Publication number
CN104301423A
CN104301423A CN201410575760.5A CN201410575760A CN104301423A CN 104301423 A CN104301423 A CN 104301423A CN 201410575760 A CN201410575760 A CN 201410575760A CN 104301423 A CN104301423 A CN 104301423A
Authority
CN
China
Prior art keywords
task
server
heartbeat message
heartbeat
state parameter
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
CN201410575760.5A
Other languages
Chinese (zh)
Other versions
CN104301423B (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.)
Qax Technology Group Inc
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410575760.5A priority Critical patent/CN104301423B/en
Publication of CN104301423A publication Critical patent/CN104301423A/en
Application granted granted Critical
Publication of CN104301423B publication Critical patent/CN104301423B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Landscapes

  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a heartbeat message sending method, device and system and relates to the technical field of internet technologies. The problem that a terminal frequently sends heartbeat messages is solved. The heartbeat message sending method comprises the steps of periodically sending main heartbeat messages to a server; receiving heartbeat response packets sent by the server; determining tasks to be issued of the server according to executing state parameters in the heartbeat response packets; periodically sending auxiliary heartbeat messages corresponding to the tasks to be issued so as to facilitate receiving of corresponding tasks issued by the server. The heartbeat message sending method, device and system is mainly used for a network system in a local area network.

Description

A kind of method, Apparatus and system sending heartbeat message
Technical field
The present invention relates to Internet technical field, particularly relate to a kind of method, the Apparatus and system that send heartbeat message.
Background technology
Terminal will perform multitask operation under normal circumstances, these tasks are in order to keep the presence of oneself at network side, the server to network side is needed to send heartbeat message, whether inquiry has new task to perform, server replys a fix information, in order to indicate the executing state of task after receiving heartbeat message.
Under the networking operational environment of reality, when reaching heart time at every turn, terminal all can send the heartbeat message of each task to server, task response can be carried out for the heartbeat message of current reception when server needs to issue task, after the fix information receiving server reply, the application programming interface (Application Program Interface is called for short API) that terminal call operation system leaves each task for has judged whether that new task performs.
In the process of above-mentioned transmission heartbeat message, inventor finds: when the task that terminal performs gets more and more, the heartbeat message that terminal constantly sends each task to server will cause the quantity sending heartbeat message to get more and more, and makes the server of terminal and network side frequently mutual.Although heartbeat message data volume is less, but because its quantity forwarded is larger, therefore will certainly take more signal resource and data resource, cause the waste of terminal processes resource, server process resource and network transmission resource, huge burden can be caused to network.
Summary of the invention
In view of this, the present invention proposes a kind of method, the Apparatus and system that send heartbeat message, the problem that terminal frequently sends heartbeat message can be solved.
According to first aspect of the present invention, the invention provides a kind of method sending heartbeat message, comprising:
Periodically main heartbeat message is sent, the heartbeat response packet that main heartbeat message returns for obtaining server to server;
The heartbeat response packet that reception server sends, carries the executing state parameter for different task in heartbeat response packet;
According to the executing state parameter in heartbeat response packet, determine the task that server is to be issued;
Periodically send task corresponding to be issued from heartbeat message so that the corresponding task that reception server issues.
According to second aspect of the present invention, present invention also offers a kind of device sending heartbeat message, described device comprises:
Transmitting element, for periodically sending main heartbeat message, the heartbeat response packet that main heartbeat message returns for obtaining server to server;
Receiving element, for the heartbeat response packet that reception server sends according to the main heartbeat message that transmitting element sends, carries the executing state parameter for different task in heartbeat response packet;
Determining unit, for the executing state parameter in the heartbeat response packet that receives according to receiving element, determines the task that server is to be issued;
Described transmitting element, also for periodically send task to be issued that corresponding determining unit determines from heartbeat message so that the corresponding task that receiving element reception server issues.
According to the 3rd aspect of the present invention, present invention also offers a kind of system sending heartbeat message, described system comprises server and terminal, and wherein, described terminal comprises the device as described in front second aspect.
By technique scheme, method, the Apparatus and system of the transmission heartbeat message that the embodiment of the present invention provides, periodically main heartbeat message can be sent to server, to obtain the heartbeat response packet carrying the executing state parameter of different task, thus determine corresponding task to be issued according to this executing state parameter, and send it from heartbeat message, so that the corresponding task that reception server issues.Compared with prior art, the present invention can when only having new task to perform just send for task response from heartbeat message, effectively can not only reduce the quantity without sending heartbeat message under task status, but also not affect the timely response of task and issue.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of specification, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows a kind of flow chart sending the method for heartbeat message that the embodiment of the present invention provides;
Fig. 2 shows a kind of structural representation sending the device of heartbeat message that the embodiment of the present invention provides;
The another kind that Fig. 3 shows the embodiment of the present invention to be provided sends the structural representation of the device of heartbeat message;
The another kind that Fig. 4 shows the embodiment of the present invention to be provided sends the structural representation of the device of heartbeat message;
The another kind that Fig. 5 shows the embodiment of the present invention to be provided sends the structural representation of the device of heartbeat message;
Fig. 6 shows a kind of schematic diagram sending the system of heartbeat message that the embodiment of the present invention provides.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in further detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Frequently send the problem of heartbeat message to solve terminal, embodiments provide a kind of method sending heartbeat message, as shown in Figure 1, the method comprises:
101, periodically main heartbeat message is sent to server.
The heartbeat response packet that described main heartbeat message in step 101 returns for obtaining described server.In the network operation process of reality, terminal needs to perform multitask operation under the mandate of the server of network side, and therefore terminal needs the presence remaining on network side.It is by periodically realizing to the mode of server transmission heartbeat message that terminal maintains its presence.When server has new task indicating terminal to perform, will the heartbeat message that the terminal received sends be responded, perform new task to authorization terminal.It is no matter the heartbeat message of which kind of form, it is sent out periodically to server, can determine after server receives that terminal is in network connection state, if server needs authorization terminal to perform new task, then server can respond the heartbeat message that terminal sends, and issues the instruction performing new task to terminal.If server does not receive the heartbeat message of terminal transmission every certain hour, then server can judge that terminal disconnects, thus carries out corresponding terminal disconnection logical process.
In the present embodiment, for keeping the heartbeat message of terminal presence to be defined as main heartbeat message, the heartbeat response packet that described main heartbeat message returns for obtaining server.Main heartbeat message not only plays a part to keep terminal presence, and periodically sends main heartbeat message to server server can also be made to respond main heartbeat message at any time, issues new heartbeat response packet in time to terminal.
102, the heartbeat response packet of reception server transmission.
Described heartbeat response packet in step 102 carries the executing state parameter for different task.Periodically send in the process of main heartbeat message in above-mentioned steps 101 to server, if server does not have new task to want authorization terminal to perform, then server can not respond the main heartbeat message that terminal sends, and described main heartbeat message only plays a part the presence keeping terminal at network side.When server has new task to want authorization terminal to perform, server can respond the main heartbeat message that terminal sends, and issues task-performance instructions to terminal.Described task-performance instructions can be realized by the mode of heartbeat response packet, can carry the executing state parameter for different task in described heartbeat response packet.
Above-mentioned have new task to want authorization terminal to perform when server time, the main heartbeat message that server might not send terminal immediately respond and issue heartbeat response packet, server also can respond the main heartbeat message that terminal sends and issue heartbeat response packet again after obtaining a part of new task after a while, to make can carry in heartbeat response packet more for the executing state parameter of different task.
The executing state parameter of the different task described in the present embodiment should have the parameter characterizing different task, also will have the parameter characterizing executing state.Wherein, usually can immobilize after determining at first for the parameter characterizing described different task, namely different task has corresponding different parameters; Parameter for characterizing described executing state can for continually varying numerical value, and also can be two numerical value or two letters, concrete the present embodiment be restricted this.Wherein, described continually varying numerical value or described two numerical value or two letters can be used for characterizing terminal the need of execution new task.
103, according to the executing state parameter in heartbeat response packet, the task that server is to be issued is determined.
Terminal is after receiving the heartbeat response packet that issues of server response heartbeat message, according to the executing state parameter of the different task of carrying in described heartbeat response packet, judge the task that server is to be issued, then send task to be issued from heartbeat message so that server treats responding from heartbeat message of issuing of task in time.In the process judging the task that server is to be issued, task to be issued can be judged according to the situation of change of the executing state parameter of different task, also can judge task to be issued according to specific numerical value or letter, concrete the present embodiment is not restricted this.
104, periodically send task corresponding to be issued from heartbeat message so that the corresponding task that reception server issues.
Step 104 be determine in step 103 server terminal after issuing of task start to server send corresponding task to be issued from heartbeat message, mentioned here is can be consistent with main heartbeat message message format from heartbeat message in itself, only main heartbeat message not only plays the object keeping terminal presence, also assures that server can respond to main heartbeat message at any time, issue heartbeat response packet to terminal in time.Then be when server has task to need to be handed down to terminal from the object of heartbeat message, terminal can send in time correspondence task to be issued from heartbeat message, server can be responded to from heartbeat message in time, when Deterministic service device issues task, there will not be delay phenomenon.
Server issues in the process of task actual, might not be at every turn respond and issue task receiving carrying out immediately after heartbeat message that terminal sends, if terminal only sends once from heartbeat message, probably make server cannot respond from heartbeat message.Therefore, at server to before responding from heartbeat message, terminal is wanted periodically to send from heartbeat message to server, Deterministic service device can at needs to when responding from heartbeat message, receive that terminal sends in time from heartbeat message, thus to issue from task corresponding to heartbeat message to terminal.
In the present embodiment indication main heartbeat message and from heartbeat message, its form can be Internet protocol message (Internet Protocol message, be called for short IP message), transmission control protocol message (Transmission Control Protocol message, be called for short TCP message), HTTP message (Hypertext transfer protocol message, be called for short HTTP message), user datagram protocol message (User Datagram Protocol message, be called for short UDP message) etc., the form of the present embodiment to heartbeat message is not restricted.
The method of the transmission heartbeat message that the embodiment of the present invention provides, periodically main heartbeat message can be sent to server, to obtain the heartbeat response packet carrying the executing state parameter of different task, thus determine corresponding task to be issued according to this executing state parameter, and send it from heartbeat message, so that the corresponding task that reception server issues.Compared with prior art, the embodiment of the present invention can when only having new task to perform just send for task response from heartbeat message, effectively can not only reduce the quantity without sending heartbeat message under task status, but also do not affect the timely response of task and issue.
Further, as to the refinement of above-described embodiment and expansion, the executing state parameter of the different task that in above-mentioned steps 103, heartbeat response packet carries can present with the form of mapping table, according to the executing state parameter in mapping table, terminal determines whether its mapping of task is the task that server is to be issued.
In implementation process, different tasks is to having different ID or other marks, and executing state parameter can corresponding key value, such as character, a numeral etc., and each task and corresponding executing state parameter map one by one.The mapping table of respective task and current executing state parameter is all preserved in terminal and server, server is when there being new task to issue, the executing state parameter of corresponding task in mapping table can be revised, issue the heartbeat response packet including mapping table after amendment to terminal.Terminal is after receiving heartbeat response packet, the mapping table preserve self and the amended mapping table of server are compared, when the executing state parameter of the several task of discovery certain or certain changes, terminal determines that the task of these executing state Parameters variation is the new task that server is to be issued.Immediately, terminal to server send these business from heartbeat message so that server responding from heartbeat message and issuing new task these tasks.
Exemplary, in different tasks, mark corresponding to switch change task can be decided to be the mark that mark corresponding to Switch, scan task can be decided to be Scan, strategy change task corresponding can be decided to be Strategy etc.; Executing state parameter can according to Arabic numerals 1,2,3,4 ... characterize.For scan task, when not having new task to perform, the executing state of the scan task Scan in the mapping table that present terminal is preserved is 1, when there being new scan task, the executing state of the scan task Scan in the mapping table that server issues is 2, terminal have received mapping table that server issues and compares with the mapping table that this locality is preserved, to determine and after performing new scan task, the mapping table that can send server carries out this locality and preserves, the executing state of the scan task Scan in the mapping table that terminal is now preserved just becomes 2, the mapping table sent for next time and server is compared.And so forth, after terminal performs new scan task again, the executing state of its scan task Scan can become 3,4,5,6 successively ... etc..Above-mentioned just for scan task, same mode, also the task that switch change task, strategy change task, Run Script task etc. are different can be performed, these tasks can single execution also can executed in parallel, this depends in the mapping table that server issues has the executing state parameter of how many tasks to there occurs change.
Optionally, also the executing state parameter of different task can be represented in the mode of state flag bit, exemplary, described state flag bit can be set as T (True) and F (False), T representative has tasks carrying, and F represents without tasks carrying.Here it should be noted that, the mode representing executing state parameter with state flag bit T and F does not need terminal to carry out preservation and follow-up comparison to the heartbeat response packet carrying execution status of task parameter, this mode only needs the state flag bit of the executing state parameter by reading different task after receiving heartbeat response packet at every turn, if the state flag bit of task is T, then illustrate that this task is the task that server is to be issued, if the state flag bit of task is F, then illustrate that this task is not the task that server is to be issued.Or as the optional mode of another kind, flag bit also can represent by 0 and 1.Wherein, 0 meaning characterized corresponds to above-mentioned F, represents without tasks carrying; 1 meaning characterized corresponds to above-mentioned T, and representative has tasks carrying.
Above-mentioned example is for a station terminal, in like manner, for multiple stage terminal, can add new parameter in the mapping table, namely represent the parameter of different terminals.The parameter of GC group connector can be IP address, also can by some algorithm (as hash algorithm) by server-assignment to terminal mark that can mutually distinguish.Just contain the parameter of GC group connector in such mapping table respectively, represent the parameter of different task and represent the parameter of different task executing state, between these three kinds of parameters, there are mapping relations.Or the mark of a GC group connector also can be added in the parameter representing different task.Exemplary, the parameter of GC group connector can be set successively by Client1, Client2, Client3, Client4 etc., can be reduced to C1, C2, C3, C4 etc.Terminal C1 can corresponding switch change task Switch, strategy change task Strategy, scan task Scan etc., terminal C2, C3, C4 etc. also can corresponding switch change task Switch, strategy change task Strategy, scan task Scan etc., or in the parameter representing different task, add mark and Switch-C1, Strategy-C1, Scan-C1 etc. of a GC group connector, Switch-C2, Strategy-C2, Scan-C2 etc.The different task representing that different terminals is corresponding can both be known by different mapping modes, and the executing state of respective task.The projected forms of concrete the present embodiment to mapping table is not restricted.
Carry out, in the process of information interaction, multiple situation to occur in terminal and server.Such as, when terminal due to artificial or failure cause disconnects from network connection state time, revise the heartbeat response packet after task status in server and may not send to terminal, and when terminal connects into network again, terminal may not need to perform the task in this amended heartbeat response packet.The heartbeat response packet that when being at this moment just necessary to disconnect terminal, server had been revised carries out aftertreatment.Therefore when terminal is in first time access network, receive the useless heartbeat response packet that server issues, optionally, before execution step 101, namely before terminal to server periodically sends main heartbeat message, can first and server carry out the initial synchronization of heartbeat response packet.The initial synchronization of described heartbeat response packet, can comprise the mapping table that mapping table that this locality preserves by server preserves according to terminal and carry out initial synchronization, make the task status in respective mapping table consistent; Also terminal and server can be comprised by the layout initial synchronization of respective mapping table.
Above-mentioned terminal First Contact Connections enters network and not only refers to terminal again connect into network after network interruption is opened, but also refers to the new terminal first connection installed and enter network.No matter terminal in which way First Contact Connections enters network, the initial synchronization that server and terminal carry out heartbeat response packet can ensure that terminal receives up-to-date heartbeat response packet, performs up-to-date task, avoids the task of terminal execution error.
Step 104 periodically send corresponding wait issuing of task after heartbeat message, terminal finally can receive the corresponding task that server issues, concrete reception opportunity and server issue and can respond main heartbeat message and to issue opportunity of heartbeat response packet similar by the server as described above-mentioned steps 102 from opportunity of the corresponding task of heartbeat message, repeat no more herein.
After terminal receives the task corresponding from heartbeat message that server issues, send and reach from the object of heartbeat message.Therefore, optionally, the step from heartbeat message stopping sending corresponding task can be performed after step 104.In implementation process, can select to stop immediately after receiving the task that server issues to send corresponding from heartbeat message, also can select in the certain hour after receiving the task that server issues, stop sending corresponding from heartbeat message after again not receiving new task.
Here it should be noted that, stop sending the step from heartbeat message of corresponding task and both can appear at same execution mode with the step that server carries out the initial synchronization of heartbeat response packet, also can individually occur in one embodiment.Role is all identical in various embodiments for they.
Carry out there will be various situation in the detailed process of information interaction in terminal and server.Such as, when all tasks are all when sending from heartbeat message to server, main heartbeat message does not just have concrete effect, therefore just can select in this case to stop sending main heartbeat message.Once terminal stop send any one task from heartbeat message, namely when terminal stop send at least one task from heartbeat message time, restore cycle property should send main heartbeat message to server immediately, for the heartbeat response packet carrying different task executing state parameter that reception server at any time issues, when avoiding new task to issue, end delay sends corresponding to heartbeat message.Aforesaid operations can ensure that terminal sends the quantity of heartbeat message and is in minimum state all the time, and does not affect server to the response of task with issue.
The embodiment of the present invention, before periodically sending main heartbeat message to server, is carried out the initial synchronization of heartbeat response packet with server, be ensure that terminal receives up-to-date heartbeat response packet, avoids terminal to receive and the task of execution error.Meanwhile, main heartbeat message transmission and stop mechanism again the quantity forwarded of heartbeat message being controlled all the time at minimum state.
Further, as the realization to said method, the embodiment of the present invention additionally provides a kind of device sending heartbeat message, this device can be arranged in terminal, also and data interaction relation can be had between terminal, in order to realize the method shown in different execution modes that above-described embodiment provides independent of terminal.As shown in Figure 2, this device comprises: transmitting element 21, receiving element 22 and determining unit 23, wherein,
Transmitting element 21, for periodically sending main heartbeat message, the heartbeat response packet that main heartbeat message returns for obtaining server to server;
Receiving element 22, for the heartbeat response packet that reception server sends according to the main heartbeat message that transmitting element 21 sends, carries the executing state parameter for different task in heartbeat response packet;
Determining unit 23, for the executing state parameter in the heartbeat response packet that receives according to receiving element 22, determines the task that server is to be issued;
Described transmitting element 21, also for periodically send task to be issued that corresponding determining unit 23 determines from heartbeat message so that the corresponding task that receiving element 22 reception server issues.
Further, as shown in Figure 3, described determining unit 23 comprises:
Comparing module 231, for the executing state parameter of described executing state parameter and previous reception being compared, if both are different, is then defined as server task to be issued by task corresponding for described executing state parameter.
Further, as shown in Figure 4, this device also comprises:
Lock unit 24, before periodically sending main heartbeat message at transmitting element 21 to server, carries out the initial synchronization of heartbeat response packet with server.
Further, this receiving element 22 receive heartbeat response packet described in executing state parameter be a state flag bit;
Further, as shown in Figure 5, described determining unit 23 comprises:
Read module 232, for reading the state flag bit of executing state parameter, whether the task corresponding according to state flag bit determination executing state parameter is the task that server is to be issued.
Further, this transmitting element 21, also for after receive corresponding task that server issues at receiving element 22, stop sending corresponding task from heartbeat message.
Further, this transmitting element 21, also for when periodically send task that corresponding institute needs to be issued from heartbeat message time, stop the described main heartbeat message of transmission;
This transmitting element 21, also for when stop send at least one task from heartbeat message time, restore cycle property sends main heartbeat message.
The device of the transmission heartbeat message that the embodiment of the present invention provides, periodically main heartbeat message can be sent to server, to obtain the heartbeat response packet carrying the executing state parameter of different task, thus determine corresponding task to be issued according to this executing state parameter, and send it from heartbeat message, so that the corresponding task that reception server issues.Compared with prior art, the embodiment of the present invention can when only having new task to perform just send for task response from heartbeat message, effectively can not only reduce the quantity without sending heartbeat message under task status, but also do not affect the timely response of task and issue.
In addition, the embodiment of the present invention, before periodically sending main heartbeat message to server, is carried out the initial synchronization of heartbeat response packet with server, be ensure that terminal receives up-to-date heartbeat response packet, avoids terminal to receive and the task of execution error.Meanwhile, main heartbeat message transmission and stop mechanism again the quantity forwarded of heartbeat message being controlled all the time at minimum state.
Further, as to the realization of said method and the application of said apparatus, as shown in Figure 6, the embodiment of the present invention additionally provides a kind of system sending heartbeat message, and this system comprises server 61 and terminal 62.Terminal 62 includes the device shown in arbitrary width in above-mentioned Fig. 2, Fig. 3, Fig. 4 and Fig. 5.
Wherein, server 61 responds for certain the main heartbeat message sent terminal 62, issues heartbeat response packet to terminal 62.Carry the executing state parameter for different task in heartbeat response packet, be used to indicate terminal 62 send corresponding server task to be issued from heartbeat message.
The system of the transmission heartbeat message that the embodiment of the present invention provides, periodically main heartbeat message can be sent to server, to obtain the heartbeat response packet carrying the executing state parameter of different task, thus determine corresponding task to be issued according to this executing state parameter, and send it from heartbeat message, so that the corresponding task that reception server issues.Compared with prior art, the embodiment of the present invention can when only having new task to perform just send for task response from heartbeat message, effectively can not only reduce the quantity without sending heartbeat message under task status, but also do not affect the timely response of task and issue.
In addition, the embodiment of the present invention, before periodically sending main heartbeat message to server, is carried out the initial synchronization of heartbeat response packet with server, be ensure that terminal receives up-to-date heartbeat response packet, avoids terminal to receive and the task of execution error.Meanwhile, main heartbeat message transmission and stop mechanism again the quantity forwarded of heartbeat message being controlled all the time at minimum state.
Embodiments of the invention disclose:
A1, a kind of method sending heartbeat message, it is characterized in that, described method comprises:
Periodically main heartbeat message is sent, the heartbeat response packet that described main heartbeat message returns for obtaining described server to server;
Receive the described heartbeat response packet that described server sends, in described heartbeat response packet, carry the executing state parameter for different task;
According to the described executing state parameter in described heartbeat response packet, determine the task that described server is to be issued;
Periodically send task to be issued described in correspondence from heartbeat message, to receive the corresponding task that described server issues.
A2, method according to claim A1, is characterized in that, described according to the described executing state parameter in described heartbeat response packet, determines to comprise the task that described server is to be issued:
The executing state parameter of described executing state parameter and previous reception is compared;
If both are different, then task corresponding for described executing state parameter is defined as described server task to be issued.
A3, method according to claim A2, is characterized in that, described periodically send main heartbeat message to server before, described method comprises further:
The initial synchronization of heartbeat response packet is carried out with described server.
A4, method according to claim A1, it is characterized in that, described executing state parameter is a state flag bit;
Described according to the described executing state parameter in described heartbeat response packet, determine to comprise the task that described server is to be issued:
Read described state flag bit;
Determine whether task corresponding to described executing state parameter is the task that described server is to be issued according to described state flag bit.
A5, method according to claim A1, is characterized in that, after receiving the corresponding task that described server issues, described method comprises further:
Stop send described corresponding task from heartbeat message.
A6, method according to claim A5, is characterized in that, when periodically send corresponding the task of needing to be issued from heartbeat message time, described method comprises further:
Stop sending described main heartbeat message;
When stop send at least one task from heartbeat message time, described method comprises further:
Restore cycle property sends described main heartbeat message.
B7, a kind of device sending heartbeat message, it is characterized in that, described device comprises:
Transmitting element, for periodically sending main heartbeat message, the heartbeat response packet that described main heartbeat message returns for obtaining described server to server;
Receiving element, for receiving the described heartbeat response packet that described server sends according to the main heartbeat message that described transmitting element sends, carries the executing state parameter for different task in described heartbeat response packet;
Determining unit, for the described executing state parameter in the described heartbeat response packet that receives according to described receiving element, determines the task that described server is to be issued;
Described transmitting element, also for periodically send corresponding described determining unit determine described in task to be issued from heartbeat message so that described receiving element receives the corresponding task that described server issues.
B8, device according to claim B7, it is characterized in that, described determining unit comprises:
Comparing module, for the executing state parameter of described executing state parameter and previous reception being compared, if both are different, is then defined as described server task to be issued by task corresponding for described executing state parameter.
B9, device according to claim B8, it is characterized in that, described device comprises further:
Lock unit, before periodically sending main heartbeat message at described transmitting element to described server, carries out the initial synchronization of heartbeat response packet with described server.
B10, device according to claim B7, is characterized in that, described in the described heartbeat response packet that described receiving element receives, executing state parameter is a state flag bit;
Described determining unit comprises:
According to described state flag bit, read module, for reading the state flag bit of described executing state parameter, determines whether task corresponding to described executing state parameter is the task that described server is to be issued.
B11, device according to claim B7, is characterized in that, described transmitting element, also for after receive corresponding task that described server issues at described receiving element, stop sending described corresponding task from heartbeat message.
B12, device according to claim B11, is characterized in that, described transmitting element, also for when periodically send task that corresponding institute needs to be issued from heartbeat message time, stop the described main heartbeat message of transmission;
Described transmitting element, also for when stop send at least one task from heartbeat message time, restore cycle property send described main heartbeat message.
C13, a kind of system sending heartbeat message, it is characterized in that, described system comprises server and terminal, and wherein, described terminal comprises the device according to any one of claim 7 to claim 12.
C14, system according to claim C13, is characterized in that, described server, respond, issue heartbeat response packet to described terminal for certain the main heartbeat message sent described terminal;
Wherein, in described heartbeat response packet, carry the executing state parameter for different task, be used to indicate described terminal send corresponding described server task to be issued from heartbeat message.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
Be understandable that, the correlated characteristic in said method and device can reference mutually.In addition, " first ", " second " in above-described embodiment etc. are for distinguishing each embodiment, and do not represent the quality of each embodiment.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In specification provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary compound mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions of the some or all parts in the denomination of invention (as determined the device of website internal chaining grade) that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computer of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.

Claims (10)

1. send a method for heartbeat message, it is characterized in that, described method comprises:
Periodically main heartbeat message is sent, the heartbeat response packet that described main heartbeat message returns for obtaining described server to server;
Receive the described heartbeat response packet that described server sends, in described heartbeat response packet, carry the executing state parameter for different task;
According to the described executing state parameter in described heartbeat response packet, determine the task that described server is to be issued;
Periodically send task to be issued described in correspondence from heartbeat message, to receive the corresponding task that described server issues.
2. method according to claim 1, is characterized in that, described according to the described executing state parameter in described heartbeat response packet, determines to comprise the task that described server is to be issued:
The executing state parameter of described executing state parameter and previous reception is compared;
If both are different, then task corresponding for described executing state parameter is defined as described server task to be issued.
3. method according to claim 2, is characterized in that, described periodically send main heartbeat message to server before, described method comprises further:
The initial synchronization of heartbeat response packet is carried out with described server.
4. method according to claim 1, is characterized in that, described executing state parameter is a state flag bit;
Described according to the described executing state parameter in described heartbeat response packet, determine to comprise the task that described server is to be issued:
Read described state flag bit;
Determine whether task corresponding to described executing state parameter is the task that described server is to be issued according to described state flag bit.
5. method according to claim 1, is characterized in that, after receiving the corresponding task that described server issues, described method comprises further:
Stop send described corresponding task from heartbeat message.
6. method according to claim 5, is characterized in that, when periodically send corresponding the task of needing to be issued from heartbeat message time, described method comprises further:
Stop sending described main heartbeat message;
When stop send at least one task from heartbeat message time, described method comprises further:
Restore cycle property sends described main heartbeat message.
7. send a device for heartbeat message, it is characterized in that, described device comprises:
Transmitting element, for periodically sending main heartbeat message, the heartbeat response packet that described main heartbeat message returns for obtaining described server to server;
Receiving element, for receiving the described heartbeat response packet that described server sends according to the main heartbeat message that described transmitting element sends, carries the executing state parameter for different task in described heartbeat response packet;
Determining unit, for the described executing state parameter in the described heartbeat response packet that receives according to described receiving element, determines the task that described server is to be issued;
Described transmitting element, also for periodically send corresponding described determining unit determine described in task to be issued from heartbeat message so that described receiving element receives the corresponding task that described server issues.
8. device according to claim 7, is characterized in that, described determining unit comprises:
Comparing module, for the executing state parameter of described executing state parameter and previous reception being compared, if both are different, is then defined as described server task to be issued by task corresponding for described executing state parameter.
9. device according to claim 8, is characterized in that, described device comprises further:
Lock unit, before periodically sending main heartbeat message at described transmitting element to described server, carries out the initial synchronization of heartbeat response packet with described server.
10. device according to claim 7, is characterized in that, described in the described heartbeat response packet that described receiving element receives, executing state parameter is a state flag bit;
Described determining unit comprises:
According to described state flag bit, read module, for reading the state flag bit of described executing state parameter, determines whether task corresponding to described executing state parameter is the task that described server is to be issued.
CN201410575760.5A 2014-10-24 2014-10-24 A kind of method, apparatus and system sending heartbeat message Active CN104301423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410575760.5A CN104301423B (en) 2014-10-24 2014-10-24 A kind of method, apparatus and system sending heartbeat message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410575760.5A CN104301423B (en) 2014-10-24 2014-10-24 A kind of method, apparatus and system sending heartbeat message

Publications (2)

Publication Number Publication Date
CN104301423A true CN104301423A (en) 2015-01-21
CN104301423B CN104301423B (en) 2018-11-06

Family

ID=52320986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410575760.5A Active CN104301423B (en) 2014-10-24 2014-10-24 A kind of method, apparatus and system sending heartbeat message

Country Status (1)

Country Link
CN (1) CN104301423B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105827697A (en) * 2016-03-14 2016-08-03 广州趣丸网络科技有限公司 User off-line detection method and user off-line detection system
CN110365803A (en) * 2019-08-26 2019-10-22 四川艾贝斯科技发展有限公司 A kind of network channel maintenance method based on udp protocol
CN114666332A (en) * 2022-03-29 2022-06-24 北京奕斯伟计算技术有限公司 Data transmission method, edge box, edge cloud and data transmission system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217482A (en) * 2008-01-18 2008-07-09 杭州华三通信技术有限公司 A method traversing NAT sending down strategy and a communication device
CN102073546A (en) * 2010-12-13 2011-05-25 北京航空航天大学 Task-dynamic dispatching method under distributed computation mode in cloud computing environment
US20110145934A1 (en) * 2009-10-13 2011-06-16 Miron Abramovici Autonomous distributed programmable logic for monitoring and securing electronic systems
CN103209089A (en) * 2012-01-17 2013-07-17 华为技术有限公司 Method for obtaining heart beat period, terminal and server
CN103929441A (en) * 2014-05-09 2014-07-16 中国银行股份有限公司 Task allocation method and device
CN104038381A (en) * 2013-03-07 2014-09-10 腾讯科技(深圳)有限公司 Applied cloud testing method and system, client and server
CN104077181A (en) * 2014-06-26 2014-10-01 国电南瑞科技股份有限公司 Status consistent maintaining method applicable to distributed task management system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217482A (en) * 2008-01-18 2008-07-09 杭州华三通信技术有限公司 A method traversing NAT sending down strategy and a communication device
US20110145934A1 (en) * 2009-10-13 2011-06-16 Miron Abramovici Autonomous distributed programmable logic for monitoring and securing electronic systems
CN102073546A (en) * 2010-12-13 2011-05-25 北京航空航天大学 Task-dynamic dispatching method under distributed computation mode in cloud computing environment
CN103209089A (en) * 2012-01-17 2013-07-17 华为技术有限公司 Method for obtaining heart beat period, terminal and server
CN104038381A (en) * 2013-03-07 2014-09-10 腾讯科技(深圳)有限公司 Applied cloud testing method and system, client and server
CN103929441A (en) * 2014-05-09 2014-07-16 中国银行股份有限公司 Task allocation method and device
CN104077181A (en) * 2014-06-26 2014-10-01 国电南瑞科技股份有限公司 Status consistent maintaining method applicable to distributed task management system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105827697A (en) * 2016-03-14 2016-08-03 广州趣丸网络科技有限公司 User off-line detection method and user off-line detection system
CN110365803A (en) * 2019-08-26 2019-10-22 四川艾贝斯科技发展有限公司 A kind of network channel maintenance method based on udp protocol
CN110365803B (en) * 2019-08-26 2021-11-02 四川艾贝斯科技发展有限公司 Network channel maintaining method based on UDP protocol
CN114666332A (en) * 2022-03-29 2022-06-24 北京奕斯伟计算技术有限公司 Data transmission method, edge box, edge cloud and data transmission system

Also Published As

Publication number Publication date
CN104301423B (en) 2018-11-06

Similar Documents

Publication Publication Date Title
US8209213B2 (en) Method for the construction and execution of a distributed workflow in a communication system
CN102833258B (en) Network address access method and system
CN102904903B (en) Communication system and communication means
CN105515900A (en) Method and device for acquiring on-line state of terminal
CN103647803A (en) A method for a mobile terminal to subscribe content and an apparatus
CN105337961A (en) Method for communication with client side and server
CN107181779B (en) Method, device and system for processing access request
CN105657000A (en) Message transmission method and device
WO2013085867A1 (en) Contextual and location awareness for device interaction
CN104995902A (en) Methods and systems for seamless network communication between IPV4 and IPV6 devices
CN108880972B (en) Information processing method, server and terminal
CN105743945A (en) Method and system for downloading files on the basis of switching download sources
CN105897888A (en) Client connection method and system
CN104486361A (en) Online game connection building method, game terminal and system
CN112565406B (en) Gray release method, gray release system and electronic equipment
CN105227673A (en) The data download method of anti-abduction, client, server and system
CN105743934A (en) HTTP access availability optimization method and mobile intelligent terminal
CN104301423A (en) Heartbeat message sending method, device and system
CN105141495A (en) Method for creating virtual device and gateway device
CN105556918B (en) A kind of resource downloading method and electronic equipment
CN113923008B (en) Malicious website interception method, device, equipment and storage medium
CN106571968A (en) Business switching method and system
CN105338187A (en) Information processing method and electronic equipment
CN105159692A (en) Application identifying method, application identifying device and server
CN112702441B (en) Container-based access data processing method, device, system and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20161124

Address after: 100088 Jiuxianqiao Chaoyang District Beijing Road No. 10, building 15, floor 17, layer 1701-26, 3

Applicant after: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.

Address before: 100088 Beijing city Xicheng District xinjiekouwai Street 28, block D room 112 (Desheng Park)

Applicant before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Applicant before: Qizhi software (Beijing) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: No. 32, Building 3, 102, 28 Xinjiekouwai Street, Xicheng District, Beijing

Patentee after: QAX Technology Group Inc.

Address before: Beijing Chaoyang District Jiuxianqiao Road 10, building 15, floor 17, layer 1701-26, 3

Patentee before: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address