Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The flow chart of method first embodiment that inserts number of host is shared in the detection that Fig. 1 provides for the embodiment of the invention, and as shown in Figure 1, this method comprises:
Step 101, obtain the access request message that main frame in the share of access network sends;
Concrete, main frame is intercepted and captured this solicited message when access request message that the WEB server sends in monitoring share of access network.This request message can adopt the mode of GET message, and (the GET message is HTML (Hypertext Markup Language) (Hypertext Transfer Protocol; Hereinafter to be referred as HTTP) requesting method commonly used in the request), also can adopt the mode of other messages.Comprise the purpose network address that this main frame will be visited in the described access request message.
Step 102, send the host information querying command to main frame according to access request message;
Concrete, can send a packet that comprises 200 OK data and a JavaScript shell script to the main frame that sends this message, the effect of this packet is that the imitation purpose is landed network address and this main frame is shaken hands, the effect of described JavaScript shell script is to this host query host information, require this main frame to return the host information that comprises specific identifier, and can make the main frame that receives this packet return host information automatically, this specific identifier can be certain hardware identifier (as MAC Address) of every main frame etc.
The host information that the main frame that step 103, basis receive returns obtains the number of host in the share of access network, includes the specific identifier of main frame in the host information.
The host information that main frame in the share of access network that receives returns is analyzed, owing to include the specific identifier of this main frame in the host information that every main frame returns, therefore, can distinguish different main frames according to these host informations, and obtain number of host in the share of access network by the number of adding up these specific identifiers with specific identifier.
The method that inserts number of host is shared in the detection that present embodiment provides, by detecting the access request message that main frame in the share of access network sends to server, inquire about this and share the host information that inserts main frame, thereby judge the number of host of sharing access according to the host information that returns.This method testing process is simple, efficient is high, testing result accuracy height, thus help managing to sharing the access main frame.
The flow chart of method second embodiment that inserts number of host is shared in the detection that Fig. 2 provides for the embodiment of the invention, and as shown in Figure 2, this method comprises:
Step 201, obtain the access request message that main frame in the share of access network sends;
Concrete, main frame is intercepted and captured this solicited message when access request message that the WEB server sends in monitoring share of access network.This request message can adopt the mode (the GET message is a requesting method commonly used in the HTTP request) of GET message, also can adopt the mode of other messages.The purpose that comprises this main frame in the described access request message is landed network address.
Step 202, send the host information querying command to main frame according to access request message;
Concrete, can send a packet that comprises 200 OK data and a JavaScript shell script to the main frame that sends this message, the effect of this packet is that the imitation purpose is landed network address and this main frame is shaken hands, the effect of described JavaScript shell script is to this host query host information, require this main frame to return the host information that comprises specific identifier, and can make the main frame that receives this packet return host information automatically, this specific identifier can be certain hardware identifier (as MAC Address) of every main frame etc.
Step 203, the host information that the main frame that receives is returned are stored in the default host information storage list, the MAC Address and the host name that include main frame in the host information comprise public network IP address information, host name information and host MAC address information in the host information storage list;
Wherein, MAC (Media Access Control; Hereinafter to be referred as: MAC) address is the Media Access Control address of this main frame, because the MAC Address that different network interface cards is corresponding different, and MAC Address is unrepeatable, even change MAC Address by revising registration table, value after the change also is unique, and the MAC Address of other main frames in every main frame and the share of access network is all inequality.Therefore, can use MAC Address to distinguish different main frames.
Concrete, in the process that the host information that receives is stored, can judge earlier and whether have this host information public network IP addresses corresponding in the host information storage list, if do not exist, then in this host information storage list, create this public network IP address recorded information, and the host name and the MAC Address of this main frame is stored in the host information of this IP address correspondence; If exist, then further judge whether to exist and whether had this host MAC address in the host MAC address information corresponding with this public network IP address, if exist, the host information that received this main frame is described, then current this host information of receiving is abandoned, if there is not this host MAC address, then host name and the MAC Address with this main frame deposits in the host information corresponding with this public network IP address.
Step 204, by the host MAC address number of same public network IP address correspondence in the statistics host information storage list, obtain to share and insert number of host;
Concrete, those skilled in the art can know, because same main frame can have the polylith network interface card, therefore in statistic processes, the MAC Address with same hostname are not repeated statistics.
Step 205, this access request message is redirected to destination address.
In order not influence the normal online activity of this main frame, can be when main frame sends the host information querying command, the accessing request information of this main frame is sent to the WEB server, be about to request message and be redirected to the purpose network address, still can carry out normal access to netwoks activity to guarantee main frame.
Be understandable that, those skilled in the art can know, in specific implementation process, in step 203, also the host information that all receives all can be stored and be in the host information storage list, and in step 204, identical MAC Address is not repeated statistics during the shared access of statistics number of host, and the MAC Address with same hostname is not repeated statistics yet, by the number of host in the MAC Address number acquisition share of access network of statistics.
The method that inserts number of host is shared in the detection that present embodiment provides, by intercepting the access request message that main frame in the share of access network sends to server, triggering is shared to this and is inserted the host query host information, include MAC Address and host name in this host information, and mac address information and host name information in the host information that this main frame is returned are recorded in the default host information storage list, the back is added up the MAC Address number under the same public network IP address in the host information storage list according to the uniqueness of MAC Address, obtains the shared access number of host of this public network IP address correspondence.This method testing process is simple, efficient is high, has improved to detect and has shared the accuracy that inserts number of host, thereby helped managing sharing the access main frame.
It is prerequisite that the shared method that inserts the number of main frame of the detection that above present embodiment provides all has network activity with shared access main frame, and because the shared purpose that inserts the number of main frame of detection is in order to be convenient to manage when the equipment that inserts on main frame and the public network communicates when sharing, therefore, embodiment provided by the invention can detect the number of host that has network activity in the share of access network exactly.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The structural representation of device first embodiment that inserts number of host is shared in the detection that Fig. 3 provides for the embodiment of the invention, and as shown in Figure 3, this device comprises acquisition module 1, host information enquiry module 2 and processing module 3; Wherein:
Acquisition module 1 is used for obtaining the access request message that the share of access network main frame sends;
Concrete, when main frame in the acquisition module 1 monitoring share of access network during to access request message that the WEB server sends, before arriving server, intercepts and captures this request message this request message, this request message can adopt the mode (the GET message is a requesting method commonly used in the HTTP request) of GET message, also can adopt the mode of other messages.Include the purpose network address that this main frame will be visited in the described access request message.
Host information enquiry module 2 is used for according to access request message to the host query host information;
Concrete, host information enquiry module 2 can send a packet that comprises 200 OK data and a JavaScript shell script to the main frame that sends this message, the effect of this packet is that the imitation purpose is landed network address and this main frame is shaken hands, the effect of described JavaScript shell script is to this host query host information, require this main frame to return the host information that comprises specific identifier, and can make the main frame that receives this packet return host information automatically, this specific identifier can be certain hardware identifier (as MAC Address) of every main frame etc.
Processing module 3 is used for the host information that returns according to the main frame that receives, obtains the number of host in the share of access network, includes the specific identifier of described main frame in the host information.
Concrete, owing to include the specific identifier of this main frame in the host information that every main frame returns, can distinguish different main frames according to these host informations with specific identifier, therefore, processing module 3 can obtain the number of host in the share of access network by the number of the specific identifier in the statistics host information.
The device that inserts number of host is shared in the detection that present embodiment provides, by detecting the access request message that main frame in the share of access network sends to server, the host information that inserts main frame is shared in inquiry, thereby judges the shared number of host that inserts according to the host information that returns.This method testing process is simple, efficient is high, testing result accuracy height, thus help managing to sharing the access main frame.
The structural representation of device second embodiment that inserts number of host is shared in the detection that Fig. 4 provides for the embodiment of the invention, and as shown in Figure 4, this device comprises acquisition module 1, host information enquiry module 2, processing module 3 and redirection module 4.Wherein:
Acquisition module 1 is used for obtaining the access request message that the share of access network main frame sends;
Concrete, when acquisition module 1 monitors main frame in the share of access network to online request message that the WEB server sends, before arriving server, intercepts and captures this request message this request message, this request message can adopt the mode (the GET message is a requesting method commonly used in the HTTP request) of GET message, also can adopt the mode of other messages.The purpose network address that will visit that comprises this main frame in the described access request message.
Host information enquiry module 2 is used for according to described access request message to described host query host information;
Concrete, host information enquiry module 2 can send a packet that comprises 200OK data and a JavaScript shell script to the main frame that sends this message, the effect of this packet is that the imitation purpose is landed network address and this main frame is shaken hands, the effect of described JavaScript shell script is to this host query host information, require this main frame to return the host information that comprises specific identifier, and can make the main frame that receives this packet return host information automatically, this specific identifier can be certain hardware identifier (as MAC Address) of every main frame etc.
Processing module 3 is used for the host information that returns according to the main frame that receives, obtains the number of host in the share of access network, includes the MAC Address and the host name of main frame in the host information;
Wherein, MAC Address is the Media Access Control address of this main frame, because the MAC Address that different network interface cards is corresponding different, and MAC Address is unrepeatable, even change MAC Address by revising registration table, value after the change also is unique, and the MAC Address of other main frames in every main frame and the share of access network is all inequality.Therefore, can use MAC Address to distinguish different main frames.
Owing to include the MAC Address of this main frame in the host information that every main frame returns, therefore can distinguish different main frames according to MAC Address, therefore, processing module 3 can obtain the number of host in the share of access network by the number of the MAC Address in the statistics host information.
Redirection module 4 is used for the access request message that acquisition module 1 obtains is redirected to destination address.
In order not influence the normal online activity of this main frame, redirection module 4 is sent to the WEB server with the solicited message of this main frame, promptly is redirected to the purpose network address of this host access.
Further, processing module 3 can comprise: receiving element 31, memory cell 32 and statistic unit 33, wherein:
Receiving element 31 is used to receive the host information that main frame returns, and includes the host name and the MAC Address of main frame in the host information;
Memory cell 32 is used for the host information that receiving element 31 receives is stored to default host information storage list, comprises public network IP address information, host name information and host MAC address information in the host information storage list;
Concrete, memory cell 32 is in the process that host information is stored, can judge earlier and whether have this host information public network IP addresses corresponding in the host information storage list, if do not exist, then in this host information storage list, create this public network IP address recorded information, and the host name and the MAC Address of this main frame is stored in the host information of this IP address correspondence; If exist, then further judge whether to exist and whether had this host MAC address in the host MAC address information corresponding with this public network IP address, if exist, the host information that received this main frame is described, then current this host information of receiving is abandoned, if there is not this host MAC address, then host name and the MAC Address with this main frame deposits in the host information corresponding with this public network IP address.
Statistic unit 33 is used for obtaining the number of host in the share of access network by the host MAC address number under the same public network IP address of statistics host information storage list.
Concrete, those skilled in the art can know, because same main frame can have the polylith network interface card, therefore in statistic processes, the MAC Address with same hostname are not repeated statistics.
Be understandable that, those skilled in the art can know, in specific implementation process, memory cell 32 also can all be stored the host information that all receives and is in the IP address recorded information corresponding in the host information storage list, and when statistic unit 33 is added up, can identical MAC Address not repeated statistics, and the MAC Address with same hostname is not repeated statistics yet, by the number of host in the MAC Address number acquisition share of access network of this statistics.
The device that inserts number of host is shared in the detection that present embodiment provides, by detecting the access request message that main frame in the share of access network sends to server, the host information that inserts main frame is shared in inquiry, comprise host MAC address and host name in this host information, and the mac address information in the host information that this main frame is returned and host name information record are stored in the default host information storage list, the back is added up the MAC Address number under the same public network IP address in the host information storage list according to the uniqueness of MAC Address, obtains the shared access number of host of this public network IP address correspondence.This method testing process is simple, efficient is high, has improved to detect and has shared the accurate height that inserts number of host, thereby helped managing sharing the access main frame.
The structural representation of first embodiment of network measuring system that Fig. 5 provides for the embodiment of the invention, as shown in Figure 5, this system comprises: detect and share device 51 and the restriction access device 52 that inserts number of host; Wherein, device 51 concrete structures of the shared access of detection number of host and the course of work repeat no more referring to aforementioned means embodiment; Restriction access device 52 is used for when shared access number of host that the device 51 that detect to share inserts number of host is detected exceeds threshold range, the main frame that exceeds threshold range is limited insert processing.
In share of access network, usually the number that needs butt joint to go into main frame detects, so that it is more abundant, utilize shared network resource efficiently and be convenient to each main frame in the share of access network is managed, detect the access request message that main frame in the share of access network sends to the WEB server by detecting the device 51 that share to insert number of host, trigger the shared main frame that inserts and return host information, thereby can judge according to the host information that returns and share the number of host that inserts, when number of host has exceeded share of access network and has held the threshold range of main frame, when promptly having exceeded the maximum of the shared access number of host that this public network IP address allowed, the main frame that adopts 52 pairs of access devices of restriction to exceed threshold range limits to insert and handles, wherein, described restriction inserts processing can be for pushing alarming page to the main frame that exceeds threshold range, also can be for the main frame that exceeds threshold range is directly disturbed, the break mode of its connection request, can also be for the main frame that exceeds threshold range being pushed advertising message or to the main frame that exceeds threshold range processing mode such as charge, and be not limited to above-mentioned restriction and insert processing mode.
The network measuring system that present embodiment provides, share the number of host that the device that inserts number of host detects shared access by detecting, when number of host exceeds threshold range, off-limits main frame is limited access and handle, thereby help managing sharing the access main frame.Testing process is simple, efficient is high and accuracy is high.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.