CN105515900B - A kind of method and device obtaining terminal presence - Google Patents
A kind of method and device obtaining terminal presence Download PDFInfo
- Publication number
- CN105515900B CN105515900B CN201510890232.3A CN201510890232A CN105515900B CN 105515900 B CN105515900 B CN 105515900B CN 201510890232 A CN201510890232 A CN 201510890232A CN 105515900 B CN105515900 B CN 105515900B
- Authority
- CN
- China
- Prior art keywords
- terminal
- status information
- unit
- current
- online
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/02—Capturing of monitoring data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of method and devices for obtaining terminal presence, are related to technical field of telecommunications, to solve the problems, such as that database load pressure is big and invents.The method comprise the steps that the presence that detection terminal is current, the presence includes " online " and " offline " two states;Current presence is compared with the presence of last time detection;If the presence of the terminal changes, the status information of the terminal is modified;Modified status information is sent to database.During obtaining terminal presence.
Description
Technical field
The present invention relates to technical field of telecommunications more particularly to a kind of method and devices for obtaining terminal presence.
Background technique
The terminals such as online viewing video, live chat and live streaming media, terminal and number during broadcasting and chat
According to needing frequently to transmit data between library, so being realized by the long connection for establishing terminal and database.And grow holding for connection
It continues to stand and can expend a large amount of database resource.To save valuable database resource, the prior art can carry out the SOT state of termination
Detection, if terminal is in off-line state, cuts off the connection of terminal and database, to reduce the waste of database resource.With
The arrival of cybertimes, Internet user was originally more, and the online user of terminal is more and more, and the resource of database is increasingly
Whether online anxiety, the requirement of efficient detection terminal be more more and more urgent.
The whether online mode of detection terminal in the prior art are as follows: sent out from terminal according to certain time interval to database
Heartbeat packet is sent, to inform that database terminal is also online, long connection also needs to continue.Or by database according between the regular hour
Every sending heartbeat packet to terminal, to obtain the presence of terminal.Since Internet user is more and more, what database received
Heartbeat packet is also more and more, can occupy more database resource to the reception of a large amount of heartbeat packets, increase the pressure of database load
Power.
Summary of the invention
The present invention provides a kind of method and devices for obtaining terminal presence, and it is big to be able to solve database load pressure
The problem of.
In order to solve the above-mentioned technical problem, on the one hand, the present invention provides a kind of methods for obtaining terminal presence, should
Method includes:
The current presence of terminal is detected, the presence includes " online " and " offline " two states;
Current presence is compared with the presence of last time detection;
If the presence of the terminal changes, the status information of the terminal is modified;
Modified status information is sent to database.
On the other hand, the present invention provides a kind of device for obtaining terminal presence, which includes:
Detection unit, for detecting the current presence of terminal, the presence includes " online " and " offline " two
Kind state;
Comparing unit, for will test the current presence of unit detection and the presence progress of last detection
It compares;
Unit is modified, if the presence of the terminal for comparing unit comparison changes, modifies the end
The status information at end;
Transmission unit, for the modified status information of the modification unit to be sent to database.
It is provided by the invention to obtain the online method and device of terminal, presence that can be current by detection terminal,
Current presence and the presence of last time detection are compared, according to the change of terminal presence, modification is eventually
Modified status information is sent to database by the status information at end.Compared with prior art, the present invention is only by presence
The status information of the terminal to change is sent to database, rather than the status information of all terminals is sent to database,
The data volume sent to database can be reduced, and then reduces database load pressure.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of method flow diagram for obtaining terminal presence provided in an embodiment of the present invention;
Fig. 2 shows another method flow diagrams for obtaining terminal presence provided in an embodiment of the present invention;
Fig. 3 shows a kind of device composition block diagram for obtaining terminal presence provided in an embodiment of the present invention;
Fig. 4 shows another device composition block diagram for obtaining terminal presence provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
In order to solve the problems, such as that database load pressure is big, the embodiment of the invention provides a kind of acquisition terminal presences
Method, as shown in Figure 1, this method comprises:
101, the current presence of detection terminal.
Presence includes " online " and " offline " two states, indicates the presence of terminal.Presence indicates eventually
There is network data demand at end, and there are data transmission with server for terminal.Off-line state, indicate terminal temporarily without network demand,
Temporarily there is no data to transmit between terminal and server.
Server determines the long connection status for whether keeping terminal and server according to the presence of terminal.Terminal
Long connection status is kept with server, needs to occupy the resource of server and network link, more pairs of number services of long connection
The pressure of device and network link is bigger.And the resource of server and network link is limited, in order to reduce server and network link
Pressure is obtained, the connection of offline terminal and server is cut off.
Detect the current presence of terminal, the i.e. presence information of detection terminal feedback.Detect current time with most
Whether the time interval for closely once receiving presence information is less than prefixed time interval, if being less than prefixed time interval,
Terminal presence be it is online, if more than prefixed time interval, then terminal presence is offline.It is every to pass through preset duration, inspection
The current presence of terminal is surveyed, preset duration is greater than prefixed time interval.
102, current presence is compared with the presence of last time detection.
Compare the presence of current presence and last detection, i.e., all terminals for arriving of Determination is online
Whether state changes.The presence of terminal is for the same terminal.One terminal, one terminal does ratio
It is right, until the terminal of all feedback status informations all compares completion
If 103, the presence of terminal changes, the status information of terminal is modified.
After the presence information that step 102 compares terminal, the terminal's status information to change is modified.Terminal
Presence changes including terminal switchs to off-line state from presence, and terminal switchs to presence from off-line state.
104, modified status information is sent to database.
The status information to change is sent to database, the presence information sent with terminal compares, a side
Face sends the frequency of status information lower than the frequency for receiving heartbeat packet, on the other hand, sends the modified of status information change
Terminal's status information all reduces the data volume of transmission terminal presence.
It is provided in an embodiment of the present invention to obtain the online method of terminal, presence that can be current by detection terminal,
Current presence and the presence of last time detection are compared, according to the change of terminal presence, modification is eventually
Modified status information is sent to database by the status information at end.Compared with prior art, the embodiment of the present invention only will be
The status information for the terminal that linear state changes is sent to database, rather than the status information of all terminals is sent to number
According to library, the data volume sent to database can be reduced, and then reduce database load pressure.
Further, the refinement and extension of method shown in Fig. 1 obtains terminal the embodiment of the invention also provides another kind and exists
The method of linear state, as shown in Fig. 2, this method comprises:
201, the current presence of detection terminal.
The current presence of terminal is detected, that is, detects the heartbeat packet at current time.Before testing, receive terminal according to
The heartbeat packet that default eartbeat interval repeatedly reports;If at a distance of the duration of this detection moment at the time of receiving the last one heartbeat packet
It is less than default eartbeat interval, then the current presence of terminal is " online ";If phase at the time of receiving the last one heartbeat packet
Duration away from this detection moment is more than default eartbeat interval, then the current presence of terminal is " offline ".According to the default heart
Jump space, terminal to server sends heartbeat packet, if there is heartbeat packet to illustrate that terminal is online, if illustrating present terminal without heartbeat packet
Offline.Default eartbeat interval, the resource according to server resource, network link is related with the quantity of terminal user, in this implementation
In example, without limitation to the duration of default eartbeat interval.
The heartbeat packet that terminal is repeatedly reported according to default eartbeat interval is received, i.e. the time interval of reception heartbeat packet is greater than pre-
If eartbeat interval, and be the integral multiple of default eartbeat interval.It is examined according at the time of receiving the last one heartbeat packet at a distance of this
The duration at moment is surveyed compared with default eartbeat interval, judges the current presence of terminal.
Detection receives the current presence of terminal of heartbeat packet.Presence includes " online " and " offline " two kinds of shapes
State.
202, the presence current according to terminal generates status list.
In status list, including terminal iidentification and online mark.Status list is generated, status list is for recording online end
The terminal iidentification at end;If the current presence of terminal is " online ", the terminal iidentification of terminal is recorded in status list.
Generate status list, record the terminal iidentification of online terminal in status list, the size of status list be it is unfixed, therewith
The variation of terminal iidentification quantity and change.Be recorded in generate status list in terminal iidentification be current presence be "
The terminal of line ".In the present embodiment, without limitation to the quantity of terminal iidentification in status list.
The current presence of terminal is detected, a generation status list is generated.
203, current presence is compared with the presence of last time detection.
Terminal iidentification is searched to be recorded in current status list but be not recorded in the status Bar that last detection generates
Terminal in table, the current presence of the terminal are " online.Search terminal iidentification be not recorded in current status list,
But it is recorded in the terminal in the status list that last detection generates, the current presence of the terminal is " offline ".It compares
The case where two kinds of presences change searches the terminal that presence changes.When comparing presence, according to terminal
Mark compares record case of the terminal in status list.
If 204, the presence of terminal changes, the status information of terminal is modified.
The status information for the terminal that the presence found in step 203 changes is made an amendment.If detection is worked as
Preceding terminal's status information be it is online, the presence of the terminal of lookup is revised as " online ".If the present terminal state of detection
Information be it is offline, the presence of the terminal of lookup is revised as " offline ".
205, the status information of integrated terminal.
If a terminal is connected to multiple servers, multiple servers can all receive the heartbeat packet of terminal sending.And eventually
The status information at end can only be unique, so needing to integrate the status information of the same terminal.It is that the same terminal connects
Select a server as director server in the multiple servers connect, by the status information of director server integrated terminal.
Director server receives the status information of other servers modification;By locally modified status information and received shape
State information merges;Duplicate removal processing is carried out to the status information after merging.By all status informations of the same terminal into
Row merges, and all status informations include locally modified status information and receive the status information that other servers are modified.Tool
The terminal for having same terminal to identify is the same terminal.One terminal can only have a status information, so by after merging
Status information carries out duplicate removal processing, obtains a unique status information.It is identical to terminal iidentification, and presence is identical
Entry carries out duplicate removal processing.
The entry that terminal iidentification is identical if it exists but presence is different, then all for deleting the corresponding terminal iidentification
Mesh.If the identical terminal of terminal iidentification, the presence detected is different, which kind of state can not be judged in the receiving end of heartbeat packet
It is accurately, so all entries that terminal iidentification is identical but presence is different are all deleted.The status information of mistake is avoided,
Server is judged whether to cut off the long interference connected.
By the status information of integrated terminal, guarantee that the current state of terminal iidentification is unique.
206, modified status information is sent to database.
By modified status information, the database is sent to including the status information after duplicate removal processing.Believe in state
In breath, including terminal iidentification and presence information mark.Modified status information is stored in database, so that server is sentenced
The disconnected long connection between terminal and server is kept or cutoff process.
Further, the realization as method shown in Fig. 1 or Fig. 2, another embodiment of the present invention additionally provide a kind of acquisition
The device of terminal presence.Present apparatus embodiment is corresponding with preceding method embodiment, can be realized in preceding method embodiment
Full content.To be easy to read, present apparatus embodiment only carries out summary description to the content in preceding method embodiment, no
Detail content in embodiment of the method is repeated one by one.As shown in figure 3, the device includes: detection unit 31, comparing unit
32, unit 33 and transmission unit 34 are modified.Wherein,
Detection unit 31, for detecting the current presence of terminal, presence includes two kinds of " online " and " offline "
State;
Comparing unit 32, for will test the current presence of the detection of unit 31 and the presence of last detection
It is compared;
Unit 33 is modified, if the presence of the terminal for the comparison of comparing unit 32 changes, modifies terminal
Status information;
Transmission unit 34 is sent to database for that will modify the modified status information of unit 33.
Further, as shown in figure 4, detection unit 31, comprising:
Receiving module 311, the heartbeat packet repeatedly reported for receiving terminal according to default eartbeat interval;
State determining module 312, if at a distance of this detection at the time of receiving the last one heartbeat packet for receiving module 311
The duration at moment is less than default eartbeat interval, then the current presence of terminal is " online ";
State determining module 312, if at a distance of this detection at the time of receiving the last one heartbeat packet for receiving module 311
The duration at moment is more than default eartbeat interval, then the current presence of terminal is " offline ".
Further, as shown in figure 4, the device further comprises:
Generation unit 35, for generating status list, status list is for recording the online end that detection unit 31 detects
The terminal iidentification at end;
The terminal iidentification of terminal is recorded if the presence current for terminal is " online " for recording unit 36
In the status list that generation unit 35 generates.
Further, as shown in figure 4, comparing unit 32, comprising:
First searching module 321, be recorded in current status list for searching terminal iidentification in recording unit 36,
But it is not recorded in the terminal in the status list that last detection generates;
Modify unit 33, comprising:
First state modified module 331, for the presence of the terminal of lookup to be revised as " online ".
Further, as shown in figure 4, comparing unit 32, comprising:
Second searching module 322 is not recorded in current status list for searching terminal iidentification in recording unit 36
In but be recorded in the terminal in the status list that last detection generates;
Modify unit 33, comprising:
Second status modifier module 332, for the presence of the terminal of lookup to be revised as " offline ".
Further, as shown in figure 4, device further comprises:
Receiving unit 37, for receiving the status information of other servers modification;
Combining unit 38, for closing locally modified status information and the received status information of receiving unit 37
And;
Duplicate removal unit 39 carries out duplicate removal processing for the status information after merging to combining unit 38;
Transmission unit 34, for the status information after 39 duplicate removal processing of duplicate removal unit to be sent to database.
Further, duplicate removal unit 39, for identical to terminal iidentification, and the identical entry of presence carries out duplicate removal
Processing.
Further, as shown in figure 4, device further comprises:
Unit 310 is deleted, if for identical but presence not to be there are terminal iidentification after 39 duplicate removal processing of duplicate removal unit
Same entry then deletes all entries of counterpart terminal mark.
It is provided in an embodiment of the present invention to obtain the online device of terminal, presence that can be current by detection terminal,
Current presence and the presence of last time detection are compared, according to the change of terminal presence, modification is eventually
Modified status information is sent to database by the status information at end.Compared with prior art, the embodiment of the present invention only will be
The status information for the terminal that linear state changes is sent to database, rather than the status information of all terminals is sent to number
According to library, the data volume sent to database can be reduced, and then reduce database load pressure.
Embodiment of the invention discloses:
A1, a kind of method for obtaining terminal presence, which is characterized in that the described method includes:
The current presence of terminal is detected, the presence includes " online " and " offline " two states;
Current presence is compared with the presence of last time detection;
If the presence of the terminal changes, the status information of the terminal is modified;
Modified status information is sent to database.
A2, method according to a1, which is characterized in that the current presence of the detection terminal, comprising:
Receive the heartbeat packet that the terminal is repeatedly reported according to default eartbeat interval;
If duration at the time of receiving the last one heartbeat packet at a distance of this detection moment is less than between the default heartbeat
Every then the current presence of the terminal is " online ";
If at the time of receiving the last one heartbeat packet at a distance of the duration of this detection moment be more than the default eartbeat interval,
Then the current presence of the terminal is " offline ".
A3, the method according to A2, which is characterized in that the method further includes:
Status list is generated, the status list is used to record the terminal iidentification of online terminal;
If the current presence of the terminal is " online ", status list is recorded in the terminal iidentification of the terminal
In.
A4, method according to a3, which is characterized in that it is described by current presence with last time detection it is online
State is compared, comprising:
Terminal iidentification is searched to be recorded in current status list but be not recorded in the status Bar that last detection generates
Terminal in table;
The status information of the modification terminal, comprising:
The presence of the terminal of lookup is revised as " online ".
A5, method according to a3, which is characterized in that it is described by current presence with last time detection it is online
State is compared, comprising:
Terminal iidentification is searched not to be recorded in current status list but be recorded in the status Bar that last detection generates
Terminal in table;
The status information of the modification terminal, comprising:
The presence of the terminal of lookup is revised as " offline ".
A6, the method according to A3 to any one of 5, which is characterized in that the method further includes:
Receive the status information of other servers modification;
Locally modified status information and received status information are merged;
Duplicate removal processing is carried out to the status information after merging;
It is described that modified status information is sent to database, comprising:
Status information after duplicate removal processing is sent to the database.
A7, the method according to A6, which is characterized in that the status information after described pair of merging carries out duplicate removal processing, packet
It includes:
It is identical to terminal iidentification, and the identical entry of presence carries out duplicate removal processing.
A8, the method according to A6, which is characterized in that the method further includes:
The entry that terminal iidentification is identical if it exists but presence is different, then all for deleting the corresponding terminal iidentification
Mesh.
B9, a kind of device for obtaining terminal presence, which is characterized in that described device includes:
Detection unit, for detecting the current presence of terminal, the presence includes " online " and " offline " two
Kind state;
Comparing unit, for will test the current presence of unit detection and the presence progress of last detection
It compares;
Unit is modified, if the presence of the terminal for comparing unit comparison changes, modifies the end
The status information at end;
Transmission unit, for the modified status information of the modification unit to be sent to database.
B10, the device according to B9, which is characterized in that the detection unit, comprising:
Receiving module, the heartbeat packet repeatedly reported for receiving the terminal according to default eartbeat interval;
State determining module, if detected at the time of receiving the last one heartbeat packet for the receiving module at a distance of this
The duration at quarter is less than the default eartbeat interval, then the current presence of the terminal is " online ";
The state determining module, if at a distance of this inspection at the time of receiving the last one heartbeat packet for the receiving module
The duration for surveying the moment is more than the default eartbeat interval, then the current presence of the terminal is " offline ".
B11, device according to b10, which is characterized in that described device further comprises:
Generation unit, for generating status list, the status list for record it is detected by the detecting unit
The terminal iidentification of line terminal;
Recording unit, if the presence current for the terminal is " online ", by the terminal iidentification of the terminal
It is recorded in the status list of generation unit generation.
B12, the device according to B11, which is characterized in that the comparing unit, comprising:
First searching module, be recorded in current status list for searching terminal iidentification in the recording unit,
But it is not recorded in the terminal in the status list that last detection generates;
The modification unit, comprising:
First state modified module, for the presence of the terminal of lookup to be revised as " online ".
B13, the device according to B11, which is characterized in that the comparing unit, comprising:
Second searching module is not recorded in current status list for searching terminal iidentification in the recording unit
In but be recorded in the terminal in the status list that last detection generates;
The modification unit, comprising:
Second status modifier module, for the presence of the terminal of lookup to be revised as " offline ".
B14, the device according to B11 to any one of 13, which is characterized in that described device further comprises:
Receiving unit, for receiving the status information of other servers modification;
Combining unit, for closing locally modified status information and the received status information of the receiving unit
And;
Duplicate removal unit carries out duplicate removal processing for the status information after merging to the combining unit;
The transmission unit, for the status information after the duplicate removal unit duplicate removal processing to be sent to the database.
B15, device according to b14, which is characterized in that the duplicate removal unit, for identical to terminal iidentification, and
The identical entry of presence carries out duplicate removal processing.
B16, device according to b14, which is characterized in that described device further comprises:
Unit is deleted, if for item identical but different presence there are terminal iidentification after duplicate removal unit duplicate removal processing
Mesh then deletes all entries of the corresponding terminal iidentification.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment
" first ", " second " etc. be and not represent the superiority and inferiority of each embodiment for distinguishing each embodiment.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein.
Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system
Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various
Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect
Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
Meaning one of can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors
Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice
Microprocessor or digital signal processor (DSP) realize the denomination of invention according to an embodiment of the present invention (as determined in website
The device of Hyperlink rank) in some or all components some or all functions.The present invention is also implemented as being used for
Some or all device or device programs of method as described herein are executed (for example, computer program and calculating
Machine program product).It is such to realize that program of the invention can store on a computer-readable medium, or can have one
Or the form of multiple signals.Such signal can be downloaded from an internet website to obtain, or be provided on the carrier signal,
Or it is provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch
To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame
Claim.
Claims (16)
1. a kind of method for obtaining terminal presence, which is characterized in that the described method includes:
Server detects the current presence of terminal, and the presence includes " online " and " offline " two states, described
Presence is that server is determined according to the presence information that terminal is fed back;
Current presence is compared with the presence of last time detection;
If the presence of the terminal changes, the status information of the terminal is modified, the modification terminal
Status information includes that the presence of terminal is revised as to " online " or " offline ";
Modified status information is sent to database, wherein lower than reception when sending the modified status information
The frequency of the heartbeat packet of the terminal is sent.
2. the method according to claim 1, wherein the presence that the detection terminal is current, comprising:
Receive the heartbeat packet that the terminal is repeatedly reported according to default eartbeat interval;
If duration at the time of receiving the last one heartbeat packet at a distance of this detection moment is less than the default eartbeat interval,
The current presence of the terminal is " online ";
If at a distance of the duration of this detection moment more than the default eartbeat interval, institute at the time of receiving the last one heartbeat packet
Stating the current presence of terminal is " offline ".
3. according to the method described in claim 2, it is characterized in that, the method further includes:
Status list is generated, the status list is used to record the terminal iidentification of online terminal;
If the current presence of the terminal is " online ", the terminal iidentification of the terminal is recorded in status list.
4. according to the method described in claim 3, it is characterized in that, described exist current presence and last detection
Linear state is compared, comprising:
Terminal iidentification is searched to be recorded in current status list but be not recorded in the status list that last detection generates
Terminal;
The status information of the modification terminal, comprising:
The presence of the terminal of lookup is revised as " online ".
5. according to the method described in claim 3, it is characterized in that, described exist current presence and last detection
Linear state is compared, comprising:
Terminal iidentification is searched not to be recorded in current status list but be recorded in the status list that last detection generates
Terminal;
The status information of the modification terminal, comprising:
The presence of the terminal of lookup is revised as " offline ".
6. method according to any one of claim 3 to 5, which is characterized in that the method further includes:
Receive the status information of other servers modification;
Locally modified status information and received status information are merged;
Duplicate removal processing is carried out to the status information after merging;
It is described that modified status information is sent to database, comprising:
Status information after duplicate removal processing is sent to the database.
7. according to the method described in claim 6, it is characterized in that, described pair merge after status information carry out duplicate removal processing,
Include:
It is identical to terminal iidentification, and the identical entry of presence carries out duplicate removal processing.
8. according to the method described in claim 6, it is characterized in that, the method further includes:
The entry that terminal iidentification is identical if it exists but presence is different then deletes all entries of the corresponding terminal iidentification.
9. a kind of device for obtaining terminal presence, which is characterized in that described device includes:
Detection unit, the presence current for server detection terminal, the presence includes " online " and " offline "
Two states, the presence are that server is determined according to the presence information that terminal is fed back;
Comparing unit, the presence that current presence and last time for will test unit detection detect are compared
It is right;
Unit is modified, if the presence of the terminal for comparing unit comparison changes, modifies the terminal
The status information of status information, the modification terminal includes that the presence of terminal is revised as to " online " or " offline ";
Transmission unit, for the modified status information of the modification unit to be sent to database, wherein send the modification
It is sent when rear status information with the frequency lower than the heartbeat packet for receiving the terminal.
10. device according to claim 9, which is characterized in that the detection unit, comprising:
Receiving module, the heartbeat packet repeatedly reported for receiving the terminal according to default eartbeat interval;
State determining module, if at a distance of this detection moment at the time of receiving the last one heartbeat packet for the receiving module
Duration is less than the default eartbeat interval, then the current presence of the terminal is " online ";
The state determining module, if detected at the time of receiving the last one heartbeat packet for the receiving module at a distance of this
The duration at quarter is more than the default eartbeat interval, then the current presence of the terminal is " offline ".
11. device according to claim 10, which is characterized in that described device further comprises:
Generation unit, for generating status list, the status list is for recording online end detected by the detecting unit
The terminal iidentification at end;
Recording unit records the terminal iidentification of the terminal if the presence current for the terminal is " online "
In the status list generated to generation unit.
12. device according to claim 11, which is characterized in that the comparing unit, comprising:
First searching module is recorded in current status list, still for searching terminal iidentification in the recording unit
The terminal not being recorded in the status list that last detection generates;
The modification unit, comprising:
First state modified module, for the presence of the terminal of lookup to be revised as " online ".
13. device according to claim 11, which is characterized in that the comparing unit, comprising:
Second searching module, in the recording unit search terminal iidentification be not recorded in current status list but
It is the terminal being recorded in the status list that last detection generates;
The modification unit, comprising:
Second status modifier module, for the presence of the terminal of lookup to be revised as " offline ".
14. device described in any one of 1 to 13 according to claim 1, which is characterized in that described device further comprises:
Receiving unit, for receiving the status information of other servers modification;
Combining unit, for merging locally modified status information and the received status information of the receiving unit;
Duplicate removal unit carries out duplicate removal processing for the status information after merging to the combining unit;
The transmission unit, for the status information after the duplicate removal unit duplicate removal processing to be sent to the database.
15. device according to claim 14, which is characterized in that the duplicate removal unit, for identical to terminal iidentification, and
And the identical entry of presence carries out duplicate removal processing.
16. device according to claim 14, which is characterized in that described device further comprises:
Unit is deleted, if for entry identical but different presence there are terminal iidentification after duplicate removal unit duplicate removal processing,
Then delete all entries of the corresponding terminal iidentification.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510890232.3A CN105515900B (en) | 2015-12-07 | 2015-12-07 | A kind of method and device obtaining terminal presence |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510890232.3A CN105515900B (en) | 2015-12-07 | 2015-12-07 | A kind of method and device obtaining terminal presence |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105515900A CN105515900A (en) | 2016-04-20 |
CN105515900B true CN105515900B (en) | 2019-04-19 |
Family
ID=55723559
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510890232.3A Active CN105515900B (en) | 2015-12-07 | 2015-12-07 | A kind of method and device obtaining terminal presence |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105515900B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105871466B (en) * | 2016-05-25 | 2021-10-29 | 全球能源互联网研究院 | Wide-area stable communication device and method with intelligent identification function |
CN107483280B (en) * | 2016-06-07 | 2021-03-09 | 阿里巴巴集团控股有限公司 | Method and device for monitoring service node device |
CN106161626A (en) * | 2016-07-13 | 2016-11-23 | 上海斐讯数据通信技术有限公司 | A kind of cloud terminal management system and method |
CN106331769A (en) * | 2016-09-23 | 2017-01-11 | 北京赢点科技有限公司 | Live streaming detection service end and optimized live streaming resource utilization method |
CN107395460B (en) * | 2017-08-23 | 2021-08-06 | 台州智奥通信设备有限公司 | Stability detection method of terminal, and statistical method and system of terminal heartbeat frequency |
CN108092847B (en) * | 2017-11-28 | 2019-03-08 | 南瑞集团有限公司 | A kind of electric power LTE wireless terminal remote on-line monitoring method |
CN108809761B (en) * | 2018-06-12 | 2020-09-04 | 威创集团股份有限公司 | Online state detection method and device |
CN109167706A (en) * | 2018-09-10 | 2019-01-08 | 北京华环电子股份有限公司 | A method of being quickly informed in gauze member |
CN109462522A (en) * | 2018-11-30 | 2019-03-12 | 中国电力科学研究院有限公司 | A kind of state monitoring method of external terminal device, terminal and its system |
CN111865754B (en) * | 2019-04-30 | 2022-09-02 | 桂林电子科技大学 | MQTT-based remote monitoring method and system |
CN110572443B (en) * | 2019-08-22 | 2022-05-13 | 厦门网宿有限公司 | Long connection state updating method, server and storage medium |
CN110691398B (en) * | 2019-10-09 | 2023-02-24 | 宁波方太厨具有限公司 | Network interaction method, system, equipment and storage medium of intelligent equipment |
CN112954413B (en) * | 2021-02-02 | 2024-01-16 | 深圳市欢太科技有限公司 | Live broadcast list updating method, device, server and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104135530A (en) * | 2014-08-06 | 2014-11-05 | 上海斐讯数据通信技术有限公司 | Increment reporting method and device |
CN105025063A (en) * | 2014-04-29 | 2015-11-04 | 刘广威 | Online data transmission method for large-scale terminal equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012167464A1 (en) * | 2011-07-01 | 2012-12-13 | 华为技术有限公司 | Heartbeat message transmission method and heartbeat proxy server |
-
2015
- 2015-12-07 CN CN201510890232.3A patent/CN105515900B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105025063A (en) * | 2014-04-29 | 2015-11-04 | 刘广威 | Online data transmission method for large-scale terminal equipment |
CN104135530A (en) * | 2014-08-06 | 2014-11-05 | 上海斐讯数据通信技术有限公司 | Increment reporting method and device |
Also Published As
Publication number | Publication date |
---|---|
CN105515900A (en) | 2016-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105515900B (en) | A kind of method and device obtaining terminal presence | |
WO2015105982A1 (en) | Method and system for searching and displaying product images | |
US20150294018A1 (en) | Method and apparatus for recommending keywords | |
CN105608159B (en) | The method and apparatus of data buffer storage | |
CN107861981A (en) | A kind of data processing method and device | |
CN105929976A (en) | Input method-based dynamic expression input method and system | |
CN105868256A (en) | Method and system for processing user behavior data | |
CN109951354B (en) | Terminal equipment identification method, system and storage medium | |
US20100010965A1 (en) | Query Management Systems | |
CN104850614B (en) | Recommendation query word shows method and apparatus | |
CN105100349A (en) | Method, device and system for synchronizing contact person information in address book | |
CN104462471A (en) | Method and device for providing segmentation search results | |
CN106815140A (en) | A kind of interface test method and device | |
CN105404631B (en) | Picture identification method and device | |
CN110750433A (en) | Interface test method and device | |
CN105224661A (en) | Conversational information search method and device | |
CN109672735A (en) | A kind of method, device and equipment of Message Processing | |
US20140365445A1 (en) | Server with file managing function and file managing method | |
CN105094385B (en) | The method, apparatus and system of remote control | |
CN104376045A (en) | Method and device for achieving questioning and answering based on searching scenes | |
CN104462967B (en) | The method, apparatus and system of file access pattern | |
CN104217033B (en) | Based on ageing searching method and device | |
CN106407126B (en) | Processing method, device and the server of coverage data | |
CN104317929A (en) | Search result display optimizing method and device | |
CN105553767B (en) | Website backdoor file detection method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Co-patentee after: Qianxin Technology Group Co., Ltd. Patentee after: Beijing Qihu Technology Co., Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Co-patentee before: BEIJING QI'ANXIN SCIENCE & TECHNOLOGY CO., LTD. Patentee before: Beijing Qihu Technology Co., Ltd. |