CN108809761A - Presence detection method and device - Google Patents

Presence detection method and device Download PDF

Info

Publication number
CN108809761A
CN108809761A CN201810598949.4A CN201810598949A CN108809761A CN 108809761 A CN108809761 A CN 108809761A CN 201810598949 A CN201810598949 A CN 201810598949A CN 108809761 A CN108809761 A CN 108809761A
Authority
CN
China
Prior art keywords
queue
terminal
target
duration
presence detection
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
CN201810598949.4A
Other languages
Chinese (zh)
Other versions
CN108809761B (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.)
Vtron Group Co Ltd
Original Assignee
Vtron Group 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 Vtron Group Co Ltd filed Critical Vtron Group Co Ltd
Priority to CN201810598949.4A priority Critical patent/CN108809761B/en
Publication of CN108809761A publication Critical patent/CN108809761A/en
Application granted granted Critical
Publication of CN108809761B publication Critical patent/CN108809761B/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

Landscapes

  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

This application discloses a kind of presence detection method and device, the presence detection method is applied to server, multiple first queues of the server configured with the information for preserving terminal, the quantity of the first queue is the quotient of preset detection time-out time and assay intervals duration, the method includes:Long circulating regard one in the multiple first queue as target first queue successively when at interval of the assay intervals;For each terminal recorded in the target first queue, the duration for the heartbeat packet for not receiving terminal transmission is obtained as Lungs from Non-Heart-Beating packet duration, judges whether the terminal keeps online according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration;It, will be in the information storage of the terminal newly reached the standard grade to current target first queue when detecting the terminal newly reached the standard grade.Presence detection method disclosed in the present application can reduce the CPU usage in presence detection process, improve detection efficiency.

Description

Presence detection method and device
Technical field
This application involves technical field of data processing, in particular to a kind of presence detection method and device.
Background technology
In internet, it is generally based on the request of Internet protocol transmission data, with acquisition request data information.
The online mode of current detection terminal is, when terminal logs in, server-side adds the information for the terminal newly reached the standard grade To the end of a queue, the information of all terminals is preserved using a queue.Each terminal can be between the detection of one, interval Heartbeat packet is sent to server every duration, and server can go to detect all terminals and not receive every an assay intervals duration The time of terminal heartbeat packet.If server detects that the time for not receiving heartbeat packet is more than detection time-out time, judge The terminal is off-line state.
In existing this terminal detection mode, server at each test, is required for detecting and all is stored in queue In terminal the eartbeat interval time, therefore, this endpoint detection methods are very high to the resource consumption of CPU.Especially work as end When the quantity at end is more, this endpoint detection methods are even more apparent to the resource consumption of CPU so that CPU usage is high, detection Process carries out slow.
Invention content
In order to overcome above-mentioned deficiency in the prior art, the application's is designed to provide a kind of presence detection side Method is applied to server, multiple first queues of the server configured with the information for preserving terminal, the first queue Quantity be it is preset detection time-out time and assay intervals duration quotient, the method includes:
Long circulating regard one in the multiple first queue as target first successively when at interval of the assay intervals Queue;
For each terminal recorded in the target first queue, the heartbeat packet for not receiving terminal transmission is obtained Duration judges whether the terminal keeps as Lungs from Non-Heart-Beating packet duration, according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration Online;
When detecting the terminal newly reached the standard grade, by the information storage of the terminal newly reached the standard grade to current target first team In row.
Optionally, in the presence detection method, second queue, second team are also configured in the server The member of row corresponds with the first queue;
It is described at interval of the assay intervals when long circulating successively by one in the multiple first queue be used as target The step of first queue includes,
Long circulating is successively using a member in the second queue as the second team of target when the assay intervals Member is arranged, using the first queue corresponding to the target second queue member as the target first queue.
Optionally, in the presence detection method, the second queue includes head member and tail portion member;
It is described at interval of the assay intervals when long circulating successively using a member in the second queue as target The step of second queue member includes:
Pointer object is directed toward the member of a second queue every the assay intervals duration successively, by the pointer The member for the second queue that object is directed toward is as the target second queue member, by the target second queue member couple The first queue answered is as the target first queue;
When the pointer object is directed toward the tail portion member, the pointer object is after being spaced the assay intervals duration Again it is directed toward the head member.
Optionally, judge whether the terminal keeps online according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration Step is:
When the Lungs from Non-Heart-Beating packet duration is more than the detection time-out time, then judge that the terminal keeps presence;
When the Lungs from Non-Heart-Beating packet duration is not above the detection time-out time, then judge that the terminal is not maintained at line State.
Optionally, the presence detection method further includes:It is obtained for each online terminal and records the terminal The Lungs from Non-Heart-Beating packet duration.
Optionally, the presence detection method further includes:
When detect in the first queue there are the Lungs from Non-Heart-Beating packet duration be more than it is described detection time-out time terminal When, the information of the terminal is deleted from the first queue.
Optionally, the presence detection method further includes, when receiving the offline information of terminal, by the terminal Information is deleted from the first queue.
Optionally, in the presence detection method, 1 second a length of, the detection time-out time when assay intervals It it is 10 seconds, the quantity of the first queue is 10.
The another object of the application is to provide a kind of presence detection device, applied to server, the server The quantity of multiple first queues configured with the information for preserving terminal, the first queue is preset detection time-out time and inspection Survey the quotient of interval duration;
The presence detection device includes:
First searching module, long circulating successively will be in the multiple first queue when at interval of the assay intervals One is used as target first queue;
State detection module, for for each terminal recorded in the target first queue, acquisition not to receive this The duration for the heartbeat packet that terminal is sent is as Lungs from Non-Heart-Beating packet duration, according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration Judge whether the terminal keeps online;
Information add module, for when detecting the terminal newly reached the standard grade, by the information storage of the terminal newly reached the standard grade Into current target first queue.
Optionally, the server is also configured with second queue, the member of the second queue and the first queue one One corresponds to;The presence detection device further includes the second searching module, and second searching module is used for every the inspection Long circulating is successively using a member in the second queue as target second queue member when surveying interval, by the target the The corresponding first queue of two queue members is as the target first queue.
In terms of existing technologies, the application has the advantages that:
In the application, end message is preserved using multiple first queues, and long circulating successively will when assay intervals One in multiple first queues is used as target first queue, is obtained according to the end message preserved in the target first queue The Lungs from Non-Heart-Beating packet duration of each terminal in the target first queue, whether to judge the corresponding terminal of the Lungs from Non-Heart-Beating packet duration For presence;And detect the target first queue;When detecting the terminal newly reached the standard grade, by the terminal newly reached the standard grade In information storage to the target first queue.So so that the terminal in detected first queue is all that there may be nothings Heart time is more than detection time-out time, to reduce CPU (Central in presence detection process Processing Unit/Processor, central processing unit) resource consumption, improve presence detection efficiency.
Description of the drawings
It, below will be to needed in the embodiment attached in order to illustrate more clearly of the technical solution of the embodiment of the present application Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the flow diagram of presence detection method provided by the embodiments of the present application;
Fig. 2 is the high-level schematic functional block diagram of presence detection device provided by the embodiments of the present application;
Fig. 3 is the structural schematic diagram of circle queue provided by the embodiments of the present application;
Fig. 4 is the corresponding schematic diagram of t1 moment circle queue and first queue provided by the embodiments of the present application;
Fig. 5 is the corresponding schematic diagram of t2 moment circle queue and first queue provided by the embodiments of the present application;
Fig. 6 is the corresponding schematic diagram of t3 moment circle queue and first queue provided by the embodiments of the present application.
Icon:The first searching modules of 110-;111- state detection modules;112- information add modules;113- second is searched Module.
Specific implementation mode
To keep the purpose, technical scheme and advantage of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, technical solutions in the embodiments of the present application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is implemented The component of example can be arranged and be designed with a variety of different configurations.
Therefore, below the detailed description of the embodiments herein to providing in the accompanying drawings be not intended to limit it is claimed Scope of the present application, but be merely representative of the selected embodiment of the application.Based on the embodiment in the application, this field is common The every other embodiment that technical staff is obtained without creative efforts belongs to the model of the application protection It encloses.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing.
In the description of the present application, term " first ", " second ", " third " etc. are only used for distinguishing description, and cannot understand To indicate or implying relative importance.
As shown in Figure 1, Fig. 1 is the flow diagram for the presence detection method that the application preferred embodiment provides.
The presence detection method of the application, is applied to server, and the server is configured with for preserving terminal Multiple first queues of information, the quantity of the first queue are the quotient of preset detection time-out time and assay intervals duration. Detection time-out time refers to preset for judging that how long not receiving terminal heartbeat packet judges that the terminal keeps not online The duration of state.Since assay intervals duration refer to detecting a queue, to starting to detect the time between next queue Length, the interval time that assay intervals duration is also sent between two neighboring heartbeat packet with terminal are equal.
The method includes:
Step S110, long circulating is successively by a conduct in the multiple first queue when at interval of the assay intervals Target first queue.In this way, after queue included in first queue has all been detected, again since first queue most When detected queue start, the queue in first queue is detected successively at interval of an assay intervals duration, to, Each queue in first queue is that one, interval detection time-out time is re-used as target first queue.
Step S111, for each terminal recorded in the target first queue, acquisition does not receive terminal transmission Heartbeat packet duration as Lungs from Non-Heart-Beating packet duration, which is judged according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration Whether end keeps online.
When the Lungs from Non-Heart-Beating packet duration of each detection terminal, examined for each terminal recorded in target first queue It surveys, without being detected to the first queue other than target first queue, the money of CPU when can reduce each presence detection Source consumes, and improves the efficiency of presence detection.
Step S112, when detecting the terminal newly reached the standard grade, by the information storage of the terminal newly reached the standard grade to current In target first queue.
In this step, when detecting the terminal newly reached the standard grade, the terminal newly reached the standard grade is stored in current be detected In target first queue.Since the quantity of first queue is equal to the quotient of detection time-out time and assay intervals duration, instantly When the target first queue that secondary re-inspection is currently detected, the terminal in the target first queue is all that there may be Lungs from Non-Heart-Beating packets Duration is more than or equal to detection time-out time, i.e. terminal time-out.
Therefore, long circulating is successively using first queue as target first team when the present embodiment is due to every minor tick assay intervals It arranges and target first queue is detected, so so that the terminal in detected target first queue is all to exist every time Time-out possible terminal all examines all terminals of storage in the queue when without used in the overtime terminal of each detection It surveys, the consumption of cpu resource can be reduced, improve the efficiency of presence detection.
In order to facilitate searching first queue, in the present embodiment, optionally, and in the presence detection method, the clothes Second queue is also configured in business device, the member of the second queue corresponds with the first queue.
It is described at interval of the assay intervals when long circulating successively by one in the multiple first queue be used as target The step of first queue includes,
Long circulating is successively using a member in the second queue as the second team of target when the assay intervals Member is arranged, using the first queue corresponding to the target second queue member as the target first queue.
In the present embodiment, the queue in the member and first queue of second queue is corresponded, will be in first queue Queue as target first queue when, as long as finding the member of two queues corresponding with target first queue.
In the present embodiment, optionally, in the presence detection method, the second queue include head member and Tail portion member.
It is described at interval of the assay intervals when long circulating successively using a member in the second queue as target The step of second queue member includes:
Pointer object is directed toward the member of a second queue every the assay intervals duration successively, by the pointer The member for the second queue that object is directed toward is as the target second queue member, by the target second queue member couple The first queue answered is as the target first queue.
When the pointer object is directed toward the tail portion member, the pointer object is after being spaced the assay intervals duration Again it is directed toward the head member.
Certainly, if it is in initialization procedure, then pointer object is directed toward head member in initialization, then carried out again Following steps:Pointer object is directed toward the member of a second queue every the assay intervals duration successively, by the finger For the second queue as direction member as the target second queue member, by the target second queue member The corresponding first queue is as the target first queue.
When the pointer object is directed toward the tail portion member, the pointer object is after being spaced the assay intervals duration Again it is directed toward the head member.
In the present embodiment, it configures second queue to circle queue, makes the queue member of circle queue and multiple first teams Row correspond.Target second queue member is determined using pointer object, and when pointer object is directed toward the tail portion member, Pointer object is set to be directed toward tail portion member again after the assay intervals duration of interval.
Due to the terminal after reaching the standard grade, if being held in the state of line, constantly heartbeat packet can be sent to server.Therefore this In embodiment, optionally, judge whether the terminal keeps online according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration The step of be:
When the Lungs from Non-Heart-Beating packet duration is more than the detection time-out time, then judge that the terminal keeps presence.
When the Lungs from Non-Heart-Beating packet duration is not above the detection time-out time, then judge that the terminal is not maintained at line State.
Judge whether terminal keeps online by the way that whether comparison Lungs from Non-Heart-Beating packet duration is more than detection time-out time, there is letter Just quick feature.
In the present embodiment, optionally, the presence detection method further includes:It is obtained simultaneously for each online terminal Record the Lungs from Non-Heart-Beating packet duration of the terminal.The Lungs from Non-Heart-Beating packet duration that terminal is obtained and recorded using individual thread, is made Must obtain and record the Lungs from Non-Heart-Beating packet duration of terminal and the Lungs from Non-Heart-Beating packet duration of detection terminal can be carried out at the same time.
In the present embodiment, optionally, the presence detection method further includes:
When detect in the first queue there are the Lungs from Non-Heart-Beating packet duration be more than it is described detection time-out time terminal When, the information of the terminal is deleted from the first queue.
The present embodiment can ensure first team by deleting the information for being not held in the terminal of line from first queue What is stored in row is all to maintain the information of online terminal, to avoid the information content mistake of stored terminal in first queue Greatly so that in detection terminal, the terminal detected will not have determined as the terminal for being not maintained at line, to improve The efficiency of line state-detection, the resource consumption and memory space of CPU when reducing presence detection.
In the present embodiment, optionally, the presence detection method further includes step S113, when receiving terminal When offline information, the information of the terminal is deleted from the first queue.Existed to delete terminal according to the offline information of terminal Corresponding informance in first queue in time can delete the information of terminal when terminal is offline from first queue, to, When detecting the terminal in first queue, offline terminal will not be detected.In this way, further improving presence detection Efficiency, the resource consumption and memory space of CPU when reducing presence detection.
In the present embodiment, optionally, in the presence detection method, 1 second a length of, the inspection when assay intervals It is 10 seconds to survey time-out time, and the quantity of the first queue is 10.
As shown in Fig. 2, Fig. 2 is the flow diagram for the presence detection method that the application preferred embodiment provides.
The presence detection device of the application is applied to server, and the server is configured with the information for preserving terminal Multiple first queues, the quantity of the first queue is the quotient of preset detection time-out time and assay intervals duration.Detection Time-out time refer to it is preset for judge how long do not receive terminal heartbeat packet, that is, judge the terminal be holding not in threadiness The duration threshold value of state.Assay intervals duration refer to since detecting a queue, to start to detect between next queue when Between length.Multiple first queues of the information of terminal are preserved in configuration in server, are matched it is not necessary that individual structure is in addition arranged Set first queue.
The presence detection device includes:
First searching module 110, long circulating is successively by the multiple first queue when at interval of the assay intervals In one be used as target first queue.
The first searching module 110 in the application is for executing step S110 shown in Fig. 2
State detection module 111, for for each terminal recorded in the target first queue, acquisition not to receive The duration for the heartbeat packet that the terminal is sent is as Lungs from Non-Heart-Beating packet duration, when according to the detection time-out time and the Lungs from Non-Heart-Beating packet Length judges whether the terminal keeps online.
State detection module 111 in the application is for executing step S111 shown in Fig. 2.
Information add module 112, for when detecting the terminal newly reached the standard grade, the information of the terminal newly reached the standard grade to be deposited It stores up in current target first queue.
Information add module 112 in the application is for executing step S112 shown in Fig. 2.
Optionally, the server is also configured with second queue, the member of the second queue and the first queue one One corresponds to;The presence detection device further includes the second searching module 113, second searching module 113 be used for every Long circulating, will be described successively using a member in the second queue as target second queue member when the assay intervals The corresponding first queue of target second queue member is as the target first queue.
One is done to online test method described herein below in conjunction with a specific terminal on-line checking process Detailed description.
In terminal presence detection process, assay intervals duration is set as 1 second, i.e., terminal every 1 second to service Device sends a heartbeat packet.It sets detection time-out time to 10 seconds, detection time-out time divided by assay intervals duration is obtained The quantity of first queue is 10.As shown in figure 3, setting second queue, makes the number of members of second queue and the team of first queue Columns is equal, i.e., 10, sets second queue to circle queue.Second queue include head member (head), tail portion at Member (tail), meanwhile, setting pointer object (cur) is directed toward the element of circle queue.Each member in circle queue is set to distinguish A corresponding first queue.Since the head member of circle queue, until the tail portion member of circle queue, to circle queue Each member is from 0,1,2,3,4,5,6,7,8,9 number consecutively.
When initialization, pointer object is directed toward to the head member (queue member that number is 0) of circle queue.
After initialization, pointer object every assay intervals duration be directed toward next queue of queue member for currently pointing at Member, i.e., the next queue member for the queue member being directed toward current pointer object every assay intervals duration is as target second Queue member.
As shown in figure 4, the t1 moment after initialization, pointer object is directed toward the member that number is 5.In circle queue, number It is stored with the information of terminal C2_0, C2_1 for the 2 corresponding first queue of member.The corresponding first queue of member that number is 3 It is stored with the information of terminal C3_0, C3_1.The corresponding first queue of member that number is 5 is stored with the letter of terminal C5_0, C5_1 Breath.At this point, detect that terminal C5_2 reaches the standard grade, then, by the information preservation of terminal C5_2 number be 5 member corresponding to the The queue tail of one queue.At the time of t1 plus 1 second, pointer object is then directed toward the member that number is 6.
As shown in figure 5, the t2 moment (at the time of t1 adds 7 seconds), pointer object is directed toward the member that number is 2, at this point, number is The information of terminal C2_0, C2_1, C2_2, C2_3 has been stored in first queue corresponding to 2 member.Therefore, the t2 moment, The terminal that the first queue corresponding to member that detection number is 2 preserves, i.e. detection terminal C2_0, C2_1, C2_2, C2_3.
T3 moment, pointer object are directed toward the member (tail portion member) that number is 9, at this point, corresponding to the member for being 9 to number First queue in terminal be detected.At the time of t3 plus 1 second, pointer object be directed toward number be 0 member (head at Member), then, pointer object was directed toward next member of member pointed by current pointer successively every 1 second again.
At the t4 moment, the first queue corresponding to the circle queue is as shown in Figure 6.At this point, number is 1 in circle queue The corresponding first queue of member be stored with the information of terminal C1_0, C1_1.The member corresponding that number is 2 in circle queue One queue is stored with the information of terminal C2_0, C2_1, C2_2, C2_3.The corresponding first team of member that number is 3 in circle queue Row are stored with the information of terminal C3_0, C3_1.The corresponding first queue of member that number is 4 in circle queue is stored with terminal The information of C4_0, C4_1.The corresponding first queue of member that number is 5 in circle queue is stored with terminal C5_0, C5_1, C5_2 Information.The corresponding first queue of member that number is 6 in circle queue is stored with the information of terminal C6_0, C6_1.Annular team The corresponding first queue of member that number is 7 in row is stored with the information of terminal C7_0, C7_1.Number is 8 in circle queue The corresponding first queue of member is stored with the information of terminal C8_0, C8_1.
In conclusion the application preserves end message using multiple first queues, and successively every assay intervals duration It regard one in multiple first queues as target first queue, is obtained according to the end message preserved in the target first queue The Lungs from Non-Heart-Beating packet duration for taking each terminal in the target first queue, to judge that the corresponding terminal of the Lungs from Non-Heart-Beating packet duration is No is presence;And detect the target first queue;When detecting the terminal newly reached the standard grade, by the terminal newly reached the standard grade Information storage to the target first queue in.So so that detected first queue is all that there may be Lungs from Non-Heart-Beating packets Duration is more than detection time-out time, to reduce the resource consumption of the CPU in presence detection process, improve clothes The response efficiency of business device.
In embodiment provided herein, it should be understood that disclosed device and method, it can also be by other Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown According to the device, the architectural framework in the cards of method and computer program product, function of multiple embodiments of the application And operation.In this regard, each box in flowchart or block diagram can represent one of a module, section or code Point, a part for the module, section or code includes one or more for implementing the specified logical function executable Instruction.It should also be noted that at some as in the realization method replaced, the function of being marked in box can also be attached to be different from The sequence marked in figure occurs.For example, two continuous boxes can essentially be basically executed in parallel, they also may be used sometimes To execute in the opposite order, this is depended on the functions involved.It is also noted that each of block diagram and or flow chart The combination of box in box and block diagram and or flow chart, function or the dedicated of action are based on as defined in execution The system of hardware is realized, or can be realized using a combination of dedicated hardware and computer instructions.
In addition, each function module in each embodiment of the application can integrate to form an independent portion Point, can also be modules individualism, can also two or more modules be integrated to form an independent part.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer read/write memory medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of step. And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
The above, the only specific implementation mode of the application, but the protection domain of the application is not limited thereto, it is any Those familiar with the art can easily think of the change or the replacement in the technical scope that the application discloses, and should all contain It covers within the protection domain of the application.Therefore, the protection domain of the application shall be subject to the protection scope of the claim.

Claims (10)

1. a kind of presence detection method, which is characterized in that be applied to server, the server is configured with for preserving end The quantity of multiple first queues of the information at end, the first queue is preset detection time-out time and assay intervals duration Quotient, the method includes:
Long circulating regard one in the multiple first queue as target first queue successively when at interval of the assay intervals;
For each terminal recorded in the target first queue, the duration for the heartbeat packet for not receiving terminal transmission is obtained As Lungs from Non-Heart-Beating packet duration, judge whether the terminal is maintained at according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration Line;
When detecting the terminal newly reached the standard grade, by the information storage of the terminal newly reached the standard grade to current target first queue In.
2. presence detection method according to claim 1, which is characterized in that be also configured with second in the server Queue, the member of the second queue correspond with the first queue;
It is described at interval of the assay intervals when long circulating be used as target first by one in the multiple first queue successively The step of queue includes,
When the assay intervals long circulating successively using a member in the second queue as target second queue at Member, using the first queue corresponding to the target second queue member as the target first queue.
3. presence detection method according to claim 2, which is characterized in that the second queue includes head member With tail portion member;
It is described at interval of the assay intervals when long circulating successively using a member in the second queue as target second The step of queue member includes:
Pointer object is directed toward the member of a second queue every the assay intervals duration successively, by the pointer object The member for the second queue being directed toward is corresponding by the target second queue member as the target second queue member The first queue is as the target first queue;
When the pointer object is directed toward the tail portion member, the pointer object after being spaced the assay intervals duration again It is directed toward the head member.
4. presence detection method according to claim 1, which is characterized in that according to the detection time-out time and institute It states Lungs from Non-Heart-Beating packet duration and judges whether the terminal keeps the online step to be,
When the Lungs from Non-Heart-Beating packet duration is more than the detection time-out time, then judge that the terminal keeps presence;
When the Lungs from Non-Heart-Beating packet duration is not above the detection time-out time, then judge that the terminal is not maintained at threadiness State.
5. presence detection method according to claim 1, which is characterized in that the presence detection method is also wrapped It includes:The Lungs from Non-Heart-Beating packet duration of the terminal is obtained and recorded for each online terminal.
6. presence detection method according to claim 1, which is characterized in that the presence detection method is also wrapped It includes:
It, will when detecting that there are the Lungs from Non-Heart-Beating packet durations more than the terminal for detecting time-out time in the first queue The information of the terminal is deleted from the first queue.
7. presence detection method according to claim 1, which is characterized in that the presence detection method is also wrapped It includes, when receiving the offline information of terminal, the information of the terminal is deleted from the first queue.
8. according to claim 1-7 any one of them presence detection methods, which is characterized in that the assay intervals duration It it is 1 second, the detection time-out time is 10 seconds, and the quantity of the first queue is 10.
9. a kind of presence detection device, which is characterized in that be applied to server, the server is configured with preservation terminal Multiple first queues of information, the quantity of the first queue are the quotient of preset detection time-out time and assay intervals duration;
The presence detection device includes:
First searching module, long circulating is successively by one in the multiple first queue when at interval of the assay intervals As target first queue;
State detection module, for for each terminal recorded in the target first queue, acquisition not to receive the terminal The duration of the heartbeat packet of transmission judges as Lungs from Non-Heart-Beating packet duration according to the detection time-out time and the Lungs from Non-Heart-Beating packet duration Whether the terminal keeps online;
Information add module, for when detecting the terminal newly reached the standard grade, by the information storage of the terminal newly reached the standard grade to working as In preceding target first queue.
10. presence detection device according to claim 9, which is characterized in that the server is also configured with second Queue, the member of the second queue correspond with the first queue;The presence detection device further includes second Searching module, second searching module be used for when the assay intervals long circulating successively by one in the second queue A member is as target second queue member, using the corresponding first queue of the target second queue member as the mesh Mark first queue.
CN201810598949.4A 2018-06-12 2018-06-12 Online state detection method and device Active CN108809761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810598949.4A CN108809761B (en) 2018-06-12 2018-06-12 Online state detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810598949.4A CN108809761B (en) 2018-06-12 2018-06-12 Online state detection method and device

Publications (2)

Publication Number Publication Date
CN108809761A true CN108809761A (en) 2018-11-13
CN108809761B CN108809761B (en) 2020-09-04

Family

ID=64085199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810598949.4A Active CN108809761B (en) 2018-06-12 2018-06-12 Online state detection method and device

Country Status (1)

Country Link
CN (1) CN108809761B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740355A (en) * 2019-09-30 2020-01-31 视联动力信息技术股份有限公司 Equipment monitoring method and device, electronic equipment and storage medium
CN111193796A (en) * 2019-12-26 2020-05-22 深圳证券交易所 Session keeping method based on delay queue, server and readable storage medium
CN112465091A (en) * 2020-12-16 2021-03-09 努比亚技术有限公司 Electronic price tag unbinding method, electronic price tag and computer readable storage medium
CN113411237A (en) * 2021-08-18 2021-09-17 成都丰硕智能数字科技有限公司 Method, storage medium and system for detecting terminal state with low delay
CN113805476A (en) * 2021-09-01 2021-12-17 武汉市政工程设计研究院有限责任公司 High-reliability network early warning method and system
CN117076874A (en) * 2023-10-17 2023-11-17 广东鹰视能效科技有限公司 Batch instrument defect diagnosis method and system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954413B (en) * 2021-02-02 2024-01-16 深圳市欢太科技有限公司 Live broadcast list updating method, device, server and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130238794A1 (en) * 2010-11-23 2013-09-12 Juniper Networks, Inc Enhanced high availability for group vpn in broadcast environment
CN104166589A (en) * 2013-05-17 2014-11-26 阿里巴巴集团控股有限公司 Heartbeat package processing method and device
CN105515900A (en) * 2015-12-07 2016-04-20 北京奇虎科技有限公司 Method and device for acquiring on-line state of terminal
CN105827697A (en) * 2016-03-14 2016-08-03 广州趣丸网络科技有限公司 User off-line detection method and user off-line detection system
CN106411645A (en) * 2016-09-30 2017-02-15 中国有色金属长沙勘察设计研究院有限公司 Network data unvarnished transmission system and disconnection detecting method thereof
CN106961364A (en) * 2017-04-24 2017-07-18 努比亚技术有限公司 Heartbeat detecting method and application server
CN107395460A (en) * 2017-08-23 2017-11-24 上海斐讯数据通信技术有限公司 The Detection of Stability method of terminal, the statistical method and system of terminal palmic rate
CN107465573A (en) * 2017-08-04 2017-12-12 郑州云海信息技术有限公司 A kind of method of raising SSR client on-line monitoring efficiency

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130238794A1 (en) * 2010-11-23 2013-09-12 Juniper Networks, Inc Enhanced high availability for group vpn in broadcast environment
CN104166589A (en) * 2013-05-17 2014-11-26 阿里巴巴集团控股有限公司 Heartbeat package processing method and device
CN105515900A (en) * 2015-12-07 2016-04-20 北京奇虎科技有限公司 Method and device for acquiring on-line state of terminal
CN105827697A (en) * 2016-03-14 2016-08-03 广州趣丸网络科技有限公司 User off-line detection method and user off-line detection system
CN106411645A (en) * 2016-09-30 2017-02-15 中国有色金属长沙勘察设计研究院有限公司 Network data unvarnished transmission system and disconnection detecting method thereof
CN106961364A (en) * 2017-04-24 2017-07-18 努比亚技术有限公司 Heartbeat detecting method and application server
CN107465573A (en) * 2017-08-04 2017-12-12 郑州云海信息技术有限公司 A kind of method of raising SSR client on-line monitoring efficiency
CN107395460A (en) * 2017-08-23 2017-11-24 上海斐讯数据通信技术有限公司 The Detection of Stability method of terminal, the statistical method and system of terminal palmic rate

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740355A (en) * 2019-09-30 2020-01-31 视联动力信息技术股份有限公司 Equipment monitoring method and device, electronic equipment and storage medium
CN111193796A (en) * 2019-12-26 2020-05-22 深圳证券交易所 Session keeping method based on delay queue, server and readable storage medium
CN112465091A (en) * 2020-12-16 2021-03-09 努比亚技术有限公司 Electronic price tag unbinding method, electronic price tag and computer readable storage medium
CN112465091B (en) * 2020-12-16 2024-03-19 努比亚技术有限公司 Electronic price tag unbinding method, electronic price tag and computer readable storage medium
CN113411237A (en) * 2021-08-18 2021-09-17 成都丰硕智能数字科技有限公司 Method, storage medium and system for detecting terminal state with low delay
CN113411237B (en) * 2021-08-18 2021-11-30 成都丰硕智能数字科技有限公司 Method, storage medium and system for detecting terminal state with low delay
CN113805476A (en) * 2021-09-01 2021-12-17 武汉市政工程设计研究院有限责任公司 High-reliability network early warning method and system
CN113805476B (en) * 2021-09-01 2024-05-14 武汉市政工程设计研究院有限责任公司 High-reliability network early warning method and system
CN117076874A (en) * 2023-10-17 2023-11-17 广东鹰视能效科技有限公司 Batch instrument defect diagnosis method and system
CN117076874B (en) * 2023-10-17 2023-12-26 广东鹰视能效科技有限公司 Batch instrument defect diagnosis method and system

Also Published As

Publication number Publication date
CN108809761B (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN108809761A (en) Presence detection method and device
US10540358B2 (en) Telemetry data contextualized across datasets
US8275581B2 (en) Managing statistical profile data
CN108255722B (en) Script generation method, script generation device and server
CN106650433B (en) A kind of anomaly detection method and system
CN103220352B (en) Terminal, server, file storage system and file storage method
CN106354606B (en) Application exception processing method and processing device
US20180268060A1 (en) Identifying client states
US20190004923A1 (en) Non-transitory computer-readable storage medium, display control method, and display control device
CN106980572B (en) Online debugging method and system for distributed system
CN108667840A (en) Injection loophole detection method and device
CN109905396A (en) A kind of WebShell file test method, device and electronic equipment
CN110784486A (en) Industrial vulnerability scanning method and system
CN107329914A (en) It is a kind of that the out of order method and device of hard disk is detected based on linux system
CN108055340A (en) Customer resources distribution method, device, computer equipment and storage medium
CN107798039A (en) A kind of method of data synchronization and device
CN107992402A (en) Blog management method and log management apparatus
US20130322686A1 (en) Profiling Activity Through Video Surveillance
CN104462451B (en) The detection method and device of database file sensitive content
US9378082B1 (en) Diagnosis of storage system component issues via data analytics
CN108228417A (en) Car networking log processing method and processing unit
CN110442439B (en) Task process processing method and device and computer equipment
CN108345902B (en) Self-learning white list model base construction and white list detection method based on transaction characteristics
CN111478792A (en) Cutover information processing method, system and device
CN107483294B (en) Method and device for monitoring network request

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant