The control method of PnP device
Technical field
The present invention relates to digital communication technology field, more particularly to a kind of control method of PnP device.
Background technology
With the popularization of the development of digital home and home network, and consumer digital electronic product, in family gradually
There are increasing digitlization amusement equipment and household appliances.Pass through the wired or wireless network of household internal, these equipment
It can interconnect, and further realize the functions such as content is shared and mutually controls.Home network device is generally using general
Plug and play technique realizes the intercommunication and control between equipment.
In plug and play architecture, user can realize inserting i.e. to other networkings by plug and play control point
With the control of household equipment.Plug and play control point meets the command operation PnP device of plug and play protocol by sending
The service provided, obtains the state and control information of PnP device.
With being on the increase in home network with plug-and-play feature home appliance, plug and play control point and insert
I.e. can be with more than one with equipment.Multiple plug and play control points can control same PnP device service, multiple to be
Plug-and-play equipment can provide same service.When multiple plug and play control points operate same PnP device service,
It is possible that competitive relation, causes current PnP device service disruption, influence user uses.Therefore need to it is multiple i.e.
Plug-and-play control point operates same PnP device service to carry out protection control so that user during service use not
It can be interrupted accidentally.Multiple PnP devices are there may be in home network same type of service is provided, user is using clothes
During business, if the PnP device of current service leaves, plug and play control point should be found other i.e. slotting as early as possible
User service is continued as with equipment.
The content of the invention
When operating same PnP device the invention aims to solve multiple plug and play control points, cause
The problem of interruption of current service.
To achieve the above object, the invention provides a kind of control method of PnP device, it is characterised in that described
Method includes:
The command information at the first control point is received when the first PnP device is in running order;
First PnP device inquires about record sheet, when having corresponding relation with first PnP device
Second control point is identical with first control point, or first PnP device does not have the control of corresponding relation
During point, first PnP device performs the corresponding processing operation of the command information;
When first PnP device is exited, or first control point detects first plug and play and set
During for improper exiting, the second PnP device is chosen at first control point from service list;
When second PnP device is in idle condition, first control point is to second plug and play
Equipment sends the command information.
Further, methods described also includes:When second control with first PnP device with corresponding relation
When system point is different from first control point, first PnP device returns to error message to first control point.
Further, it is described when first PnP device is exited, or first control point detect it is described
First PnP device is improper also to be included when exiting, and first control point is by first PnP device from described
Deleted in service list.
Further, methods described also includes:When first PnP device from working condition is changed into idle condition,
Or when from idle condition being changed into working condition, first control point is changed described first in the service list and inserted i.e.
With the state of equipment.
Further, methods described also includes:When second PnP device is in running order, described first
The 3rd PnP device is chosen from the service list in control point.
Advantages of the present invention is:
(1)When the same PnP device of multiple plug and play control point contention operations, it is to avoid current service is interrupted.
(2)When PnP device is exited or the first control point detects that the first PnP device is improper to be exited,
Plug and play control point can choose an alternative PnP device and continue offer service, so as to improve the reliability of service
Property.
Brief description of the drawings
Fig. 1 is the control method flow chart of PnP device provided in an embodiment of the present invention;
Fig. 2 is the control method corresponding relation state transition diagram of PnP device provided in an embodiment of the present invention;
Fig. 3 is that PnP device provided in an embodiment of the present invention handles plug and play control point command operation flow chart;
Fig. 4 is that plug and play control point provided in an embodiment of the present invention handles PnP device flow chart.
Embodiment
Below by drawings and Examples, technical scheme is described in further detail.
Fig. 1 is the control method flow chart of PnP device provided in an embodiment of the present invention.As shown in figure 1, this method
Comprise the following steps:
Step 101, the command information at the first control point is received when the first PnP device is in running order;
Step 102, the first PnP device inquiry record sheet, when there is corresponding relation with the first PnP device
Second control point is identical with the first control point, or during control point of first PnP device with corresponding relation, the
The corresponding processing operation of one PnP device execute instruction information;
Further, when different with the first control point from the first PnP device second control point with corresponding relation
When, the first PnP device returns to error message to the first control point.
Step 103, when the first PnP device is exited, or to detect the first PnP device non-at the first control point
When normally exiting, the second PnP device is chosen at the first control point from service list;
Step 104, when the second PnP device is in idle condition, the first control point is to the second PnP device
Send command information.
Fig. 2 is the control method corresponding relation state transition diagram of PnP device provided in an embodiment of the present invention.Such as Fig. 2
It is shown, when PnP device starts, the service state of PnP device is set to idle condition, now plug and play
Corresponding relation is not present with control point in equipment;When the service state of PnP device is working condition, PnP device
Record and the corresponding relation at control point;When control point is left, PnP device removes whole corresponding relations with control point,
At the same time, PnP device can receive the command information at any one control point;When PnP device is to control point
Service at the end of, service state is set to idle condition by PnP device, and removes the corresponding relation with control point.
Fig. 3 is that PnP device provided in an embodiment of the present invention handles plug and play control point command operation flow chart.
As shown in figure 3, the operating process comprises the following steps:
Step 301, when PnP device is in running order, control point sends instruction letter to PnP device
Breath.
Step 302, if PnP device is not recorded with the corresponding relation at control point or the control point with inserting i.e.
With the control point recorded in equipment it is identical when, PnP device performs the command information.
Step 303, if the corresponding relation of PnP device record is different from the control point, PnP device is not
The command information is performed, and returns to error code information.
Fig. 4 is that plug and play control point provided in an embodiment of the present invention handles PnP device flow chart.Such as Fig. 4 institutes
Show, the processing procedure comprises the following steps:
Step 401, when PnP device leaves, control point deletes the PnP device from service list.
Step 402, control point selects the PnP device in idle condition from service list, and is set to plug and play
Preparation send command information.
Step 403, if the PnP device of selection is in running order, control point selection is next in the free time
PnP device under state.Until operating successfully or untill there is no alternative PnP device in service list.
Further, the relation of the service list of control point offer required service, control point and service list is as follows:
(1)When the PnP device newly added provides service, control point is added into service list.
(2)When the PnP device in service list leaves, the record in service list is deleted.
(3)When the service state of PnP device changes, the service state in modification service list.
Above-described embodiment, has been carried out further to the purpose of the present invention, technical scheme and beneficial effect
Describe in detail, should be understood that the embodiment that the foregoing is only the present invention, be not intended to limit the present invention
Protection domain, within the spirit and principles of the invention, any modifications, equivalent substitutions and improvements done etc. all should be included
Within protection scope of the present invention.