Background technology
Along with improving constantly of people's consumption demand, also to have higher requirement for the ease for use and the affinity of household appliances, safe, easy-to-use, comfortable product more and more is subjected to people's favor, the product demand of hommization thereby day by day displayed.Following household appliances will more and more be tending towards networking, intelligent, personalized, hommization, become information terminal, provide services on the Internet.
International, domestic well-known IT enterprises and traditional home appliance manufacturer jointly open up network home appliance one after another, and information technology, network technology are introduced the household electrical appliances production field, and information-based household electrical appliances new products such as network refrigerator, network microwave oven, network air-conditioner emerge in an endless stream.
The network home appliance product has driven the development of related industries such as wired home, intelligent residential district, has the repayment of considerable market prospects and interests.
The network home appliance product is because its very high technology content and huge market potential have become one of household appliances enterprise's high-tech and the prospective standard weighed.
Domestic network electrical appliance industry some problems under current development situation:
Because the influence of media and communications guiding, ordinary consumer is when mentioning " network home appliance ", what at first expect is exactly the product of set-top box and so on, and the application of information technology in field of household appliances should be more extensive in fact, also should be actual and far-reaching more to people's life influence.
Successfully develop cooperatively the example of network home appliance from external many well-known manufacturers, IT enterprises and traditional home appliance enterprise have his own strong points as can be seen, and in this emerging field, both sides should close cooperation, gives full play to advantage separately, expansion development space separately.
Current standard and the agreement that the multiple network household electrical appliances are arranged in the world, we can not follow a certain standard blindly, but should make according to actual conditions, meet the standard and the agreement of current household electrical appliances developing direction, make oneself to stand on the favourable relatively competitive position.
The digital home network solution is arisen at the historic moment under such a case.It is the application for a patent for invention (application number: 02103815.5) of " digital family network system " that the applicant proposes denomination of invention on March 27th, 2002 to Intellectual Property Right Bureau of the RPC.The digital home network solution is a cover solution that meets current household electrical appliances development situation, realizes the family digital network, scheme has embodied a concentrated reflection of digital home network will meet the certain standard agreement, realize the method that portable terminal control combines with network terminal control, be that many intelligent appliances can perhaps can be controlled by net control terminal on INTERNET with a mobile control terminal.
The applicant proposes the application for a patent for invention (application number: 02103816.3) that denomination of invention is " method of the control of information household appliances and mutual visit in the digital home network " on March 27th, 2002 to Intellectual Property Right Bureau of the RPC.This method can make in the digital home network information household appliances keep versatility, makes the information household appliances that different vendor produces can seamless adding digital home network, and makes product have the ability of adding new function, can visit mutually between the information household appliances simultaneously.
The content that relates to digital home network and device file among the application sees also above-mentioned two patent applications.
Summary of the invention
The object of the present invention is to provide a kind of method of carrying out communication between the digital home network gateway.
The means of communication between the digital home network gateway, its characteristics are:
This method comprises the steps:
(1) the home automation control network gateway obtains the IP address by DHCP (Dynamic Host Control Protocol) from primary gateway;
(2) primary gateway is applied for the registration of to subnet gateway by sending the log-in command packet, and subnet gateway receives this order back and sends confirmation, then succeeds in registration.After succeeding in registration, primary gateway in all communication data packet numbering then be the sign that subnet gateway and primary gateway are confirmed the other side's identity, and subnet gateway only accepts to number from primary gateway IP address and major network the request of correct packet;
(3) primary gateway by be provided with, reading order reads the state parameter of each equipment or the state parameter of each equipment is set from subnet gateway;
(4) subnet gateway provides the device description file of each equipment, the state parameter of each equipment, the contents such as device registry of each equipment connection status by reporting order to primary gateway, makes primary gateway understand the state of whole home automation control network;
(5) subnet gateway sends the device file of certain equipment in its home automation control network of controlling or represents that each equipment of whole home automation control network connects the device registry of situation to primary gateway by embarkation order.Primary gateway is carried out the maintenance of the equipment control form of the conversion of device file and webpage and self inside after receiving home appliance file or device registry;
(6) before primary gateway, subnet gateway are closed, then before closing, initiate log off procedure by the side of closing.Confirm that if de-registration request obtains the other side then the numbering of the major network in this registering communication is invalid, before registration next time, subnet gateway is not accepted the request of any primary gateway.
Digital home network is made up of net control terminal, mobile control terminal and a plurality of communication module transmission and reception apparatus, and the main effect of net control terminal is by Internet network control intelligent appliance, also can carry out tame electric control by local computer.Net control terminal has following characteristics:
(1) net control terminal has provided man-machine interface clearly, can enter the control options interface of any electrical equipment, controls all controlled function of each household electrical appliances, operates very simply, and is that the user comes into plain view.
(2) net control terminal also has the function of the various household electrical appliances of management, join in the domestic network system as new household electrical appliances, net control terminal has the increase option, can add new equipment by adding the device file of being formulated by the DEVICEFILE agreement.Net control terminal also has deletion can not use the function of device option.
(3) communication module that net control terminal and each household electrical appliances had can carry out exchanges data by wired RS485 communication and wireless telecommunications dual mode, has improved the versatility of itself.Communications protocol between net control terminal and each communication module is digital home network (DHN) communications protocol standard.
The effect of mobile control terminal is by the mode of wireless telecommunications existing intelligent appliance in the present family to be carried out centralized control.Mobile control terminal has following characteristics:
(1) mobile control terminal has a man-machine interface clearly, can show the electrical equipment that family is all by the screen on it, by the button on the mobile control terminal keyboard, can enter the control options interface of any electrical equipment, all controlled function that comprise these household electrical appliances in the control options interface, selecting each controlled function option can control this function of these household electrical appliances, operate very simply, and is that the user comes into plain view.
(2) mobile control terminal is to carry out communication by wireless communication modes, can not be subjected to the restriction of barrier, can control each home appliance that moves on the control terminal in coverage, and control is more reliable.
(3) mobile control terminal also has the function of the various household electrical appliances of management, join in the domestic network system as new household electrical appliances, mobile control terminal has the increase option, can add new equipment by adding the device file of being formulated by the DEVICEFILE agreement.Mobile control terminal also has deletion can not use the function of device option.
(4) communication module that mobile control terminal and each household electrical appliances had can carry out exchanges data by wireless communication mode, and the communications protocol between mobile control terminal and each communication module is digital home network (DHN) network communication protocol standard.
A communication module is set in each home appliance, this communication module comprises wired RS485 communication and two kinds of communication modes of wireless telecommunications, it mainly acts on is by using digital home network (DHN) communications protocol standard and net control terminal and mobile control terminal to carry out exchanges data, realize that with this household electrical appliances that this equipment is connected control, transmission meets the device file of DEVICEFILE protocol specification when increasing equipment.
Embodiment
Digital home network is made up of net control terminal, mobile control terminal and a plurality of communication module transmission and reception apparatus, sees Fig. 1.The effect of various piece is respectively:
The main effect of net control terminal is by Internet network control intelligent appliance, also can carry out tame electric control by local computer.
After the user steps on the Internet network, open the home control network interface, according to each household electrical appliances option that shows on the interface, enter some families electric control interface, control this household electrical appliances.
The net control terminal of native system has following characteristics:
(1) net control terminal has provided man-machine interface clearly, can enter the control options interface of any electrical equipment, controls all controlled function of each household electrical appliances, operates very simply, and is that the user comes into plain view.
(2) net control terminal also has the function of the various household electrical appliances of management, join in the domestic network system as new household electrical appliances, net control terminal has the increase option, can add new equipment by adding the device file of being formulated by the DEVICEFILE agreement.Net control terminal also has deletion can not use the function of device option.
(3) communication module that net control terminal and each household electrical appliances had can carry out exchanges data by wired RS485 communication and wireless telecommunications dual mode, has improved the versatility of itself.Communications protocol between net control terminal and each communication module is digital home network (DHN) communications protocol standard.
The effect of mobile control terminal is by the mode of wireless telecommunications existing intelligent appliance in the present family to be carried out centralized control.
In the present family if household electrical appliances are carried out the words of remote control, want the corresponding remote controller of household electrical appliances, a lot of people are obscured each remote controller, to such an extent as to when controlling an electrical equipment mutually, which goes to differentiate is the remote controller of these household electrical appliances, and does not have display interface clearly.
The mobile control terminal of native system has following characteristics:
(1) mobile control terminal has a man-machine interface clearly, can show the electrical equipment that family is all by the screen on it, by the button on the mobile control terminal keyboard, can enter the control options interface of any electrical equipment, all controlled function that comprise these household electrical appliances in the control options interface, selecting each controlled function option can control this function of these household electrical appliances, operate very simply, and is that the user comes into plain view.
(2) mobile control terminal is to carry out communication by wireless communication modes, can not be subjected to the restriction of barrier, can control each home appliance that moves on the control terminal in coverage, and control is more reliable.
(3) mobile control terminal also has the function of the various household electrical appliances of management, join in the domestic network system as new household electrical appliances, mobile control terminal has the increase option, can add new equipment by adding the device file of being formulated by the DEVICEFILE agreement.Mobile control terminal also has deletion can not use the function of device option.
(4) communication module that mobile control terminal and each household electrical appliances had can carry out exchanges data by wireless communication mode, and the communications protocol between mobile control terminal and each communication module is digital home network (DHN) network communication protocol standard.
A communication module is set in each home appliance, this communication module comprises wired RS485 communication and two kinds of communication modes of wireless telecommunications, it mainly acts on is by using digital home network (DHN) communications protocol standard and net control terminal and mobile control terminal to carry out exchanges data, realize that with this household electrical appliances that this equipment is connected control, transmission meets the device file of DEVICEFILE protocol specification when increasing equipment.
As shown in Figure 2, the user visits primary gateway by Internet, the various device in visit and the control family major network.The home automation control network gateway is communicated by letter with primary gateway with ICP/IP protocol by ethernet network interface as an equipment in the major network, provides the state of various device in the home automation control network to primary gateway; The report new equipment adding, withdraw from situation.The user visits primary gateway by Internet, and primary gateway is carried out authentication to remote access person; The user carries out operation of equipment and control by the Web page on the primary gateway; Primary gateway is monitored all devices by subnet gateway and home automation control network.
Subnet gateway is as an equipment in the major network, and it need support DHCP (Dynamic Host Control Protocol) (RFC2131), and primary gateway also need be supported DHCP (Dynamic Host Control Protocol).Subnet gateway is communicated by letter with the DHCP service end on the primary gateway as the client of DHCP, obtains the IP address automatically.
Communication protocol between primary gateway and the subnet gateway is based on the application protocol of TCP, and its port numbers is 1088, realizes communicating by letter between primary gateway and the subnet gateway.In addition, consider the safety issue of user by Internet remote access, control appliance the time, the remote equipment access control can only be undertaken by primary gateway.That is: remote access control is directly to the visit of primary gateway, to the control of the equipment in the home automation control network, by between primary gateway and the subnet gateway communicate by letter and subnet gateway and equipment between the realization of communicating by letter.Subnet gateway is as the communication interface of home automation control network in major network, only accept the communication request of primary gateway, this agreement has stipulated that primary gateway is at the subnet gateway registering functional, subnet gateway only responds the communication request of registered primary gateway, thus the primary gateway visit that the information in the home automation control network that guarantees can only be authorized to.Describe the form of communication data packet below in detail, see the following form.
Protocol version | Keep | Type of data packet | Data packet length | The major network numbering | Data |
????2bits | ??2bits | 4bits | ???2Bytes | ??2Bytes | ??0-512K ???Bytes |
Frame head | Frame data |
Wherein: protocol version: 2, the expression communication protocol version is 1 at present.Keep: 2, be used for later protocol extension, there is not definition at present.Type of data packet: 4, be used for the type of presentation protocol packet, concrete definition sees table: described type of data packet comprises registration, nullifies, is provided with, reads, reports, uploads, affirmation and reserved part.
Type of data packet | Explanation | Function |
?????0 | Registration | Primary gateway is registered to subnet gateway |
?????1 | Nullify | Primary gateway is nullified to subnet gateway |
?????2 | Be provided with | Primary gateway is to the parameter that is provided with of subnet |
?????3 | Read | Primary gateway reads the parameter of subnet |
?????4 | Report | Subnet gateway is reported parameter to primary gateway |
?????5 | Upload | Subnet gateway sends home appliance file or household electrical appliances registration table to primary gateway |
?????6 | Confirm | The affirmation of communication |
????7-15 | | Reserve |
Data packet length: 2 bytes, represent that this packet does not comprise the length of the frame data of frame head, unit is 8 bytes.
The major network numbering: 2 bytes, selected at random by primary gateway, in the primary gateway and subnet gateway communication process of primary gateway after the subnet gateway registration, be used to confirm the identity of primary gateway.
Data: the data in the packet.
The data packet format of log-in command is: type of data packet is 0, and packet data comprises the IP of primary gateway of 6 bytes and the major network numbering of 2 bytes.
The log-on data packet format sees the following form:
Type of data packet | The data of packet |
?????0 | The IP 6Bytes of primary gateway | Major network numbering 2Bytes |
This packet is connected in the major network at subnet gateway, and by primary gateway with DHCP (Dynamic Host Control Protocol) distributing IP address after, send to the registration packet of subnet gateway by primary gateway, after subnet gateway request of receiving and the affirmation, in the communication afterwards, subnet gateway is only accepted the communication request from primary gateway IP address and the major network numbering primary gateway consistent with registration first.
The major network numbering is selected at random by primary gateway, and the length of 2 bytes is mainly for fear of visit, the control of unauthorized primary gateway to subnet gateway.In case selected, effective before the registration next time after primary gateway is nullified.When re-registering, the major network numbering can be selected again at random.
The data packet format of nullifying order is: type of data packet is 1, and packet data comprises the IP of primary gateway of 6 bytes and the major network numbering of 2 bytes.
Nullify data packet format such as following table:
Type of data packet | The data of packet |
????1 | The IP 6Bytes of primary gateway | Major network numbering 2Bytes |
Close in primary gateway, subnet gateway closes, or when changing primary gateway, send to subnet gateway by primary gateway, or subnet gateway sends to the cancellation packet of primary gateway.Receive this packet the recipient, and under the situation that the affirmation major network is numbered, primary gateway IP is correct, provide the affirmation packet.After cancellation came into force, before registration next time, subnet gateway was not accepted the communication request from any equipment.After the cancellation, the major network numbering lost efficacy simultaneously, when registering, reselected the major network numbering next time.
The data packet format that order is set is: type of data packet is 2, packet data comprise the UDS of the equipment that will be provided with of 6 bytes, 1 byte order number and corresponding equipment file be set order (each is provided with order is 32 bytes) is set.
Data packet format is set to see the following form:
Type of data packet | The data of packet |
?????2 | The UDS 6Bytes of the equipment that is provided with | Order number 1Bytes is set | The corresponding equipment file 32 bytes of order are set | Corresponding equipment 32 bytes of order are set | | Corresponding equipment 32 bytes of order are set |
This packet is used for the parameter by certain equipment of control home automation control network of primary gateway transmission.Comprising the order that is provided with of: the sign of corresponding equipment and the parameter correspondence that will be provided with, this order is provided by the device file of this equipment.One is provided with a plurality of parameters that command packet can be provided with certain equipment simultaneously, and the number of parameter indicates with the integer of 1 byte, and promptly one is provided with command packet and simultaneously 255 parameters can be set at most.Each parameter is provided with order no longer than 32 bytes.
After subnet gateway receives this order, carry out corresponding operation, and return to the affirmation of primary gateway operation success or not by home automation control network.
The data packet format of reading order is: type of data packet is 3, and packet data comprises the reading order number of the UDS of the equipment that will read of 6 bytes, 1 byte and the reading order of corresponding equipment file (each reading order is 32 bytes).
The reading of data packet format sees the following form.
Type of data packet | The data of packet |
????3 | The UDS 6Bytes of the equipment that reads | Reading order number 1Bytes | 32 bytes of the reading order of corresponding equipment file | 32 bytes of the reading order of corresponding equipment | … | 32 bytes of the reading order of corresponding equipment |
This packet is used for the parameter that reads certain equipment of home automation control network by the primary gateway transmission.Comprising the reading order of: the sign of corresponding equipment and the parameter correspondence that will be provided with, this order is by the device file explanation of this equipment.
A read command packet can read a plurality of parameters of certain equipment simultaneously, and the number of parameter is by the integer explanation of 1 byte, and promptly a read command packet can read 255 parameters at most simultaneously.Each parameter reading order is no longer than 32 bytes.
Subnet gateway is operated accordingly by home automation control network after receiving this packet, and the parameter that reads sends to primary gateway to report packet.
The data packet format of reporting order is: type of data packet is 4, and packet data comprises the report number of parameters of the UDS of the equipment of being reported of 6 bytes, 1 byte and the parameter of corresponding equipment file (each reading order is 32 bytes)
The report data packet format sees the following form:
Type of data packet | The data of packet |
?????4 | The UDS 6Bytes of the equipment of being reported | Report the number 1Bytes of parameter | 32 bytes of the parameter of corresponding equipment file | 32 bytes of the parameter of corresponding equipment file | … | 32 bytes of the parameter of corresponding equipment file |
This packet is used for the parameter by certain equipment of home automation control network of controlling of subnet gateway transmission.Comprising: the sign of corresponding equipment and the parameter that will report and various abnormal information, this parameter is by the device file explanation of equipment.
Report a plurality of parameters that packet can be reported certain equipment simultaneously for one, the number of parameter is by the integer explanation of 1 byte, and promptly a report command packet can be reported 255 parameters simultaneously at most.Each parameter is no longer than 32 bytes.
This packet both can sent by subnet gateway by the reading order request of primary gateway.Also can initiatively send by subnet gateway.
The data packet format of embarkation order is: type of data packet is 5, and packet data comprises the UDS of the equipment that will upload of 6 bytes and the device file of corresponding device.
The packet format that uploads data sees the following form.
Type of data packet | The data of packet |
?????5 | The UDS 6Bytes of the equipment of uploading | The device file of corresponding device |
This packet is used for the institute's device file of certain equipment of home automation control network of controlling that is sent by subnet gateway or represents the device registry of each equipment connection situation of whole home automation control network.Device file and device registry are distinguished by the equipment UDS in the packet, if UDS is the UDS of subnet gateway, upload device registration table then if the UDS of miscellaneous equipment, is then uploaded the device file of this equipment.
Primary gateway is carried out the maintenance of the equipment control form of the conversion of device file and webpage and self inside behind the device file that receives device registry or equipment.
The data packet format of confirming order is: type of data packet is 6, and packet data comprises the data content of affirmation type and 1 byte of 1 byte.
Confirm that data packet format sees the following form.
Type of data packet | The data of packet |
?????6 | Confirm Class1 Byte | Data content 1Byte |
The recipient of packets such as this packet is used for above-mentioned registration, cancellation, be provided with, read handles the affirmation of received packet.Concrete definition sees the following form.
Confirm type | Data content | Explanation |
?????0 | The data of 1 byte | 0 the expression succeed in registration 1 the expression registration failure |
?????1 | The data of 1 byte | 0 expression is nullified successfully 1 expression and is nullified failure |
?????2 | The data of 1 byte | 0 expression is provided with success 1 expression failure is set |
?????3 | The data of 1 byte | 0 expression is read success 1 expression and is read failure |
???4-255 | The data of 1 byte | Reserve |
The means of communication between the digital home network gateway are:
(1) the home automation control network gateway obtains the IP address by DHCP (Dynamic Host Control Protocol) from primary gateway;
(2) primary gateway is applied for the registration of to subnet gateway by sending the log-in command packet, and subnet gateway receives this order back and sends confirmation, then succeeds in registration.After succeeding in registration, primary gateway in all communication data packet numbering then be the sign that subnet gateway and primary gateway are confirmed the other side's identity, and subnet gateway only accepts to number from primary gateway IP address and major network the request of correct packet;
(3) primary gateway by be provided with, reading order reads the state parameter of each equipment or the state parameter of each equipment is set from subnet gateway;
(4) subnet gateway provides the device description file of each equipment, the state parameter of each equipment, the contents such as device registry of each equipment connection status by reporting order to primary gateway, makes primary gateway understand the state of whole home automation control network;
(5) subnet gateway sends the device file of certain equipment in its home automation control network of controlling or represents that each equipment of whole home automation control network connects the device registry of situation to primary gateway by embarkation order.Primary gateway is carried out the maintenance of the equipment control form of the conversion of device file and webpage and self inside after receiving home appliance file or device registry;
(6) before primary gateway, subnet gateway are closed, then before closing, initiate log off procedure by the side of closing.Confirm that if de-registration request obtains the other side then the numbering of the major network in this registering communication is invalid, before registration next time, subnet gateway is not accepted the request of any primary gateway.
Primary gateway is communicated by letter with subnet gateway if desired, and then the equipment in the control home automation control network, need be registered on the subnet gateway.In case be registered on the subnet gateway, subnet gateway is only communicated by letter with a unique primary gateway that is registered to self, does not accept the communication request of other IP network equipment.
The process of registration is initiated by primary gateway.Primary gateway sends the log-in command packet, comprising the IP address of primary gateway, and the major network numbering of 2 bytes that generate at random by primary gateway, after subnet gateway received this order, subnet gateway then succeeded in registration after sending affirmation.After succeeding in registration, primary gateway in all communication data packet numbering then be the sign that subnet gateway and primary gateway are confirmed the other side's identity, and subnet gateway only accepts to number from primary gateway IP address and major network the request of correct packet.
Before primary gateway, subnet gateway are closed, then before closing, initiate log off procedure by the side of closing.Confirm that if de-registration request obtains the other side then the numbering of the major network in this registering communication is invalid, before registration next time, subnet gateway is not accepted the request of any primary gateway.
Communicating by letter between primary gateway and the subnet gateway mainly is the connection status of transmitting home automation control network, the state of each equipment etc.Primary gateway by be provided with, reading order reads the state parameter of each equipment or the state parameter of each equipment is set from subnet gateway.Subnet gateway provides the device description file of each equipment, the state parameter of each equipment, the contents such as device registry of each equipment connection status by reporting order to primary gateway, makes primary gateway understand the state of whole home automation control network.
Because this communication protocol operates on the reliable TCP transmission basis, the unfailing performance of its transmission accesses assurance, success or failure that the affirmation function of this agreement is used to describe registration, nullify, be provided with, read etc. operates, and the correctness of transmission itself is not described.