Embodiment
Terminological interpretation:
URL:Uniform Resource Location, URL(uniform resource locator) is to be used for the character string of descriptor resource on the Internet.
Wi-Fi:Wireless Fidelity, Wireless Fidelity belongs to the short distance wireless technical that uses in office and family.
Wi-Fi Direct: be a kind of standard on the Wi-Fi basis, allow the equipment in the wireless network to need not to interconnect by wireless router.
Bluetooth: the radiotechnics of a kind of support equipment short haul connection (in the general 10m) can comprise that carrying out wireless messages between numerous equipment such as mobile phone, PDA, wireless headset, notebook computer, relevant peripheral hardware exchanges.
TCP:Transmission Control Protocol, transmission control protocol, its be a kind of towards connect (connecting guiding), reliably, based on transport layer (Transport layer) communication protocol of byte stream
UDP:User Datagram Protocol, User Datagram Protoco (UDP), it is mainly used to support those need transmit the network application of data between computer, UDP has got rid of information reliable delivery mechanism, wait function transfer to finish to upper layer application with ordering safety, greatly reduced the time of implementation, speed is guaranteed.
HTTP:Hypertext Transfer Protocol, HTML (Hypertext Markup Language) is used for transmitting on the internet hypertext language.
HTTPS:Secure Hypertext Transfer Protocol refers to safe HTML (Hypertext Markup Language), and it is a secured communication channel, based on HTTP, is used for exchange of information between client-server.
UPnP:Universal Plug and Play, UPnP is that peer-to-peer network that realizations such as various smart machines, wireless device and PC spread all over the world is connected the structure of (P2P).UPnP is a kind of distributed, the open network architecture.UPnP is media independently.In any operating system, utilize any programming language can use UPnP equipment.
SDK:Software Development Kit, SDK is realized specific function, SDK can initiatively not move usually, but just carries out specific function by application call.
Short-range communication refers to the communication between nearer distance (for example in hundreds of rice) equipment.Generally realize short-range communication by local area network (LAN) or point-to-point mode, for example: by WiFi, WiFi-Direct, bluetooth, NFC, RFID etc.
Subscriber equipment: refer to the smart machine by user's direct control, the user controls other equipment by these equipment executive utilities.Common subscriber equipment is intelligent terminal, for example: smart mobile phone, panel computer, intelligent glasses, intelligent watch etc.
Environmental unit: be distributed in the smart machine in people's work, the living environment, these equipment are carried out specific business function, can produce professional relevant data, and data are offered subscriber equipment, use for subscriber equipment processing, for example: intelligent television, intelligent refrigerator, intelligent water heater etc.
Please refer to Fig. 1, the equipment that the embodiment of the invention provides comprises subscriber equipment 101, environmental unit 102 and message server 103.
Subscriber equipment 101 is connected to the Internet by modes such as operator's wireless network (for example GPRS, 3G, 4G etc.), WiFi, WiFi-Direct, cable broadbands.
Message server 103 is disposed on the internet, for subscriber equipment 101, environmental unit 102 visits.Message server 103 has been preserved the relevant information of subscriber equipment 101, can be between subscriber equipment 101 and environmental unit 102 pass-along message.
Belong to short-range communication between environmental unit 102 and the subscriber equipment 101, for example: WiFi, WiFi-Direct, bluetooth, NFC(Near Field Communication, close range wireless communication), RFID(Radio FrequencyIdentification, radio-frequency (RF) identification) etc.Environmental unit 102 has the ability of visit the Internet, if himself does not have, also can be by subscriber equipment 101 visit the Internets, and for example subscriber equipment 101 serves as the WiFi access point.
In embodiments of the present invention, subscriber equipment 101 need not to install a plurality of application clients and a plurality of environmental unit 102 is adaptive, reduced the pressure of subscriber equipment 101, environmental unit 102 is when sending message content to subscriber equipment 101, can't directly send message content to subscriber equipment 101, its message content is transmitted to subscriber equipment 101 by message server 103, has therefore guaranteed the fail safe of subscriber equipment 101 when carrying out information interaction with environmental unit 102.
By reference to the accompanying drawings the present invention is described in further detail below by embodiment.
Please refer to Fig. 2, present embodiment provides a kind of information interacting method based on message server, comprises following step:
Step 3.1: subscriber equipment sends log-on message to message server, this log-on message is subscriber equipment according to the user's who gets access to input information structuring, comprised device address, the device identification of subscriber equipment, this device address is used for message server and sends message to subscriber equipment.Device identification can be user-defined in when registration, and perhaps the administration module in the subscriber equipment generates automatically according to the software of subscriber equipment and/or hardware characteristics; The communication protocol interface that administration module in the subscriber equipment of device address detects this equipment obtains.
Step 3.2: message server is that subscriber equipment generates the information receiving and transmitting address, and this information receiving and transmitting address refer message server is used for message server according to the subscriber equipment of information receiving and transmitting address lookup correspondence.Generate the information receiving and transmitting address and can be following two kinds of generting machanisms, a kind of mode is to generate static information receiving and transmitting address, static state refers to keep between address and the equipment stable corresponding relation, can not change along with the change of factors such as time, place, for example: the device identification according to the user generates static information receiving and transmitting address; Another kind of mode is to generate dynamic information receiving and transmitting address; be that subscriber equipment is registered at every turn; the information receiving and transmitting address that message server generates is all different; such benefit has been to protect the privacy of subscriber equipment; subscriber equipment is want when mutual with environmental unit; the application dynamic address; dynamic address is only effective under certain condition; in case exceed predetermined condition, dynamic address had just lost efficacy, for example: in case finish alternately; perhaps behind certain hour; just lost efficacy in this address, environmental unit rethinks to subscriber equipment and sends message, just can't arrive.In an instantiation, please refer to the information receiving and transmitting address field of table 1, the composition rule of information receiving and transmitting address is a URL, it comprises two parts content at least: message server domain name and port (the http agreement is defaulted as 80) and the pseudo-code corresponding with subscriber equipment, the domain name of message server and port refer message server, the pseudo-code corresponding with subscriber equipment are used for the corresponding subscriber equipment of message server inquiry.For example: http://www.a.com/12345432, wherein http://www.a.com/ is domain name and port, the 12345432nd, the pseudo-code corresponding with subscriber equipment.
Step 3.3: message server sends to subscriber equipment with the information receiving and transmitting address that generates.
When subscriber equipment is registered to message server, message server needs the relevant information of maintenance customer's equipment, please refer to table 1, in the present invention's one instantiation, message server is according to the mode of the log-on message maintenance customer facility information of receiving, message server generates the corresponding relation of device identification, device address and information receiving and transmitting address.
Table 1 subscriber equipment table
In another kind of embodiment, to the message server registration, message server is preserved device identification and the device address of subscriber equipment to subscriber equipment in registration process earlier, and can temporarily not send the information receiving and transmitting address to subscriber equipment this moment.After the registration, when subscriber equipment need carry out information interaction with environmental unit, subscriber equipment sends the request that requires to obtain the information receiving and transmitting address to message server, carry the device identification of subscriber equipment in the registration process in this request, message server regenerates or inquires about with it corresponding information receiving and transmitting address according to this device identification, sends it to subscriber equipment.The device identification of subscriber equipment can generate by subscriber equipment in registration process automatically, also can be that message server is that subscriber equipment generates.
Step 4.1: environmental unit sends broadcast, broadcast comprises the device address of environmental unit, environmental unit can send broadcast according to predetermined condition, for example, timed sending, detect new subscriber equipment and establish when adding network to send, detect and send when new point-to-point equipment connects etc.In an instantiation, environmental unit uses udp protocol to send broadcast, has carried environmental unit in the broadcast for the device address and the port that receive message, for example, and 192.168.1.23:8088.The content such as title/pet name, functional description that optionally, can also comprise environmental unit in the broadcast.
Step 4.2: subscriber equipment according to the device address of the environmental unit that carries in the broadcast, will send to environmental unit from the information receiving and transmitting address that message server obtains after getting access to the broadcast of environmental unit transmission.
In another kind of embodiment, environmental unit does not send broadcast, but subscriber equipment sends broadcast, and the information receiving and transmitting address is sent to environmental unit.
In another kind of embodiment, environmental unit and subscriber equipment do not send broadcast, but the two is set up direct communication network and comes pass-along message transmitting-receiving address.For example: set up NFC communication, subscriber equipment sends to environmental unit to the information receiving and transmitting address; Perhaps in two-dimension code, the two-dimension code that environmental unit scanning subscriber equipment provides has then obtained the information receiving and transmitting address to subscriber equipment the information receiving and transmitting geocoding; Perhaps user equipment scans the two-dimension code that provides of environmental unit, obtained the mailing address of environmental unit, subscriber equipment sends to environmental unit to the information receiving and transmitting address by this mailing address then.Should be appreciated that environmental unit obtains the information receiving and transmitting address and can also realize by other conventional method of this area.
Step 4.3: environmental unit gets access to behind the information receiving and transmitting address that subscriber equipment sends its preservation, is used for the follow-up message content that sends to the information receiving and transmitting address.
Step 5.1: environmental unit sends the message content of environmental unit to this information receiving and transmitting address behind the information receiving and transmitting address that gets access to the subscriber equipment transmission, message content is content of multimedia such as text, image, video, sound, can be the content of single type, also may be polytype combination.In an instantiation, message content is a kind of message format that meets Web webpage relevant criterion, for example HTML5 standard.
In another kind of embodiment, in the step 5.1, environmental unit also sends the device address of environmental unit to message server, information such as the IP address, port numbers of environmental unit have been reflected in the device address of environmental unit, are used for after subscriber equipment gets access to the message content of environmental unit response result being returned to environmental unit by message server.
Step 5.2: after message server gets access to the message content of environmental unit transmission, message content is carried out fail safe detect.
In another kind of embodiment, in step 5.2, after message server gets access to the device address of environmental unit, the build environment device identification, for example, hash is carried out in the device address of environmental unit calculate, obtain unique environmental unit sign, message server is safeguarded the device address of environmental unit and the corresponding relation of environmental unit sign.Please refer to table 2, in an instantiation, message server is safeguarded the device address of environmental unit and the mode of the corresponding relation that environmental unit identifies.
In another embodiment, environmental unit also sends the environmental unit sign to message server, has not then needed the device identification of message server build environment.
Table 2 environmental unit table
Step 5.3: when message server when to detect message content be safe, message content is transmitted to corresponding subscriber equipment; When detecting message content when dangerous, then refuse message content is transmitted to corresponding subscriber equipment.
In another kind of embodiment, message server also sends to subscriber equipment together with environmental unit sign and message content, when being used for subscriber equipment and environmental unit generation information interaction, to environmental unit echo reply result, or when making things convenient for subscriber equipment simultaneously with a plurality of environmental unit generation information interaction, to the particular environment equipment sending message.Be to be understood that, subscriber equipment has been known the device address of environmental unit when getting access to the broadcast that environmental unit sends, subscriber equipment also can use this device address to carry out the direct transmission of message when carrying out information interaction with environmental unit after getting access to the message content that environmental unit sends; But the fail safe for guarantee information, subscriber equipment can only send the information receiving and transmitting address to this device address, and can not send interactive messages, when subscriber equipment carries out information interaction with environmental unit after getting access to the message content that environmental unit sends, can only send to the device address of the environmental unit of subscriber equipment by message server, the message that subscriber equipment returns to environmental unit can only be transmitted to environmental unit by message server.The information interaction that should be appreciated that subscriber equipment and environmental unit can be repeatedly.
Step 5.4: the user is resolved and showed to subscriber equipment to it after getting access to the message content of the environmental unit that message server sends.For example, when the form of message content is the web webpage, the browser engine that subscriber equipment then calls self resolves the message content received and the form by webpage shows the user, and simultaneously, the user also can carry out further information interaction by the interaction options in the webpage and environmental unit.
According to above-mentioned information interacting method based on message server, present embodiment also provides the relevant device of realizing this method, comprises subscriber equipment, environmental unit and message server.
Please refer to Fig. 3, be the module diagram of subscriber equipment in the present embodiment, this subscriber equipment comprises communication module 601, human-computer interaction module 602, administration module 603 and memory module 604.
Communication module 601 is used for communicating with message server and environmental unit, it supports short-range communications such as WiFi, WiFiDirect, bluetooth, RFID to connect, also support and the communicating to connect of the Internet, and communicating to connect host-host protocols such as supporting TCP, UDP, HTTP, HTTPS on the basis.
Human-computer interaction module 602 is used for gathering user's input information and shows output information to the user, and human-computer interaction module 602 provides input capability, is used for gathering user's input information, for example keyboard, touch-screen, sound, video etc.; Human-computer interaction module 602 also provides fan-out capability, is used for showing output information to the user, for example display screen, loudspeaker, vibration component etc.
Administration module 603 is connected with human-computer interaction module 602 with communication module 601, be used for the input information structuring log-on message according to the user, log-on message is sent to message server by communication module 601, and after getting access to the information receiving and transmitting address that message server returns, the information receiving and transmitting address is sent to environmental unit; Administration module 603 also for the message content of the environmental unit that obtains the message server transmission, is resolved it; Log-on message comprises the device address of subscriber equipment, and information receiving and transmitting address refer message server is used for message server according to the subscriber equipment of information receiving and transmitting address lookup correspondence.Wherein, log-on message comprises the device address of subscriber equipment, and information receiving and transmitting address refer message server is used for message server according to the subscriber equipment of information receiving and transmitting address lookup correspondence.In an instantiation, administration module 603 comprises browser engine, is used for resolving the web page contents of message content, for example the HTML5 content.
In another kind of embodiment, administration module 603 also identifies for device address or the environmental unit of the environmental unit that obtains the message server transmission, be used for subscriber equipment and handle at the message content to environmental unit, when carrying out information interaction with environmental unit to environmental unit echo reply result.
Should be appreciated that administration module 603 can comprise the processor as the electronic equipment maincenter, processor is connected with various external modules, and the various application programs in the subscriber equipment are moved by processor.In addition, subscriber equipment is equipped with the operating system between hardware and application program, be used for providing application program running environment, public bottom ability (for example subscriber equipment receives the informing mechanism that the message content rear line of environmental unit is given notice) be provided and provide support for application access hardware.
Memory module 604 is connected with administration module, is used for the storage data.Be to be understood that, memory module 604 comprises persistent storage (hard disk, SD card etc.) and perishability storage (internal memory), wherein persistent storage be used for to be preserved data such as application program, but not the memory space of persistent storage needed program, data when being used for the equipment operation is provided.
Please refer to Fig. 4, be the module diagram of environmental unit in the present embodiment, this environmental unit comprises communication module 701, administration module 702, memory module 703 and sensor assembly 704.
Communication module 701 is used for communicating by letter with message server with subscriber equipment, it supports short-range communications such as WiFi, WiFi Direct, bluetooth, RFID to connect, perhaps also support and the communicating to connect of the Internet, and communicating to connect host-host protocols such as supporting TCP, UDP, HTTP, HTTPS on the basis.
Administration module 702 is connected with communication module 701, be used for control communication module 701 and send broadcast, and after getting access to the information receiving and transmitting address that subscriber equipment sends, sending the message content of environmental unit to the information receiving and transmitting address, broadcast comprises the device address of environmental unit.In another kind of embodiment, environmental unit does not send broadcast, and subscriber equipment directly sends to environmental unit by the mode of broadcasting with the information receiving and transmitting address.Should be appreciated that environmental unit obtains the information receiving and transmitting address and can also realize by other conventional method of this area.
Memory module 703 is connected with administration module 702, is used for the storage data.Be to be understood that, memory module 703 comprises persistent storage (hard disk, SD card etc.) and perishability storage (internal memory), wherein persistent storage be used for to be preserved data such as application program, but not the memory space of persistent storage needed program, data when being used for the equipment operation is provided.
Sensor assembly 704 is connected with administration module 702, is used for gathering environmental information, for example: a kind of environmental unit that is attached on the coffee machine, how many people sensor assembly has connect coffee in detecting one day; A kind of environmental unit that is attached on the refrigerator, sensor assembly detect interior user of a week and have opened refrigerator doors several times, have perhaps got beverage several times; Sensor assembly on the shopper window, detect passer-by age, sex, wear characteristics.The above-mentioned content that is detected by sensor assembly is environmental information.Sensor assembly 704 can comprise one or more transducers according to service needed.Accordingly, administration module 702 also is used for forming corresponding service feature according to environmental information.Sensor assembly 704 is gathered belongs to raw information, often can not give professionally directly to use, and need analyze according to the needs of business, forms the information of higher aspect, is service feature.For example: in the scene of shopper window, camera is transducer, and the raw information of collection is exactly photo or video, analyzes " people's age, sex, wear characteristics " from photo or video, just belongs to service feature.
In another kind of embodiment, administration module 702 also sends the device address of environmental unit to the information receiving and transmitting address behind the information receiving and transmitting address that gets access to the subscriber equipment transmission, the device address of environmental unit is used for after subscriber equipment gets access to the message content of environmental unit response result being returned to environmental unit.
Should be appreciated that administration module 702 can comprise the processor as the electronic equipment maincenter, processor is connected with various external modules, and the various application programs in the environmental unit are moved by processor.In addition, environmental unit is equipped with the operating system between hardware and application program, be used for providing application program running environment, public bottom ability be provided and provide support for application access hardware.
The environmental unit that present embodiment provides need not to pass through in advance authentication and the authentication of message server, can directly send message content to the information receiving and transmitting address, guarantee the high-adaptability of message server.
Please refer to Fig. 5, be the module diagram of message server in the present embodiment, this message server comprises communication module 801, administration module 802, memory module 803 and safety detection module 804.
Communication module 801 is used for communicating with subscriber equipment and environmental unit, and it has network interface and protocol stack, makes message server can insert the Internet, for subscriber equipment and environmental unit visit.
Administration module 802 is connected with communication module 801, is used for behind the log-on message that gets access to the subscriber equipment transmission, is that subscriber equipment generates the information receiving and transmitting address, and the information receiving and transmitting address is sent to subscriber equipment; Log-on message comprises the device address of subscriber equipment; Information receiving and transmitting address refer message server is used for message server according to the subscriber equipment of information receiving and transmitting address lookup correspondence; Administration module 802 also is used for behind the message content that gets access to the environmental unit transmission message content being transmitted to corresponding subscriber equipment; This log-on message comprises the device address of subscriber equipment.Administration module 802 needs the corresponding relation between management of subscriber sign and the subscriber equipment.
Memory module 803 is connected with administration module 802, is used for the storage data.Be to be understood that, memory module 803 comprises persistent storage (hard disk, SD card etc.) and perishability storage (internal memory), wherein persistent storage be used for to be preserved data such as application program, but not the memory space of persistent storage needed program, data when being used for the equipment operation is provided.
Safety detection module 804 is connected with administration module 802, being used for after administration module 802 gets access to the message content of environmental unit transmission this message content being carried out fail safe detects, when to detect message content be safe, notice administration module 802 was transmitted to corresponding subscriber equipment with message content; Dangerous when detecting message content, notice administration module 802 refusals are transmitted to corresponding subscriber equipment with message content.The existence of safety detection module 804 can guarantee the fail safe of subscriber equipment when carrying out information interaction with numerous foreign environment equipment.When concrete the application, safety detection module 804 can be set to filter the junk information of environmental unit transmission, the Virus of implantable subscriber equipment etc.
In another kind of embodiment, administration module 802 also obtains the device address of environmental unit, and generate corresponding environmental unit sign, administration module 802 is when sending the message content of environmental unit to subscriber equipment, also send the environmental unit sign to subscriber equipment, be used for after subscriber equipment gets access to the message content of environmental unit, response result being returned to environmental unit.
Should be appreciated that administration module 802 can comprise the processor as the electronic equipment maincenter, processor is connected with various external modules, and the various application programs in the message server are moved by processor.In addition, message server is equipped with the operating system between hardware and application program, be used for providing application program running environment, public bottom ability be provided and provide support for application access hardware.
Please refer to Fig. 6, be the concrete application examples of information interacting method between the equipment in the present embodiment.
Smart mobile phone is as subscriber equipment, water dispenser is as environmental unit, the user registers to message server by mobile phone, or after registration to message server send a request message the transmitting-receiving address solicited message, when message server gets access to the log-on message of mobile phone or solicited message, generate the information receiving and transmitting address, and send to mobile phone.Water dispenser sends broadcast as environmental unit under predetermined condition, when the user holds mobile phone near water dispenser, after mobile phone receives the broadcast of water dispenser, according to the device address of the water dispenser that carries in the broadcast information receiving and transmitting address is sent to water dispenser.After water dispenser gets access to the information receiving and transmitting address of mobile phone, send the message content of water dispenser to this information receiving and transmitting address.Message server carries out fail safe to message content and detects after receiving the message content that water dispenser sends, if safety then according to the device address of the mobile phone of information receiving and transmitting address correspondence, message content is transmitted to mobile phone.
Subscriber equipment can be built-in with browser engine, can support to satisfy the message content of Web standard, make message content have the flexibility of height, simple message content can be passage, complicated message content then can be one section webpage that contains audio frequency, video, image, can also have text box to accept user's input in the webpage, webpage also has submit button to send message for subscriber equipment to environmental unit.As shown in Figure 6, the literal among the figure, text input frame, to send button all be to provide in the message content of being sent by environmental unit (water dispenser).
Certainly, behind the message content that receives the water dispenser transmission, can carry out information interaction in order to guarantee mobile phone with water dispenser, when water dispenser sends message content to the information receiving and transmitting address, also send the device address of water dispenser.After message server receives this device address, generate the device identification of corresponding water dispenser, and when transmitting message content, the device identification of water dispenser is sent to mobile phone.When mobile phone carries out information interaction according to message content needs and water dispenser, then interactive information is sent to message server together with the device identification of water dispenser, message server is inquired about the device address of corresponding water dispenser again according to device identification, interactive information is transmitted to water dispenser.
Information interacting method and equipment thereof based on message server that present embodiment provides, can realize the information interaction between subscriber equipment and the environmental unit, wherein, subscriber equipment need not to install a plurality of application clients and comes with a plurality of environmental units adaptive, reduced the pressure of subscriber equipment, environmental unit is when sending message content to subscriber equipment, can't directly send message content to subscriber equipment, its message content is transmitted to subscriber equipment by message server, has therefore guaranteed the fail safe of subscriber equipment when carrying out information interaction with environmental unit.
It will be appreciated by those skilled in the art that, the all or part of step of the whole bag of tricks can instruct related hardware to finish by program in the above-mentioned execution mode, this program can be stored in the computer-readable recording medium, and storage medium can comprise: read-only memory, random asccess memory, disk or CD etc.
Above content be in conjunction with concrete execution mode to further describing that the present invention does, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace.