Summary of the invention
In order to solve above-mentioned technical problem, the invention provides a kind of equipment method of attachment and device, it is possible to
Multiple from the scene of equipment at a main equipment, both avoid being mistakenly connected to non-targeted equipment, again can in time,
Quickly it is connected to target device.
In order to reach the object of the invention, the invention provides a kind of equipment method of attachment, including:
First equipment is searched for and receives broadcast;
If what described first equipment received that the second equipment sends carries the first wide of the first indication field
Broadcast message, then judge whether to be connected with described built the standing of second equipment, if it is, with described second
Equipment is set up and is reconnected;Otherwise, broadcast is continued search for;If described first equipment receives second and sets
With described second equipment whether the second broadcast of the second indication field that what preparation was sent carry, then judge
Built stood connection, reconnected if it is, set up with described second equipment;Otherwise, with described second equipment
Newly-built connection.
Further, described first broadcast is that described second equipment is not in the case of function key is triggered
Sent;Described second broadcast is that described second equipment is in the case of detecting that function key is triggered
Sent.
Further, described method also includes:
Described first equipment is upon receiving the broadcast message, it may be judged whether built with described second equipment stood
Before connection, outside filtering out target device always according to the device identification carried in the broadcast received
The broadcast that other equipment sends.
Further, a kind of equipment method of attachment, including:
Second equipment sends the first broadcast, carries the first indication field in described first broadcast,
The first equipment receiving the first broadcast for instruction judges whether stood built with described second equipment
Connect, reconnect if it is, set up with described second equipment;Otherwise, broadcast is continued search for;
Described second equipment sends the second broadcast according to the operation of user, in described second broadcast
In carry the second indication field, receive the first equipment of the second broadcast for instruction and judging and institute
Second equipment of stating is built stood connection in the case of, set up with described second equipment and reconnect;Otherwise, with institute
State the second newly-built connection of equipment.
Further, the triggering of described second equipment Inspection function key, in the case of function key is not triggered
Send described first broadcast;Described second broadcast is sent in the case of function key is triggered detecting
Message.
Further, a kind of equipment connecting device, including: message reception units, connection judgment unit and company
Order unit, wherein:
Described message reception units, is used for searching for and receiving broadcast;
Described connection judgment unit, for receiving taking of the second equipment transmission at described message reception units
During with the first broadcast of the first indication field, it may be judged whether connected with described built the standing of second equipment
Connect, reconnect if it is, indicate described connection unit to set up with described second equipment;Otherwise, instruction institute
State message reception units and continue search for broadcast;Receive the second equipment at described message reception units to send out
During the second broadcast carrying the second indication field sent, it may be judged whether built with described second equipment
Stood connection, reconnected if it is, indicate described connection unit to set up with described second equipment;Otherwise,
Indicate that described connection unit is newly-built with described second equipment to be connected;
Described connection unit, reconnects for setting up with described second equipment or newly-built is connected.
Further, described first broadcast is that described second equipment is not in the case of function key is triggered
Sent;Described second broadcast is that described second equipment is in the case of detecting that function key is triggered
Sent.
Further, this device also includes filter element, wherein:
Described filter element, is used for after described message reception units receives broadcast, described connection
Judging unit judge whether built with described second equipment stood be connected before, according to described message reception units
The device identification carried in the broadcast received filters out what other equipment outside target device sent
Broadcast.
Further, a kind of equipment connecting device, including: the first broadcast signal generating unit, the second broadcast
Message generation unit and transmitting element, wherein:
Described first broadcast signal generating unit, for generating the first broadcast and sending list by described
Unit sends described first broadcast, carries the first indication field, be used in described first broadcast
Instruction receives the first equipment of the first broadcast and judges whether to connect with described built the standing of second equipment
Connect, reconnect if it is, set up with described second equipment;Otherwise, broadcast is continued search for;
Described second broadcast signal generating unit, for generating the second broadcast also according to the operation of user
Send described second broadcast by described transmitting element, in described second broadcast, carry second
Indication field, the first equipment receiving the second broadcast for instruction is judging and described second equipment
Built stood connection in the case of, with described second equipment set up reconnect;Otherwise, with described second equipment
Newly-built connection;
Described transmitting element, for raw according to described first broadcast signal generating unit or the second broadcast
Calling of unit is become to carry out message transmission.
Further, this device also includes detector unit, wherein:
Described detector unit, for detecting the triggering of function key, obtains testing result;
Described first broadcast signal generating unit, specifically for described detector unit detection function key not by
Described first broadcast is generated in the case of triggering;
Described second broadcast signal generating unit, specifically for detecting function key quilt in described detector unit
Described second broadcast is generated in the case of triggering.
Compared with prior art, the present invention includes that the first equipment is searched for and receives broadcast;If received
The first broadcast carrying the first indication field sent to the second equipment, then judge whether and second
Equipment is built stood connection, reconnected if it is, set up with the second equipment;Otherwise, broadcast is continued search for
Message;If receiving the second broadcast carrying the second indication field that the second equipment sends, then
Judge that stood the most built with the second equipment is connected, reconnect if it is, set up with the second equipment;Otherwise,
Newly-built with the second equipment it is connected.The present invention is in the environment of one master and multiple slaves, and main equipment both can be avoided connecting
To be not set up connect non-targeted equipment, can in time, quickly be connected to whether set up again
Cross the target device connected and multiple identical in the case of equipment existing, non-mesh will not be mistakenly connected to
Mark is from equipment.Further, after connecting disconnection, it is not necessary to any operation, can realize reconnecting.
Other features and advantages of the present invention will illustrate in the following description, and, partly from froming the perspective of
Bright book becomes apparent, or understands by implementing the present invention.The purpose of the present invention is excellent with other
Point can be realized by structure specifically noted in description, claims and accompanying drawing and be obtained.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing
Embodiments of the invention are described in detail.It should be noted that in the case of not conflicting, this Shen
Embodiment in please and the feature in embodiment can mutual combination in any.
Can be at the computer of such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing
System performs.And, although show logical order in flow charts, but in some cases,
Can be to be different from the step shown or described by order execution herein.
As it is shown in figure 1, a kind of equipment method of attachment of the application, including:
Step 101: the first equipment Inspection user opens the enabled instruction of broadcast search, according to user
Enabled instruction start broadcast search;
First equipment can be mobile phone or other can be as the Intelligent hardware etc. of main equipment.
Step 102: the first equipment is searched for and receives broadcast;
First equipment, after the search starting broadcast, may search for the broadcast of near zone,
And be received.
Step 103: the first equipment is after receiving the broadcast that the second equipment sends, it is judged that receive
The broadcast of the second equipment be the first broadcast carrying the first indication field, still carry
Second broadcast of the second indication field, if receiving the first broadcast, then performs step 104;
If receiving the second broadcast, then perform step 106;
The first indication field carried in first broadcast is for indicating the first equipment to receive first wide
After broadcasting message, it may be judged whether stood built with the second equipment is connected, and stands connection if built, then with
Two equipment are set up and are reconnected;Without setting up connection, then continue search for broadcast.Such that it is able to protect
First equipment of demonstrate,proving in the scene of one master and multiple slaves it can be avoided that misconnection non-targeted equipment.
The second indication field carried in second broadcast is for indicating the first equipment to receive second wide
After broadcasting message, it may be judged whether stood built with the second equipment is connected, and stands connection if built, then with
Two equipment are set up and are reconnected;Otherwise, newly-built with the second equipment it is connected.Such that it is able to avoiding the non-mesh of misconnection
While marking device, can in time, quickly set up connection for target device, no matter target device
It is the equipment being connected of having set up with the first equipment, did not still set up the new equipment connected.
First broadcast is that second equipment function key controlling to connect on this second equipment is not triggered
In the case of sent, such as, the second equipment starting up, ready after, persistently send
One broadcast.
Second broadcast is the second equipment institute in the case of function key control connection being detected is triggered
Send, triggering mode can be click, double-click, three hit or long by etc..Such as, the second equipment is in inspection
Measure after function key is double-clicked and send the second broadcast.In the application only when new foundation connects, need
User triggers a function key and completes establishment of connection.Restart at equipment, connect when disconnection, all
Need not user and carry out any operation again, can realize reconnecting.
Being that the second broadcast arranges timeout mechanism, the i.e. second equipment is persistently sending the second broadcast one
After the appointment time, then start and send the first broadcast, in order to avoid the second equipment to connect newly entering arriving
Other main equipments of near zone.
Second equipment, after being connected with the first equipment foundation, closes the transmission of broadcast.Disconnect connecting
After, restart the transmission of the first broadcast.
Function key can be the special connection button (such as Bluetooth key, wifi button etc.) arranged on equipment,
Can also be multiplexing power button or main menu button etc..
In the application, the second equipment (includes that the first broadcast and the second broadcast disappear in the broadcast sent
Breath) in can also carry the device identification of the second equipment, in order to the first equipment upon receiving the broadcast message,
The first broadcast filtering out the transmission of non-targeted equipment according to the device identification carried in broadcast, then,
Judge that stood the most built with the second equipment is connected again, thus the broadcast only sent target device is entered
Row processes, and reduces the treating capacity of the first equipment, and improves joint efficiency and set up the safety connected.
Step 104: the first equipment judges stood the most built with the second equipment sending the first broadcast
Connect, if it is, perform step 105;Otherwise, step 102 is performed;
In the application, the first equipment judges that stood the most built with the second equipment is connected, including: set second
Standby MAC Address is carried out in the connected device MAC Address list that this first equipment self preserves
Coupling, if matched, it is determined that set up with the second equipment and be connected;If do not matched, then
Determine not set up with the second equipment and be connected.
First equipment can get the MAC of the second equipment from the source address field of the first broadcast
Address.
Step 105: the first equipment and the second equipment are set up and reconnected, and terminate;
In the application, the first equipment is actively set up with the second equipment and is reconnected.
Step 106: the first equipment judges that stood the most built with the second equipment is connected, if it is, hold
Row step 105;Otherwise, step 107 is performed;
Step 107: the first equipment and the newly-built connection of the second equipment, completes matching operation, preserves and second
The relevance linkage information of equipment.
First equipment is after setting up with the second equipment and being connected, also by the MAC Address of the second equipment write the
In the connected device MAC Address list that one equipment self preserves.
First equipment will actively initiate the connection establishment process with the second equipment, carries in a connection request
The identification information of the first equipment, in order to the second equipment judges the legitimacy of the first equipment accordingly, and then determines
Whether set up and the connection of the first equipment.
As in figure 2 it is shown, the equipment method of attachment of another embodiment of the application, including:
Step 201: the second equipment sends the first broadcast, carries the first finger in the first broadcast
Showing field, the first equipment receiving the first broadcast for instruction judges whether built with the second equipment
Stood connection, reconnected if it is, set up with the second equipment;Otherwise, broadcast is continued search for;
Step 202: the second equipment sends the second broadcast according to the operation of user, disappears in the second broadcast
Breath carries the second indication field, for instruction receive the first equipment of the second broadcast judge with
Second equipment is built stood connection in the case of, set up with the second equipment and reconnect;Otherwise, with the second equipment
Newly-built connection.
In the application the first broadcast be non-user trigger send, the second broadcast be user trigger send out
Send.No matter the second equipment has been transmitted across the first broadcast, as long as to trigger transmission second wide for user
Broadcast message, then the second equipment performs the transmission of the second broadcast.
Second equipment sends the first broadcast in the case of function key is not triggered;Function detected
Key sends the second broadcast in the case of being triggered.
Such as, the second each function key of equipment Inspection, obtain testing result, according to the testing result obtained,
Determining whether the function key controlling to connect is triggered, if be triggered, then the second equipment sends and carries second
Second broadcast of indication field.Triggering mode can be click, double-click, three hit or long by etc..Example
As, the second equipment sends the second broadcast after function key is double-clicked detecting.
Being that the second broadcast arranges timeout mechanism on the second device, the second equipment is persistently sending second
After the broadcast one appointment time, perform the transmission of the first broadcast, to avoid the second equipment continuous
Send the second broadcast to cause being connected to newly entering other main equipments near zone.And again examining
Measure after the function key controlling to connect is triggered, then restart to send the second broadcast.
Second equipment, after being connected with the first equipment foundation, closes the transmission of broadcast.Disconnect connecting
After, restart the transmission of the first broadcast.
Second equipment, when the first equipment initiates newly-built connection, responds the connection request of the first equipment.
As it is shown on figure 3, a kind of equipment connecting device that the application provides, including: message reception units,
Connection judgment unit and connection unit, wherein:
Message reception units, is used for searching for and receiving broadcast;
Connection judgment unit, for message reception units receive second equipment send carry first
During the first broadcast of indication field, it may be judged whether stood built with the second equipment is connected, if it is,
Then instruction connects unit and the second equipment is set up and reconnected;Otherwise, instruction message reception units continues search for extensively
Broadcast message;Message reception units receive second equipment send carry the second of the second indication field
During broadcast, it may be judged whether stood built with the second equipment is connected, if it is, instruction connects unit
Set up with the second equipment and reconnect;Otherwise, instruction connects unit and the newly-built connection of the second equipment;
Connect unit, reconnect for setting up with the second equipment or newly-built be connected.
First broadcast is that the second equipment is sent in the case of function key is not triggered;Second broadcast
Message is the second equipment to be sent in the case of function key is triggered detecting.
Shown device also includes filter element, wherein:
Filter element, is used for after message reception units receives broadcast, connection judgment unit judges
The most built with the second equipment stood be connected before, take according in the broadcast that message reception units receives
The device identification of band filters out the broadcast that other equipment outside target device sends.
As shown in Figure 4, the another kind of equipment connecting device that the application provides, including: the first broadcast
Signal generating unit, the second broadcast signal generating unit and transmitting element, wherein:
First broadcast signal generating unit, for generating the first broadcast and by transmitting element transmission the
One broadcast, carries the first indication field in the first broadcast, receives first for instruction wide
The first equipment broadcasting message judges whether that stood built with the second equipment is connected, if it is, set with second
Standby foundation reconnects;Otherwise, broadcast is continued search for;
Second broadcast signal generating unit, for generating the second broadcast according to the operation of user and passing through
Transmitting element sends the second broadcast, carries the second indication field in the second broadcast, is used for referring to
Show that the first equipment receiving the second broadcast built with the second equipment found situation about being connected judging
Under, set up with the second equipment and reconnect;Otherwise, newly-built with the second equipment it is connected;
Transmitting element, for according to the first broadcast signal generating unit or the second broadcast signal generating unit
Call and carry out message transmission.
Shown device also includes detector unit, wherein:
Detector unit, for detecting the triggering of function key, obtains testing result;
First broadcast signal generating unit, specifically for the feelings not being triggered in detector unit detection function key
The first broadcast is generated under condition;
Second broadcast signal generating unit, specifically for detecting, in detector unit, the feelings that function key is triggered
The second broadcast is generated under condition.
Although the embodiment that disclosed herein is as above, but described content only readily appreciates the present invention
And the embodiment used, it is not limited to the present invention.Technology people in any art of the present invention
Member, on the premise of without departing from the spirit and scope that disclosed herein, can be in the form implemented and thin
Any amendment and change is carried out on joint, but the scope of patent protection of the present invention, still must be with appended right
Claim is defined in the range of standard.