CN104618394A - Method and device for establishing communication connection between client sides and router - Google Patents
Method and device for establishing communication connection between client sides and router Download PDFInfo
- Publication number
- CN104618394A CN104618394A CN201510091895.9A CN201510091895A CN104618394A CN 104618394 A CN104618394 A CN 104618394A CN 201510091895 A CN201510091895 A CN 201510091895A CN 104618394 A CN104618394 A CN 104618394A
- Authority
- CN
- China
- Prior art keywords
- client
- service source
- cos
- response message
- inquiry message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method and a device for establishing a communication connection between client sides, and a router, and the method, the device and the router are used for simplifying a service inquiry process of the client sides. The method comprises the following steps: receiving an inquiry message from the first client side, wherein the inquiry message carries a service type required by the first client side; determining whether a second client side capable of providing the service type exists in a service resource list or not; if the second client side capable of providing the service type exists, sending a first response message to the first client side in a unicast mode, wherein the first response message carries a first network address of the second client side, so that the first client side establishes the communication connection with the second client side through the first network address. According to the technical scheme adopted by the invention, the response message is replied through the router instead of the second client side, so that the process of establishing the communication connection between the first client side and the second client side is shortened by half and the service inquiry process of the client sides is shortened.
Description
Technical field
The disclosure relates to communication technical field, particularly relates to a kind of method, device and the router that establish a communications link among clients.
Background technology
Use in the local network of Bonjour agreement at one, a lot of thing becomes simple.Such as, when user carries portable computer to corporate office, if user wants by portable computer at company's printed document, because the Printer Information of company is not kept in the portable computer of user, in this case, the portable computer of user can be made to be connected to the printer of company by Bonjour agreement, thus avoid user that the relevant information of printer is manually set on a portable computer, make the operation of user become more simple.
As follows by the specific implementation process of Bonjour agreement: when printer has started and can provide normal print service, (printer has local unique domain name, such as, xiaomi10F._printer_._tcp.local and xiaomi11F._printer_.tcp.local two printers), the up-to-date IP address, port numbers etc. of printer, by the network router registration print service of mDNS to this locality, are registered on the router by this printer, the portable computer of access local network is when needs print service, such as, portable computer is by the open printing page and by the request of mDNS to router transmission print service, then all at router registration and available print service all can respond mDNS message to portable computer, and carry respective local unique domain name, such as, also the printer of print service can be provided to be xiaomi10F._printer_.tcp.local and xiaomi11F._printer_.tcp.local at router registration, so in the printer browsing pages of portable computer, there will be the title of above-mentioned two printers, if xiaomi10F._printer_.tcp.local is closer from user, now user can click this printer and start to print.Portable computer sends mDNS message to IP address corresponding to router solicitation and port numbers with xiaomi10F._printer_.tcp.local domain name.The print service of xiaomi10F._printer_.tcp.local is responded by mDNS and carries IP address and the port numbers of this printer, portable computer receives after the IP address of printer and port numbers by transmission control protocol (Transmission Control Protocol, referred to as TCP) connect with the printer of xiaomi10F._printer_.tcp.local, start transfer printing order.
Portable computer is needed to send out Query mDNS to router in said process, Query mDNS is transmitted to printer by router again, printer is to router response Answer mDNS, Answer mDNS is transmitted to portable set by router again, the therefore discovery of printer, the too long in flow of parsing.
Summary of the invention
For overcoming Problems existing in correlation technique, disclosure embodiment provides a kind of method, device and the router that establish a communications link among clients, in order to simplify the flow process of client query service.
According to the first aspect of disclosure embodiment, a kind of method shortening the flow process of client query service is provided, comprises:
Receive the inquiry message from the first client, in described inquiry message, carry the COS that described first client needs;
The second client that described COS can be provided is determined whether there is from Service Source list;
If there is described second client that can provide described COS, the first response message is sent to described first client clean culture, described first response message carries the first network address of described second client, sets up the communication connection with described second client for described first client by described first network address.
In one embodiment, after the inquiry message of described reception from the first client, described method also can comprise:
Determine whether described COS meets the access rights for described first client is arranged;
If determine to meet described access rights, perform the described step determining whether to provide the second client of described COS according to described COS from Service Source list;
If do not met, abandon described inquiry message.
In one embodiment, after the inquiry message of described reception from the first client, described method also can comprise:
The session entry whether existing and match with described inquiry message is inquired about from inquiry conversational list;
If there is described session entry, upgrade the timer corresponding with described session entry, and perform described the second client determining whether to provide described COS according to described COS from Service Source list;
If there is no described session entry, creates the session entry matched with described inquiry message, starts the timer corresponding with described session entry.
In one embodiment, after the inquiry message of described reception from the first client, described method also can comprise:
Determine whether the problem field in described inquiry message is empty;
If be empty, abandon described inquiry message;
If be not empty, from described inquiry message, resolve the COS of described first client, perform the described step determining whether to provide the second client of described COS according to described COS from Service Source list.
In one embodiment, after the inquiry message of described reception from the first client, described method also can comprise:
Determine whether the acknowledgement field in described inquiry message is empty;
If be empty, from described inquiry message, resolve the Service Source of described first client, perform the described step determining whether to provide the second client of described COS according to described COS from Service Source list;
If be not empty, from described acknowledgement field, resolve the Service Source that described first client can provide;
Described Service Source list is upgraded according to the Service Source that described first client can provide.
In one embodiment, the described Service Source that can provide according to described first client upgrades described Service Source list, can comprise:
Determine whether to have recorded in described Service Source list the Service Source that described first client can provide;
If recorded the Service Source that described first client can provide, upgrade the existence duration of the Service Source that described first client can provide;
If do not record the Service Source that described first client can provide, the Service Source that can provide for described first client in described Service Source list creates corresponding resource record.
In one embodiment, described method also can comprise:
If there is not described second client that can provide described COS in described Service Source list, in the local area network (LAN) at described router place, multicast sends described inquiry message;
Receive the second response message returned according to described inquiry message from the 3rd client in described local area network (LAN);
If parse the COS meeting described first client needs from described second response message, the second response message is sent to described first client clean culture, described second response message carries the second network address of described 3rd client, sets up the communication connection with described 3rd client for described first client by described second network address.
In one embodiment, after the second response message that described reception returns according to described inquiry message from the 3rd client in described local area network (LAN), described method also can comprise:
Determine whether the acknowledgement field in described second response message is empty;
If be empty, abandon described second response message;
If be not empty, from the acknowledgement field of described second response message, parse the Service Source that described 3rd client provides.
In one embodiment, described method also can comprise:
Determine whether to have recorded in described Service Source list the Service Source that described 3rd client can provide;
If recorded the Service Source that described 3rd client can provide, upgrade the existence duration of the Service Source that described 3rd client can provide;
If do not record the Service Source that described 3rd client can provide, the Service Source that can provide for described 3rd client in described Service Source list creates corresponding resource record.
In one embodiment, described method also can comprise:
Determine the existence duration that the Service Source of each client recorded in described Service Source list is corresponding;
Determine whether to need to send inquiry request to each client described, to determine whether each client described still can provide the COS recorded in described Service Source list according to the duration of crossing in described Service Source list that described existence duration and timer record.
In one embodiment, described method also can comprise:
For the client returning response message according to described apply for information, described in upgrading in described Service Source list, return the life duration that the client of response message is corresponding;
For the client not returning response message according to described apply for information, the resource information described client not returning response message recorded in described Service Source list is deleted.
According to the second aspect of disclosure embodiment, a kind of device shortening the flow process of client query service is provided, comprises:
Receiver module, is configured to receive the inquiry message from the first client, carries the COS that described first client needs in described inquiry message;
First determination module, is configured to determine whether there is the second client of the described COS of carrying in the described inquiry message that described receiver module can be provided to receive from Service Source list;
First sending module, if be configured to described first determination module to determine to there is described second client that can provide described COS, the first response message is sent to described first client clean culture, described first response message carries the first network address of described second client, sets up the communication connection with described second client for described first client by described first network address.
In one embodiment, described device also can comprise:
Second determination module, is configured to after described receiver module receives the inquiry message from the first client, determines whether described COS meets the access rights for described first client is arranged;
If described second determination module is determined to meet described access rights, described first determination module performs the described step determining whether second client that can provide described COS according to described COS from Service Source list;
First discard module, if be configured to described second determination module not meet described access rights, abandons described inquiry message.
In one embodiment, described device also can comprise:
Enquiry module, is configured to after described receiver module receives the inquiry message from the first client, from inquiry conversational list, inquire about the session entry whether existing and match with described inquiry message;
Update module, if be configured to described enquiry module inquire and there is described session entry, upgrade the timer corresponding with described session entry, described first determination module execution is described determines whether second client that can provide described COS according to described COS from Service Source list;
First creation module, inquires there is not described session entry if is configured to described enquiry module, creates the session entry matched with described inquiry message, starts the timer corresponding with described session entry.
In one embodiment, described device also can comprise:
3rd determination module, is configured to after described receiver module receives the inquiry message from the first client, determines whether the problem field in described inquiry message is empty;
Second discard module, if be configured to described 3rd determination module to determine that the problem field in described inquiry message is sky, abandons described inquiry message;
First parsing module, if be configured to described 3rd determination module to determine that the problem field in described inquiry message is not sky, from described inquiry message, resolve the COS of described first client, described first determination module performs the described step determining whether second client that can provide described COS according to described COS from Service Source list.
In one embodiment, described device also can comprise:
4th determination module, after being configured to the inquiry message of described receiver module reception from the first client, determines whether the acknowledgement field in described inquiry message is empty;
Second parsing module, if be configured to described 4th determination module to determine that the acknowledgement field in described inquiry message is sky, from described inquiry message, resolve the Service Source of described first client, described first determination module performs the described step determining whether second client that can provide described COS according to described COS from Service Source list;
3rd parsing module, if be configured to described 4th determination module to determine that the acknowledgement field in described inquiry message is not sky, resolves the Service Source that described first client can provide from described acknowledgement field;
First update module, the Service Source that described first client being configured to parse according to described 3rd parsing module can provide upgrades described Service Source list.
In one embodiment, described first update module can comprise:
Determine submodule, be configured to determine whether to have recorded in described Service Source list the Service Source that described first client that described 3rd parsing module parses can provide;
Upgrade submodule, if be configured to the described Service Source that submodule is determined to record described first client and can be provided of determining, upgrade the existence duration of the Service Source that described first client can provide;
Create submodule, if be configured to the described Service Source that submodule is determined not record described first client and can be provided of determining, the Service Source that can provide for described first client in described Service Source list creates corresponding resource record.
In one embodiment, described device also can comprise:
Second sending module, if be configured to described first determination module to determine there is not described second client that can provide described COS in described Service Source list, in the local area network (LAN) at described router place, multicast sends described inquiry message;
Second receiver module, is configured to receive the second response message returned according to the described inquiry message that described second sending module sends from the 3rd client in described local area network (LAN);
3rd sending module, if be configured to parse the COS meeting described first client needs from described second response message that described second receiver module receives, the second response message is sent to described first client clean culture, described second response message carries the second network address of described 3rd client, sets up the communication connection with described 3rd client for described first client by described second network address.
In one embodiment, described device also can comprise:
5th determination module, is configured to after described second receiver module receives the second response message returned according to described inquiry message from the 3rd client in described local area network (LAN), determine whether the acknowledgement field in described second response message is empty;
3rd discard module, if be configured to described 5th determination module to determine that the acknowledgement field in described second response message is sky, abandons described second response message;
4th parsing module, if be configured to described 5th determination module to determine that the acknowledgement field in described second response message is not sky, parses the Service Source that described 3rd client provides from the acknowledgement field of described second response message.
In one embodiment, described device also can comprise:
6th determination module, is configured to determine whether to have recorded in described Service Source list the Service Source that described 3rd client can provide;
Second update module, if be configured to described 6th determination module to determine to record the Service Source that described 3rd client can provide, upgrades the existence duration of the Service Source that described 3rd client can provide;
Second creation module, if be configured to described 6th determination module to determine not record the Service Source that described 3rd client can provide, the Service Source that can provide for described 3rd client in described Service Source list creates corresponding resource record.
In one embodiment, described device also can comprise:
7th determination module, is configured to the existence duration determining that the Service Source of each client recorded in described Service Source list is corresponding;
8th determination module, be configured to the duration of crossing in described Service Source list that the described existence duration determined according to described 7th determination module and timer record determine whether to need to send inquiry request to each client described, to determine whether each client described still can provide the COS recorded in described Service Source list.
In one embodiment, described device also can comprise:
3rd update module, is configured to the client for returning response message according to described apply for information, returns the life duration that the client of response message is corresponding in described Service Source list described in upgrading;
Removing module, is configured to the client for not returning response message according to described apply for information, and the resource information described client not returning response message recorded in described Service Source list is deleted.
According to the third aspect of disclosure embodiment, a kind of router is provided, comprises:
Processor;
For the memory of storage of processor executable instruction;
Wherein, described processor is configured to:
Receive the inquiry message from the first client, in described inquiry message, carry the COS that described first client needs;
The second client that described COS can be provided is determined whether there is from Service Source list;
If there is described second client that can provide described COS, the first response message is sent to described first client clean culture, described first response message carries the first network address of described second client, sets up the communication connection with described second client for described first client by described first network address.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect: by inquiring about the COS whether existing and can provide the first client needs in Service Source list after receiving inquiry message, when existence enough provides the second client of COS, directly response message can be returned the first client, thus enable the first client set up network by the network address of second client of carrying in response message with the second client to be connected, because router has answered response message for the second client generation, therefore the flow process making the first client and the second client establish a communications link shortens half, shorten the flow process of client query service.
Should be understood that, it is only exemplary and explanatory that above general description and details hereinafter describe, and can not limit the disclosure.
Accompanying drawing explanation
Accompanying drawing to be herein merged in specification and to form the part of this specification, shows embodiment according to the invention, and is used from specification one and explains principle of the present invention.
Figure 1A is the flow chart of the method established a communications link among clients according to an exemplary embodiment.
Figure 1B is the scene graph of the method established a communications link among clients according to an exemplary embodiment.
Fig. 2 is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment one.
Fig. 3 is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment two.
Fig. 4 A is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment three.
Fig. 4 B is the flow chart of the step S405 according to an exemplary embodiment three.
Fig. 5 is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment four.
Fig. 6 A is the flow chart of the maintenance service the Resources list according to an exemplary embodiment five.
Fig. 6 B is the flow chart of the active maintenance Service Source list according to an exemplary embodiment five.
Fig. 6 C is the flow chart of the passive maintenance Service Source list according to an exemplary embodiment five.
Fig. 7 is the block diagram of a kind of device established a communications link among clients according to an exemplary embodiment.
Fig. 8 is the block diagram of the device that the another kind according to an exemplary embodiment establishes a communications link among clients.
Fig. 9 is another according to exemplary embodiment block diagram of device of establishing a communications link among clients.
Figure 10 is another according to exemplary embodiment block diagram of device of establishing a communications link among clients.
Figure 11 is the block diagram of the also a kind of device established a communications link among clients according to an exemplary embodiment.
Figure 12 is the block diagram of the also another kind of device established a communications link among clients according to an exemplary embodiment.
Figure 13 is a kind of block diagram being applicable to the device established a communications link among clients according to an exemplary embodiment.
Embodiment
Here will be described exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Execution mode described in following exemplary embodiment does not represent all execution modes consistent with the present invention.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present invention are consistent.
Figure 1A is the flow chart of the method established a communications link among clients according to an exemplary embodiment, and Figure 1B is the scene graph of the method established a communications link among clients according to an exemplary embodiment; This method established a communications link among clients can be applied on the router, and as shown in Figure 1A, the method established a communications link among clients comprises the following steps S101-S 103:
In step S101, receive the inquiry message from the first client, wherein, in inquiry message, carry the COS that the first client needs.
In one embodiment, inquiry message can be that port is 5353 based on the Query mDNS message in Bonjour agreement, and object IP is 224.0.0.251; In one embodiment, the COS that router needs by parsing the first client from this inquiry message, thus determine to provide the client of the service required for it for the first client from local area network (LAN), such as, the COS that first client needs is print service, then router can be that the first client determines corresponding printer etc.
In step s 102, from Service Source list, determine whether there is the second client that COS can be provided, if existed, perform step S103, if there is no, perform step S104.
In one embodiment, Service Source list can comprise the Service Source that the client in the local area network (LAN) of router place can provide, this Service Source can comprise the resource type (TYPE) that the client in the WLAN (wireless local area network) at router place provides, resource name (NAME), resources-type (CLASS), resource domain name (DOMAIN), resource instances assumed name claims (INSTANCE NAME), resource IP, MAC, the local area network (LAN) at place (such as, WLAN (wireless local area network) WLAN) etc., such as, by resolving inquiry message, router determines that the COS that the first client needs is print service, the client that resource type is printer can be searched in Service Source list.
In step s 103, if there is second client that can provide COS, the first response message is sent to the first client clean culture, wherein, first response message carries the first network address of the second client, sets up the communication connection with the second client for the first client by first network address.
In one embodiment, first network address can comprise the IP address, MAC Address, domain name etc. of the client that can provide COS, as long as the first client and the second client can be made to establish a communications link, disclosure embodiment does not limit the concrete network address.
In step S104, if there is not second client that can provide COS in Service Source list, in the local area network (LAN) at router place, multicast sends inquiry message.
Below in conjunction with Figure 1B, exemplary illustration is carried out to disclosure embodiment, as shown in Figure 1B, first client (carrying out exemplary illustration for individual notebook 11) is carried to the individual notebook 11 of unit for user from family, user needs by individual notebook 11 printed document data, after individual notebook sends inquiry message to router one 2, the COS that this inquiry message carries is printer service, whether exist in the Service Source list that router one 2 can be stored by inquiry and can provide the printer of print service for individual notebook 11, if exist for individual notebook 11 to provide the printer of print service (such as, printer 13 and printer 14), then router one 2 sends the first response message directly to the clean culture of individual notebook 11, by the network address of printer 13 and printer 14 is sent to individual notebook, user can determine one from printer 13 and printer 14, such as, determine to connect printer 13, then can set up the communication connection between individual notebook 11 and printer 13.If do not exist for the printer that individual notebook 11 provides print service in Service Source list, under this kind of situation, illustrate that printer 13 in local area network (LAN) and printer 14 not yet register its Service Source provided at router one 2 place, therefore, router one 2 is after the inquiry message receiving individual notebook 11, this inquiry message is copied many parts, in the local area network (LAN) at router one 2 place, multicast sends inquiry message, printer 13 and printer 14 are after receiving inquiry message, response message is returned to router one 2, and its each self-corresponding Service Source is carried in response message, thus make the printer that the user of individual notebook 11 selects it to need from printer 13 and printer 14, set up individual notebook 11 and selected printer (such as, user chooses printer 13) between communication connection.
In the present embodiment, router passes through in Service Source list, inquire about the COS whether existing and the first client can be provided to need after receiving inquiry message, when existence enough provides the second client of COS, response message directly can be returned the first client by router, thus enable the first client set up network by the network address of second client of carrying in response message with the second client to be connected, response message has been answered because router carries out generation for the second client, therefore the flow process making the first client and the second client establish a communications link shortens half, shorten the flow process of client query service, in addition, during owing to only there is not second client that can provide COS in Service Source list, router just can send inquiry message to multicast in local area network (LAN), thus exist when the second client of COS can be provided in Service Source list, client irrelevant with COS in WLAN (wireless local area network) need not be waken up and listen to multicast message, greatly improve the flying power of client.
In one embodiment, after receiving the inquiry message from the first client, method also can comprise:
Determining whether COS meets is the access rights that the first client is arranged;
If determine to meet access rights, perform the step determining whether the second client that COS can be provided according to COS from Service Source list;
If do not met, abandon inquiry message.
In one embodiment, after receiving the inquiry message from the first client, method also can comprise:
The session entry whether existing and match with inquiry message is inquired about from inquiry conversational list;
If there is session entry, upgrade the timer corresponding with session entry, and execution determines whether second client that can provide COS according to COS from Service Source list;
If there is no session entry, creates the session entry matched with inquiry message, starts the timer corresponding with session entry.
In one embodiment, after receiving the inquiry message from the first client, method also can comprise:
Determine whether the problem field in inquiry message is empty;
If be empty, abandon inquiry message;
If be not empty, from inquiry message, resolve the Service Source of the first client, perform the step determining whether the second client that COS can be provided according to COS from Service Source list.
In one embodiment, after receiving the inquiry message from the first client, method also can comprise:
Determine whether the acknowledgement field in inquiry message is empty;
If be empty, from inquiry message, resolve the Service Source of the first client, perform the step determining whether the second client that COS can be provided according to COS from Service Source list;
If be not empty, from acknowledgement field, resolve the Service Source that the first client can provide;
Service Source list is upgraded according to the Service Source that the first client can provide.
In one embodiment, upgrade Service Source list according to the Service Source that the first client can provide, can comprise:
Determine whether to have recorded in Service Source list the Service Source that the first client can provide;
If recorded the Service Source that the first client can provide, upgrade the existence duration of the Service Source that the first client can provide;
If do not record the Service Source that the first client can provide, the Service Source that can provide for the first client in Service Source list creates corresponding resource record.
In one embodiment, method also can comprise:
If there is not second client that can provide COS in Service Source list, in the local area network (LAN) at router place, multicast sends inquiry message;
Receive the second response message returned according to inquiry message from the 3rd client in local area network (LAN);
If parse the COS meeting the first client needs from the second response message, the second response message is sent to the first client clean culture, second response message carries the second network address of the 3rd client, sets up the communication connection with the 3rd client for the first client by second network address.
In one embodiment, after receiving the second response message returned according to inquiry message from the 3rd client in local area network (LAN), method also can comprise:
Determine whether the acknowledgement field in the second response message is empty;
If be empty, abandon the second response message;
If be not empty, from the acknowledgement field of the second response message, parse the Service Source that the 3rd client provides.
In one embodiment, method also can comprise:
Determine whether to have recorded in Service Source list the Service Source that the 3rd client can provide;
If recorded the Service Source that the 3rd client can provide, upgrade the existence duration of the Service Source that the 3rd client can provide;
If do not record the Service Source that the 3rd client can provide, the Service Source that can provide for the 3rd client in Service Source list creates corresponding resource record.
In one embodiment, method also can comprise:
Determine the existence duration that the Service Source of each client recorded in Service Source list is corresponding;
Determine whether to need to send inquiry request, to determine whether each client still can be provided in the COS recorded in Service Source list to each client according to the duration of crossing in Service Source list that existence duration and timer record.
In one embodiment, method also can comprise:
For the client returning response message according to apply for information, upgrade in Service Source list and return life duration corresponding to the client of response message;
For the client not returning response message according to apply for information, the resource information client not returning response message recorded in Service Source list is deleted.
How to establish a communications link among clients, please refer to subsequent embodiment.
So far, the said method that disclosure embodiment provides, the first client can be enable to set up network by the network address of second client of carrying in response message with the second client be connected, because router has answered response message for the second client generation, therefore the flow process making the first client and the second client establish a communications link shortens half, shortens the flow process of client query service.
With specific embodiment, the technical scheme that disclosure embodiment provides is described below.
Fig. 2 is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment one; The said method that the present embodiment utilizes disclosure embodiment to provide, for by carrying out exemplary illustration for client arranges access rights, as shown in Figure 2, comprises the steps:
In step s 201, receive the inquiry message from the first client, wherein, in inquiry message, carry the COS that the first client needs, perform step S202.
The description of step S201 refers to the description of above-mentioned steps S101, is not described in detail in this.
In step S202, determining whether COS meets is the access rights that the first client is arranged, if determine to meet access rights, performs step S203, if determine not meet access rights, performs step S206.
In one embodiment, the access rights of the first client can be determined on the router based on Bonjour agreement, in one embodiment, access rights can be the services allowing client can access setting, also can be the service forbidding that client-access sets, such as, the access rights of client 1 are to inquire the service of issuing in all local area network, the access rights of client 2 are for can not find print service, the access rights of client 3 are for can only find music sharing service, the access rights of client 4 are for can not find that FTP serves etc., the particular type of disclosure embodiment to access rights does not limit.
In step S203, if determine to meet access rights, the second client that COS can be provided is determined whether there is from Service Source list, if there is second client that can provide COS, perform step S204, second client of COS if there is no can be provided, perform step S205.
The description of step S203 refers to the description of above-mentioned steps S102, is not described in detail in this.
In step S204, if there is second client that can provide COS, the first response message is sent to the first client clean culture, first response message carries the first network address of the second client, sets up the communication connection with the second client for the first client by first network address.
The description of step S204 refers to the description of above-mentioned steps S103, is not described in detail in this.
Such as, first client is client 2, the COS that carrying client 2 in inquiry message from client 2 needs is print service, if by the access rights of inquiring client terminal 2 for print service can not be found, then the inquiry message from client 2 is abandoned, thus, the insignificant query message from client 2 can be avoided to allow other client in local area network (LAN) listen to by the forwarding of router, thus avoid client incoherent in local area network (LAN) to wake up, reduce the possibility that other client in local area network (LAN) is waken up, greatly improve the flying power of client.
In step S205, if there is not second client that can provide COS in Service Source list, in the local area network (LAN) at router place, multicast sends inquiry message, and flow process terminates.
The description of step S205 refers to the description of above-mentioned steps S104, is not described in detail in this.
In step S206, if determine not meet access rights, abandon this inquiry message, flow process terminates.
On the basis of Advantageous Effects with above-described embodiment, the present embodiment is the access rights that the first client is arranged by determining whether COS meets, insignificant query message can be avoided to allow other client in local area network (LAN) listen to by the forwarding of router, thus avoid client incoherent in local area network (LAN) to wake up, reduce the possibility that other client in local area network (LAN) is waken up, greatly improve the flying power of client, the COS required for different clients can also provide application scenarios flexibly.
Fig. 3 is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment two; The said method that the present embodiment utilizes disclosure embodiment to provide, to carry out exemplary illustration by inquiry session list item, as shown in Figure 3, comprises the steps:
In step S301, receive the inquiry message from the first client, wherein, in inquiry message, carry the COS that the first client needs.
The description of step S301 refers to the description of above-mentioned steps S101, is not described in detail in this.
In step s 302, from inquiry conversational list, inquire about the session entry whether existing and match with inquiry message, if there is no session entry, perform step S303, if there is session entry, perform step S304.
In step S303, if there is no session entry, creates the session entry matched with inquiry message, starts the timer corresponding with session entry, performs step S305.
In step s 304, if there is session entry, upgrade the timer corresponding with session entry, and perform step S305.
In step S305, from Service Source list, the second client that COS can be provided is determined whether according to COS, if there is second client that can provide described COS, perform step S306, second client of COS if there is no can be provided, perform step S307.
The description of step S305 refers to the description of above-mentioned steps S102, is not described in detail in this.
In step S306, send the first response message to the first client clean culture, the first response message carries the first network address of the second client, and set up the communication connection with the second client for the first client by first network address, flow process terminates.
The description of step S306 refers to the description of above-mentioned steps S103, is not described in detail in this.
In step S307, if there is not second client that can provide COS in Service Source list, in the local area network (LAN) at router place, multicast sends inquiry message, and flow process terminates.
The description of step S307 refers to the description of above-mentioned steps S104, is not described in detail in this.
In above-mentioned steps S302-step S304, in one embodiment, it is the session entry that each inquiry message newly received creates that inquiry conversational list can comprise router, the duration that can record the time receiving inquiry message in this session entry and can store in inquiry conversational list.
Such as, router have received in 13 o'clock sharps of on February 15th, 2015 inquiry message that individual notebook needs print service, if create session entry for this individual notebook before router, then can inquire the session entry of this individual notebook about print service from this inquiry conversational list, if router receives the inquiry message of this individual notebook first, then can create a new session entry, to record the time of this individual notebook request print service for this individual notebook.
In one embodiment, one timer can be set for each session entry in inquiry conversational list, when client still requests the service that this session entry records in the timing length set by timer, when the time span then recorded in inquiry conversational list this session entry of timer has exceeded timer, the timer corresponding with session entry can be upgraded, thus can avoid because session entry is owing to exceeding the timing length of timer memory time and deleted.
Below in conjunction with Figure 1B, exemplary illustration is carried out to the disclosure, as shown in Figure 1B, individual's notebook 11 passes through on February 14th, 2015 the mode request print service sending inquiry message to router one 2, router is after have sent to individual notebook and can providing the printer 13 of print service and the network address of printer 14, individual's notebook and printer 13 establish communication connection, if router one 2 is the record duration of the session entry of individual's notes 11 setting by inquiry conversational list is 30, so within 30 days, individual's notebook 11 can be established a communications link by this session entry and printer 13, if individual notebook 11 no longer asked print service in 30 days, the session entry of this individual notebook 11 correspondence can be deleted by router one 2, thus reduce the memory space of inquiry conversational list, if individual notebook 11 asks print service to router one 2 again on the February after February 14 28, then timer corresponding for the session entry of individual notebook 11 can upgrade by router one 2, thus can avoid due to the aging of timer and the session entry of individual notebook 11 is deleted.
On the basis of Advantageous Effects with above-described embodiment, the present embodiment is managed by the session entry of each client in inquiry conversational list routers, thus while the memory space of inquiry conversational list can be reduced, can also avoid due to the aging of timer and the session entry of client is deleted.
Fig. 4 A is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment three; For router, how the said method that the present embodiment utilizes disclosure embodiment to provide, can find that the COS that client provides carries out exemplary illustration, as shown in Figure 4 A, comprise the steps:
In step S401, receive the inquiry message from the first client, wherein, in inquiry message, carry the COS that the first client needs, perform step S402.
The description of step S401 refers to the description of above-mentioned steps S101, is not described in detail in this.
In step S402, determine whether the problem field in inquiry message is empty, if be not empty, perform step S403, if be empty, perform step S409.
In step S403, determine whether the acknowledgement field in inquiry message is empty, if be not empty, perform step S404, if be empty, perform step S406.
In step s 404, from acknowledgement field, resolve the Service Source that the first client can provide, perform step S405.
In step S405, upgrade Service Source list according to the Service Source that the first client can provide, perform step S406.
Description about step S405 can see Fig. 4 B illustrated embodiment.
In step S406, from inquiry message, resolve the COS of the first client, perform step S407.
In step S 407, from Service Source list, determine whether there is the second client that this COS can be provided, if there is second client that can provide COS, perform step S408.
The description of step S407 refers to the description of above-mentioned steps S102, is not described in detail in this.
In step S408, send the first response message to the first client clean culture, the first response message carries the first network address of the second client, and set up the communication connection with the second client for the first client by first network address, flow process terminates.
The description of step S408 refers to the description of above-mentioned steps S103, is not described in detail in this.
In step S409, if be empty, abandon this inquiry message, flow process terminates.
In step S402, in one embodiment, the COS of the needs of the first client, the network address of the first client and the service time required for the first client can be represented by the problem field (question count) in inquiry message.By problem field, router can be enable to know the COS of the first client.
In step S403 and step S404, in one embodiment, acknowledgement field (answer count) in inquiry message can comprise the COS that the first client can provide in local area network (LAN), as shown in Figure 1B, such as, first client is printer 13, its COS that can provide is print service, if printer 13 is by sending inquiry message to router one 2 thus finding that all printers in local area network (LAN) (such as, want to find printer 14), printer 13 is by being carried at the acknowledgement field in inquiry message by its Service Source that can provide, the printer 14 in local area network (LAN) and individual notebook 11 can be made to know the COS that printer 13 can provide, thus initiatively can find the Service Source in local area network (LAN), during the Service Source avoiding the client needs in local area network (LAN) relevant, router 12 is again to other client transmission inquiry message.
In one embodiment, as shown in Figure 4 B, step S405 can comprise:
In step S4051, determine whether to have recorded in Service Source list the Service Source that the first client can provide, if recorded the Service Source that the first client can provide, perform step S4052, if recorded the Service Source that the first client can provide, perform step S4053.
In step S4052, if recorded the Service Source that the first client can provide, upgrade the existence duration of the Service Source that the first client can provide.
In step S4053, if do not record the Service Source that the first client can provide, the Service Source that can provide for the first client in Service Source list creates corresponding resource record.
On the basis of Advantageous Effects with above-described embodiment, the present embodiment can enable the client in local area network (LAN) initiatively report its COS that can provide to router by acknowledgement field, thus the Service Source that router can be enable initiatively to find in local area network (LAN), when avoiding the client in local area network (LAN) to need relevant Service Source, router sends inquiry message to other client again.
Fig. 5 is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment four; The said method that the present embodiment utilizes disclosure embodiment to provide, return response message to other client forwarded after apply for information in local area network (LAN) of the client in local area network (LAN) to router for router and carry out exemplary illustration, as shown in Figure 5, comprise the steps:
In step S501, in the local area network (LAN) at router place, multicast sends inquiry message, performs step S502.
In step S502, receive the second response message returned according to inquiry message from the 3rd client in local area network (LAN), perform step S503.
In step S503, determine whether the acknowledgement field in the second response message is empty, if be not empty, perform step S504, if be empty, perform step S510.
In step S504, if be not empty, from the acknowledgement field of the second response message, parse the Service Source that the 3rd client provides, perform step S505.
In step S505, determine whether to have recorded in Service Source list the Service Source that the 3rd client can provide, if recorded the Service Source that the 3rd client can provide, perform step S506, if do not record the Service Source that the 3rd client can provide, perform step S507.
In step S506, if recorded the Service Source that the 3rd client can provide, upgrade the existence duration of the Service Source that the 3rd client can provide, performed step S508.
In step s 507, if do not record the Service Source that the 3rd client can provide, the Service Source that can provide for the 3rd client in Service Source list creates corresponding resource record, performs step S508.
In step S508, determine whether to parse the COS meeting the first client needs from the second response message, if the COS meeting the first client needs can be parsed from the second response message, perform step S509, if the COS meeting the first client needs can not be parsed from the second response message, perform step S510.
In step S509, if parse the COS meeting the first client needs from the second response message, the second response message is sent to the first client clean culture, second response message carries the second network address of the 3rd client, set up the communication connection with the 3rd client for the first client by second network address, flow process terminates.
In step S510, abandon the second response message, flow process terminates.
As shown in Figure 1B, when individual notebook 11 have sent the inquiry message of request print service to router one 2, but not yet there is the Service Source of journal printer 13 and printer 14 in Service Source list, in this case, this inquiry message can copy by router one 2, and multicast is sent to the client in the local area network (LAN) at router one 2 place, after printer 13 and printer 14 receive this inquiry message, its respective Service Source is carried in the second response message, after router one 2 receives this second response message, the Service Source of printer 13 and printer 14 can be parsed from the second response message, and respective Service Source is carried out record in Service Source list.
Again such as, other client in the local area network (LAN) at router one 2 place (such as, PC terminal) after receiving this inquiry message, also the second response message is returned to router one 2, because PC terminal can not provide print service, therefore the second response message of returning by resolving PC terminal of router one 2, thus can determine that this second response message is incoherent message, thus this second response message can be abandoned, avoid individual notebook 11 to make unnecessary communication connection.
On the basis of Advantageous Effects with above-described embodiment, the present embodiment by router by sending the second response message to the first client clean culture, incoherent client in local area network (LAN) can be avoided thus to be waken up and to monitor this second response message, thus the cruising time of incoherent client can be extended.
Fig. 6 A is the flow chart of the method that establishes a communications link among clients according to an exemplary embodiment five, Fig. 6 B is the flow chart of the active maintenance Service Source list according to an exemplary embodiment five, and Fig. 6 C is the flow chart of the passive maintenance Service Source list according to an exemplary embodiment five; The said method that the present embodiment utilizes disclosure embodiment to provide, so that how maintenance service the Resources list carries out exemplary illustration, as shown in Figure 6A, comprises the steps:
In step s 601, the existence duration that the Service Source of each client recorded in Service Source list is corresponding is determined.
In step S602, determine to need transmission to inquire the client of request, to determine whether each client needing to send apply for information still can provide the COS recorded in Service Source list according to the duration of crossing in Service Source list that existence duration and timer record.
In step S603, for the client returning response message according to apply for information, upgrade in Service Source list and return life duration corresponding to the client of response message.
In step s 604, for the client not returning response message according to apply for information, the resource information client not returning response message recorded in Service Source list is deleted.
In order to the clearer technical scheme understanding disclosure embodiment, below by Fig. 6 B and Fig. 6 C, exemplary illustration is carried out to Fig. 6 A illustrated embodiment.
As shown in Figure 6B, realize, to the maintenance of Service Source list, comprising the steps: by the mode of passive query
In step s 611, determine the existence duration that the Service Source of each client recorded in Service Source list is corresponding, perform step S612.
In step S612, determine whether timer has exceeded the first preset ratio value of default existence duration, if exceeded the first preset ratio value of default existence duration, perform step S613, if do not exceed the first preset ratio value of default existence duration, perform step S611.
In step S613, the client corresponding to the first preset ratio value exceeding default existence duration sends apply for information, performs step S614.
In step S614, determine whether to receive the response message that client returns according to this apply for information, if the response message that client returns according to this apply for information can be received, perform step S615, if the response message that client returns according to this apply for information can not be received, perform step S616.
In step S615, upgrade the existence duration returning the client of response message recorded in Service Source list, and re-execute step S611.
In step S616, the client corresponding to the second preset ratio value exceeding default existence duration sends apply for information, performs step S617.
In step S617, determine whether to receive the response message that client returns according to this apply for information, if the response message that client returns according to this apply for information can be received, perform step S618, if the response message that client returns according to this apply for information can not be received, perform step S619.
In step S618, upgrade the existence duration returning the client of response message recorded in Service Source list, and re-execute step S611.
In step S619, from Service Source list, delete the Service Source of the client not returning response message, and re-execute step S611.
In the present embodiment, the first preset ratio value is such as the 80%, second preset ratio value of whole storage duration is such as 90% of the whole storage duration of Service Source.It will be understood by those skilled in the art that, above-mentioned first preset ratio value and the second preset ratio value are only exemplary illustration, can also the 3rd preset ratio value, the 4th preset ratio value be passed through (such as, 95%, 98% etc.) etc. the storage duration of Service Source is inquired about, thus realize the passive maintenance to Service Source list.
As shown in Figure 6 C, realize, to the maintenance of Service Source list, comprising the steps: by the mode of active inquiry
In step S621, the timing length that the timer that the Service Source recorded in the interval duration inquiry service the Resources list preset is corresponding is corresponding, performs step S622.
In step S622, determine whether the storage duration that the Service Source that records in Service Source list is corresponding has exceeded default timing length, if exceeded default timing length, perform step 623, if do not exceed default timing length, re-execute step S621.
In step S623, sending apply for information to exceeding client corresponding to default timing length, performing step S624.
In step S624, determine whether to receive the response message that client returns according to apply for information, for the client receiving response message, perform step S625, for the client not receiving response message, perform step S626.
In step S625, upgrade the timing length of client in Service Source list returning response message, re-execute step S621.
In step S626, from Service Source list, delete the Service Source of the client not returning response message, and re-execute step S621.
In the present embodiment, can be 15 seconds every the interval duration preset, the storage duration that the Service Source coming to have stored in the list of active inquiry Service Source by interval duration is corresponding, thus the active maintenance to Service Source list can be realized.
In the present embodiment, safeguard the Service Source list in disclosure embodiment by the way, when any one client in Service Source list is removed due to equipment or the factor such as equipment breaking-up can not provide for other client in local area network (LAN) the COS recorded in Service Source list again, in time this client can be deleted in Service Source list, thus the accuracy of Service Source list records Service Source can be improved, reduce router when receiving inquiry message due to multicast request can not be sent with when needing the client of serving not mate by providing the client of COS in local area network (LAN).
Fig. 7 is the block diagram of a kind of device established a communications link among clients according to an exemplary embodiment, and as shown in Figure 7, the device established a communications link among clients comprises:
Receiver module 71, is configured to receive the inquiry message from the first client, carries the COS that the first client needs in inquiry message;
First determination module 72, is configured to determine whether there is the second client of the COS of carrying in the inquiry message that receiver module 71 can be provided to receive from Service Source list;
First sending module 73, if be configured to first to determine that mould 72 pieces is determined to there is second client that can provide COS, the first response message is sent to the first client clean culture, first response message carries the first network address of the second client, sets up the communication connection with the second client for the first client by first network address.
Fig. 8 is the block diagram of the device that the another kind according to an exemplary embodiment establishes a communications link among clients, and on above-mentioned basis embodiment illustrated in fig. 7, device also can comprise:
Second determination module 81, is configured to after receiver module 61 receives the inquiry message from the first client, and determining whether COS meets is the access rights that the first client is arranged;
If the second determination module 81 is determined to meet access rights, the first determination module 62 performs the step determining whether second client that can provide COS according to COS from Service Source list;
First discard module 82, if be configured to the second determination module 81 not meet access rights, abandons inquiry message.
Fig. 9 is another according to exemplary embodiment block diagram of device of establishing a communications link among clients, and on above-mentioned basis embodiment illustrated in fig. 7, device also can comprise:
Enquiry module 91, is configured to after receiver module 71 receives the inquiry message from the first client, from inquiry conversational list, inquire about the session entry whether existing and match with inquiry message;
Update module 92, if be configured to enquiry module 91 inquire and there is session entry, upgrade the timer corresponding with session entry, the first determination module 72 performs the second client determining whether to provide COS according to COS from Service Source list;
First creation module 93, inquires there is not session entry if is configured to enquiry module 91, creates the session entry matched with inquiry message, starts the timer corresponding with session entry.
Figure 10 is another according to exemplary embodiment block diagram of device of establishing a communications link among clients, and on the basis of above-described embodiment, as shown in Figure 9, device also can comprise:
3rd determination module 21, is configured to after receiver module 71 receives the inquiry message from the first client, determines whether the problem field in inquiry message is empty;
Second discard module 22, if be configured to the 3rd determination module 21 to determine that the problem field in inquiry message is sky, abandons inquiry message;
First parsing module 23, if be configured to the 3rd determination module 21 to determine that the problem field in inquiry message is not sky, from inquiry message, resolve the COS of the first client, the first determination module 72 performs the step determining whether second client that can provide COS according to COS from Service Source list.
In one embodiment, device also can comprise:
4th determination module 24, is configured to after receiver module connects the inquiry message of 71 receipts from the first client, determine whether the acknowledgement field in inquiry message is empty;
Second parsing module 25, if be configured to the 4th determination module 24 to determine that the acknowledgement field in inquiry message is sky, from inquiry message, resolve the Service Source of the first client, the first determination module 71 performs the step determining whether second client that can provide COS according to COS from Service Source list;
3rd parsing module 26, if be configured to the 4th determination module 24 to determine that the acknowledgement field in inquiry message is not sky, resolves the Service Source that the first client can provide from acknowledgement field;
First update module 27, the Service Source that the first client being configured to parse according to the 3rd parsing module 26 can provide upgrades Service Source list.
In one embodiment, the first update module 27 can comprise:
Determine submodule 271, be configured to determine whether to have recorded in Service Source list the Service Source that the first client that the 3rd parsing module 26 parses can provide;
Upgrade submodule 272, if be configured to determine the Service Source that submodule 271 is determined to record the first client and can be provided, upgrade the existence duration of the Service Source that the first client can provide;
Create submodule 273, if be configured to determine the Service Source that submodule 271 is determined not record the first client and can be provided, the Service Source that can provide for the first client in Service Source list creates corresponding resource record.
Figure 11 is the block diagram of the also a kind of device established a communications link among clients according to an exemplary embodiment, and on the basis of above-described embodiment, as shown in figure 11, device also can comprise:
Second sending module 31, if be configured to the first determination module 72 to determine there is not second client that can provide COS in Service Source list, in the local area network (LAN) at router place, multicast sends inquiry message;
Second receiver module 32, is configured to receive the second response message returned according to the inquiry message that the second sending module 31 sends from the 3rd client in local area network (LAN);
3rd sending module 33, if be configured to parse the COS meeting the first client needs the second response message received from the second receiver module 32, the second response message is sent to the first client clean culture, second response message carries the second network address of the 3rd client, sets up the communication connection with the 3rd client for the first client by second network address.
In one embodiment, device also can comprise:
5th determination module 34, is configured to after the second receiver module 32 receives the second response message returned according to inquiry message from the 3rd client in local area network (LAN), determine whether the acknowledgement field in the second response message is empty;
3rd discard module 35, if be configured to the 5th determination module 34 to determine that the acknowledgement field in the second response message is sky, abandons the second response message;
4th parsing module 36, if be configured to the 5th determination module 34 to determine that the acknowledgement field in the second response message is not sky, parses the Service Source that the 3rd client provides from the acknowledgement field of the second response message.
In one embodiment, device also can comprise:
6th determination module 37, is configured to determine whether to have recorded in Service Source list the Service Source that the 3rd client can provide;
Second update module 38, if be configured to the 6th determination module 36 to determine to record the Service Source that the 3rd client can provide, upgrades the existence duration of the Service Source that the 3rd client can provide;
Second creation module 39, if be configured to the 6th determination module 36 to determine not record the Service Source that the 3rd client can provide, the Service Source that can provide for the 3rd client in Service Source list creates corresponding resource record.
Figure 12 is the block diagram of the also another kind of device established a communications link among clients according to an exemplary embodiment, and on the basis of above-described embodiment, as shown in figure 12, device also can comprise:
7th determination module 41, is configured to the existence duration determining that the Service Source of each client recorded in Service Source list is corresponding;
8th determination module 42, be configured to the duration of crossing in Service Source list that the existence duration determined according to the 7th determination module 41 and timer record determine whether to need to send inquiry request, to determine whether each client still can provide the COS recorded in Service Source list to each client.
In one embodiment, device also can comprise:
3rd update module 43, is configured to the client for returning response message according to apply for information, upgrades and return life duration corresponding to the client of response message in Service Source list;
Removing module 44, is configured to the client for not returning response message according to apply for information, and the resource information client not returning response message recorded in Service Source list is deleted.
About the device in above-described embodiment, wherein the concrete mode of modules executable operations has been described in detail in about the embodiment of the method, will not elaborate explanation herein.
Figure 13 is a kind of block diagram being applicable to the device controlling the indicator light be arranged on smart machine according to an exemplary embodiment.Such as, device 1300 may be provided in a smart mobile phone or panel computer.With reference to Figure 13, device 1300 comprises processing components 1322, and it comprises one or more processor further, and the memory resource representated by memory 1332, can such as, by the instruction of the execution of processing unit 1322, application program for storing.The application program stored in memory 1332 can comprise each module corresponding to one group of instruction one or more.In addition, processing components 1322 is configured to perform instruction, to perform the above-mentioned method established a communications link among clients.
Device 1300 can also comprise the power management that a power supply module 1326 is configured to final controlling element 1300, and a wired or wireless network interface 1350 is configured to device 1300 to be connected to network, and input and output (I/O) interface 1358.Device 1300 can operate the operating system based on being stored in memory 1332, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Those skilled in the art, at consideration specification and after putting into practice disclosed herein disclosing, will easily expect other embodiment of the present disclosure.The application is intended to contain any modification of the present disclosure, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present disclosure and comprised the undocumented common practise in the art of the disclosure or conventional techniques means.Specification and embodiment are only regarded as exemplary, and true scope of the present disclosure and spirit are pointed out by claim below.
Should be understood that, the disclosure is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendment and change not departing from its scope.The scope of the present disclosure is only limited by appended claim.
Claims (23)
1. establish a communications link a method among clients, and on the router, it is characterized in that, described method comprises in application:
Receive the inquiry message from the first client, in described inquiry message, carry the COS that described first client needs;
The second client that described COS can be provided is determined whether there is from Service Source list;
If there is described second client that can provide described COS, the first response message is sent to described first client clean culture, described first response message carries the first network address of described second client, sets up the communication connection with described second client for described first client by described first network address.
2. method according to claim 1, is characterized in that, after the inquiry message of described reception from the first client, described method also comprises:
Determine whether described COS meets the access rights for described first client is arranged;
If determine to meet described access rights, perform the described step determining whether to provide the second client of described COS according to described COS from Service Source list;
If do not met, abandon described inquiry message.
3. method according to claim 1, is characterized in that, after the inquiry message of described reception from the first client, described method also comprises:
The session entry whether existing and match with described inquiry message is inquired about from inquiry conversational list;
If there is described session entry, upgrade the timer corresponding with described session entry, and perform described the second client determining whether to provide described COS according to described COS from Service Source list;
If there is no described session entry, creates the session entry matched with described inquiry message, starts the timer corresponding with described session entry.
4. method according to claim 1, is characterized in that, after the inquiry message of described reception from the first client, described method also comprises:
Determine whether the problem field in described inquiry message is empty;
If be empty, abandon described inquiry message;
If be not empty, from described inquiry message, resolve the Service Source of described first client, perform the described step determining whether to provide the second client of described COS according to described COS from Service Source list.
5. method according to claim 1, is characterized in that, after the inquiry message of described reception from the first client, described method also comprises:
Determine whether the acknowledgement field in described inquiry message is empty;
If be empty, from described inquiry message, resolve the COS of described first client, perform the described step determining whether to provide the second client of described COS according to described COS from Service Source list;
If be not empty, from described acknowledgement field, resolve the Service Source that described first client can provide;
Described Service Source list is upgraded according to the Service Source that described first client can provide.
6. method according to claim 5, is characterized in that, the described Service Source that can provide according to described first client upgrades described Service Source list, comprising:
Determine whether to have recorded in described Service Source list the Service Source that described first client can provide;
If recorded the Service Source that described first client can provide, upgrade the existence duration of the Service Source that described first client can provide;
If do not record the Service Source that described first client can provide, the Service Source that can provide for described first client in described Service Source list creates corresponding resource record.
7. method according to claim 1, is characterized in that, described method also comprises:
If there is not described second client that can provide described COS in described Service Source list, in the local area network (LAN) at described router place, multicast sends described inquiry message;
Receive the second response message returned according to described inquiry message from the 3rd client in described local area network (LAN);
If parse the COS meeting described first client needs from described second response message, the second response message is sent to described first client clean culture, described second response message carries the second network address of described 3rd client, sets up the communication connection with described 3rd client for described first client by described second network address.
8. method according to claim 7, is characterized in that, after the second response message that described reception returns according to described inquiry message from the 3rd client in described local area network (LAN), described method also comprises:
Determine whether the acknowledgement field in described second response message is empty;
If be empty, abandon described second response message;
If be not empty, from the acknowledgement field of described second response message, parse the Service Source that described 3rd client provides.
9. method according to claim 7, is characterized in that, described method also comprises:
Determine whether to have recorded in described Service Source list the Service Source that described 3rd client can provide;
If recorded the Service Source that described 3rd client can provide, upgrade the existence duration of the Service Source that described 3rd client can provide;
If do not record the Service Source that described 3rd client can provide, the Service Source that can provide for described 3rd client in described Service Source list creates corresponding resource record.
10. method according to claim 1, is characterized in that, described method also comprises:
Determine the existence duration that the Service Source of each client recorded in described Service Source list is corresponding;
Determine whether to need to send inquiry request to each client described, to determine whether each client described still can provide the COS recorded in described Service Source list according to the duration of crossing in described Service Source list that described existence duration and timer record.
11. methods according to claim 10, is characterized in that, described method also comprises:
For the client returning response message according to described apply for information, described in upgrading in described Service Source list, return the life duration that the client of response message is corresponding;
For the client not returning response message according to described apply for information, the resource information described client not returning response message recorded in described Service Source list is deleted.
12. 1 kinds of devices established a communications link among clients, on the router, it is characterized in that, described device comprises in application:
Receiver module, is configured to receive the inquiry message from the first client, carries the COS that described first client needs in described inquiry message;
First determination module, is configured to determine whether there is the second client of the described COS of carrying in the described inquiry message that described receiver module can be provided to receive from Service Source list;
First sending module, if be configured to described first determination module to determine to there is described second client that can provide described COS, the first response message is sent to described first client clean culture, described first response message carries the first network address of described second client, sets up the communication connection with described second client for described first client by described first network address.
13. devices according to claim 12, is characterized in that, described device also comprises:
Second determination module, is configured to after described receiver module receives the inquiry message from the first client, determines whether described COS meets the access rights for described first client is arranged;
If described second determination module is determined to meet described access rights, described first determination module performs the described step determining whether second client that can provide described COS according to described COS from Service Source list;
First discard module, if be configured to described second determination module not meet described access rights, abandons described inquiry message.
14. devices according to claim 12, is characterized in that, described device also comprises:
Enquiry module, is configured to after described receiver module receives the inquiry message from the first client, from inquiry conversational list, inquire about the session entry whether existing and match with described inquiry message;
Update module, if be configured to described enquiry module inquire and there is described session entry, upgrade the timer corresponding with described session entry, described first determination module execution is described determines whether second client that can provide described COS according to described COS from Service Source list;
First creation module, inquires there is not described session entry if is configured to described enquiry module, creates the session entry matched with described inquiry message, starts the timer corresponding with described session entry.
15. devices according to claim 12, is characterized in that, described device also comprises:
3rd determination module, is configured to after described receiver module receives the inquiry message from the first client, determines whether the problem field in described inquiry message is empty;
Second discard module, if be configured to described 3rd determination module to determine that the problem field in described inquiry message is sky, abandons described inquiry message;
First parsing module, if be configured to described 3rd determination module to determine that the problem field in described inquiry message is not sky, from described inquiry message, resolve the COS of described first client, described first determination module performs the described step determining whether second client that can provide described COS according to described COS from Service Source list.
16. devices according to claim 12, is characterized in that, described device also comprises:
4th determination module, after being configured to the inquiry message of described receiver module reception from the first client, determines whether the acknowledgement field in described inquiry message is empty;
Second parsing module, if be configured to described 4th determination module to determine that the acknowledgement field in described inquiry message is sky, from described inquiry message, resolve the Service Source of described first client, described first determination module performs the described step determining whether second client that can provide described COS according to described COS from Service Source list;
3rd parsing module, if be configured to described 4th determination module to determine that the acknowledgement field in described inquiry message is not sky, resolves the Service Source that described first client can provide from described acknowledgement field;
First update module, the Service Source that described first client being configured to parse according to described 3rd parsing module can provide upgrades described Service Source list.
17. devices according to claim 16, is characterized in that, described first update module comprises:
Determine submodule, be configured to determine whether to have recorded in described Service Source list the Service Source that described first client that described 3rd parsing module parses can provide;
Upgrade submodule, if be configured to the described Service Source that submodule is determined to record described first client and can be provided of determining, upgrade the existence duration of the Service Source that described first client can provide;
Create submodule, if be configured to the described Service Source that submodule is determined not record described first client and can be provided of determining, the Service Source that can provide for described first client in described Service Source list creates corresponding resource record.
18. devices according to claim 12, is characterized in that, described device also comprises:
Second sending module, if be configured to described first determination module to determine there is not described second client that can provide described COS in described Service Source list, in the local area network (LAN) at described router place, multicast sends described inquiry message;
Second receiver module, is configured to receive the second response message returned according to the described inquiry message that described second sending module sends from the 3rd client in described local area network (LAN);
3rd sending module, if be configured to parse the COS meeting described first client needs from described second response message that described second receiver module receives, the second response message is sent to described first client clean culture, described second response message carries the second network address of described 3rd client, sets up the communication connection with described 3rd client for described first client by described second network address.
19. devices according to claim 18, is characterized in that, described device also comprises:
5th determination module, is configured to after described second receiver module receives the second response message returned according to described inquiry message from the 3rd client in described local area network (LAN), determine whether the acknowledgement field in described second response message is empty;
3rd discard module, if be configured to described 5th determination module to determine that the acknowledgement field in described second response message is sky, abandons described second response message;
4th parsing module, if be configured to described 5th determination module to determine that the acknowledgement field in described second response message is not sky, parses the Service Source that described 3rd client provides from the acknowledgement field of described second response message.
20. devices according to claim 19, is characterized in that, described device also comprises:
6th determination module, is configured to determine whether to have recorded in described Service Source list the Service Source that described 3rd client can provide;
Second update module, if be configured to described 6th determination module to determine to record the Service Source that described 3rd client can provide, upgrades the existence duration of the Service Source that described 3rd client can provide;
Second creation module, if be configured to described 6th determination module to determine not record the Service Source that described 3rd client can provide, the Service Source that can provide for described 3rd client in described Service Source list creates corresponding resource record.
21. devices according to claim 12, is characterized in that, described device also comprises:
7th determination module, is configured to the existence duration determining that the Service Source of each client recorded in described Service Source list is corresponding;
8th determination module, be configured to the duration of crossing in described Service Source list that the described existence duration determined according to described 7th determination module and timer record determine whether to need to send inquiry request to each client described, to determine whether each client described still can provide the COS recorded in described Service Source list.
22. devices according to claim 21, is characterized in that, described device also comprises:
3rd update module, is configured to the client for returning response message according to described apply for information, returns the life duration that the client of response message is corresponding in described Service Source list described in upgrading;
Removing module, is configured to the client for not returning response message according to described apply for information, and the resource information described client not returning response message recorded in described Service Source list is deleted.
23. 1 kinds of routers, is characterized in that, described router comprises:
Processor;
For the memory of storage of processor executable instruction;
Wherein, described processor is configured to:
Receive the inquiry message from the first client, in described inquiry message, carry the COS that described first client needs;
The second client that described COS can be provided is determined whether from Service Source list;
If there is described second client that can provide described COS, the first response message is sent to described first client clean culture, described first response message carries the first network address of described second client, sets up the communication connection with described second client for described first client by described first network address.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510091895.9A CN104618394B (en) | 2015-02-28 | 2015-02-28 | The method, apparatus and router of communication connection are established among clients |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510091895.9A CN104618394B (en) | 2015-02-28 | 2015-02-28 | The method, apparatus and router of communication connection are established among clients |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104618394A true CN104618394A (en) | 2015-05-13 |
CN104618394B CN104618394B (en) | 2018-05-18 |
Family
ID=53152669
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510091895.9A Active CN104618394B (en) | 2015-02-28 | 2015-02-28 | The method, apparatus and router of communication connection are established among clients |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104618394B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110830790A (en) * | 2018-08-08 | 2020-02-21 | 浙江宇视科技有限公司 | Method and device for intelligently building automatic testing networking environment |
CN114513549A (en) * | 2022-02-18 | 2022-05-17 | 新华三技术有限公司 | Communication method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103312571A (en) * | 2013-05-28 | 2013-09-18 | 北京小米科技有限责任公司 | Method and device for finding equipment |
CN103412728A (en) * | 2013-07-10 | 2013-11-27 | 深圳Tcl新技术有限公司 | Method and system for device file printing based on local area network |
CN103955348A (en) * | 2014-05-06 | 2014-07-30 | 丁四涛 | Network printing system and printing method |
WO2014198142A1 (en) * | 2013-06-09 | 2014-12-18 | Hangzhou H3C Technologies Co., Ltd. | Zero-configuration networking protocol |
-
2015
- 2015-02-28 CN CN201510091895.9A patent/CN104618394B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103312571A (en) * | 2013-05-28 | 2013-09-18 | 北京小米科技有限责任公司 | Method and device for finding equipment |
WO2014198142A1 (en) * | 2013-06-09 | 2014-12-18 | Hangzhou H3C Technologies Co., Ltd. | Zero-configuration networking protocol |
CN103412728A (en) * | 2013-07-10 | 2013-11-27 | 深圳Tcl新技术有限公司 | Method and system for device file printing based on local area network |
CN103955348A (en) * | 2014-05-06 | 2014-07-30 | 丁四涛 | Network printing system and printing method |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110830790A (en) * | 2018-08-08 | 2020-02-21 | 浙江宇视科技有限公司 | Method and device for intelligently building automatic testing networking environment |
CN114513549A (en) * | 2022-02-18 | 2022-05-17 | 新华三技术有限公司 | Communication method and device |
CN114513549B (en) * | 2022-02-18 | 2023-09-15 | 新华三技术有限公司 | Communication method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104618394B (en) | 2018-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104202360B (en) | The method of accessed web page, device and router | |
US9531585B2 (en) | Network bootstrapping for a distributed storage system | |
US20140035727A1 (en) | Application Routing Configuration for NFC Controller Supporting Multiple NFCEEs | |
US9107164B1 (en) | Wake on one-to-many communication | |
WO2019134595A1 (en) | Configuration system, client device, embedded device configuration method, and storage medium | |
CN103229478A (en) | Method and device for virtual-machine drift determination | |
CN112104744B (en) | Traffic proxy method, server and storage medium | |
CN108207012B (en) | Flow control method, device, terminal and system | |
CN101147380A (en) | Method and apparatus for efficiently expanding a P2P network | |
WO2017167185A1 (en) | Architecture, method and apparatus for realizing network function communication | |
US9313345B2 (en) | Information processing apparatus, system, and control method for information processing apparatus | |
CN105245382A (en) | Router configuration information modifying method and device | |
US9930151B2 (en) | Method and apparatus for extending local area network protocols to work across the internet and establishing connectivity without discovery for local area network protocols | |
JP2017208797A (en) | Unified data networking across heterogeneous networks | |
JP2017201776A (en) | Content delivery through uneven network | |
WO2017167186A1 (en) | Architecture, method and apparatus for realizing network function communication | |
CN104618394A (en) | Method and device for establishing communication connection between client sides and router | |
US8135742B2 (en) | Proxy service providing apparatus, service providing method, and network system | |
US8166199B2 (en) | Communication apparatus, network system, communication method and program | |
US20150036584A1 (en) | Relay server, service providing device, and access control method | |
CN105340238A (en) | System and method of ANQP querying using common ANQP group version | |
US20230254381A1 (en) | Service Request Handling | |
CN112448985B (en) | Distributed system, network processing method and device and electronic equipment | |
JP4532238B2 (en) | On-demand service provision system | |
CN105745950A (en) | Managing multicast transmissions |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |