A kind of terminal presence monitoring method and system
Technical field
The present invention relates to technical field of terminal management, in particular to a kind of terminal presence monitoring method and it is
System.
Background technology
Tr069 agreements, i.e. CPE wide area networks management agreement, it provides to be managed home network device in network matches somebody with somebody
The general framework and agreement put, for being carried out remotely to equipment such as the gateway in home network, router, Set Top Boxes from network side
Centralized management.So-called tr069 terminals, that is, the terminal for realizing the tr069 agreements can be referred to as tr069 terminals, for example, realize
The home terminal of the tr069 agreements.
In field of telecommunications, home terminal net number it is very huge, can usually reach hundreds of thousands, it is millions of in addition on
Ten million number, and for operator, it compares the number for being concerned about that a certain moment home terminal is online, current webmaster again
The technical scheme of the online number of system statistics home terminal is as follows:
(1) terminal backward NM server of reaching the standard grade is registered, and NM server records its current hour of log-on, when will
When counting online number, nearest a period of time is just counted (for example:Nearest 20 minutes) to the registered number of terminals of NM server
Mesh.However, the terminal data error for counting in this way is very big, for example:Terminal was reached the standard grade registration before 1 hour, with latter
Straight online, now the online terminal cannot just be counted on;Or, terminal was reached the standard grade the end after registration, but 5 minutes before 8 minutes
End is just offline, and offline terminal statistics will be online by the method for now sampling, so as to cause error.
(2) NM server randomly selects the terminal of certain amount by a certain percentage, and real-time statistics these terminals
Line situation, is then calculated in proportion, counts the online situation of terminal on network, also has larger mistake using this kind of method
Difference.
In addition, NM server and terminal also used at present carry out real-time, interactive with obtain its whether presence feelings
The scheme of condition, as shown in figure 1, working as ACS (Auto Configuration System, Automatic Configuration Server, i.e. network manager service
Device) when counting the online situations of CPE (Customer premises equipment, customer premises equipment, CPE, i.e. terminal), in real time
Interacted with each terminal, the reply for receiving terminal thinks that it is online, otherwise it is assumed that offline.When terminal number is few, use
The program is relatively applicable, but, if terminal number is more, the program is just difficult to carry out, and reason is as follows:
NM server and terminal interaction, it is necessary to after waiting for a period of time, if can not receive terminal replies, can just think the end
End is offline, and usual this stand-by period is set to 5-10 seconds, it is assumed here that be set to 5 seconds, false when there is 3,000,000 station terminal in network
If actually having 50% online, NM server can receive the reply of online terminal at 1 second or so, and also 50% is offline in addition, this
When NM server count the total time that all terminal presences spend and be:3000000 * (1+5)/2=,900 ten thousand seconds=2500
Hour, that is to say, that single thread will spend 2500 hours could complete these work, by 1000 thread concurrents, also at least need
Spend 2.5 hours, and in this period NM server be substantially all cannot be used for process other any affairs, it is clear that should
Method is less efficient.
The content of the invention
It is an object of the invention to provide a kind of terminal presence monitoring method and system, it can allow operator faster
More accurately inquire the online situation of terminal.
In order to reach the purpose of the present invention, the present invention uses following technical scheme:
A kind of terminal presence monitoring method, including:
Terminal is just carried to only to being sent on state server at interval of a status message report cycle for pre-setting
The state reporting message of one terminal identification information for distinguishing the terminal;
State server record obtains the temporal information of the state reporting message, and will be taken in the state reporting message
The terminal identification information of band and corresponding time information renovation to state information database;
NM server sends state information searching message to state server, and state server is according to the status information
Query messages inquire about state information database, count current online end message and send it to NM server.
Preferably, before all steps are performed, also include:
Terminal sends state parameter registration request to NM server;
NM server responds the request, sets the status message report cycle parameter and status service of the terminal
Device address parameter, and send it to corresponding terminal.
Preferably, state server according to the state information searching information query state information database and count work as
The method of preceding online end message is:In state server inquiry state information database in nearest section termination timing statisticses
Terminal identification information, and be organized into current online end message, wherein, the terminal timing statisticses are on status message
Report cycle parameter and statistic wave time parameter sum set in advance.
Preferably, it is tr069 forms or http format messages that terminal is sent to the state reporting message of state server.
Preferably, after all steps are performed, also include:
NM server sends target terminal state information searching message to state server, and state server is according to described
Whether target terminal state information searching information query state information database, judge the target terminal within a period of time recently
Whether state reporting message was reported to the state server, if it is not, then judge that the target is interrupted offline, if so, then webmaster clothes
Business device sends http get message to the target terminal, when the target terminal device replied 200ok feedback messages, then need not be again
Inform message is waited to be judged as the target terminal online, if report time-out, judges that the target terminal is offline.
Preferably, NM server sends to the http get message of target terminal the usemame/password for carrying mistake.
A kind of terminal presence monitoring system, including:
Terminal, just uses to sending to carry on state server for the status message report cycle that is pre-set at interval of one
Uniquely to distinguish the state reporting message of the terminal identification information of the terminal;
State server, the temporal information of the state reporting message is obtained for recording, and the state reporting is disappeared
The terminal identification information and corresponding time information renovation to state information database carried in breath;For foundation from network manager service
The state information searching information query state information database that device gets, counts current online end message and is sent to
To NM server;
NM server, for sending state information searching message to state server;For being obtained from state server
The current online end message for counting.
Preferably, the terminal is additionally operable to send state parameter registration request to NM server, and NM server then rings
The request is answered, the status message report cycle parameter and state server address parameter of the terminal are set, and sent out
Deliver to corresponding terminal.
Preferably, the state server is according to the state information searching information query state information database and counts
The method for going out current online end message is:In state server inquiry state information database when a nearest section termination is counted
Interior terminal identification information, and current online end message is organized into, wherein, the terminal timing statisticses disappear for state
Breath report cycle parameter and statistic wave time parameter sum set in advance.
Preferably, it is that tr069 forms or http forms disappear that the terminal is sent to the state reporting message of state server
Breath.
Preferably, the NM server is additionally operable to send target terminal state information searching message to state server,
State server judges that the target terminal is according to the target terminal state information searching information query state information database
It is no whether to report state reporting message to the state server within a period of time recently, if it is not, then judging that the target is interrupted
Offline, if so, then NM server sends http get message to the target terminal, as the target terminal device replied 200 ok
During feedback message, then inform message need not be again waited to be judged as the target terminal online, if report time-out, judges target end
End is offline.
Preferably, NM server sends to the http get message of target terminal the usemame/password for carrying mistake.
Autgmentability of the present invention using tr069 agreements can be seen that by the technical scheme of the invention described above, to terminal
Parameter is extended, and allows online its state of terminal timing active reporting.Using the present invention, can be accurate in a short period of time
Inquire current online end message.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes a part of the invention, this hair
Bright schematic description and description does not constitute inappropriate limitation of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is the schematic flow sheet that traditional NM server obtains terminal's status information;
Fig. 2 is terminal presence monitoring method schematic flow sheet provided in an embodiment of the present invention;
Fig. 3 is terminal presence monitoring system structural representation provided in an embodiment of the present invention;
Fig. 4 is the information exchange schematic diagram in embodiment of the present invention presence information acquisition process.
Specific embodiment
In order that the technical problems to be solved by the invention, technical scheme and beneficial effect are clearer, clear, below tie
Drawings and Examples are closed, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only
It is used to explain the present invention, is not intended to limit the present invention.
As shown in Fig. 2 a kind of terminal presence monitoring method provided in an embodiment of the present invention, comprises the following steps:
S103, terminal at interval of a status message report cycle for pre-setting just to sent on state server carry use
Uniquely to distinguish the state reporting message of the terminal identification information of the terminal;
S104, state server record obtain the temporal information of the state reporting message, and the state reporting are disappeared
The terminal identification information and corresponding time information renovation to state information database carried in breath;
S105, NM server send state information searching message to state server, and state server is according to the shape
State information query message inquires about state information database, counts current online end message and sends it to network manager service
Device.
Under preferred embodiment, before all steps are performed, also include:
S101, terminal send state parameter registration request to NM server;
S102, NM server respond the request, set the status message report cycle parameter and shape of the terminal
State server address parameter, and send it to corresponding terminal.
In the step S101 and S102, terminal is allowed to increase by two configuration parameters, the parameter is X_<VENDOR>_
StatusServerAddress and X_<VENDOR>_ StatusServerInterval, the value of above-mentioned two parameter can pass through
NM server is set, and first parameter is used for the address of configuration status server, and second parameter disappears for configuration status
Breath report cycle (i.e. time interval);It is described<VENDOR>Parameter represents that manufacturer indicates that in actual implementation process, these are made by oneself
Adopted parameter must meet tr069 protocol specifications.
In the step S103, it is tr069 forms or http that terminal is sent to the state reporting message of state server
(HyperText Transfer Protocol, HTTP) format messages, such that it is able to greatly save network traffics
With the parsing time of state server.
In terminal after electricity, normally registered to NM server, while sending out one to StatusServerAddress addresses
Individual state reporting message, then every a StatusServerInterval times just to StatusServerAddress ground
A state reporting message is sent out in location, as long as message content includes terminal identification information, for example:The terminal identification information is
Equipment Serial Number, it is the unique mark of the terminal, and state server is without replying the state reporting message for receiving also, whole
It all needs not be tr069 forms to hold the state reporting message for sending, if the message also may be used for http format messages.
In the step S104, after state server receives the state reporting message that terminal is sent, terminal is recorded
Terminal identification information (such as equipment Serial Number) and state server record obtain the temporal information of the state reporting message,
Above- mentioned information is updated to state information database afterwards, in specific implementation process, the information of 5,000,000 station terminals, in 150M
Deposit and just store enough, for the state reporting message for not meeting call format that state server is received, then directly lose
Abandon and disregard.In an embodiment of the present invention, the legal form of state server regulation is tr069 forms or http lattice
Formula, certainly, the form can voluntarily be specified by self-defined, here only be merely to enumerate of the invention one to be preferable to carry out
Example, is not used to limit the present invention.
In the step S105, state server is according to the state information searching information query state information database
And count the method for current online end message and be:In a nearest section termination in state server inquiry state information database
Terminal identification information in timing statisticses, and current online end message is organized into, wherein, the terminal timing statisticses are
Status message report cycle parameter and statistic wave time parameter sum set in advance.The statistic wave time
Parameter is the same with status message report cycle parameter, can be set by User Defined.
When NM server thinks the current online situation of acquisition terminal, it is only necessary to which hair-like state information query message is to state
The terminal that state reporting message is received in nearest a period of time is counted just can obtain and is relatively defined by server, state server
It is simultaneously fed back to NM server by current online end message really in real time, so that webmaster personnel grasp current in real time
The online situation of terminal, for example, when the status message report cycle for pre-setting is 10S, then as long as state server is counted
The terminal of state reporting message is have sent in nearest 15 seconds can just obtain current online end message.Here, preset
Statistic wave time parameter be 5s.
Under preferred embodiment, after all steps are performed, also include:
S106, NM server send target terminal state information searching message to state server, state server according to
According to the target terminal state information searching information query state information database, judge the target terminal whether at nearest one section
Whether state reporting message was reported to the state server in time, if it is not, then judging that the target is interrupted offline, if so, then
NM server sends http get message to the target terminal, when the target terminal device replied 200ok feedback messages, then
Inform message need not be again waited to be judged as the target terminal online, if report time-out, judges that the target terminal is offline.
In some cases, due to cause specific or demand, NM server may need real-time with specific mesh really
Mark terminal interaction, so as to judge its state in real time.
The way that prior art is generally used is that toward terminal hair http get message, (message package contains NM server
Usemame/password), terminal replies 200ok, then again to NM server hair inform message, NM server is received terminal
After inform, then transmitting order to lower levels to be to obtain certain presence parameter value of terminal, if the terminal replies parameter value, gateway
It is online that server is considered as the terminal.
However, above-mentioned prior art interaction flow is complex, in interaction, the pressure of NM server can be caused
It is larger, now can in the following method reduce NM server pressure.
Whether NM server judges the target terminal according to the state information database stored on state server first
State reporting message was reported in 2 minutes, if it did not, being considered as the target terminal offline, otherwise, is interrupted to the target and sent out
Http get message, if device replied 200ok message, NM server is considered as the target and interrupts online, if report time-out, just recognizes
For the target terminal is offline, and need not again wait inform message.
It is further preferable that NM server sends to the http get message of target terminal the user name/close for carrying mistake
Code.
In the method for above-mentioned NM server active obtaining target terminal status information, although NM server without
Inform message is waited, but if terminal is online, terminal still can send inform message, NM server to NM server
Equally to parse these messages (in addition, may will also carry out other operations, for example:Check whether IP changes), and according to
According under this preferred embodiment, when NM server will send out http get message to terminal, deliberately send and carry mistake
To target terminal, such target is interrupted would not disappear the http get message of usemame/password to NM server hair inform
Breath, if target terminal is offline, NM server can obtain the mistake of time-out, if target terminal is online, NM server meeting
Obtain the incorrect mistake of usemame/password, such NM server just can be by the time-out error prompting message that receives
Or miscue message judges whether target terminal is online.
In addition, a CPE (i.e. terminal) timings are also defined in tr069 agreements actively being handed over ACS (i.e. NM server)
Mutual parameter PeriodicInformInterval, for sending CPE to NM server every a fixed time interval
Information.
But in the prior art, terminal sends the CPE information and can bring following influence to NM server:
(1) if tr069 standards this time interval set it is larger, cannot just cause that NM server is more accurate
The online situation of statistics terminal;
(2) if this time interval of tr069 standards sets very little, such as 10 seconds or so, it will cause problems with:
1) these terminals are continually interacted with NM server, (such as its numbers when many in line terminal equipment
It is hundreds of thousands, or even during 1,011,000 rank), all resources of NM server are nearly all used to process this timing friendship
Mutually, other affairs cannot be processed, but during practice, NM server statistics terminal unit status Just One Of Those Things
The function of individual very little).
2) terminal is that, for sending CPE information, right CPE information frequently includes more with interacting for NM server
Information, for example, include:The useful informations such as equipment unique designation information, device type information, type information, company-information, and
Described with SOAP, therefore message data size is relatively large;After NM server receives the CPE information, it is necessary to webmaster
The terminal device information that server is preserved is compared, and so as to time update, these all bring very big extra open to whole system
Pin.
However, terminal presence monitoring method provided in an embodiment of the present invention but just avoids these drawbacks:
(1) information exchange is carried out using terminal and state server, allows state server to share expense, reduce network manager service
Device pressure, so that NM server can attentively process other normal business;
(2) terminal is directly interacted with simple http format messages with state server, and need to only report little information,
Message is relatively much smaller.
As shown in figure 3, it is a kind of terminal presence monitoring system provided in an embodiment of the present invention, the system bag
Include:
Terminal 10, just takes to being sent on state server 20 for the status message report cycle that is pre-set at interval of one
Band is used to the state reporting message of the terminal identification information for uniquely distinguishing the terminal 10;Wherein, the terminal 10 is sent to state
The state reporting message of server 20 is tr069 forms or http format messages;
State server 20, obtains the temporal information of the state reporting message for recording, and by the state reporting
The terminal identification information and corresponding time information renovation to state information database carried in message;Taken from webmaster for foundation
The business state information searching information query state information database that gets of device 30, count current online end message and by its
Send to NM server 30;
NM server 30, for sending state information searching message to state server 20;For from state server
20 obtain the current online end message for counting.
The terminal 10 is additionally operable to send state parameter registration request to NM server 30, and NM server 30 is then responded
The request, sets the status message report cycle parameter and the address parameter of state server 20 of the terminal 10, and by its
Send to corresponding terminal 10.
The state server 20 according to the state information searching information query state information database and count work as
The method of preceding online end message is:In nearest section termination timing statisticses in the inquiry state information database of state server 20
Interior terminal identification information, and current online end message is organized into, wherein, the terminal timing statisticses are status message
Report cycle parameter and statistic wave time parameter sum set in advance.
When NM server 30 wants the status information of active obtaining target terminal 10, the NM server 30 is also used
In target terminal state information searching message is sent to state server 20, state server 20 is according to the target terminal state
Information query message inquire about state information database, judge the target terminal 10 whether recently a period of time in whether to the shape
State server 20 reported state reporting message, if it is not, then judging that the target is interrupted offline, if so, then NM server 30 is sent out
Http get message to the target terminal 10 is sent, when the 10 device replied 200ok feedback messages of target terminal, then need not be waited again
Treat that inform message is judged as the target terminal 10 online, if report time-out, judges that the target terminal 10 is offline.
It is further preferable that NM server 30 sends to the http get message of target terminal 10 user for carrying mistake
Name/password.When NM server 30 will to terminal 10 send out http get message when, deliberately send carry mistake user name/
To target terminal 10, such target is interrupted would not send out inform message to the http get message of password to NM server 30,
If target terminal 10 is offline, NM server 30 can obtain the mistake of time-out, if target terminal 10 is online, NM server
30 can obtain the incorrect mistake of usemame/password, and such NM server 30 can just be carried by the time-out error for receiving
Show that message or miscue message judge whether target terminal 10 is online.
As shown in figure 4, it is the information exchange schematic diagram in inventive embodiments presence information acquisition process, it includes
Following steps:
(1) when terminal 10 goes up electricity first, registered to NM server 30, NM server 30 sets its status message and reports
Cycle parameter and the address parameter of state server 20, send it to terminal 10 after setting up.In addition, upper electricity next time of terminal 10
When, it is not necessary to described two parameters are set again, except non-user needs to be changed described two parameter values;
(2) terminal 10 receives the status message report cycle parameter and the ground of state server 20 of the transmission of NM server 30
After the parameter of location, correspondence parameter is set, and corresponding actions are carried out according to parameter value, i.e., it is just past every one section of status message report cycle
The hair-like state of state server 20 complains to message;
(3) state server 20 receive terminal 10 state complain to message after, the status information number in the internal memory that upgrades in time
According to storehouse (can also persistence preserve);
(4) when NM server 30 will inquire about 10 state of terminal, NM server 30 directly enters to state server 20
Row request, to obtain the online situation of present terminal;
(5) state server 20 returns to the online situation of present terminal to NM server according to the request of NM server 30
30, further analyze and process offer facility with for webmaster personnel.
Described above has shown and described a preferred embodiment of the present invention, but as previously described, it should be understood that the present invention
Be not limited to form disclosed herein, be not to be taken as the exclusion to other embodiment, and can be used for various other combinations,
Modification and environment, and can be in invention contemplated scope described herein, by above-mentioned teaching or the technology or knowledge of association area
It is modified.And the change and change that those skilled in the art are carried out do not depart from the spirit and scope of the present invention, then all should be in this hair
In the protection domain of bright appended claims.