The content of the invention
Object of the present invention is to provide client loading method and device, solves in correlation technique in network bandwidthLimited or a large number of users is reached the standard grade simultaneously in the case that user averagely reach the standard grade the stand-by period it is long the problem of.
According to an aspect of the present invention, there is provided a kind of client loading method, including:Receive DHCPDHCP reaches the standard grade request message, wherein, DHCP request messages of reaching the standard grade are sent by multiple client;Set according to preset rulesPriority, wherein, the preset rules include request on-line time rule and/or ask number rule of reaching the standard grade;According to priority pairDHCP clients corresponding to request message of reaching the standard grade are reached the standard grade.
Further, the DHCP received in first time request messages of reaching the standard grade are reached the standard grade in the case of failure, and receiving again shouldDHCP reaches the standard grade request message, and this sets the reach the standard grade priority of request message of the DHCP to include according to preset rules:
If the preset rules are request on-line time rule, reached the standard grade request message and the according to the DHCP being currently receivedThe reach the standard grade first time differences of request message of the DHCP once received set the DHCP that is currently received to reach the standard grade request messagePriority, wherein, the big priority of the first time difference is high;Or
Reached the standard grade number rule if the preset rules are request, reach the standard grade the of request message according to the DHCP being currently receivedOne accumulative request number of times sets the DHCP being currently received to reach the standard grade the priority of request message, wherein, the first accumulative requestPriority often is high;Or
If the preset rules for request on-line time rule and request reach the standard grade number rule, according to be currently received shouldThe first time difference of request message that DHCP reaches the standard grade request message and the DHCP that receives for the first time reaches the standard grade, and be currently receivedReach the standard grade the first accumulative request number of times of request message of the DHCP set the DHCP being currently received to reach the standard grade the excellent of request messageFirst level, wherein, priority of the first time difference greatly and more than the first accumulative request number of times is high.
Further, the DHCP that the basis is currently received reach the standard grade request message and for the first time receive the DHCP reach the standard gradeThe first time difference of request message sets the reach the standard grade priority of request message of the DHCP being currently received to include:
Judge that the DHCP that is currently received reaches the standard grade request message and the DHCP that receives for the first time reaches the standard grade request messageWhether first time difference is more than or equal to very first time threshold value;In the case where the judgment result is yes, setting is currently receivedDHCP request messages of reaching the standard grade be high priority;In the case where judged result is no, the DHCP being currently received is setRequest message of reaching the standard grade is low priority;
Reach the standard grade the first accumulative request number of times of request message of the DHCP that the basis is currently received sets and is currently receivedThe reach the standard grade priority of request message of the DHCP include:Judge that the DHCP that is currently received reaches the standard grade the first accumulative of request messageWhether request number of times is more than or equal to the first frequency threshold value;In the case where the judgment result is yes, set what is be currently received to be somebody's turn to doDHCP request messages of reaching the standard grade are high priority;In the case where judged result is no, the DHCP being currently received is set to reach the standard gradeRequest message is low priority;
The DHCP that the basis is currently received reaches the standard grade request message and the DHCP that receives for the first time reaches the standard grade request messageFirst time difference, and reach the standard grade the first accumulative request number of times of request message of the DHCP being currently received sets this currentThe reach the standard grade priority of request message of DHCP includes:The DHCP for judging to be currently received reaches the standard grade what request message received with first timeWhether the reach the standard grade time differences of request message of the DHCP are more than or equal to very first time threshold value, and on the DHCP being currently receivedWhether the request of line request message number of reaching the standard grade is more than or equal to the first frequency threshold value;In the case where judged result is all to be,It is high priority to set the DHCP that is currently received request message of reaching the standard grade;In the case where judged result is all no, sets and work asBefore the DHCP that receives request message of reaching the standard grade be low priority.
Further, the very first time threshold value is less than the maximum tolerance stand-by period, or to reach needed for predetermined cumulative numberTime.
Further, the client is reached the standard grade according to priority including:Establish two queues;Included according to queueThe reach the standard grade priority of request message of the DHCP handle two queues successively, the client is reached the standard grade.
Further, this set according to preset rules the DHCP reach the standard grade request message priority before, this method is alsoIncluding:In the case of the casual user's entry for request message of being reached the standard grade in the absence of type of message for DHCP, generation type of message isDHCP reaches the standard grade casual user's entry of request message, and records casual user's items for information, wherein, casual user's items for informationIncluding:Type of message, priority and the DHCP that receives for the first time reach the standard grade reception time of request message, or, message classType, priority and the DHCP that is currently received reach the standard grade the first accumulative request number of times of request message, or, type of message,Priority, the DHCP received for the first time reach the standard grade the receptions time of request message and the DHCP that is currently received reaches the standard grade and askedSeek the first accumulative request number of times of message;In the case of existing casual user's entry, casual user's items for information is updated.
Further, the dynamic host configuration protocol DHCP that the reception client is sent is reached the standard grade before request message, the partyMethod also includes:Find that message sends the dhcp response message of carrying client ip address according to the DHCP received, wherein, the visitorFamily end IP address is used to the client and sends DHCP to the server reaching the standard grade request message.
Further, the DHCP that the basis receives has found that message sends the dhcp response message for carrying client ip addressIncluding:The priority of DHCP discovery messages is set according to preset rules, wherein, the preset rules include acquisition request IP addressTime rule and/or acquisition request IP address number rule;The DHCP of the carrying client ip address is sent according to the priorityResponse message.
Further, in the case where the DHCP that first time receives has found that message does not get IP address, receive againDHCP has found message, sets the DHCP to find that the priority of message includes according to preset rules:
If the preset rules are acquisition request IP address time rule, according to the DHCP that is currently received find message andThe DHCP received for the first time has found that the second time difference of message sets the DHCP being currently received to find the preferential of messageLevel, wherein, the big priority of second time difference is high;Or
If the preset rules are acquisition request IP address number rule, message is found according to the DHCP being currently receivedSecond accumulative request number of times sets the priority for the DHCP discovery messages being currently received, wherein, the second accumulative request timeThe more priority of number is high;
If the preset rules include acquisition request IP address time rule and acquisition request IP address number rule, according to work asBefore the DHCP that receives find that message and the DHCP received for the first time have found the second time difference of message, and currently connectThe DHCP received has found the priority that the second accumulative request number of times of message sets the DHCP being currently received to find message,Wherein, priority of second time difference greatly and more than the second accumulative request number of times is high.
Further, the DHCP that the basis is currently received has found that message and the DHCP received for the first time have found messageThe second time difference set the DHCP that is currently received to find that the priority of message includes:Judge to be currently received is somebody's turn to doDHCP has found that message and the DHCP received for the first time have found whether the second time difference of message was more than or equal to for the second timeThreshold value;In the case where the judgment result is yes, the DHCP being currently received is set to find that message is high priority;Judging to tieIn the case that fruit is no, the DHCP being currently received is set to find that message is low priority;Or
The DHCP that the basis is currently received has found that the second accumulative request number of times of message sets what is be currently received to be somebody's turn to doDHCP has found that the priority of message includes:The DHCP for judging to be currently received has found whether the second of message add up request number of timesMore than or equal to the second frequency threshold value;In the case where the judgment result is yes, the DHCP being currently received is set to find messageFor high priority;In the case where judged result is no, the DHCP being currently received is set to find that message is low priority;Or
When the DHCP that the basis is currently received has found that message and the DHCP received for the first time have found the second of messageBetween difference, and the DHCP that is currently received has found that the second accumulative request number of times of message sets the DHCP being currently receivedIt was found that the priority of message includes:The DHCP for judging to be currently received has found that message and the DHCP received for the first time have found reportWhether the second time difference of text is more than or equal to the second time threshold, and the DHCP being currently received has found the second of messageWhether accumulative request number of times is more than or equal to the second frequency threshold value;In the case where judged result is all to be, current receive is setThe DHCP arrived has found that message is high priority;In the case where judged result is all no, the DHCP being currently received is setIt was found that message is low priority.
According to another aspect of the present invention, there is provided a kind of client eedle threader, including:Receiving module, it is dynamic for receivingState host configuration DHCP reaches the standard grade request message, wherein, DHCP request messages of reaching the standard grade are sent by multiple client;IfModule is put, for setting the DHCP to reach the standard grade the priority of request message according to preset rules, wherein, the preset rules include requestOn-line time is regular and/or asks number rule of reaching the standard grade;Upper wire module, for being reached the standard grade according to priority to the DHCP request messageThe corresponding client is reached the standard grade.
Further, the receiving module is additionally operable to reach the standard grade the feelings of failure in the DHCP that first time receives request messages of reaching the standard gradeUnder condition, the DHCP being received again and is reached the standard grade request message, the setup module includes:
First setting unit, should according to what is be currently received if being request on-line time rule for the preset rulesDHCP reach the standard grade request message and for the first time receive the DHCP reach the standard grade request message first time difference set be currently receivedThe DHCP reach the standard grade the priority of request message, wherein, the big priority of first time difference is high;Or
Second setting unit, if for the preset rules be request reach the standard grade number rule, according to be currently received shouldReach the standard grade the first accumulative request number of times of request message of DHCP sets the DHCP being currently received to reach the standard grade the priority of request message,Wherein, the priority more than the first accumulative request number of times is high;Or
3rd setting unit, if for the preset rules for request on-line time rule and request reach the standard grade number rule, rootAccording to the DHCP being currently received reach the standard grade request message and for the first time receive the DHCP reach the standard grade request message the very first time it is poorValue, and reach the standard grade the first accumulative request number of times of request message of the DHCP being currently received set the DHCP being currently receivedReach the standard grade the priority of request message, wherein, first time difference is big and the first accumulative request number of times more than priority it is high.
Further, first setting unit includes:First judgment sub-unit, for the DHCP for judging to be currently receivedReach the standard grade request message and for the first time receive the DHCP reach the standard grade request message first time difference whether be more than or equal to firstTime threshold;First sets subelement:For in the case where the judgment result is yes, setting the DHCP being currently received to reach the standard gradeRequest message is high priority;In judged result in the case of no, to set the DHCP being currently received to reach the standard grade request messageFor low priority;
Second setting unit includes:Second judgment sub-unit, for judging that the DHCP that is currently received reaches the standard grade requestWhether the accumulative request number of times of the first of message is more than or equal to the first frequency threshold value;Second sets subelement, for judging to tieFruit is high priority in the case of being, to set the DHCP being currently received request messages of reaching the standard grade;It is no in judged resultIn the case of, it is low priority to set the DHCP being currently received request messages of reaching the standard grade;
3rd setting unit includes:3rd judgment sub-unit, for judging that the DHCP that is currently received reaches the standard grade requestWhether the reach the standard grade time difference of request message of message and the DHCP received for the first time is more than or equal to very first time threshold value, and oughtBefore the reach the standard grade request number of reaching the standard grade of request message of the DHCP that receives whether be more than or equal to the first frequency threshold value;3rd is setSubelement, for all in the case of being, to set the DHCP being currently received request messages of reaching the standard grade being Gao You in judged resultFirst level;All in the case of no, to set the DHCP being currently received request messages of reaching the standard grade it is low priority in judged result.
Further, the device also includes:Sending module, visitor is carried for finding that message is sent according to the DHCP receivedThe dhcp response message of family end IP address, wherein, the client ip address is used for the client and sends DHCP to the serverLine request message.
By the present invention, priority is set and according to priority pair using message of being reached the standard grade according to preset rules to DHCP requestThe technical scheme that client is reached the standard grade, solve in correlation technique network bandwidth is limited or a large number of users while reaches the standard gradeIn the case of user averagely reach the standard grade the stand-by period it is long the problem of, shorten user averagely reach the standard grade the stand-by period.
Embodiment
Describe the present invention in detail below with reference to accompanying drawing and in conjunction with the embodiments.It should be noted that do not conflictingIn the case of, the feature in embodiment and embodiment in the application can be mutually combined.
A kind of client loading method, apparatus and system are provided in the present embodiment, and Fig. 2 is according to embodiments of the present inventionClient loading method flow chart one, as shown in Fig. 2 the flow comprises the following steps:
Step S202, receive dynamic host configuration protocol DHCP and reach the standard grade request message, wherein, the DHCP reaches the standard grade request messageIt is to be sent by multiple client;
Need the user end to server reached the standard grade to broadcast DHCP to reach the standard grade request message.
Step S204, the DHCP is set to reach the standard grade the priority of request message according to preset rules, wherein, the preset rules bagInclude request on-line time rule and/or ask number rule of reaching the standard grade;
In the case where above-mentioned preset rules are above-mentioned request on-line time rule, according on the DHCP being currently receivedLine request message and the DHCP received for the first time reach the standard grade request message first time difference set that this is currently received shouldDHCP reaches the standard grade the priority of request message, wherein, the big priority of first time difference is high.
A kind of feasible embodiment is, when receiving DHCP request messages, judge in casual user's table whetherIn the presence of the MAC of the client, if in the absence of the MAC of the client, the casual user's entry for corresponding to client mac is generated,Three fields are added in casual user's entry:Type of message, time, priority are received for the first time.Client receives for the first timeAfter DHCP request messages, these three fields are write in corresponding casual user's entry, type of message is " request ",Low priority, and obtain by way of reading system time point the DHCP received for the first time and reach the standard grade the time point A of request message.
In the case of the MAC that the client be present, judge whether the type of message in casual user's entry is DHCPReach the standard grade request message, if it is not, the type of message in corresponding casual user's entry is updated into " request ", update simultaneouslyDHCP request messages receive time field for the first time, labeled as low priority.
In the case of client is not reached the standard grade successfully for the first time, DHCP request messages are retransmitted, the client be presentThe MAC at end, and the type of message in casual user's entry is that DHCP reaches the standard grade in the case of request message, is currently connect by obtainingThe reach the standard grade modes of system time point of request message of the DHCP received obtain the DHCP being currently received and reached the standard grade request messageTime point B, by calculate the DHCP that is currently received reach the standard grade request message time point B and the DHCP that receives for the first time onThe time point A of line request message first time difference sets priority, the big priority height of time difference.
One kind is preferably carried out mode, pre-sets very first time threshold value, judge first time difference whether be more than orEqual to very first time threshold value, in the case where the judgment result is yes, namely first time difference is more than or equal to very first time thresholdIn the case of value, set the DHCP being currently received reach the standard grade request message priority for height;In the feelings that judged result is noUnder condition, namely first time difference be less than very first time threshold value in the case of, set the DHCP being currently received reach the standard grade request reportThe priority of text is low.
Very first time threshold value could be arranged to the arbitrary value no more than casual user's entry ageing term.Preferably, firstTime threshold set can from user's maximum tolerance stand-by period and client attempt to reach the standard grade n times stand-by period two in terms of examineConsider.
For example, user's maximum tolerance stand-by period is 5s, i.e. all users of network requirement can reach the standard grade in 5s, threshold value4s is could be arranged to, so as to which high priority processing can be obtained more than the client that 4s does not reach the standard grade.For another example user automatically attempts toThe time interval of line is 3s, and it is N*3s that the stand-by period that n times are attempted to reach the standard grade, which occurs, N*3s is set a threshold to, so as to attempt n timesThe trial next time for the user all not reached the standard grade, which is reached the standard grade, can obtain high priority processing.Further, very first time threshold value is smaller, effectFruit is better, can consider the stand-by period that user's maximum tolerance stand-by period and client are attempted to reach the standard grade when reaching n times, takeThe two smaller value is as threshold values.
In the case where above-mentioned preset rules reach the standard grade number rule for above-mentioned request, according on the DHCP being currently receivedFirst accumulative request number of times of line request message sets the DHCP being currently received to reach the standard grade the priority of request message, wherein,Priority more than first accumulative request number of times is high.So-called first accumulative request number of times refer to that the server receives from sameThe DHCP of one client reaches the standard grade the number of request message.
A kind of feasible embodiment is, when receiving DHCP request messages, judge in casual user's table whetherIn the presence of the MAC of the client, if in the absence of the MAC of the client, the casual user's entry for corresponding to client mac is generated,Three fields are added in casual user's entry:Type of message, the first accumulative request number of times, priority.Client is received for the first timeTo after DHCP request messages, these three fields are write in corresponding casual user's entry, type of message is" request ", priority are low, and it is 1 to record the first accumulative request number of times.
In the case of the MAC that the client be present, judge whether the type of message in casual user's entry is DHCPReach the standard grade request message, if it is not, the type of message in corresponding casual user's entry is updated into " request ", initialize simultaneouslyFirst accumulative request number of times, is set to 1, labeled as low priority.
In the case of client is not reached the standard grade successfully for the first time, client retransmits DHCP request messages, existsThe MAC of the client, and the type of message in casual user's entry is that DHCP reaches the standard grade in the case of request message, obtains firstAccumulative request number of times sets priority after adding 1, first adds up the priority height more than request number of times.
A kind of preferred embodiment is to pre-set the first frequency threshold value, judges whether the first accumulative request number of times is more thanOr equal to threshold value, in the case where the judgment result is yes, namely the first accumulative request number of times is more than or equal to the first frequency threshold valueIn the case of, set the DHCP being currently received reach the standard grade request message priority for height;In the situation that judged result is noUnder, namely in the case that the first accumulative request number of times is less than the first frequency threshold value, set the DHCP being currently received to reach the standard grade requestThe priority of message is low.
It is that above-mentioned request on-line time rule and request are reached the standard grade in the case of number rule in above-mentioned preset rules, according to working asBefore the DHCP that receives reach the standard grade request message and the DHCP that receives for the first time reaches the standard grade the first time difference of request message, withAnd the DHCP being currently received reach the standard grade request message the first accumulative request number of times set this to be currently received the DHCP onThe priority of line request message, wherein, priority of the first time difference greatly and more than the first accumulative request number of times is high.
A kind of feasible embodiment is, when receiving DHCP request messages, judge in casual user's table whetherIn the presence of the MAC of the client, if in the absence of the MAC of the client, the casual user's entry for corresponding to client mac is generated,Three fields are added in casual user's entry:Type of message, time, the first accumulative request number of times, priority are received for the first time.After client receives DHCP request messages for the first time, these three fields, message are write in corresponding casual user's entryType is " request ", low priority, and obtain that the DHCP received for the first time reaches the standard grade by way of reading system time point pleaseThe time point A of message is sought, the accumulative request number of times of record first is 1.
In the case of the MAC that the client be present, judge whether the type of message in casual user's entry is DHCPReach the standard grade request message, if it is not, the type of message in corresponding casual user's entry is updated into " request ", initialize simultaneouslyFirst accumulative request number of times, is set to 1, and labeled as low priority, renewal DHCP request messages receive the time for the first timeField.
In the case of client is not reached the standard grade successfully for the first time, DHCP request messages are retransmitted, the client be presentThe MAC at end, and the type of message in casual user's entry is that DHCP reaches the standard grade in the case of request message, is currently connect by obtainingThe reach the standard grade modes of system time point of request message of the DHCP received obtain the DHCP being currently received and reached the standard grade request messageTime point B, obtain the DHCP being currently received reach the standard grade request message time point B with for the first time receive DHCP reach the standard grade pleaseThe time point A of message first time difference is sought, and updates the first accumulative request number of times, it is tired according to first time difference and firstRequest number of times setting priority is counted, priority of the first time difference greatly and more than the first accumulative request number of times is high.
One kind is preferably carried out mode, pre-sets very first time threshold value and the first frequency threshold value, judges the very first timeWhether difference is more than or equal to very first time threshold value, and whether the first accumulative request number of times is more than or equal to the first frequency threshold value,In the case where judged result is all to be, namely first time difference is more than or equal to very first time threshold value and the first accumulative requestIn the case that number is more than or equal to the first frequency threshold value, the DHCP being currently received is set to reach the standard grade the priority of request messageFor height;In the case where judged result is all no, namely first time difference is less than very first time threshold value and the first accumulative requestIn the case that number is less than the first frequency threshold value, set the DHCP being currently received reach the standard grade request message priority to be low.
Similarly, very first time threshold value could be arranged to the arbitrary value no more than casual user's entry ageing term.It is preferred thatGround, the stand-by period that the n times that can be reached the standard grade from user's maximum tolerance stand-by period and client trial are set of very first time threshold valueFrom the aspect of two.
Further, it is less than very first time threshold value in first time difference and the first accumulative request number of times is more than or equal to theIn the case of one frequency threshold value, or it is more than or equal to very first time threshold value in first time difference and the first accumulative request number of times is smallIn the case of the first frequency threshold value, the reach the standard grade priority of request message of the DHCP that is currently received is set to be.
Step S206, client corresponding to request message of being reached the standard grade according to priority to the DHCP are reached the standard grade.
Establish at least two queues, each queue includes priority identical DHCP and reached the standard grade request message, according to queueThe reach the standard grade priority of request message of the DHCP included performs at least two queue successively, and the place that reaches the standard grade is carried out to the clientReason.It is so-called to perform at least two queue successively and refer to, including high priority DHCP reach the standard grade request message queue in also haveDHCP reach the standard grade client corresponding to request message do not reach the standard grade successfully in the case of, do not perform the DHCP including low priority reach the standard grade pleaseThe queue of message is asked, namely during processing priority is not or priority is that low DHCP reaches the standard grade request message, so as to ensure basisPriority client corresponding to request message of being reached the standard grade to DHCP is reached the standard grade.
A kind of optional embodiment is that the DHCP that the server is sent according to the client received has found that message is sentThe dhcp response message of IP address is carried, wherein, the IP address is used to the client and sends DHCP to the server reaching the standard grade requestMessage.In the case where the DHCP that first time receives has found that message does not get IP address, receive what client retransmitted againDHCP has found message.Client, which receives, to be sent DHCP to server after the dhcp response message and reaches the standard grade request message.
Specifically, DHCP has found that message carries the MAC information of the client, server is according to MAC message identification usersInquire about local casual user's table.In the case of this MAC is not present in casual user's table, casual user's entry is generated.Above-mentioned IPAddress can include the IP address of client and the IP address of server, to cause user end to server request to reach the standard grade.
, please not yet receiving that DHCP reaches the standard grade more than ageing term it is noted that the MAC information has ageing termIn the case of seeking message, the MAC information of relative client is aging in casual user's table.The DHCP reach the standard grade request message detectionCorresponding MAC information is not present into casual user's table, generates casual user's entry.
Preferably, find that message sends the dhcp response message for carrying IP address including according to pre- according to the DHCP receivedIf the rule setting DHCP has found the priority of message, and the dhcp response message of the carrying IP address is sent according to priority.Wherein, the preset rules include request on-line time rule and/or ask number rule of reaching the standard grade.
In the case where the preset rules are acquisition request IP address time rule, sent out according to the DHCP being currently receivedExisting message and the DHCP received for the first time have found that the second time difference of message sets the DHCP being currently received to find reportThe priority of text, wherein, the big priority of the second time difference is high.
A kind of feasible embodiment is, when receiving DHCP discover messages, judge in casual user's table whetherIn the presence of the MAC of the client, if in the absence of the MAC of the client, the casual user's entry for corresponding to client mac is generated,Three fields are added in casual user's entry:Type of message, time, priority are received for the first time.Client receives for the first timeAfter DHCP discover messages, these three fields are write in corresponding casual user's entry, type of message is" discover ", low priority, and the DHCP received for the first time is obtained by way of reading system time point and finds messageTime point A.
In the case of the MAC that the client be present, judge whether the type of message in casual user's entry is DHCPIt was found that message, if it is not, the type of message in corresponding casual user's entry is updated into " discover ", while updates DHCPDiscover messages receive time field for the first time, labeled as low priority.
In the case that client obtains IP address failure for the first time, DHCP request messages are retransmitted, the visitor be presentType of message in the MAC at family end and casual user's entry is in the case that DHCP has found message, passes through and obtains current receiveTo the DHCP find that the mode of the system time point of message obtains the time point B that the DHCP that is currently received has found message,The DHCP being currently received by calculating has found that the time point B and DHCP received for the first time of message has found the time point of messageA the second time difference sets priority, the big priority height of time difference.
One kind is preferably carried out mode, pre-sets the second time threshold, judge the second time difference whether be more than orEqual to the second time threshold, in the case where the judgment result is yes, namely the second time difference is more than or equal to the second time thresholdIn the case of value, the DHCP being currently received is set to find that the priority of message is height;In the case where judged result is no,Namely second time difference be less than the second time threshold in the case of, set the DHCP that is currently received to find the priority of messageTo be low.
Second time threshold could be arranged to the arbitrary value no more than casual user's entry ageing term.Preferably, secondSetting for time threshold can be attempted to obtain the stand-by period two of IP address n times from user's maximum tolerance stand-by period and clientFrom the aspect of.
For example, user's maximum tolerance stand-by period is 5s, i.e., all users of network requirement can with obtaining IP in 5sLocation, threshold value could be arranged to 4s, and high priority processing can be obtained so as to not get the client of IP address more than 4s.Example againSuch as, the time interval that user automatically attempts to obtain IP address is 3s, and it is N* that the stand-by period that n times are attempted to obtain IP address, which occurs,3s, N*3s is set a threshold to, IP address meeting is obtained so as to attempt the trial next time for the user that n times all do not get IP addressObtain high priority processing.Further, the second time threshold is smaller, and effect is better, can consider user's maximum toleranceStand-by period and client are attempted to obtain stand-by period when IP address reaches n times, take the two smaller value as threshold values.
In the case where the preset rules are acquisition request IP address number rule, sent out according to the DHCP being currently receivedSecond accumulative request number of times of existing message sets the priority of current DHCP discoveries message, wherein, the second accumulative request number of timesMore priority is high.
A kind of feasible embodiment is, when receiving DHCP discover messages, judge in casual user's table whetherIn the presence of the MAC of the client, if in the absence of the MAC of the client, the casual user's entry for corresponding to client mac is generated,Three fields are added in casual user's entry:Type of message, the second accumulative request number of times, priority.Client is received for the first timeTo after DHCP discover messages, these three fields are write in corresponding casual user's entry, type of message is" discover ", priority are low, and it is 1 to record the second accumulative request number of times.
In the case of the MAC that the client be present, judge whether the type of message in casual user's entry is DHCPIt was found that message, if it is not, the type of message in corresponding casual user's entry is updated to " discover ", while initializes secondAccumulative request number of times, is set to 1, labeled as low priority.
In the case that when client, acquisition IP address is failed for the first time, client retransmits DHCP discover messages,In the presence of the MAC of the client, and the type of message in casual user's entry is in the case that DHCP has found message, to obtain secondAccumulative request number of times sets priority, and second adds up the priority height more than request number of times.
A kind of preferred embodiment is to pre-set the second frequency threshold value, judges whether the second accumulative request number of times is more thanOr equal to threshold value, in the case where the judgment result is yes, namely the second accumulative request number of times is more than or equal to the second frequency threshold valueIn the case of, set the DHCP being currently received to find that the priority of message is height;In the case where judged result is no,In the case that i.e. second accumulative request number of times is less than the second frequency threshold value, the DHCP being currently received is set to find the preferential of messageLevel is low.
Include the situation of acquisition request IP address time rule and acquisition request IP address number rule in the preset rulesUnder, message is found according to the DHCP being currently received and the DHCP of reception has found the second time difference of message for the first time,And the DHCP being currently received has found that the second accumulative request number of times of message sets the current DHCP to find the preferential of messageLevel, wherein, the second time difference is big and the second accumulative request number of times more than preferential transmission.
A kind of feasible embodiment is, when receiving DHCP discover messages, judge in casual user's table whetherIn the presence of the MAC of the client, if in the absence of the MAC of the client, the casual user's entry for corresponding to client mac is generated,Four fields are added in casual user's entry:Type of message, time, the second accumulative request number of times, priority are received for the first time.After client receives DHCP discover messages for the first time, this four fields are write in corresponding casual user's entry:MessageType is " discover ", low priority, and the DHCP received for the first time is obtained by way of reading system time point and is foundThe time point A of message, the accumulative request number of times of record second is 1.
In the case of the MAC that the client be present, judge whether the type of message in casual user's entry is DHCPIt was found that message, if it is not, the type of message in corresponding casual user's entry is updated to " discover ", while initializes secondAccumulative request number of times, is set to 1, and labeled as low priority, renewal DHCP discover messages receive time word for the first timeSection.
In the case that acquisition IP address is failed for the first time when client, DHCP discover messages are retransmitted, should existingThe MAC of client, and the type of message in casual user's entry is in the case that DHCP has found message, currently to be connect by obtainingThe DHCP received has found that the mode of the system time point of message obtains the time point that the DHCP being currently received has found messageB, obtain the DHCP being currently received and find that the time point B and DHCP received for the first time of message has found the time point A of messageThe second time difference, and update the second accumulative request number of times, set according to the second time difference and the second accumulative request number of timesPriority, priority of second time difference greatly and more than the second accumulative request number of times are high.
One kind is preferably carried out mode, pre-sets the second time threshold and the second frequency threshold value, judges for the second timeWhether difference is more than or equal to the second time threshold, and whether the second accumulative request number of times is more than or equal to the second frequency threshold value,In the case where judged result is all to be, namely the second time difference is more than or equal to the second time threshold and the second accumulative requestIn the case that number is more than or equal to the second frequency threshold value, the DHCP being currently received is set to find that the priority of message isIt is high;In the case where judged result is all no, namely the second time difference is less than the second time threshold and the second accumulative request timeIn the case that number is less than the second frequency threshold value, the DHCP being currently received is set to find that the priority of message is low.
Similarly, the second time threshold could be arranged to the arbitrary value no more than casual user's entry ageing term.It is preferred thatGround, the setting of the second time threshold can attempt to obtain from user's maximum tolerance stand-by period and client IP address n times etc.From the aspect for the treatment of the time two.
Further, it is less than the second time threshold in the second time difference and the second accumulative request number of times is more than or equal to theIn the case of two frequency threshold values, or it is more than or equal to the second time threshold in the second time difference and the second accumulative request number of times is smallIn the case of the second frequency threshold value, set during the DHCP that is currently received has found that the priority of message is.
By above-mentioned steps, solve in correlation technique network bandwidth is limited or a large number of users while situation about reaching the standard gradeLower user averagely reach the standard grade the stand-by period it is long the problem of, shorten user averagely reach the standard grade the stand-by period.
Fig. 3 is the structured flowchart of client eedle threader according to embodiments of the present invention, as shown in figure 3, the device includes:
Receiving module 32, reached the standard grade request message for receiving dynamic host configuration protocol DHCP, wherein, the DHCP reaches the standard grade pleaseSeeking message is sent by multiple client;
Setup module 34, for setting the DHCP to reach the standard grade the priority of request message according to preset rules, wherein, this is defaultRule includes request on-line time rule and/or asks number rule of reaching the standard grade;
Upper wire module 36, for being reached the standard grade according to priority to the client.
Fig. 4 is the structured flowchart one of client eedle threader according to the preferred embodiment of the invention, as shown in figure 4, this connectsReceive module 32 to be additionally operable to reach the standard grade in the case of failure in the DHCP that first time receives request messages of reaching the standard grade, receive the DHCP againReach the standard grade request message, the setup module 34 includes:
First setting unit 42, should according to what is be currently received if being request on-line time rule for the preset rulesDHCP reaches the standard grade request message and the DHCP that receives for the first time reaches the standard grade, and the first time difference of request message sets the current receptionTo the DHCP reach the standard grade the priority of request message, wherein, the big priority of first time difference is high;Or
Second setting unit 44, if for the preset rules be request reach the standard grade number rule, according to be currently received shouldReach the standard grade the first accumulative request number of times of request message of DHCP sets the DHCP being currently received to reach the standard grade the priority of request message,Wherein, the priority more than the first accumulative request number of times is high;Or
3rd setting unit 46, if for the preset rules for request on-line time rule and request reach the standard grade number rule,The DHCP according to being currently received reaches the standard grade request message and the DHCP that receives for the first time reaches the standard grade very first time of request messageDifference, and the DHCP being currently received reach the standard grade request message the first accumulative request number of times set that this is currently received shouldDHCP reaches the standard grade the priority of request message, wherein, first time difference is big and the first accumulative request number of times more than priority it is high.
Fig. 5 is the structured flowchart two of exception handling device according to the preferred embodiment of the invention, as shown in figure 5, this firstSetting unit 42 includes:First judgment sub-unit 51, for judging that the DHCP that is currently received reaches the standard grade request message and firstWhether the reach the standard grade first time differences of request message of the DHCP of secondary reception are more than or equal to very first time threshold value;First sets sonUnit 52:It is Gao You in the case where the judgment result is yes, setting the DHCP being currently received request messages of reaching the standard gradeFirst level;In the case of no, to set the DHCP being currently received request messages of reaching the standard grade it is low priority in judged result;
Second setting unit 44 includes:Second judgment sub-unit 53, the DHCP for judging to be currently received reach the standard gradeWhether the accumulative request number of times of the first of request message is more than or equal to the first frequency threshold value;Second set subelement 54, forJudged result is high priority in the case of being, to set the DHCP being currently received request messages of reaching the standard grade;In judged resultIn the case of no, it is low priority to set the DHCP being currently received request messages of reaching the standard grade;
3rd setting unit 46 includes:3rd judgment sub-unit 55, the DHCP for judging to be currently received reach the standard gradeWhether the reach the standard grade time difference of request message of request message and the DHCP received for the first time is more than or equal to very first time threshold value,And whether the reach the standard grade request numbers of reaching the standard grade of request message of the DHCP being currently received are more than or equal to the first frequency threshold value;3rdSubelement 56 is set, in judged result all in the case of being, to set the DHCP being currently received to reach the standard grade request messageFor high priority;In judged result all in the case of no, to set the DHCP being currently received to reach the standard grade request message to be low excellentFirst level.
Fig. 6 is the structured flowchart three of exception handling device according to the preferred embodiment of the invention, as shown in fig. 6, the clientEnd eedle threader also includes:
Sending module 62, for finding that message sends the dhcp response message of carrying IP address according to the DHCP received,Wherein, the IP address is used to the client and sends DHCP to the server reaching the standard grade request message.
Fig. 7 is that client according to embodiments of the present invention is reached the standard grade the structured flowchart of system, as shown in fig. 7, the device includes:
Client 72, reached the standard grade request message for sending dynamic host configuration protocol DHCP
Server 74, reached the standard grade request message for receiving DHCP, wherein, DHCP request messages of reaching the standard grade are by multiple clientsWhat end was sent;The DHCP is set to reach the standard grade the priority of request message according to preset rules, wherein, the preset rules are included in requestLine time rule and/or request reach the standard grade number rule;The client is reached the standard grade according to priority.
The present invention is further described in conjunction with specific embodiments by taking time rule as an example below.
Fig. 8 is the flow chart that client according to embodiments of the present invention obtains IP address method, as shown in figure 8, the flowComprise the following steps:
Step S802, receive dynamic host configuration protocol DHCP discover and find message;
Step S804, temporary entry corresponding to client mac is judged whether, if the determination result is YES, then perform stepRapid S806;If judged result is no, redirects and perform step S818;
Step S806, judge whether type of message is " discover ", namely find message, if the determination result is YES, thenPerform step S808;If judged result is no, redirects and perform step S820;
Step S808, obtain this system time for receiving discover messages;
Step S810, calculate the difference of this time and record time in casual user's entry that receive message;
Step S812, compare the size of difference and predetermined threshold value, if being more than or equal to threshold value, redirect execution stepS816, step S814 is performed if threshold value is less than;
Step S814, by this casual user's entry marker bit low priority;
Step S816, this casual user's entry is labeled as high priority;
Step S818, casual user's entry is generated, while recorded message type " discover " and message receive time, markIt is designated as low priority;
Step S820, the type of message " discover " in corresponding casual user's entry is updated, while update message receptionTime field, labeled as low priority.
Fig. 9 is the flowchart 2 of client loading method according to embodiments of the present invention, as shown in figure 9, the flow includesFollowing steps:
Step S902, receive DHCP reach the standard grade request DHCP request messages;
Step S904, temporary entry corresponding to client mac is judged whether, if the determination result is YES, then perform stepRapid S906;If judged result is no, redirects and perform step S918;
Step S906, judge whether type of message is " request ", namely request message of reaching the standard grade, if the determination result is YES,Then perform step S908;If judged result is no, redirects and perform step S920;
Step S908, obtain this system time for receiving request messages;
Step S910, calculate the difference of this time and record time in casual user's entry that receive message;
Step S912, compare the size of difference and predetermined threshold value, if being more than or equal to threshold value, redirect execution stepS916, step S914 is performed if threshold value is less than;
Step S914, by this casual user's entry marker bit low priority;
Step S916, this casual user's entry is labeled as high priority;
Step S918, casual user's entry is generated, while recorded message type " request " and message receive time, markIt is designated as low priority;
When step S920, updating the type of message " request " in corresponding casual user's entry, while updating message receptionBetween field, labeled as low priority.
Obviously, those skilled in the art should be understood that above-mentioned each module of the invention or each step can be with generalComputing device realize that they can be concentrated on single computing device, or be distributed in multiple computing devices and formedNetwork on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to they are storedPerformed in the storage device by computing device, and in some cases, can be with different from shown in order execution hereinThe step of going out or describing, they are either fabricated to each integrated circuit modules respectively or by multiple modules in them orStep is fabricated to single integrated circuit module to realize.So, the present invention is not restricted to any specific hardware and software combination.
It should be only above the preferred embodiments of the present invention, be not intended to limit the invention, for the technology of this areaFor personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiiesChange, equivalent substitution, improvement etc., all should be included within protection scope of the present invention.