Summary of the invention
The invention provides a kind of method and apparatus by gateway control apparatus, in order to solve in existing Centralized Control System, often to reach the standard grade an intelligent appliance of the same type, control terminal all to gateway consults AllJoyn service interface, will cause the problem that the repetitive operation of control terminal and gateway is more.
Based on above-mentioned technical matters, the present invention solves by the following technical programs.
The invention provides a kind of method by gateway control apparatus, the step performed at described gateway side comprises: the facility information and the device type that receive the equipment described to be controlled that equipment to be controlled sends; Obtain standard corresponding to described device type and control plug-in unit; Based on described facility information, standard described in instantiation controls plug-in unit, and the equipment that obtains controls plug-in unit; Described equipment is controlled plug-in unit and sends to control terminal, so that described control terminal controls plug-in unit based on described equipment control described equipment to be controlled.
Wherein, obtain standard corresponding to described device type and control plug-in unit, comprising: from local terminal or from network side, obtain standard corresponding to described device type and control plug-in unit.
Wherein, obtain standard corresponding to described device type from network side and control plug-in unit, comprising: obtain device description file corresponding to described device type from network side; In described device description file, inquire about the logical device types of described equipment to be controlled; Obtain standard corresponding to described logical device types from network side and control plug-in unit.
Wherein, described facility information comprises: the unique identification information of described equipment to be controlled; Or described facility information comprises: the unique identification information of described equipment to be controlled and the AllJoyn service interface information of described equipment to be controlled.
Wherein, if described facility information does not comprise the AllJoyn service interface information of described equipment to be controlled, then based on described facility information, before standard described in instantiation controls plug-in unit, described method also comprises: the AllJoyn service interface information obtaining described equipment to be controlled.
Present invention also offers a kind of device by gateway control apparatus, the described device being positioned at gateway side comprises: receiver module, for receiving facility information and the device type of the equipment described to be controlled that equipment to be controlled sends; Acquisition module, controls plug-in unit for obtaining standard corresponding to described device type; Instantiation module, for based on described facility information, standard described in instantiation controls plug-in unit, and the equipment that obtains controls plug-in unit; Sending module, sends to control terminal for described equipment is controlled plug-in unit, so that described control terminal controls plug-in unit based on described equipment control described equipment to be controlled.
Wherein, described acquisition module, for from local terminal or from network side, obtains standard corresponding to described device type and controls plug-in unit.
Wherein, from network side obtain standard corresponding to described device type control plug-in unit time, described acquisition module specifically for: obtain device description file corresponding to described device type from network side; In described device description file, inquire about the logical device types of described equipment to be controlled; Obtain standard corresponding to described logical device types from network side and control plug-in unit.
Wherein, described facility information comprises: the unique identification information of described equipment to be controlled; Or described facility information comprises: the unique identification information of described equipment to be controlled and the AllJoyn service interface information of described equipment to be controlled.
Wherein, if described facility information does not comprise the AllJoyn service interface information of described equipment to be controlled, then described instantiation module is also for the AllJoyn service interface information obtaining described equipment to be controlled.
Beneficial effect of the present invention is as follows:
The present invention is at gateway side, and according to facility information and the device type of equipment to be controlled, control plug-in unit for equipment to be controlled generates corresponding equipment, control terminal controls plug-in unit based on this equipment and controls equipment to be controlled.Equipment to be controlled can be avoided to reach the standard grade by the present invention, control terminal all needs the AllJoyn service interface inquiring about equipment to be controlled at every turn, reduces the repetitive operation of control terminal and gateway, provides work efficiency, promotes Consumer's Experience effect.
Embodiment
Centralized Control System comprises: gateway, control terminal and equipment to be controlled.Wherein, the quantity of equipment to be controlled can be one or more.Such as: in home environment, arrange comprise the router of gateway function, intelligent appliance, for controlling the mobile terminal of intelligent appliance.Further, gateway accessing Internet of Things, communicates to set up with cloud platform.
Main thought of the present invention is, the present invention, at gateway side, according to facility information and the device type of equipment to be controlled, controls plug-in unit for equipment to be controlled generates corresponding equipment, and equipment is controlled plug-in unit send to control terminal, control terminal controls plug-in unit based on this equipment and controls equipment to be controlled.Equipment to be controlled can be avoided to reach the standard grade by the present invention, control terminal all needs the AllJoyn service interface inquiring about equipment to be controlled at every turn, reduces the repetitive operation of control terminal and gateway, provides work efficiency, promotes Consumer's Experience effect.
Below in conjunction with accompanying drawing and embodiment, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, do not limit the present invention.
Embodiment one
The present embodiment provides a kind of method by gateway control apparatus.Fig. 1 is the process flow diagram of the method by gateway control apparatus according to a first embodiment of the present invention.
Step S110, receives facility information and the device type of this equipment to be controlled that equipment to be controlled sends.
Equipment to be controlled comprises: intelligent appliance.Such as: intelligent air condition, intelligent washing machine etc.
Facility information comprises: the unique identification information of equipment to be controlled; Or facility information comprises: the unique identification information of equipment to be controlled and the AllJoyn service interface information of equipment to be controlled.Unique identification information is for distinguishing different equipment to be controlled.The unique identification information of equipment to be controlled is such as: Lighting1.AllJoyn service interface information comprises interface name and interface method and/or interface attributes.Such as: interface name is org.AllJoyn.LightingController, interface method is for opening On, closing Off (), and interface attributes is that light color regulates LightingColor.
Device type is: the kind of intelligent appliance.Such as: Intelligent air tone category, intelligent washing machine class etc.
Facility information and device type can be sent to gateway by equipment to be controlled.Such as: equipment to be controlled when gateway registration, Portable device information and device type in log-on message.
Step S120, obtains standard corresponding to device type and controls plug-in unit.
It is standardized model that standard controls plug-in unit, and this standard controls the function control information that plug-in unit provides equipment to be controlled.The equipment to be controlled of identical device type shares a standard and controls plug-in unit, and namely device type and standard control plug-in unit one_to_one corresponding.Standard controls plug-in unit and comprises facility information, device type, function control command.Wherein, standard controls the facility information in plug-in unit is empty.
Concrete, receive device type, just can obtain standard corresponding to device type and control plug-in unit; Or first the device type received is carried out buffer memory, notice control terminal equipment to be controlled is reached the standard grade, if the control plug-in unit receiving control terminal transmission generates request, then obtain standard corresponding to device type and control plug-in unit.
From local terminal (gateway) or from network side, obtain standard corresponding to device type and control plug-in unit.Further, judge whether local terminal exists the standard corresponding with device type and control plug-in unit; If so, then obtain standard corresponding to device type from local terminal and control plug-in unit; If not, then obtain standard corresponding to device type from network side and control plug-in unit.
If local terminal exists device type, corresponding standard controls plug-in unit, then represent that gateway is for other equipment of the same type with equipment to be controlled, performed the acquisition that standard controls plug-in unit; Or represent that gateway has prestored multiple standards and controlled plug-in unit.
Step S130, based on facility information, instantiation standard controls plug-in unit, and the equipment that obtains controls plug-in unit.
Equipment control plug-in unit is that the standard after instantiation controls plug-in unit.Based on the facility information of equipment to be controlled, standard is controlled plug-in unit and be created as concrete object, this object is that the equipment that equipment to be controlled is corresponding controls plug-in unit.
Through instantiation process, it is corresponding with equipment to be controlled that equipment controls plug-in unit, and equipment controls plug-in unit can carry out function control to equipment to be controlled.
Instantiation standard controls plug-in unit, is standard is controlled plug-in unit and equipment to be controlled is bound, and then creates out the plug-in unit for controlling to specify equipment to be controlled.
If facility information does not comprise the AllJoyn service interface information of equipment to be controlled, then based on facility information, before instantiation standard control plug-in unit, also need the AllJoyn service interface information obtaining equipment to be controlled.
Step S140, controls plug-in unit by equipment and sends to control terminal, so that control terminal controls plug-in unit based on equipment control equipment to be controlled.
Control terminal receives and loading equipemtn controls plug-in unit.Like this, the function controlling equipment to be controlled is just provided with at control terminal.When needs control equipment to be controlled, control terminal only needs control command to be sent to equipment to be controlled by gateway, just can realize the control to equipment to be controlled.
It should be noted that, facility information and device type, when transmitting apparatus information and device type, can together send by equipment to be controlled, also can separately send, further, facility information can send after device type, as long as facility information ensures to send before instantiation process.
Based on the present embodiment, gateway automatically generates equipment corresponding to equipment to be controlled and controls plug-in unit, and control terminal controls plug-in unit based on this equipment and controls equipment to be controlled, and avoid equipment to be controlled to reach the standard grade, control terminal all will inquire about its AllJoyn service interface information at every turn.
Embodiment two
Fig. 2 is the process flow diagram of the method by gateway control apparatus according to a second embodiment of the present invention.
Step S210, receives the log-on message that equipment to be controlled sends, and finishing equipment registration; Facility information and device type is carried in this log-on message.
Facility information comprises: the device name of equipment to be controlled, unique identification information.
Device type is standardized device type.The describing mode of same device type is identical, such as: AllJoynLighting, represents the light fixture of AllJoyn standard.
Device first to be controlled is reached the standard grade, and needs to send log-on message to gateway, so that after gateway completes registration, adds Centralized Control System.Further, the RegisterControllee method of equipment calls gateway to be controlled, registers at gateway side finishing equipment.After facility registration to be controlled completes, reach the standard grade in Centralized Control System.
Step S220, sends to control terminal the information that equipment to be controlled reached the standard grade, and receives the control plug-in unit that control terminal sends for this equipment to be controlled and generate request.
Sending to control terminal information of reaching the standard grade, for informing control terminal, having the equipment to be controlled of new registration in its network environment, inquiry control terminal controls plug-in unit the need of the equipment generating this equipment to be controlled.
Because equipment to be controlled is equipment of reaching the standard grade first, control terminal does not also possess the equipment controlling this equipment to be controlled and controls plug-in unit, and therefore, control terminal needs to install this equipment and controls plug-in unit.
The present embodiment can also judge whether to exist in control terminal side only for controlling the vertical application (Application of equipment to be controlled, be called for short APP), if exist, then process ends, do not send to gateway and control plug-in unit generation request, use this special APP to control equipment to be controlled, or, send control plug-in unit generation request at the rear of this special APP of unloading to gateway; If do not exist, then send to gateway and control plug-in unit generation request.
Control terminal calls the GenerateControllee method of gateway, and the equipment that request gateway generates this equipment to be controlled controls plug-in unit.
Step S230, after receiving control plug-in unit that control terminal sends and generating request, obtains standard corresponding to the device type of equipment to be controlled from network side and controls plug-in unit.
Standard controls the function control command that plug-in unit provides equipment to be controlled of the same type.Such as: the standard of light fixture controls plug-in unit and comprises: the opening of light fixture, close, the control command of the function such as light color adjustment.
Step S240, the standard corresponding with this device type that reception network side returns controls plug-in unit.
Step S250, obtains the AllJoyn service interface information of equipment to be controlled.
Because do not carry AllJoyn service interface information in log-on message, therefore, gateway needs, by AllJoynIntropect interface acquisition methods, to obtain the AllJoyn service interface information of equipment to be controlled.
The present embodiment only needs gateway before generation equipment controls plug-in unit, obtain the AllJoyn service interface information of equipment to be controlled, and avoid controlled terminal and reach the standard grade at every turn, control terminal all will obtain the AllJoyn service interface information of equipment to be controlled.
Step S260, according to AllJoyn service interface information and facility information, instantiation standard controls plug-in unit, and the equipment that obtains controls plug-in unit.
Instantiation comprises: standard of being bound by facility information controls the facility information in plug-in unit; Interface method in AllJoyn service interface information, interface attributes are tied to respectively the corresponding control command that standard controls plug-in unit.
Different according to device type, AllJoyn service interface information comprises interface method and/or interface attributes.Such as: thermometer only has temperature property; Light fixture has the extraction of root, pass method, light color to regulate attribute.Therefore, only the interface method comprised in AllJoyn service interface information, interface attributes are bound.
Such as: the unique identification information of light fixture is Lighting1; The standard of light fixture controls plug-in unit and comprises: light fixture title, the opening of light fixture, close, the control command of the function such as light color adjustment; The AllJoyn service interface information of light fixture comprises the extraction of root, pass method, light color adjustment attribute; In instantiation process, by unique identification information Lighting1 and light fixture name binding, by open control command and the extraction of root is bound, closing control order and pass method are bound, regulate attribute to bind the order of light color regulable control and light color.
If device A to be controlled is identical with the device type of equipment B to be controlled, and the equipment having generated device A to be controlled controls plug-in unit A, when the equipment generating equipment B to be controlled controls plug-in unit, first the equipment generating equipment B to be controlled controls plug-in unit B, then utilize equipment control plug-in unit A and equipment to control plug-in unit B and form an instantiation file, also can form each self-corresponding instantiation file respectively.
Step S270, controls plug-in unit by equipment and sends to control terminal.
Control terminal loading equipemtn controls plug-in unit, and user operates in control terminal, and the control command that operation is corresponding is sent to gateway by control terminal, then is sent to equipment to be controlled by gateway, realizes the control to equipment to be controlled.
Because AllJoyn service interface information is identical between the equipment of identical device type, so, before acquisition standard controls plug-in unit, if the equipment that there are other equipment at local terminal controls plug-in unit and this other equipment are identical with the device type of equipment to be controlled, then can copy and upgrade this equipment and control plug-in unit, by the facility information that this equipment other device information updates controlled in plug-in unit are equipment to be controlled, other binding relationships that equipment controls in plug-in unit are constant, and then the equipment obtaining equipment to be controlled controls plug-in unit.
Embodiment three
In normative document, the concept of physical equipment and logical device is proposed according to international Internet of Things normal structure OneM2M, can according to the function of physical equipment, physical equipment is abstracted into one or more logical device, such as: intelligent air condition comprises refrigerating function and temperature sensor functionality, can by abstract for intelligent air condition be refrigerator and temperature sensor; And for example: televisor comprises display and sound equipment, can by abstract for televisor be display and sound equipment.
Therefore, device type can take out one or more logical device types.Such as: device type is Intelligent air tone category, Intelligent air tone category comprises two logical device types, is respectively refrigerator class and temperature sensor class.The present embodiment can be that the standard of each logical device types configuration correspondence controls plug-in unit, and then controls plug-in unit according to standard, and the equipment that formation logic equipment is corresponding controls plug-in unit, to control plug-in unit steering logic equipment by equipment.
As shown in Figure 3, the process flow diagram of the step of plug-in unit is controlled for acquisition standard according to a third embodiment of the present invention.
Step S310, obtains device description file corresponding to the device type of equipment to be controlled from network side.
This equipment to be controlled refers to physical equipment.
Device description file is levels of standards, and the device description file of the equipment to be controlled of identical device type is identical.Device description file comprises: the logical device index LogicDeviceIndex of the device type of equipment to be controlled, equipment to be controlled.Logical device index comprises: logical device title LogicDeviceName and logical device types LogicDeviceType etc.Logical device title is such as light fixture, and logical device types is such as AllJoynLighting.
Step S320, in device description file, inquires about the logical device types of equipment to be controlled.
Step S330, obtains standard corresponding to logical device types from network side and controls plug-in unit.
Standard controls the function control information that plug-in unit provides the logical device of this logical device types.This standard controls logical device title, the logical device control command that plug-in unit comprises this logical device, such as: control command 1=opening/closing, control command 2=arranges color.
Because logical device is the abstract of physical equipment, therefore, when the standard that instantiation logical device types is corresponding controls plug-in unit, need the facility information using physical equipment, instantiation standard controls plug-in unit.
Embodiment four
The invention provides a kind of device by gateway control apparatus, as shown in Figure 4, is the structural drawing of the device by gateway control apparatus according to a fourth embodiment of the present invention.This device is positioned at gateway side.
This device comprises:
Receiver module 410, for receiving facility information and the device type of this equipment to be controlled that equipment to be controlled sends.Wherein, described facility information comprises: the unique identification information of described equipment to be controlled; Or described facility information comprises: the unique identification information of described equipment to be controlled and the AllJoyn service interface information of described equipment to be controlled.
Acquisition module 420, controls plug-in unit for obtaining standard corresponding to described device type.Further, acquisition module 420, for from local terminal or from network side, obtains standard corresponding to described device type and controls plug-in unit.Further, from network side obtain standard corresponding to described device type control plug-in unit time, acquisition module 420 specifically for: obtain device description file corresponding to described device type from network side; In described device description file, inquire about the logical device types of described equipment to be controlled; Obtain standard corresponding to described logical device types from network side and control plug-in unit.
Instantiation module 430, for based on described facility information, standard described in instantiation controls plug-in unit, and the equipment that obtains controls plug-in unit.
Sending module 440, sends to control terminal for described equipment is controlled plug-in unit, so that described control terminal controls plug-in unit based on described equipment control described equipment to be controlled.
In one embodiment, if described facility information does not comprise the AllJoyn service interface information of described equipment to be controlled, then instantiation module 430 is also for the AllJoyn service interface information obtaining described equipment to be controlled.
The function of the device described in the present embodiment is described in the embodiment of the method shown in Fig. 1-3, therefore not detailed part in the description of the present embodiment, see the related description in previous embodiment, can not repeat at this.
Although be example object, disclose the preferred embodiments of the present invention, it is also possible for those skilled in the art will recognize various improvement, increase and replacement, and therefore, scope of the present invention should be not limited to above-described embodiment.