Embodiment
The following description and drawings illustrate specific embodiment of the invention scheme fully, to enable those skilled in the art to put into practice them.Other embodiments can comprise structure, logic, electric, process and other change.Embodiment only represents possible change.Unless explicitly requested, otherwise independent parts and function are optional, and the order of operation can change.The part of some embodiments and feature can be included in or replace part and the feature of other embodiments.The scope of embodiment of the present invention comprises the gamut of claims, and all obtainable equivalent of claims.In this article, these embodiments of the present invention can be represented with term " invention " individually or always, this is only used to conveniently, and if in fact disclose the invention more than, be not the scope that automatically will limit this application is any single invention or inventive concept.
Fig. 1 shows the schematic flow sheet of the method for the control service end of the embodiment of the present invention,
As shown in Figure 1, in some illustrative embodiments, described method, can be applied to net control device, comprises following step:
Step S101, receives the general-purpose interface call request message that client sends;
General-purpose interface is for client and service end carry out communicating and interface that preset or user is arranged; This general-purpose interface can solve the client that causes because bottom transmission technology is different and service end cannot the problem of direct communication, provides unified communication mode; The client of bottom transmission technology identical in addition and service end are except can except direct communication, and what client also can realize being unified each service end by net control device by this general-purpose interface calling and controlling; The service interface parameter of general-purpose interface after according to the communication protocol encapsulation of general-purpose interface and the service interface parameter of destination service end is carried in described general-purpose interface call request message;
Net control device herein refers to supports multiple bottom transmission technology, is among at least two networks simultaneously, can respectively with a series of equipment of the devices communicating in each network, such as server, gateway; Described client refers to installs a series of device or the equipment that promising user provides the program of local service, the user terminals such as such as mobile phone, panel computer, PC, or, various home appliances having installed client etc.; Described destination service end refers to can provide service for client, but the device different from the bottom transmission technology that described client is supported or equipment;
Step S102, resolves described general-purpose interface call request message according to the communication protocol of general-purpose interface, obtains address and the control information of destination service end;
Parameter in the general-purpose interface call request message parsed, except the service interface information (comprising: the address of general-purpose interface, control mode and relevant parameter) of general-purpose interface, also comprise the service interface information (comprising: the address of destination service end and control information) of invocation target service end;
Described general-purpose interface call request message comprises one or more destination service end, in current network, such as have 10 service ends, but client only needs 3 service ends controlled wherein, then these 3 service ends are destination service end, then comprise address and the control information of each service end of these 3 service ends in general-purpose interface call request message;
In some illustrative embodiments, described control information comprises the method for calling of described destination service end; Or, described control information comprise described destination service end method of calling and with the method for calling of this destination service end with the use of at least one relevant parameter;
Citing is described the control information of destination service end:
If destination service end is audio amplifier, user sends the instruction stopping playing music for controlling audio amplifier to net control device (gateway) by client (mobile phone), then the control information of audio amplifier only comprises the address of audio amplifier and the method for calling (stopping " stop ") of audio amplifier; If when user wants that controlling audio amplifier is fast-forward to certain position by the song of current broadcasting, then control information not only comprises the address of audio amplifier, the method for calling (F.F. " FF (FastForward) ") of audio amplifier, also must comprise the location parameter corresponding with F.F. instruction (as 3 points 20 seconds);
Step S103, according to the communication protocol that destination service end is supported, the described control information got is encapsulated, obtain the control request message meeting the communication protocol that described destination service end is supported, and according to the address of described destination service end, described control request message is sent to described destination service end;
Said process can be: when after the control information parsing destination service end, according to the communication protocol that destination service end is supported, secondary encapsulation is carried out in control information, obtain described control request message, then control request message is sent to described destination service end, to make destination service end according to the control information controlled in request message, perform and operate accordingly;
Wherein, the communication protocol that destination service end is supported obtains in advance;
Citing: suppose that the destination service end parsed is 2, audio amplifier and TV respectively, wherein the communication protocol of audio amplifier support is bluetooth BT, and the communication protocol of TV support is wireless WIFI, the communication protocol then supported according to each destination service end respectively carries out secondary encapsulation to control information, namely be converted into the form that each destination service end can identify, generate and control request message, and send to corresponding destination service end respectively;
In some illustrative embodiments, described, the described control information got is encapsulated, specifically comprises:
Judge that whether this call request is legal; If so, then described encapsulation is carried out.
In some illustrative embodiments, also comprise: if illegal, then feedback request illegally responds and stops subsequent operation;
In some illustrative embodiments, before receiving described general-purpose interface call request message, also comprise: the relevant information (service interface information as general-purpose interface) sending described general-purpose interface to as described in client and as described in destination service end; Wherein, the relevant information of described general-purpose interface comprises the bus address of general-purpose interface, the method for calling of general-purpose interface and relevant parameter thereof; The object sending the relevant information of general-purpose interface is to allow client call general-purpose interface according to the relevant information of described general-purpose interface; Here parameter is necessary, can be one section for expressing the character string of interface message;
The service interface information of general-purpose interface can be informed client that is safeguarded or surrounding and service end (comprising destination service end) by modes such as broadcast, clean culture or multicasts by the relevant information of the described general-purpose interface of described transmission;
In some illustrative embodiments, before receiving described general-purpose interface call request message, also comprise: the address of described destination service end and control information are sent to described client; Send mode herein can be broadcast, multicast or clean culture; The service interface information of the described service end obtained may be that the broadcast by receiving service end obtains, or, obtained by the message received from service end, do not limit herein;
Such as: by broadcast form by all devices in service interface information (comprising: the address of each server and the control information) informing network of at least one service end (comprising destination service end) of all registrations, comprise described client.
Fig. 2 shows the schematic flow sheet of the method for the control service end of the embodiment of the present invention,
As shown in Figure 2, in some illustrative embodiments, described method, can be applied to destination service end, comprises following step:
Step S201, encapsulates the address of destination service end and control information by the communication protocol of general-purpose interface, obtains general-purpose interface call request message;
In some illustrative examples, before step S201, also comprise:
Receive the relevant information of the described general-purpose interface that described net control device side sends; Described general-purpose interface for described net control device provide for client and service end carry out communicating and interface that preset or user is arranged; Wherein, the relevant information of described general-purpose interface comprises the bus address of general-purpose interface, the method for calling of general-purpose interface and relevant parameter;
In some illustrative embodiments, before step S201, also comprise: the address and the control information that obtain destination service end;
Described destination service end can be one or more, if desired controls multiple service end simultaneously, then described destination service end is multiple;
In some illustrative embodiments, described destination service end is safeguarded by described net control device, and the address of described acquisition destination service end and control information, comprising:
By described net control device, inquire about and obtain address and the control information of described destination service end;
Optionally, also by the broadcast of net control device, address and the control information of at least one destination service end described can be obtained;
In some illustrative embodiments, described control information comprises the method for calling of described destination service end; Or, if the method for calling of described destination service end need with at least one relevant parameter with the use of, then described control information comprise described destination service end method of calling and with the method for calling of this destination service end with the use of at least one relevant parameter;
In some illustrative embodiments, if described control information comprises the method for calling of described destination service end, and at least one relevant parameter described; Undertaken encapsulating the address of each described destination service end and corresponding control information by the communication protocol of the general-purpose interface of net control device then, comprising:
At least one relevant parameter described is packaged in same general-purpose interface parameter;
In some illustrative embodiments, described general-purpose interface call request message comprises general-purpose interface parameter, then step S201 specifically comprises:
The address of described destination service end and control information are all packaged in a general-purpose interface parameter; Or, according to information type, the address of described destination service end and control information are packaged in different general-purpose interface parameters;
Carry out below illustrating and above-mentioned encapsulation process be described:
If described destination service end is one, be packaged in the situation of multiple general-purpose interface parameter: if the control information of destination service end comprises the method for calling of described destination service end and at least one parameter corresponding, then by the address encapsulation of destination service end in general-purpose interface parameter A, the method of calling of destination service end is packaged in general-purpose interface parameter B, at least one improve parameter unification corresponding with method of calling of destination service end is packaged in general-purpose interface parameter C; Be packaged in the situation of a general-purpose interface parameter: by the address of above-mentioned destination service end, the method for calling of destination service end and at least one parameter accordingly, be all packaged in general-purpose interface parameter D;
Similar, if described destination service end is multiple, the address of at least one destination service end described and corresponding control information are all packaged in a general-purpose interface parameter; Or, according to information type, the address of at least one destination service end described and corresponding control information are packaged in different general-purpose interface parameters; Such as: according to information type (address of destination service end, the method for calling of destination service end and parameter) point three classes, the method for calling of the address of at least one destination service end described, each described destination service end and parameter are sub-packed in corresponding general-purpose interface parameter respectively; Step S202, sends to described net control device by described general-purpose interface call request message;
The object of described net control device described general-purpose interface call request is sent to be: to encapsulate resolving the described control information that this interface interchange request message obtains to make described net control device, obtain the control request message meeting the communication protocol that described destination service end is supported, and described control request message is sent to described destination service end.
Fig. 3 shows the schematic flow sheet of the method for the control service end of the embodiment of the present invention,
As shown in Figure 3, in some illustrative embodiments, described method comprises following several step:
Step S301, user terminal (client) obtains the service interface information of execute (general-purpose interface) and the service interface information of networking household electrical appliances (service end);
Described execute interface is the interface of gateway (net control device), and described execute service interface information comprises address, the method for calling of described general-purpose interface and its relevant parameter; Described networking household electrical appliances, namely can provide at least one service with the home appliance of gateway communication; Described service interface information comprises: the method for calling of at least one service that the address of each networking household electrical appliances, networking household electrical appliances provide and at least one parameter corresponding to the method for calling of networking household electrical appliances; Wherein, parameter is optional, because the method for calling of some networking household electrical appliances is without the need to parameter;
Step S302, user terminal selecting destination service, carries out Information encapsulation;
User terminal, according to the service interface information of the networking household electrical appliances received, is selected the service (one or more) needed, and is selected the corresponding networking household electrical appliances providing this service accordingly; And according to the service interface information of networking household electrical appliances, and the service interface information of execute, carry out corresponding Information encapsulation, obtain far call request;
Step S303, user terminal sends far call request to execute interface;
Step S304, gateway resolves the information in far call request;
Gateway resolves far call request, obtains wherein about the information (method of calling of address, home appliance, parameter) calling home appliance;
Step S305, the information in far call request is sent to home appliance by gateway;
Information in call request is converted to the message of the discernible communication protocol of home appliance, and send to home appliance;
Step S306, home appliance process request, performs associative operation;
After home appliance receives above-mentioned message, according to the information in message, perform and operate accordingly.
With a specific embodiment, this programme is described below, as shown in Figure 4, relates to mobile phone, gateway, LED (lamp) and audio amplifier in this embodiment; User utilizes mobile phone (client) can pass through gateway (net control device) and controls the home appliance (service end comprises LED and audio amplifier) in home network;
Suppose the correspondence of each equipment in home network as shown in Figure 5, on the application layer, mobile phone is by providing the application A PP1 of client, application program Trans to gateway sends call request, then sends on the application A PP2 providing signal light control to serve of home appliance (LED) by gateway by the instruction in this call request; In fact, communicate based on the point-to-point communications framework of C/S framework between equipment, comprise BusDaemon (BUS, bus finger daemon) and terminal node (application program), the BUS of each equipment couples together the bus of point to point network communication system that formation one is communicated with; Below each device bus layer, system additionally provides a level of abstraction, comprises the interface of corresponding communication protocol; As can be seen from Figure 5, mobile phone supports that bluetooth BT, LED support wireless WiFi, gateway supports above-mentioned two kinds of communication protocols, mobile phone sends message by BT to gateway, and gateway is undertaken communicate (audio amplifier is identical with LED, does not carry out tired stating herein) by WiFi and LED again;
The service interface information of the home appliance (comprising LED and audio amplifier) that mobile phone is safeguarded by gateway acquisition execute service interface information and gateway; Above-mentioned service interface information is as shown in the table:
Wherein, address is used for the service interface on recognition purpose equipment; Call request is sent to the corresponding interface that just can find called target device in network according to address; Method of calling represents the operation that call request will perform; The necessary data that parameter is imported into needed for executable operations; In table, the first row calls the service interface information needed for execute interface of gateway; The service interface information of what in table, the second row and the third line described is home appliance;
Below in conjunction with Fig. 4, whole communication process is set forth:
Step S401, the service interface information of mobile phone packaged LED and audio amplifier;
If mobile phone encapsulates the service interface information of LED and audio amplifier respectively, form two call request, and send to gateway to control respectively, then the process encapsulated can be as follows:
To control audio amplifier:
Mode 1: the service interface information of audio amplifier is packaged into an execute interface parameters;
Calling except the method for calling of the address of necessity, execute interface of gateway execute interface, may comprise an execute interface parameters, form is as follows:
MethodCall(“com.producer.gateway:sd77as”,“execute”,args);
Wherein, args is execute interface parameters, comprises the interface IP address of invoked audio amplifier, the title of the method for calling of audio amplifier, the information such as relevant parameter; Play a first melody in a looping fashion as called audio amplifier by mobile phone, args can be form:
Mode 2: the service interface information of audio amplifier is packaged into multiple execute interface parameters;
Calling of gateway execute interface also can comprise multiple parameter, as encapsulated the interface IP address of audio amplifier, the title of the method for calling of audio amplifier and relevant parameter respectively by three parameters:
MethodCall(“com.producer.gateway:sd77as”,“execute”,appAddress,methodName,methodArgs);
Wherein, appAddress comprises target device application address, and methodName comprises the title of called mode, and methodArgs comprises called parameter; Still play a first melody in a looping fashion to call audio amplifier above, appAddress can be " com.producer.audio:sdsd90 "; MethodName can be " play "; MethodArgs can be form below:
Optionally, no matter which kind of form above-mentioned, when comprising a more than parameter in household electrical appliances service interface information, multiple parameter needs to combine to be encapsulated in same execute interface parameters;
If mobile phone needs to encapsulate the service interface information of LED and audio amplifier simultaneously, namely only form a call request, and send to gateway to control, then the process encapsulated can be as follows:
Mode 1: the service interface information of LED and audio amplifier is all packaged in same execute interface parameters;
That supposes gateway execute interface calls the form adopting MethdCall (" com.producer.gateway:sd77as ", " execute ", args); The address that LED luminance regulates and audio amplifier is play, method of calling and relevant parameter are encapsulated as the parameter args of gateway execute interface by mobile phone; Args form can be as follows:
Mode 2: the service interface information of LED and audio amplifier is packaged in multiple execute interface parameters;
If the form calling employing MethdCall (" com.producer.gateway:sd77as ", " execute ", appAddress, methodName, methodArgs) of gateway execute interface; Then appAddress can be the form of array, and Section 1 appAddress [0] is " com.producer.lighting:ds89sd ", Section 2 appAddress [1] is " com.producer.audio:sdsd90 "; MethodName also can be array accordingly, and Section 1 methodName [0] is " intensity ", and Section 2 methodName [1] is " play ".MethodArgs can be form below:
Now, need when gateway is resolved the parameter contained by first <device> label to be carried out corresponding association with appAddress [0], methodName [0], the parameter contained by second <device> label is carried out corresponding association with appAddress [1], methodName [1];
Step S402, mobile phone calls the execute interface of gateway;
If customer selecting controls LED and audio amplifier simultaneously, then send call request to described gateway, described call request carries the service interface information of the execute interface after encapsulation and the service interface information of LED and audio amplifier;
Step S403, gateway parses the interface message of LED and audio amplifier;
Gateway resolves execute interface, parses the interface message of LED and audio amplifier in execute interface parameters;
Step S404, gateway judges that whether call request is legal;
The rule base that gateway consults stores, judges that user mobile phone control LED and audio amplifier are legal;
Step S405, gateway returns interface response to mobile phone;
Gateway returns to mobile phone one response, and represent and received call request and started to perform, triggered step S406 and S407 afterwards, these two steps do not have inevitable ordinal relation;
Step S406, gateway and LED set up session;
Step S407, session set up by gateway and audio amplifier;
Step S408, gateway calls LED luminance and regulates interface;
Gateway calls the corresponding interface of LED according to the address of LED obtained, the method for calling of LED, relevant parameter, generates the message of the discernible communication protocol of LED, sends to LED;
Step S409, gateway calls audio amplifier playback interface;
Gateway calls the corresponding interface of audio amplifier according to the address of audio amplifier obtained, the method for calling of audio amplifier, relevant parameter, generates the message of the discernible communication protocol of audio amplifier, sends to LED; Wherein, step S408, S409 do not have inevitable ordinal relation;
Step S410, LED are to the response of gateway feedback brightness regulation interface;
After LED performs the operation regulating brightness, send feedback message to gateway, inform that gateway has completed corresponding operation;
Step S411, audio amplifier is to the response of gateway feedback playback interface.
After audio amplifier performs the operation of playing music, send feedback message to gateway, inform that gateway has completed corresponding operation; Wherein, step S408, S409 do not have inevitable ordinal relation;
Optionally, gateway, after the feedback message receiving LED or audio amplifier, also can send feedback acknowledgment to mobile phone, informs that user has completed the Service controll to LED or audio amplifier;
Optionally, gateway can carry out record to the process that user mobile phone in said process calls LED and audio amplifier, and is associated with audio amplifier with LED by mobile phone; Such as can arrange an equipment contingency table in a gateway, after each client (as mobile phone) calls service end (LED or audio amplifier) by gateway, gateway all can carry out record in equipment contingency table, and client is associated with service end.
Fig. 6 shows a kind of structural representation controlling the device 600 of service end of the embodiment of the present invention,
In some illustrative embodiments, described device 600, comprising:
Receiving element 601, for receiving the general-purpose interface call request message that client sends;
Resolution unit 602, for resolving described general-purpose interface call request message by the communication protocol of general-purpose interface, obtains address and the control information of destination service end;
First transmitting element 603, the described control information got encapsulates by the communication protocol for supporting according to destination service end, obtain the control request message meeting the communication protocol that described destination service end is supported, and according to the address of described destination service end, described control request message is sent to described destination service end;
In some illustrative embodiments, described control information comprises the method for calling of described destination service end;
Or, described control information comprise described destination service end method of calling and with the method for calling of this destination service end with the use of at least one relevant parameter;
In some illustrative embodiments, described device 600, described first transmitting element 603 comprises:
Judging unit 6031, whether legal for judging described general-purpose interface call request message;
If so, then the described control information got is encapsulated;
In some illustrative embodiments, described device 600, also comprises:
Second transmitting element 604, before receiving described general-purpose interface call request message, sends the relevant information of described general-purpose interface to described client and described destination service end for described receiving element 601;
Wherein, the relevant information of described general-purpose interface comprises the bus address of general-purpose interface, the method for calling of general-purpose interface and relevant parameter;
In some illustrative embodiments, described device 600, also comprises:
3rd transmitting element 605, before receiving described general-purpose interface call request message, is sent to described client by the address of described destination service end and control information for described receiving element 601.
Fig. 7 shows a kind of structural representation controlling the device 700 of service end of the embodiment of the present invention,
In some illustrative embodiments, described device 700, comprising:
Encapsulation unit 701, for being encapsulated by the communication protocol of general-purpose interface in the address of destination service end and corresponding control information, obtains general-purpose interface call request message;
Control unit 702, for giving described net control device by described general-purpose interface call request message;
In some illustrative embodiments, the address of described destination service end and control information are inquired about by described net control device and are acquired;
In some illustrative embodiments, described device 700, also comprises:
Receiving element 703, for described encapsulation unit 701, the address of destination service end and control information are encapsulated by the communication protocol of general-purpose interface, before obtaining general-purpose interface call request message, receive the relevant information of the described general-purpose interface that described net control device side sends;
Wherein, the relevant information of described general-purpose interface comprises the bus address of general-purpose interface, the method for calling of general-purpose interface and relevant parameter thereof;
In some illustrative embodiments, described general-purpose interface call request message comprises general-purpose interface parameter, and described encapsulation unit 701, comprising:
First encapsulation subelement 7011, for being all packaged in a general-purpose interface parameter by the address of described destination service end and control information; Or, according to information type, the address of described destination service end and control information are packaged in different general-purpose interface parameters;
In some illustrative embodiments, described control information comprises the method for calling of described destination service end;
Or, described control information comprise described destination service end method of calling and with the method for calling of this destination service end with the use of at least one relevant parameter;
In some illustrative embodiments, if described control information comprise described destination service end method of calling and with the method for calling of this destination service end with the use of at least one relevant parameter, then described encapsulation unit 701, comprising:
Second encapsulation subelement 7012, for being packaged at least one relevant parameter described in same general-purpose interface parameter.
Adopt above-described embodiment, following effect can be reached:
Make client can call by net control device any service end that net control device can connect; Service end calls the client of net control device service without the need to possessing;
Client and service end set up session without the need to prior and net control device, reduce the running load of equipment, save energy consumption.
Those skilled in the art it is also understood that various illustrative box, module, circuit and the algorithm steps combining embodiment herein and describe all can be embodied as electronic hardware, computer software or its combination.In order to the interchangeability between hardware and software is clearly described, all carry out usually describing around its function to various illustrative parts, frame, module, circuit and step above.Be embodied as hardware as this function or be embodied as software, the design constraint depending on specific application and whole system is applied.Those skilled in the art for each application-specific, can realize described function in the mode of accommodation, but, thisly realize decision-making and should not be construed as and deviate from protection range of the present disclosure.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.