CN109905450B - Inter-device communication method, device and storage medium - Google Patents

Inter-device communication method, device and storage medium Download PDF

Info

Publication number
CN109905450B
CN109905450B CN201711310259.6A CN201711310259A CN109905450B CN 109905450 B CN109905450 B CN 109905450B CN 201711310259 A CN201711310259 A CN 201711310259A CN 109905450 B CN109905450 B CN 109905450B
Authority
CN
China
Prior art keywords
gateway
sub
session
physical channel
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711310259.6A
Other languages
Chinese (zh)
Other versions
CN109905450A (en
Inventor
吕建文
张祥勇
尹晓磊
张宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201711310259.6A priority Critical patent/CN109905450B/en
Publication of CN109905450A publication Critical patent/CN109905450A/en
Application granted granted Critical
Publication of CN109905450B publication Critical patent/CN109905450B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the application provides a method, a device, equipment and a storage medium for communication among equipment, so that a server can distinguish different sub-equipment connected with a gateway conveniently. The method comprises the following steps: receiving a binding request through a physical channel of a gateway; allocating a first session for the sub-equipment of the gateway according to the binding request, and binding the sub-equipment and the physical channel of the gateway, wherein the first session is used for transmitting the communication message of the sub-equipment forwarded by the gateway; generating a binding response and feeding back through the physical channel. The data of the gateway and the sub-devices thereof can be transmitted through one physical channel, and the server forwards the communication messages of different sub-devices through different sessions, so that the different sub-devices can be distinguished conveniently.

Description

Inter-device communication method, device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an inter-device communication method, an inter-device communication apparatus, a gateway, a server, and a storage medium.
Background
The Internet of things (IoT) is an Internet with which things are connected, and with the rise of the Internet of things, Internet of things devices are increasingly diversified.
The internet of things equipment needs to be networked and interacted with the server at the cloud end, some internet of things equipment can be directly connected with the server at the cloud end, some internet of things equipment cannot be directly connected with the server, and the server at the cloud end needs to be connected through the gateway, so that a plurality of pieces of sub-equipment can be mounted under one gateway generally.
However, since a plurality of sub-devices may be mounted under one gateway, it is difficult for the server to distinguish data of different sub-devices.
Disclosure of Invention
The embodiment of the application provides a communication method between devices, so that a server can distinguish different sub-devices connected with a gateway conveniently.
Correspondingly, the embodiment of the application also provides an inter-device communication device, an electronic device and a storage medium, which are used for ensuring the implementation and application of the system.
In order to solve the above problem, an embodiment of the present application discloses an inter-device communication method, including: receiving a binding request through a physical channel of a gateway; allocating a first session for the sub-equipment of the gateway according to the binding request, and binding the sub-equipment and the physical channel of the gateway, wherein the first session is used for transmitting the communication message of the sub-equipment forwarded by the gateway; generating a binding response and feeding back through the physical channel.
Optionally, allocating a first session to the child device of the gateway according to the binding request includes: acquiring authentication information of the sub-equipment of the gateway from the connection request, and authenticating the sub-equipment according to the authentication information; and after the authentication of the sub-equipment is passed, generating a first session, and establishing a mapping relation between the equipment information of the sub-equipment and the first session.
Optionally, the binding the physical channels of the sub-device and the gateway includes: and acquiring the equipment information of the sub-equipment, and binding the equipment information with the physical channel.
Optionally, the method further includes: receiving a connection request of a gateway, and distributing a physical channel for the gateway according to the connection request; and generating a connection response and sending the connection response so as to feed back the physical channel through the connection response.
Optionally, the allocating a physical channel to the gateway according to the connection request includes: acquiring authentication information of the gateway from the connection request, and authenticating the gateway according to the authentication information of the gateway; and after the authentication of the gateway is passed, distributing a physical channel and binding the physical channel with the gateway information of the gateway.
Optionally, before the allocating the physical channel, the method further includes: and generating a second session, and establishing a mapping relation between the gateway information of the gateway and the second session.
Optionally, the method further includes: and receiving the communication message of the sub-equipment through a physical channel of the gateway, and forwarding the communication message through the first session.
Optionally, the method further includes: receiving a communication message through a first session, and determining a physical channel bound by a sub-device corresponding to the first session; and forwarding the communication message by adopting the physical channel.
Optionally, the method further includes: receiving a communication message through a physical channel of the gateway; and determining a resource party of the communication message according to the resource path, and selecting a first session or a second session to forward the communication message according to the resource party.
Optionally, the determining a resource side of the communication packet according to the resource path, and selecting a first session or a second session to forward the communication packet according to the resource includes: acquiring a resource path corresponding to the communication message, and judging whether a resource party is a gateway or not according to the resource path; if the resource side is the gateway, the communication message is forwarded through the second session; if the resource side is not the gateway, judging whether the resource side is the sub-equipment bound with the gateway or not according to the resource path; and if the resource side is the sub-equipment bound with the gateway, forwarding the communication message through the first session corresponding to the sub-equipment.
The embodiment of the application also discloses a method for communication between devices, which comprises the following steps: receiving a network access request of the sub-equipment; generating a binding request according to the network access request, and sending the binding request to a server through a physical channel so that the server binds the sub-equipment and the physical channel of the gateway; and receiving a binding response returned by the server through the physical channel.
Optionally, the generating a binding request according to the network access request includes: and acquiring the authentication information of the sub-equipment according to the network access request, and generating a binding request according to the authentication information of the sub-equipment.
Optionally, the method further includes: sending a connection request to a server; and receiving a connection response fed back by the server, and determining a physical channel according to the connection response, wherein the physical channel is bound by the server for the gateway according to the connection request.
Optionally, the method further includes: encapsulating the communication message according to a protocol format, and forwarding the encapsulated communication message through the physical channel, wherein the communication message comprises: communication messages of the gateway and/or communication messages of the sub-devices.
Optionally, the information of the resource party is stored in the resource path corresponding to the encapsulated communication packet, where the information of the resource party includes: gateway information of the gateway and/or device information of the kid device.
The embodiment of the present application further discloses an inter-device communication apparatus, including: the connection module is used for receiving the binding request through a physical channel of the gateway; a binding module, configured to allocate a first session to a child device of the gateway according to the binding request, and bind the child device and a physical channel of the gateway, where the first session is used to transmit a communication packet of the child device forwarded by the gateway; and the feedback module is used for generating a binding response and feeding back the binding response through the physical channel.
Optionally, the binding module includes: the authentication submodule is used for acquiring authentication information of the sub-equipment of the gateway from the connection request and authenticating the sub-equipment according to the authentication information; and the session generation submodule is used for generating a first session after the authentication of the sub-equipment is passed, and establishing a mapping relation between the equipment information of the sub-equipment and the first session.
Optionally, the binding module includes: and the channel binding submodule is used for acquiring the equipment information of the sub-equipment and binding the equipment information with the physical channel.
Optionally, the connection module is further configured to receive a connection request of the gateway; the binding module is further configured to allocate a physical channel to the gateway according to the connection request; the feedback module is further configured to generate a connection response and send the connection response, so as to feed back the physical channel through the connection response.
Optionally, the binding module includes: the authentication submodule is used for acquiring the authentication information of the gateway from the connection request and authenticating the gateway according to the authentication information of the gateway; and the channel binding submodule is used for distributing a physical channel and binding the physical channel with the gateway information of the gateway after the gateway passes the authentication.
Optionally, the binding module further includes: and the session generation submodule is used for generating a second session and establishing a mapping relation between the gateway information of the gateway and the second session.
Optionally, the method further includes: the service communication module is used for receiving the communication message of the sub-equipment through a physical channel of the gateway; and the service forwarding module is used for forwarding the communication message through the first session.
Optionally, the method further includes: the service forwarding module is used for receiving the communication message through a first session and determining a physical channel bound by the sub-equipment corresponding to the first session; and the service communication module is used for adopting the physical channel to forward the communication message.
Optionally, the method further includes: the service communication module is used for receiving a communication message through a physical channel of the gateway; and the service forwarding module is used for determining a resource party of the communication message according to the resource path and selecting a first session or a second session to forward the communication message according to the resource party.
Optionally, the service forwarding module is configured to obtain a resource path corresponding to the communication packet, and determine whether a resource party is a gateway according to the resource path; if the resource side is the gateway, the communication message is forwarded through the second session; if the resource side is not the gateway, judging whether the resource side is the sub-equipment bound with the gateway or not according to the resource path; and if the resource side is the sub-equipment bound with the gateway, forwarding the communication message through the first session corresponding to the sub-equipment.
The embodiment of the present application further discloses an inter-device communication apparatus, including: the device communication module is used for receiving a network access request of the sub-device; the request module is used for generating a binding request according to the network access request and sending the binding request to a server through a physical channel so that the server binds the sub-equipment with the physical channel of the gateway; and the response receiving module is used for receiving the binding response returned by the server through the physical channel.
Optionally, the request module is configured to obtain authentication information of the sub device according to the network access request, and generate a binding request according to the authentication information of the sub device.
Optionally, the request module is configured to send a connection request to a server; the response receiving module is configured to receive a connection response fed back by the server, and determine a physical channel according to the connection response, where the physical channel is bound by the server according to the connection request.
Optionally, the method further includes: a service transmission module, configured to encapsulate the communication packet according to a protocol format, and forward the encapsulated communication packet through the physical channel, where the communication packet includes: communication messages of the gateway and/or communication messages of the sub-devices.
Optionally, the information of the resource party is stored in the resource path corresponding to the encapsulated communication packet, where the information of the resource party includes: gateway information of the gateway and/or device information of the kid device.
The embodiment of the present application further discloses a server, including: one or more processors; and one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the server to perform a method of inter-device communication as described in one or more of the embodiments of the present application.
Embodiments of the present application also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause a server to perform a method of inter-device communication as described in one or more of the embodiments of the present application.
The embodiment of the present application further discloses a gateway, including: one or more processors; and one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the gateway to perform an inter-device communication method as described in one or more of the embodiments of the present application.
Embodiments of the present application also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause a gateway to perform a method of inter-device communication as described in one or more of the embodiments of the present application.
Compared with the prior art, the embodiment of the application has the following advantages:
in the embodiment of the application, when the sub-devices need to be connected with the gateway, a binding request can be sent to the server through a physical channel of the gateway, and the server can allocate a first session to the sub-devices of the gateway according to the binding request, so that the communication messages of the sub-devices forwarded by the gateway are transmitted through the first session, and the sub-devices are bound with the physical channel of the gateway, so that the data of the gateway and the sub-devices thereof can be transmitted through one physical channel, and the server forwards the communication messages of different sub-devices through different sessions, thereby being convenient for distinguishing the different sub-devices.
Drawings
Fig. 1 is a schematic diagram of a communication system of an embodiment of the present application;
FIG. 2 is a schematic diagram of communication interaction between devices in an embodiment of the present application;
FIG. 3 is a distributed communication system architecture according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a connection interaction process in an embodiment of the present application;
fig. 5 is a schematic diagram of an interaction process of a communication packet in an embodiment of the present application;
FIG. 6 is a flowchart illustrating steps of a gateway in an embodiment of a method for inter-device communication according to the present application;
FIG. 7 is a flow chart illustrating steps of a server in an embodiment of a method for inter-device communication according to the present application;
fig. 8 is a flowchart illustrating steps of uplink transmission in an embodiment of a method for inter-device communication according to the present application;
fig. 9 is a flowchart illustrating steps of downlink transmission in an embodiment of an inter-device communication method according to the present application;
FIG. 10 is a block diagram of an embodiment of an inter-signal communication apparatus applied to a server according to the present application;
FIG. 11 is a block diagram of another embodiment of an inter-signal communication apparatus applied to a server according to the present application;
fig. 12 is a block diagram of an embodiment of an inter-signal communication apparatus applied to a gateway according to the present application;
fig. 13 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
The embodiment of the application provides a method and a device for communication among equipment, wherein a server can distribute different sessions for a gateway and sub-equipment connected with the gateway, so that communication messages of the gateway and the sub-equipment connected with the gateway are forwarded to the server through the same physical channel, and the server transmits the communication messages among service platforms based on different sessions. The communication message is message data of the device, and may include various types of information, such as service information, device state information, and the like, where the service information may be determined based on a service of the corresponding device, for example, the service information of the lighting device is a lighting on/off instruction, and the service information of the access control system is a locking or unlocking instruction.
As shown, a communication system includes: server 10, gateway 20, sub-devices 30, and service platform 40, wherein the gateway may connect one or more of the sub-devices. One side where the gateway and the sub-device are located is called an equipment side, one side where the server and the service platform are located is called a service side, data are transmitted between the equipment side and the service side through the same physical channel between the gateway and the sub-device connected with the gateway and the server, and different session communication is adopted for the gateway and the sub-device between the server of the service side and the service platform, so that the server can distinguish the gateway and the sub-device connected with the gateway based on the session.
The sub-equipment comprises the Internet of things equipment, the Internet of things equipment is connected with the server through the gateway if needed, and the sub-equipment is lighting equipment, security equipment and the like. The Gateway (Gateway) may be used for both wide area network interconnection and local area network interconnection, may be used between two systems with different communication protocols, data formats or languages, and even completely different architectures, and may be regarded as a translator.
Referring to fig. 2, a schematic diagram of inter-device communication is shown.
Step 202, the gateway receives a network access request of the child device. The kid device may request access to the network and may send a network request to the gateway.
And step 204, the gateway generates a binding request based on the network access request, and sends the binding request through the physical channel.
Step 206, allocating a first session to the child device of the gateway according to the binding request, and binding the child device and the physical channel of the gateway. The server can carry out validity verification such as authentication processing and the like on the sub-equipment based on the binding request, after the sub-equipment is confirmed to be legal, a first session can be distributed to the sub-equipment, and the sub-equipment and the physical channel of the gateway are bound, so that the server and the service platform can interact communication messages of the sub-equipment through the first session, the gateway and the sub-equipment share the same physical channel, namely, the gateway transmits data of the gateway and the sub-equipment through the physical channel.
Step 208, the server generates a binding response and feeds back the binding response to the gateway through the physical channel. The gateway confirms that the sub-device is successfully bound, and subsequently can forward the communication message of the sub-device to the server, so that the communication message is forwarded to the service platform through the server.
For each network-accessing sub-device, the physical channels of the sub-device and the gateway can be bound at the server based on the binding request, and the first session is allocated to the sub-device, so that the communication messages of the server for different sub-devices can be transmitted through different sessions without knowing the topological connection of the gateway and the sub-device.
In this embodiment, the server may further allocate a physical channel and a session to the gateway when the gateway requests a connection, that is, when the gateway wants to access the communication system, generate a connection request, and send the connection request to the server. Then the server can carry out validity verification, such as authentication processing and the like, on the gateway based on the connection request of the gateway, and can allocate a second session to the gateway after the gateway is confirmed to be valid, so that the server and the service platform can interact with the communication message of the gateway through the second session; a physical channel is also assigned to the gateway so that communications between the gateway and the server occur over the physical channel. And the server generates a connection response and sends the connection response so as to feed back the physical channel through the connection response.
In summary, the gateway and the sub-devices thereof share the same physical channel, wherein the data of the sub-devices is forwarded by the gateway, and the server further establishes sessions for the gateway and the sub-devices respectively, so that the server does not need to pay attention to the topological relationship between the gateway and the sub-devices, and the server can transmit data directly based on the session and the service platform. Different sub-devices can be accurately distinguished, and the structure is flexible and the expandability is strong.
In an alternative embodiment of the present application, the present application may be applied to a distributed communication system, where different servers may be implemented by the same or different servers, for example, one server is used to perform communication with a gateway, legal verification of a device, session allocation, and the like, and may also be implemented by multiple servers, for example, where the servers include: the system comprises an access server, an authentication server and a session server. The access server (access server) is a front-end server responsible for connection, and may use various protocols for communication, such as MQTT (Message Queuing Telemetry Transport) Protocol, CoAP (Constrained Application Protocol), HTTP (hypertext transfer Protocol), and the like. The authentication server is used for authenticating the gateway and the sub-equipment of the access system, and can also avoid the unauthorized of the message, such as the message of the fake sub-equipment forwarded by the gateway can be refused. The session server is used for taking charge of the routing relationship of the session in the communication system, and usually uses distributed storage, such as Hbase, etc., so that the access server mounted by the session server can be quickly found through one piece of device information (such as device ID), for example, the access server can be found by using the session during the downlink transmission of the message.
A distributed communication system architecture is shown in fig. 3. The communication information includes: the gateway g1, the gateway g2 and the gateway g1 are connected with the sub-device d1 and the sub-device d2, and the gateway g2 is connected with the sub-device d3, the sub-device d4 and the sub-device d 5. The gateway g1 and the gateway g2 are respectively connected with an access server AS of the service end, the access server AS is connected with an authentication server CS and a session server SS, and the access server AS is also connected with a service platform BP. The interaction between the devices in the communication system is shown in fig. 4 and 5.
Wherein the connection interaction process is shown in fig. 4.
Step 402, the gateway generates a connection request and sends the connection request to the access server. E.g., gateway g1, may access the communication system through the access server, gateway g1 may generate a corresponding connection request to send to the access server.
Step 404, the access server obtains the authentication information of the gateway from the connection request, and forwards the authentication information to the authentication server. The authentication information of the gateway may be used as the first authentication information.
Step 406, the authentication server authenticates the gateway based on the authentication information of the gateway, and feeds back an authentication result, including success or failure. If authentication fails, the access server may deny access to the gateway.
Step 408, for the feedback of successful authentication, the access server sends a session generation request to the session server.
Step 410, the session server generates a second session, establishes a mapping relationship between the second session and the gateway information of the gateway, and feeds back the mapping relationship. The session server assigns a second session s2 for the gateway g1 and then establishes the mapping g1-s 2.
Step 412, the access server allocates a physical channel to the gateway, and binds the gateway information of the gateway with the physical channel. I.e. the gateway g1 is assigned a physical channel c1, thus binding g1-c 1.
In step 414, the access server generates a connection response and feeds back the connection response. The connection response may be a response that the connection was successful.
At step 416, the kid device may request to log on to the gateway and may send a web request to the gateway. I.e., kid 1 sends a request to access network to gateway g 1.
Step 418, the gateway determines the authentication information of the sub-device based on the network access request, generates a binding request and sends the binding request to the access server through the physical channel.
Step 420, the access server obtains the authentication information of the sub-device from the binding request, and forwards the authentication information of the sub-device to the authentication server. The authentication information of the sub-device may be used as the second authentication information.
Step 422, the authentication server authenticates the sub-device based on the authentication information, and feeds back the authentication result, including success or failure. If the authentication fails, the access server can refuse the access and binding of the sub-equipment.
Step 424, for the feedback of successful authentication, the access server sends a session generation request to the session server.
And 426, the session server generates a first session for the sub-device, establishes a mapping relationship between the first session and the sub-device, and feeds back the mapping relationship. The session server assigns the child device d1 the first session s1 and then establishes the mapping d1-s 1.
In step 428, the access server binds the device information of the sub-device with the physical channel of the corresponding gateway. I.e., binding the physical channel c1, i.e., d1-c1, to the child device d 1.
Step 430, the access server generates a binding response and feeds back to the gateway through the physical channel. The binding response may be a response that the binding was successful.
And step 432, the gateway generates a network access response and feeds the network access response back to the child equipment, and the network access can be successfully realized through the child equipment.
Therefore, the login of the gateway and the equipment in the system can be realized through the steps, and then the communication message can be transmitted through uplink and downlink. For the communication message sent by the gateway through the physical channel, a resource party of the communication message can be determined according to the resource path, the resource party is the gateway, the second session is inquired, if the resource party is the sub-device, the first session is inquired, and then the communication message is forwarded to the service platform through the inquired session (the first session or the second session).
For the convenience of distinguishing, the communication packet sent by the sub-device to the service platform is referred to as an uplink communication packet, and the communication packet sent by the service platform to the sub-device is referred to as a downlink communication packet. The interaction process of the communication message is as shown in fig. 5.
Step 502, the sub-device sends an uplink communication message to the gateway. The communication between the sub-devices and the gateway can be realized based on various communication modes, such as Bluetooth and WIFI.
Step 504, the gateway encapsulates the uplink communication packet of the sub-device, and then forwards the uplink communication packet to the access server through the physical channel. The encapsulation mode can be set according to requirements, such as encapsulation and forwarding according to protocols such as MQTT, CoAP, HTTP and the like. In which, the device information may be carried in the resource path during the encapsulation process, thereby facilitating the access server to query the session, for example, the resource path is TOPIC, URI, or the like. In this example, after receiving the uplink communication packet through the physical channel c1 of the gateway g1, the access server determines that the resource side is the sub-device d1 according to the TOPIC, queries the mapping relationships d1-s1, and determines that the first session s1 needs to be invoked.
Step 506, the access server determines the sub-device to which the uplink communication packet belongs according to the resource path of the uplink communication packet, and queries the first session of the sub-device.
Step 508, the access server forwards the uplink communication packet to the service platform through the first session.
Step 510, the service platform determines a first session according to the sub-device to which the sent downlink communication message belongs, and sends the downlink communication message to the access server through the first session.
Step 512, the access server determines the sub-device to which the downlink communication packet belongs according to the first session, and determines a physical channel of a gateway bound by the sub-device. The access server queries the mapping relation d1-s1 to determine the sub-device d1 according to the first session s1, and then queries the physical channel c1 according to the binding relation d1-c 1.
Step 514, the access server forwards the downlink communication packet to the gateway through the physical channel. That is, the downlink communication message is sent to the gateway g1 through the physical channel c 1.
In step 516, the gateway determines the sub-device corresponding to the downlink communication packet and forwards the downlink communication packet to the sub-device.
The access server and the gateway may transmit a TCP (Transmission Control Protocol) message, where the message may include one or more Protocol-encapsulated communication messages, so that the TCP message may be split into communication messages, or a plurality of TCP messages may form a communication message, which is specifically determined according to the settings of the communication messages and the TCP messages.
In this application embodiment, communication message can be confirmed according to specific thing networking device, for example, to the fluorescent tube system, communication message can include light on, off information, the temperature information of bulb etc. to the security protection system, communication message can include the on, off information of lock etc..
In the embodiment of the application, the corresponding logical session is inquired by using the resource paths such as TOPIC of the communication message or URI of the HTTP, so that the forwarding can be realized without invading the service message. Compared with the existing gateway forwarding device message mode that fields need to be encapsulated and defined according to the negotiated data format, the embodiment of the application does not limit the data format, the gateway can directly transmit the communication message, only a legal resource path needs to be constructed, and the method is simple and convenient to operate and high in efficiency.
Referring to fig. 6, a flowchart illustrating steps of a gateway in an embodiment of an inter-device communication method in the present application is shown, which specifically includes the following steps:
step 602, a connection request is sent to a server.
The gateway may connect to the server for accessing the communication system, and therefore, the gateway may generate a corresponding connection request, which may include authentication information, such as a signature, and the like, and may also include device information, such as a device name, a device identification (Identity, ID), and the like, and then send the connection request to the server. For example, the communication gateway may assign information for authentication to a legitimate gateway and a legitimate sub-device, such as assigning a device name devicename and a device key devicecret to each device, and may calculate signature data based on the information for authentication, and add the signature data as authentication information to the connection request.
Step 604, receiving a connection response fed back by the server, and determining a physical channel according to the connection response. The physical channel is used for transmitting communication messages, and the communication messages comprise communication messages of a gateway and communication messages of the sub-equipment.
Step 606, receiving the network access request of the sub-device.
Step 608, generating a binding request according to the network access request, and sending the binding request to a server through the physical channel.
The kid device may request access to the network and may send a network request to the gateway. The gateway generates a binding request based on the network access request, the binding request carries authentication information of the sub-device, such as a signature, and the like, and also carries device information of the sub-device, such as a device name, a device ID, and the like, and then the binding request can be sent through the physical channel.
And step 610, receiving a binding response returned by the server through the physical channel.
For a gateway and its connected sub-devices, the server establishes a physical channel and a session for each device, so that the gateway and the server interact through the physical channel, and the server forwards the communication messages of different devices to the service platform by adopting different sessions. The topological relation of the gateway and the sub-devices thereof can be dynamically adjusted, for example, the sub-device d1 can be hung on the gateway g1, and can also be hung on the gateway g2 after the gateway g1 is offline, so that the flexibility and the expandability of the device side are improved.
Referring to fig. 7, a flowchart illustrating steps of a server in an embodiment of an inter-device communication method according to the present application is shown, which specifically includes the following steps:
step 702, receiving a connection request of a gateway, allocating a physical channel to the gateway according to the connection request, and binding a second session.
Step 704, generating a connection response and sending, so as to feed back the physical channel through the connection response.
The server can carry out validity verification such as authentication processing and the like on the gateway based on the connection request of the gateway, and can generate a second session and bind gateway information of the gateway with the second session after the gateway is confirmed to be legal, so that the server and the service platform can interact communication messages of the gateway through the second session; the gateway is also bound to a physical channel through which communications between the gateway and the server occur.
In an optional embodiment, the authentication information of the gateway may be obtained from the connection request, and the gateway is authenticated according to the authentication information of the gateway; after the authentication of the gateway is passed, generating a second session, and establishing a mapping relation between the gateway information of the gateway and the second session; and allocating a physical channel and binding the physical channel with the gateway information of the gateway. Receiving a connection request of a gateway, authenticating the gateway according to the connection request, namely, a server can carry out validity verification before connecting the gateway, can carry authentication information of the gateway in the connection request, such as signature data, and then authenticates the gateway based on the authentication information of the gateway. For example, the communication gateway may assign information for authentication to a legitimate gateway and a legitimate sub-device, such as assigning a device name devicename and a device key devicecret to each device, and may calculate signature data based on the information for authentication. The server then obtains the signature data from the authentication information of the connection request, calculates a signature data based on the device information of the gateway, compares the obtained signature data with the calculated signature data, and determines whether the two match. If the matching is successful, the authentication is successful, otherwise, the authentication is not successful. First channel information may be bound for the gateway after the authentication of the gateway passes. If the authentication is not passed, the process can be ended, and the connection of the gateway is rejected. The server may then generate a second session and establish a mapping between the gateway information of the gateway and said second session, such as a gateway name or gateway identification and a mapping for the second session. And then, distributing a physical channel for the gateway, and binding the gateway information with the physical channel. So that the subsequent gateway can interact data with the server through the physical channel.
Step 706, receiving a binding request through the physical channel, allocating a first session to the child device of the gateway according to the binding request, and binding the child device and the physical channel of the gateway.
The server can carry out validity verification such as authentication processing and the like on the sub-equipment based on the binding request, and can generate a first session and bind the equipment information of the sub-equipment with the first session after the sub-equipment is confirmed to be legal, so that the server and the service platform can interact the communication message of the sub-equipment through the first session; the sub-devices are also bound to the physical channel so that the gateway and its sub-devices share the same physical channel. The gateway confirms that the sub-device is successfully bound, and subsequently, the gateway can forward the communication message of the sub-device to the server, so that the communication message is forwarded to the service platform through the server.
If the authentication information is signature data, the server correspondingly calculates one signature data, and then compares the acquired signature data with the calculated signature data to determine whether the two are matched. If the matching is successful, the authentication is successful, otherwise, the authentication is not successful. After the authentication of the sub-device is passed, the server may generate a first session, and establish a mapping relationship between the device information of the sub-device and the first session, such as a device name or a device identifier, and a mapping relationship corresponding to the first session. And then establishing the binding relationship between the equipment information of the sub-equipment and the physical channel, so that the physical channel is adopted for forwarding between the communication message gateway of the sub-equipment and the server.
At step 708, a binding response is generated and fed back through the physical channel.
For a gateway and its connected sub-devices, the server establishes a physical channel and a session for each device, so that the gateway and the server interact through the physical channel, and the server forwards the communication messages of different devices to the service platform by adopting different sessions. In the embodiment of the application, the gateway can record information such as the device name and the device identifier of the device, and can also locally maintain the sub-device list of the access server.
To sum up, when the sub-devices need to be connected with the gateway, a binding request can be sent to the server through the physical channel of the gateway, the server can allocate a first session to the sub-devices of the gateway according to the binding request, so that the communication messages of the sub-devices forwarded by the gateway are transmitted through the first session, and the sub-devices are bound with the physical channel of the gateway, so that the data of the gateway and the sub-devices thereof can be transmitted through one physical channel, and the server forwards the communication messages of different sub-devices through different sessions, thereby being convenient for distinguishing different sub-devices.
For the service platform, the topological relation of the gateway and the sub-devices thereof does not need to be sensed, the corresponding session of the device can be directly determined, and correspondingly, the topological relation of the gateway and the sub-devices thereof can be dynamically adjusted, for example, the sub-device d1 can be hung on the gateway g1, and can be hung on the gateway g2 after the gateway g1 is off line, so that the flexibility and the expandability of the device side are improved.
Referring to fig. 8, a flowchart illustrating steps of uplink transmission in an embodiment of an inter-device communication method according to the present application is shown, which specifically includes the following steps:
step 802, receiving a communication packet through the physical channel.
In the uplink data transmission process, the gateway can package the communication message according to the protocol format and then send the communication message to the server through the physical communication. The communication message may be a communication message of a gateway or a communication message of a sub-device. When packaging, the information of the affiliated resource party can be added in the resource path, wherein the information of the affiliated resource party comprises: gateway information of the gateway and/or device information of the sub-device, for example, the gateway information is added to the communication packet of the gateway, and the sub-device information is added to the communication packet of the sub-device, including information such as device (gateway) name and identifier.
In one example, the child device may send a communication packet to the gateway, and the gateway encapsulates the communication packet according to a protocol and then forwards the encapsulated communication packet through the physical channel. In another example, the gateway encapsulates its own communication packet according to a protocol, and then forwards the encapsulated communication packet through the physical channel.
Then, a resource party of the communication packet may be determined according to the resource path, and the first session or the second session may be selected to forward the communication packet according to the resource party, including the following steps 804 and 810.
Step 804, acquiring a resource path corresponding to the communication message, and judging whether a resource party is a gateway according to the resource path.
The server acquires the resource path from the encapsulated communication message, and then determines the resource party according to the resource path, namely, whether the resource party is a gateway can be judged. If yes, go to step 806; if not, go to step 808.
Step 806, forwarding the communication packet through the second session.
And if the resource side is the gateway, the server forwards the service platform corresponding to the communication message through the second session.
And 808, judging whether the resource side is the sub-equipment bound with the gateway or not according to the resource path.
If the resource side is not the gateway, whether the resource side in the resource path is the resource device bound by the gateway can be further judged. If the sub-device is judged to have a binding relationship with the physical channel, whether the sub-device is located in the device list of the gateway, and the like. If yes, go to step 810, otherwise go to step 812.
Step 810, forwarding the communication packet through the first session corresponding to the sub-device.
And if the resource side is the sub-equipment bound with the gateway, acquiring a first session corresponding to the sub-equipment, and then forwarding the communication message to a service platform through the first session corresponding to the sub-equipment.
Step 812, discarding the communication packet.
If the resource side is not the sub-device bound with the gateway, the communication message is determined to be the communication message of the illegal device, and the communication message can be discarded.
For example, when the method is executed in MQTT manner, the resource path corresponding to the communication packet sent by the gateway itself is: and (3) mqtttopic/g 1/upload, the server can find the second session s2 according to the gateway g1, so that the communication message is forwarded to the service platform through the second session s 2. Correspondingly, the resource path corresponding to the communication message of the gateway sending sub-device is as follows: and mqtttopic ═ d1/upload, the server can find the first session s1 according to the sub-device d1, and then forward the communication message to the service platform through the first session s 1. Therefore, the communication messages of the gateway and the sub-equipment can be transmitted through the same physical channel and the server, the server can inquire corresponding logic sessions according to the resource paths corresponding to the communication messages to transmit the communication messages, data formats are not invaded in the transmission process of the communication messages, and users can transmit data packets with any format to the service platform.
Referring to fig. 9, a flowchart illustrating a step of downlink transmission in an embodiment of an inter-device communication method according to the present application is shown, which specifically includes the following steps:
step 902, receiving the communication message through a session.
The communication message corresponding to the service platform can be forwarded to the device side through the server, so that the service platform can interface to input target devices such as a gateway, a sub-device and the like when the service platform needs to execute the service, and then the communication message can be sent to the server by adopting the session corresponding to the target device. The session includes a first session and/or a second session. For example, the communication message of the gateway is sent to the server through the second session, and the communication message of the sub-device is sent to the server through the first session.
In one example, one sub-device mounted under the home internet of things gateway is a door lock, after the business system sends an unlocking instruction to the door lock, the business system queries a target lock based on information of the door lock, and then sends the unlocking instruction to the server by adopting a first session of the lock.
Step 904, according to the session query mapping relationship, determining the corresponding resource party.
The server determines a resource party corresponding to the communication message according to the mapping relation inquired by the session, wherein the resource party comprises: a gateway or a kid device. And if the mapping relation is queried based on the second session, determining the corresponding resource party to be the gateway, and if the mapping relation is queried based on the first session, determining the corresponding resource party to be the sub-device.
Step 906, determining the bound physical channel according to the resource side.
The gateway can inquire the physical channel correspondingly bound with the gateway, and the physical channel of the gateway correspondingly bound with the sub-device can also be inquired based on the sub-device.
For example, by sending the communication packet through s2, it may be determined that the communication packet belongs to gateway g1 in g1-s2, and then the physical channel c1 may be determined based on the binding relationship g1-c 1. If the communication packet is sent through s1, it may be determined that the communication packet belongs to the sub-device d1 through d1-s1, and then the physical channel c1 may be determined based on the binding relationship d1-c 1.
Step 908, forwarding the communication packet through the physical channel.
Communication messages may be forwarded to the gateway via the physical channel. After receiving the communication message, the gateway can determine the communication message belonging to the gateway or the sub-device based on the resource side information in the communication message, such as gateway information, device information, and the like, and forward the communication message belonging to the sub-device to the corresponding sub-device. The communication message belonging to the gateway can be processed by itself.
In the embodiment of the application, the corresponding logical session is inquired by using the resource paths such as TOPIC of the communication message or URI of the HTTP, so that the forwarding can be realized without invading the service message. Compared with the existing gateway forwarding device message mode that fields need to be encapsulated and defined according to the negotiated data format, the embodiment of the application does not limit the data format, the gateway can directly transmit the communication message, only a legal resource path needs to be constructed, and the method is simple and convenient to operate and high in efficiency.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
On the basis of the above embodiments, the present embodiment further provides an inter-device communication apparatus, which is applied to a server. The server may include an access server, an authentication server, a session server, and the like.
Referring to fig. 10, a block diagram of an embodiment of an inter-signal communication apparatus applied to a server according to the present application is shown, which may specifically include the following modules:
a connection module 1002, configured to receive a binding request through a physical channel of a gateway.
A binding module 1004, configured to allocate a first session to the child device of the gateway according to the binding request, and bind the child device and the physical channel of the gateway, where the first session is used to transmit the communication packet of the child device forwarded by the gateway.
A feedback module 1006, configured to generate a binding response and feed back through the physical channel.
Referring to fig. 11, a block diagram of another embodiment of an inter-signal communication apparatus applied to a server according to the present application is shown, and specifically, the apparatus may include the following modules:
a connection module 1002, configured to receive a connection request of a gateway; and receiving the binding request through a physical channel of the gateway.
A binding module 1004, configured to allocate a physical channel to the gateway according to the connection request; and allocating a first session for the sub-equipment of the gateway according to the binding request, and binding the sub-equipment and the physical channel of the gateway, wherein the first session is used for transmitting the communication message of the sub-equipment forwarded by the gateway.
A feedback module 1006, configured to generate a connection response and send the connection response, so as to feed back the physical channel through the connection response; and generating a binding response and feeding back through the physical channel.
A service communication module 1008, configured to receive a communication packet through the physical channel; and forwarding the communication message through the physical channel.
A service forwarding module 1010, configured to determine a resource party of the communication packet according to a resource path, and select a first session or a second session to forward the communication packet according to the resource party; and receiving the communication message through a session, and determining a physical channel of a corresponding resource party according to the session, wherein the session comprises a first session and/or a second session.
Wherein the binding module 1004 includes: authentication sub-module 10042, session generation sub-module 10044, and channel binding sub-module 10046.
In an optional embodiment, the authentication sub-module 10042 is configured to obtain authentication information of the sub-device of the gateway from the connection request, and authenticate the sub-device according to the authentication information.
The session generating sub-module 10044 is configured to generate a first session after the authentication of the sub-device is passed, and establish a mapping relationship between the device information of the sub-device and the first session.
The channel binding sub-module 10046 is configured to obtain the device information of the sub-device, and bind the device information and the physical channel.
In another optional embodiment, the authentication sub-module 10042 is configured to obtain authentication information of the gateway from the connection request, and authenticate the gateway according to the authentication information of the gateway.
The channel binding sub-module 10046 is configured to allocate a physical channel and bind the physical channel with the gateway information of the gateway after the authentication of the gateway passes.
The session generating sub-module 10044 is configured to generate a second session, and establish a mapping relationship between the gateway information of the gateway and the second session.
The service communication module 1008 is configured to receive the communication packet of the child device through the physical channel of the gateway. A service forwarding module 1010, configured to forward the communication packet through the first session.
A service forwarding module 1010, configured to receive a communication packet through a first session, and determine a physical channel bound to a sub-device corresponding to the first session; and a service communication module 1008, configured to forward the communication packet using the physical channel.
The service forwarding module 1010 is configured to obtain a resource path corresponding to the communication packet, and determine whether a resource party is a gateway according to the resource path; if the resource side is the gateway, the communication message is forwarded through the second session; if the resource side is not the gateway, judging whether the resource side is the sub-equipment bound with the gateway or not according to the resource path; and if the resource side is the sub-equipment bound with the gateway, forwarding the communication message through the first session corresponding to the sub-equipment.
The service forwarding module 1010 is configured to determine a corresponding resource party according to the session query mapping relationship, where the resource party includes: a gateway or a sub-device; and determining the bound physical channel according to the resource side.
On the basis of the above embodiments, the present embodiment further provides an inter-device communication apparatus, which is applied to a gateway.
Referring to fig. 12, a block diagram of an embodiment of an inter-signal communication apparatus applied to a gateway according to the present application is shown, which may specifically include the following modules:
a device communication module 1202, configured to receive a network entry request of a child device.
A request module 1204, configured to generate a binding request according to the network access request, and send the binding request to a server through a physical channel, so that the server binds the physical channels of the sub-devices and the gateway.
A response receiving module 1206, configured to receive, through the physical channel, the binding response returned by the server.
A service transmission module 1208, configured to encapsulate the communication packet according to a protocol format, and forward the encapsulated communication packet through the physical channel, where the communication packet includes: communication messages of the gateway and/or communication messages of the sub-devices.
The request module 1204 is configured to send a connection request to a server.
The response receiving module 1206 is configured to receive a connection response fed back by the server, and determine a physical channel according to the connection response, where the physical channel is bound by the server according to the connection request.
The request module 1204 is configured to obtain authentication information of the sub-device according to the network access request, and generate a binding request according to the authentication information of the sub-device.
The information of the resource party is stored in the resource path corresponding to the encapsulated communication message, wherein the information of the resource party includes: gateway information of the gateway and/or device information of the kid device.
To sum up, when the sub-devices need to be connected with the gateway, a binding request can be sent to the server through the physical channel of the gateway, the server can allocate a first session to the sub-devices of the gateway according to the binding request, so that the communication messages of the sub-devices forwarded by the gateway are transmitted through the first session, and the sub-devices are bound with the physical channel of the gateway, so that the data of the gateway and the sub-devices thereof can be transmitted through one physical channel, and the server forwards the communication messages of different sub-devices through different sessions, thereby being convenient for distinguishing different sub-devices.
For the service platform, the topological relation of the gateway and the sub-devices thereof does not need to be sensed, the corresponding session of the device can be directly determined, and correspondingly, the topological relation of the gateway and the sub-devices thereof can be dynamically adjusted, for example, the sub-device d1 can be hung on the gateway g1, and can be hung on the gateway g2 after the gateway g1 is off line, so that the flexibility and the expandability of the device side are improved.
In the embodiment of the application, the corresponding logical session is inquired by using the resource paths such as TOPIC of the communication message or URI of the HTTP, so that the forwarding can be realized without invading the service message. Compared with the existing gateway forwarding device message mode that fields need to be encapsulated and defined according to the negotiated data format, the embodiment of the application does not limit the data format, the gateway can directly transmit the communication message, only a legal resource path needs to be constructed, and the method is simple and convenient to operate and high in efficiency.
The present application further provides a non-transitory, readable storage medium, where one or more modules (programs) are stored, and when the one or more modules are applied to a device, the device may execute instructions (instructions) of method steps in this application.
Embodiments of the present application provide one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause an electronic device to perform the methods as described in one or more of the above embodiments. In the embodiment of the application, the electronic device comprises a server, a gateway, a sub-device and the like, wherein the sub-device is a device such as an internet of things device.
Embodiments of the present disclosure may be implemented as an apparatus, which may include electronic devices such as servers (clusters), terminal devices, identifiers, IoT devices, etc., using any suitable hardware, firmware, software, or any combination thereof, for a desired configuration. Fig. 13 schematically illustrates an example apparatus 1300 that can be used to implement various embodiments described herein.
For one embodiment, fig. 13 illustrates an example apparatus 1300 having one or more processors 1302, a control module (chipset) 1304 coupled to at least one of the processor(s) 1302, memory 1306 coupled to the control module 1304, non-volatile memory (NVM)/storage 1308 coupled to the control module 1304, one or more input/output devices 1310 coupled to the control module 1304, and a network interface 1312 coupled to the control module 1306.
Processor 1302 may include one or more single-core or multi-core processors, and processor 1302 may include any combination of general-purpose or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, the apparatus 1300 can be a server or the like of the transcoding end described in the embodiments of the present application.
In some embodiments, apparatus 1300 may include one or more computer-readable media (e.g., memory 1306 or NVM/storage 1308) having instructions 1314 and one or more processors 1302, which in combination with the one or more computer-readable media, are configured to execute instructions 1314 to implement modules to perform actions described in this disclosure.
For one embodiment, control module 1304 may include any suitable interface controllers to provide any suitable interface to at least one of the processor(s) 1302 and/or any suitable device or component in communication with control module 1304.
The control module 1304 may include a memory controller module to provide an interface to the memory 1306. The memory controller module may be a hardware module, a software module, and/or a firmware module.
Memory 1306 may be used, for example, to load and store data and/or instructions 1314 for device 1300. For one embodiment, memory 1306 may comprise any suitable volatile memory, such as suitable DRAM. In some embodiments, the memory 1306 may comprise a double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
For one embodiment, control module 1304 may include one or more input/output controllers to provide an interface to NVM/storage 1308 and input/output device(s) 1310.
For example, NVM/storage 1308 may be used to store data and/or instructions 1314. NVM/storage 1308 may include any suitable non-volatile memory (e.g., flash memory) and/or may include any suitable non-volatile storage device(s) (e.g., one or more Hard Disk Drives (HDDs), one or more Compact Disc (CD) drives, and/or one or more Digital Versatile Disc (DVD) drives).
NVM/storage 1308 may include storage resources that are physically part of the device on which apparatus 1300 is installed, or it may be accessible by the device and need not be part of the device. For example, NVM/storage 1308 may be accessible over a network via input/output device(s) 1310.
Input/output device(s) 1310 may provide an interface for apparatus 1300 to communicate with any other suitable device, input/output device(s) 1310 may include communication components, audio components, sensor components, and so forth. The network interface 1312 may provide an interface for the device 1300 to communicate over one or more networks, and the device 1300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and/or protocols, such as access to a wireless network based on a communication standard, e.g., WiFi, 2G, 3G, 4G, etc., or a combination thereof.
For one embodiment, at least one of the processor(s) 1302 may be packaged together with logic for one or more controllers (e.g., memory controller modules) of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be packaged together with logic for one or more controllers of the control module 1304 to form a System In Package (SiP). For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with logic for one or more controller(s) of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with logic of one or more controllers of the control module 1304 to form a system on chip (SoC).
In various embodiments, apparatus 1300 may be, but is not limited to being: a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.), among other terminal devices. In various embodiments, apparatus 1300 may have more or fewer components and/or different architectures. For example, in some embodiments, device 1300 includes one or more cameras, a keyboard, a Liquid Crystal Display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an Application Specific Integrated Circuit (ASIC), and speakers.
An embodiment of the present application provides a control device, including: one or more processors; and one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the control device to perform a device remote commissioning method as described in one or more of the embodiments of the present application.
An embodiment of the present application provides a debugging device, including: one or more processors; and one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the commissioning device to perform the device remote commissioning method as described in one or more of the embodiments of the present application.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method for communication between devices, the apparatus for communication between devices, the server, the gateway and the storage medium provided by the present application are described in detail above, and specific examples are applied herein to illustrate the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (32)

1. An inter-device communication method, comprising:
generating a second session, and establishing a mapping relationship between gateway information of a gateway and the second session, wherein the second session is used for transmitting a communication message of the gateway;
receiving a binding request through a physical channel of a gateway;
allocating a first session for the sub-equipment of the gateway according to the binding request, and binding the sub-equipment and the physical channel of the gateway, wherein the first session is used for transmitting the communication message of the sub-equipment forwarded by the gateway; the gateway and the sub-equipment thereof transmit data through the same physical channel with the server;
generating a binding response and feeding back through the physical channel.
2. The method of claim 1, wherein allocating a first session for a child device of the gateway in accordance with the binding request comprises:
acquiring authentication information of the sub-equipment of the gateway from the connection request, and authenticating the sub-equipment according to the authentication information;
and after the authentication of the sub-equipment is passed, generating a first session, and establishing a mapping relation between the equipment information of the sub-equipment and the first session.
3. The method of claim 1, wherein the binding the physical channels of the sub-device and the gateway comprises:
and acquiring the equipment information of the sub-equipment, and binding the equipment information with the physical channel.
4. The method of claim 1, further comprising:
receiving a connection request of a gateway, and distributing a physical channel for the gateway according to the connection request;
and generating a connection response and sending the connection response so as to feed back the physical channel through the connection response.
5. The method of claim 4, wherein said allocating a physical channel to the gateway according to the connection request comprises:
acquiring authentication information of the gateway from the connection request, and authenticating the gateway according to the authentication information of the gateway;
and after the authentication of the gateway is passed, distributing a physical channel and binding the physical channel with the gateway information of the gateway.
6. The method of claim 1, further comprising:
and receiving the communication message of the sub-equipment through a physical channel of the gateway, and forwarding the communication message through the first session.
7. The method of claim 1, further comprising:
receiving a communication message through a first session, and determining a physical channel bound by a sub-device corresponding to the first session;
and forwarding the communication message by adopting the physical channel.
8. The method of claim 1, further comprising:
receiving a communication message through a physical channel of the gateway;
and determining a resource party of the communication message according to the resource path, and selecting a first session or a second session to forward the communication message according to the resource party.
9. The method of claim 8, wherein determining a resource side of the communication packet according to the resource path and selecting the first session or the second session to forward the communication packet according to the resource comprises:
acquiring a resource path corresponding to the communication message, and judging whether a resource party is a gateway or not according to the resource path;
if the resource side is the gateway, the communication message is forwarded through the second session;
if the resource side is not the gateway, judging whether the resource side is the sub-equipment bound with the gateway or not according to the resource path;
and if the resource side is the sub-equipment bound with the gateway, forwarding the communication message through the first session corresponding to the sub-equipment.
10. An inter-device communication method, comprising:
determining a second session, wherein the second session has a mapping relation with gateway information of a gateway, and the second session is used for transmitting a communication message of the gateway;
receiving a network access request of the sub-equipment;
generating a binding request according to the network access request, and sending the binding request to a server through a physical channel so that the server allocates a first session for the sub-equipment of the gateway and binds the sub-equipment with the physical channel of the gateway; the first session is used for transmitting the communication message of the sub-equipment forwarded by the gateway; the gateway and the sub-equipment thereof transmit data through the same physical channel with the server;
and receiving a binding response returned by the server through the physical channel.
11. The method of claim 10, wherein generating a binding request according to the network entry request comprises:
and acquiring the authentication information of the sub-equipment according to the network access request, and generating a binding request according to the authentication information of the sub-equipment.
12. The method of claim 10, further comprising:
sending a connection request to a server;
and receiving a connection response fed back by the server, and determining a physical channel according to the connection response, wherein the physical channel is bound by the server for the gateway according to the connection request.
13. The method of claim 10, further comprising:
encapsulating the communication message according to a protocol format, and forwarding the encapsulated communication message through the physical channel, wherein the communication message comprises: communication messages of the gateway and/or communication messages of the sub-devices.
14. The method according to claim 13, wherein the encapsulated communication packet has stored therein information of a resource party in a resource path corresponding to the encapsulated communication packet, wherein the information of the resource party includes: gateway information of the gateway and/or device information of the kid device.
15. An inter-device communication apparatus, comprising:
the session generation submodule is used for generating a second session and establishing a mapping relation between gateway information of a gateway and the second session, wherein the second session is used for transmitting a communication message of the gateway;
the connection module is used for receiving the binding request through a physical channel of the gateway;
a binding module, configured to allocate a first session to a child device of the gateway according to the binding request, and bind the child device and a physical channel of the gateway, where the first session is used to transmit a communication packet of the child device forwarded by the gateway; the gateway and the sub-equipment thereof transmit data through the same physical channel with the server;
and the feedback module is used for generating a binding response and feeding back the binding response through the physical channel.
16. The apparatus of claim 15, wherein the binding module comprises:
the authentication submodule is used for acquiring authentication information of the sub-equipment of the gateway from the connection request and authenticating the sub-equipment according to the authentication information;
and the session generation submodule is used for generating a first session after the authentication of the sub-equipment is passed, and establishing a mapping relation between the equipment information of the sub-equipment and the first session.
17. The apparatus of claim 15, wherein the binding module comprises:
and the channel binding submodule is used for acquiring the equipment information of the sub-equipment and binding the equipment information with the physical channel.
18. The apparatus of claim 15,
the connection module is also used for receiving a connection request of the gateway;
the binding module is further configured to allocate a physical channel to the gateway according to the connection request;
the feedback module is further configured to generate a connection response and send the connection response, so as to feed back the physical channel through the connection response.
19. The apparatus of claim 18, wherein the binding module comprises:
the authentication submodule is used for acquiring the authentication information of the gateway from the connection request and authenticating the gateway according to the authentication information of the gateway;
and the channel binding submodule is used for distributing a physical channel and binding the physical channel with the gateway information of the gateway after the gateway passes the authentication.
20. The apparatus of claim 15, further comprising:
the service communication module is used for receiving the communication message of the sub-equipment through a physical channel of the gateway;
and the service forwarding module is used for forwarding the communication message through the first session.
21. The apparatus of claim 15, further comprising:
the service forwarding module is used for receiving the communication message through a first session and determining a physical channel bound by the sub-equipment corresponding to the first session;
and the service communication module is used for adopting the physical channel to forward the communication message.
22. The apparatus of claim 18, further comprising:
the service communication module is used for receiving a communication message through a physical channel of the gateway;
and the service forwarding module is used for determining a resource party of the communication message according to the resource path and selecting a first session or a second session to forward the communication message according to the resource party.
23. The apparatus of claim 22,
the service forwarding module is used for acquiring a resource path corresponding to the communication message and judging whether a resource party is a gateway or not according to the resource path; if the resource side is the gateway, the communication message is forwarded through the second session; if the resource side is not the gateway, judging whether the resource side is the sub-equipment bound with the gateway or not according to the resource path; and if the resource side is the sub-equipment bound with the gateway, forwarding the communication message through the first session corresponding to the sub-equipment.
24. An inter-device communication apparatus, comprising:
the device communication module is used for determining a second session, the second session has a mapping relation with gateway information of a gateway, and the second session is used for transmitting a communication message of the gateway; receiving a network access request of the sub-equipment;
the request module is used for generating a binding request according to the network access request, sending the binding request to a server through a physical channel so that the server distributes a first session for the sub-equipment of the gateway, and binding the sub-equipment and the physical channel of the gateway; the first session is used for transmitting the communication message of the sub-equipment forwarded by the gateway; the gateway and the sub-equipment thereof transmit data through the same physical channel with the server;
and the response receiving module is used for receiving the binding response returned by the server through the physical channel.
25. The apparatus of claim 24,
the request module is used for acquiring the authentication information of the sub-equipment according to the network access request and generating a binding request according to the authentication information of the sub-equipment.
26. The apparatus of claim 24,
the request module is used for sending a connection request to the server;
the response receiving module is configured to receive a connection response fed back by the server, and determine a physical channel according to the connection response, where the physical channel is bound by the server according to the connection request.
27. The apparatus of claim 24, further comprising:
a service transmission module, configured to encapsulate the communication packet according to a protocol format, and forward the encapsulated communication packet through the physical channel, where the communication packet includes: communication messages of the gateway and/or communication messages of the sub-devices.
28. The apparatus of claim 27, wherein the encapsulated communication packet has information about a resource side stored in a corresponding resource path, wherein the information about the resource side comprises: gateway information of the gateway and/or device information of the kid device.
29. A server, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the server to perform the inter-device communication method of one or more of claims 1-9.
30. One or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause a server to perform the inter-device communication method of one or more of claims 1-9.
31. A gateway, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the gateway to perform the inter-device communication method of one or more of claims 10-14.
32. One or more machine readable media having instructions stored thereon that, when executed by one or more processors, cause a gateway to perform the inter-device communication method of one or more of claims 10-14.
CN201711310259.6A 2017-12-11 2017-12-11 Inter-device communication method, device and storage medium Active CN109905450B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711310259.6A CN109905450B (en) 2017-12-11 2017-12-11 Inter-device communication method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711310259.6A CN109905450B (en) 2017-12-11 2017-12-11 Inter-device communication method, device and storage medium

Publications (2)

Publication Number Publication Date
CN109905450A CN109905450A (en) 2019-06-18
CN109905450B true CN109905450B (en) 2021-11-16

Family

ID=66942495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711310259.6A Active CN109905450B (en) 2017-12-11 2017-12-11 Inter-device communication method, device and storage medium

Country Status (1)

Country Link
CN (1) CN109905450B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112910675A (en) * 2019-12-04 2021-06-04 云丁网络技术(北京)有限公司 Equipment management method, device and system
CN113691978B (en) * 2020-05-18 2023-07-25 云米互联科技(广东)有限公司 Multi-equipment token processing method and system
CN112350925A (en) * 2020-11-06 2021-02-09 北京小米移动软件有限公司 Gateway control method, device, system, electronic equipment and storage medium
CN116266845B (en) * 2022-11-29 2024-02-13 浙江绍兴苏泊尔生活电器有限公司 Data transmission method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104144526A (en) * 2013-05-07 2014-11-12 北京得实达康系统集成有限公司 Data transmission method and system based on ANT gateway
CN204652411U (en) * 2015-04-28 2015-09-16 上海福睿电子科技有限公司 A kind of coupling networking based on smart machine
CN105629752A (en) * 2015-12-30 2016-06-01 深圳众乐智府科技有限公司 Intelligent household equipment access method and intelligent household system
CN106100949A (en) * 2016-08-11 2016-11-09 安徽健搏信息科技有限公司 A kind of control system for intelligent home device
CN106302590A (en) * 2015-05-28 2017-01-04 上海汽车集团股份有限公司 Cloud platform

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103826321B (en) * 2012-11-19 2017-11-03 联想(北京)有限公司 The method and apparatus of a kind of electronic equipment connection
US10212233B2 (en) * 2014-08-07 2019-02-19 Telefonaktiebolaget L M Ericsson (Publ) Data transfer in a system of connected things
CN105223827A (en) * 2015-10-13 2016-01-06 重庆慧居智能电子有限公司 A kind of wireless intelligent house control system
CN105357224B (en) * 2015-12-08 2019-08-02 深圳众乐智府科技有限公司 A kind of registration of intelligent domestic gateway, removing method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104144526A (en) * 2013-05-07 2014-11-12 北京得实达康系统集成有限公司 Data transmission method and system based on ANT gateway
CN204652411U (en) * 2015-04-28 2015-09-16 上海福睿电子科技有限公司 A kind of coupling networking based on smart machine
CN106302590A (en) * 2015-05-28 2017-01-04 上海汽车集团股份有限公司 Cloud platform
CN105629752A (en) * 2015-12-30 2016-06-01 深圳众乐智府科技有限公司 Intelligent household equipment access method and intelligent household system
CN106100949A (en) * 2016-08-11 2016-11-09 安徽健搏信息科技有限公司 A kind of control system for intelligent home device

Also Published As

Publication number Publication date
CN109905450A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
CN109905450B (en) Inter-device communication method, device and storage medium
KR101877188B1 (en) Service layer interworking using mqtt protocol
CN107426339B (en) Access method, device and system of data connection channel
US20190222426A1 (en) Smart Object Identification In The Digital Home
US8955084B2 (en) Timestamp-based token revocation
US9967738B2 (en) Methods and arrangements for enabling data transmission between a mobile device and a static destination address
WO2017024791A1 (en) Authorization processing method and device
US9648052B2 (en) Real-time communications gateway
EP3114821B1 (en) Method and devices for establishing a connection between a seeker device and a target device
EP4184821A1 (en) Ims data channel-based communication method and device
EP3942832B1 (en) Network based media processing security
CN114553592B (en) Method, equipment and storage medium for equipment identity verification
EP2666256B1 (en) Method and apparatus for phone communication using home network
WO2016054888A1 (en) Method and device for creating subscription resource
EP2693691B1 (en) Method and apparatus for initializing gateway in device management system
JP7246379B2 (en) Service layer message templates in communication networks
US20120300776A1 (en) Method for creating virtual link, communication network element, and ethernet network system
CN105681225A (en) Network resource acquisition method and device
EP2849470B1 (en) Function sharing in wireless access hotspot device
CA2794818C (en) Timestamp-based token revocation
CN110913351A (en) Multicast control method, device, network equipment and storage medium
JP6050513B2 (en) Protection of payloads transmitted over a communications network
CN114125025B (en) Data transmission method and device under multi-target network
WO2022094936A1 (en) Access method, device, and cloud platform device
CN111490997B (en) Task processing method, proxy system, service system and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant