WO2021237536A1 - 基于物联网的通信方法、装置及设备 - Google Patents

基于物联网的通信方法、装置及设备 Download PDF

Info

Publication number
WO2021237536A1
WO2021237536A1 PCT/CN2020/092721 CN2020092721W WO2021237536A1 WO 2021237536 A1 WO2021237536 A1 WO 2021237536A1 CN 2020092721 W CN2020092721 W CN 2020092721W WO 2021237536 A1 WO2021237536 A1 WO 2021237536A1
Authority
WO
WIPO (PCT)
Prior art keywords
connection
server
credential
request message
connection credential
Prior art date
Application number
PCT/CN2020/092721
Other languages
English (en)
French (fr)
Inventor
张军
茹昭
罗朝明
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN202410366489.8A priority Critical patent/CN118118255A/zh
Priority to CN202080099164.8A priority patent/CN115362664B/zh
Priority to PCT/CN2020/092721 priority patent/WO2021237536A1/zh
Publication of WO2021237536A1 publication Critical patent/WO2021237536A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • This application relates to the technical field of the Internet of Things, and in particular to a communication method, device and equipment based on the Internet of Things.
  • IoT devices of different manufacturers can communicate with each other.
  • IoT devices of different manufacturers are connected to different IoT cloud platforms, and the interconnection and intercommunication between the IoT devices is realized through the cloud interface (the communication interface between the source IoT cloud platform and the destination IoT cloud platform).
  • the cloud interface the communication interface between the source IoT cloud platform and the destination IoT cloud platform.
  • IoT device A communicates with IoT device B
  • IoT device A first sends the communication data to cloud platform A
  • cloud platform A forwards the communication data to cloud platform B through the cloud interface
  • cloud platform B then forwards the communication data To the Internet of Things device B, so as to realize the communication between the Internet of Things device A and the Internet of Things device B.
  • the embodiments of the present application provide a communication method, device, and equipment based on the Internet of Things, which are used to shorten the communication link and reduce the interaction delay.
  • an embodiment of the present application provides a communication method based on the Internet of Things, including:
  • the first device sends a connection request message to the second device, where the connection request message is used to instruct the first device to request to establish a connection with the second device, the first device is connected to the first server, and the first device is connected to the first server.
  • the second device is connected to the second server;
  • connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication method based on the Internet of Things, including:
  • the second device receives a connection request message sent by the first device, where the connection request message is used to instruct the first device to request to establish a connection with the second device, the first device is connected to the first server, and the The second device is connected to the second server;
  • connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication method based on the Internet of Things, including:
  • the first server receives a first binding request message sent by the first device, where the first binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device, and the first device is connected to the In the first server, the second device is connected to the second server;
  • the first server sends a second binding request message to the second server according to the first binding request message, where the second binding request message is used to enable the second server to generate a connection credential, so
  • the connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication method based on the Internet of Things, including:
  • the second server receives a second binding request message sent by the first server, where the second binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device; wherein the first device accesses In the first server, the second device is connected to the second server;
  • the second server generates a connection credential according to the second binding request message, where the connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication device based on the Internet of Things, which is applied to a first device, and includes:
  • the sending module is configured to send a connection request message to the second device, where the connection request message is used to instruct the first device to request to establish a connection with the second device, and the first device is connected to the first server, so The second device is connected to the second server;
  • the processing module is configured to establish a connection between the first device and the second device when a connection credential exists, and the connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication device based on the Internet of Things, which is applied to a second device, and includes:
  • the receiving module is configured to receive a connection request message sent by a first device, where the connection request message is used to instruct the first device to request to establish a connection with the second device, and the first device is connected to the first server, The second device is connected to a second server;
  • the processing module is configured to establish a connection between the second device and the first device when a connection credential exists, and the connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication device based on the Internet of Things, which is applied to a first server, and includes:
  • the receiving module is configured to receive a first binding request message sent by the first device, where the first binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device, and the first device is connected to In the first server, the second device is connected to the second server;
  • the sending module is configured to send a second binding request message to the second server according to the first binding request message, where the second binding request message is used to enable the second server to generate a connection credential, so
  • the connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication device based on the Internet of Things, which is applied to a second server, and includes:
  • the receiving module is configured to receive a second binding request message sent by the first server, where the second binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device; wherein the first device is connected Is connected to the first server, and the second device is connected to the second server;
  • the processing module is configured to generate a connection credential according to the second binding request message, where the connection credential is a credential used to establish a connection between the first device and the second device.
  • an embodiment of the present application provides a communication device, including: a processor and a memory;
  • the memory is used to store computer-executable instructions; the processor executes the computer-executable instructions, so that the communication device executes the method according to any one of the first aspect, or executes the method according to any one of the second aspect
  • an embodiment of the present application provides a computer-readable storage medium that stores a computer-executable instruction, and when the computer-executable instruction is executed by a processor, it implements any item as in the first aspect
  • the first device is connected to the first server, the second device is connected to the second server, and the first device sends a connection request message to the second device ,
  • the first device establishes a connection with the second device.
  • the first device and the second device can establish a local connection based on the connection credentials, so that the interaction process between the first device and the second device does not need to be forwarded through the cloud interface, thereby shortening the communication link and reducing the interaction delay.
  • FIG. 1 is a schematic diagram of a network system to which an embodiment of this application is applicable;
  • FIG. 2 is a schematic diagram of a process of communicating between IoT devices through a cloud interface in an embodiment of this application;
  • FIG. 3 is a schematic flowchart of a communication method based on the Internet of Things provided by an embodiment of this application;
  • FIG. 4 is a schematic flowchart of a communication method based on the Internet of Things provided by another embodiment of this application.
  • FIG. 5 is a schematic flowchart of a communication method based on the Internet of Things provided by another embodiment of this application.
  • FIG. 6 is a schematic flowchart of a communication method based on the Internet of Things provided by another embodiment of this application.
  • FIG. 7 is a schematic structural diagram of a communication device provided by an embodiment of this application.
  • FIG. 8 is a schematic structural diagram of a communication device provided by an embodiment of this application.
  • FIG. 1 is a schematic diagram of a network system to which an embodiment of this application is applicable.
  • device A and device B are terminal devices that access different IoT platforms. Among them, device A is connected to server A, and device B is connected to server B. It is understandable that in practical applications, there may be one or more IoT devices connected to each server, and FIG. 1 only uses one as an example.
  • the Internet of Things device access server may use multiple network technologies, which are not limited in the embodiment of the present application.
  • IoT devices can access the server through the 3GPP network.
  • the Internet of Things device can be an entity that provides resources. It can be a data collection device such as a sensor or a data acquisition card. It can also be an electrical component device such as a switch, a socket or a lamp. It can also be an air conditioner, a washing machine, a refrigerator, a speaker or a TV, etc. Electronic equipment.
  • the Internet of Things device can also be a terminal device installed with control software for the Internet of Things device, including but not limited to: user terminal devices such as smart phones, smart watches, and smart speakers.
  • user terminal devices such as smart phones, smart watches, and smart speakers.
  • the Internet of Things devices may also be other smart hardware devices that can provide resources and implement corresponding functional services, which are not repeated in the embodiments of the present application.
  • Server A and Server B in Figure 1 are used as IoT cloud servers.
  • the server is used to provide various services to IoT devices.
  • the server can be connected to business applications for users to access.
  • the server can be a cloud platform, cloud server, network-side server, gateway and other devices.
  • FIG. 1 there is a communication interface between server A and server B.
  • the communication interface between different servers is referred to as a cloud interface.
  • the cloud interface Through the cloud interface, the interconnection and intercommunication between IoT devices connected to different servers can be realized.
  • IoT devices of different manufacturers are connected to different servers. IoT devices of different vendors need to be interconnected through cloud interfaces. Exemplarily, as shown in FIG. 1, device A accesses server A, and device B accesses server B. When device A and device B communicate, they need to communicate remotely through the cloud interface between server A and server B.
  • Fig. 2 is a schematic diagram of a process of communicating between IoT devices through a cloud interface in an embodiment of the application. As shown in Figure 2, taking the scenario where device A requests to communicate with device B as an example, the communication process includes the following steps:
  • Oauth an authorization authentication (Open Authorization, Oauth) process to server A.
  • Oauth provides a safe, open and simple standard for user resource authorization.
  • Oauth authorization does not allow a third party to touch the user's account information (such as user name, password), that is, the third party can apply for the authorization of the user's resource without using the user's account information.
  • Server A obtains an access token for cross-platform operation from server B.
  • Server A finds device B managed by server B through the cloud interface.
  • device A When device A communicates with device B, device A sends communication data to server A.
  • Server A forwards the communication data to server B through the cloud interface.
  • Server B forwards the communication data to device B.
  • the IoT devices connected to different servers must communicate with each other through the cloud interface, which makes the communication link longer and the interaction delay increases.
  • the embodiments of the present application provide a communication method based on the Internet of Things.
  • Internet of Things devices that access different servers can use connection credentials to establish local connections, so that local communication between the Internet of Things devices can be carried out. There is no need to communicate through the cloud interface, thereby shortening the communication link, reducing the interaction delay, and improving the user experience.
  • FIG. 3 is a schematic flowchart of a communication method based on the Internet of Things provided by an embodiment of the application. As shown in Figure 3, the method of this embodiment includes:
  • the first device sends a connection request message to the second device, where the connection request message is used to instruct the first device to request to establish a connection with the second device.
  • the first device and the second device are Internet of Things devices, where the first device is connected to the first server, and the second device is connected to the second server.
  • the first device When the first device needs to interact with the second device, the first device sends a connection request message to the second device to request to establish a connection with the second device.
  • the connection between the first device and the second device established in this embodiment is a local connection, or is called a point-to-point connection, that is, a connection used for direct communication between the first device and the second device without going through Cloud interface between servers.
  • the first device and the second device may be located in the same local area network, and the first device and the second device establish a connection based on the local area network.
  • the local connection between the first device and the second device in this embodiment is a transport layer security (TLS) or a datagram transport layer security (DTLS) connection.
  • TLS transport layer security
  • DTLS datagram transport layer security
  • the first device is a device installed with IoT device control software.
  • the first device may be a smart phone, a tablet computer, or the like.
  • the second device is an Internet of Things device.
  • the second device may be a lamp, a switch, a TV, a refrigerator, a smart speaker, and so on.
  • the first device can be used to control the second device.
  • the first device may also be called a control device, and the second device may also be called a controlled device.
  • both the first device and the second device may be IoT devices.
  • the first device may be a switch, and the second device may be a lamp.
  • the first device may be a speaker, and the second device may be a television.
  • connection request may be initiated by the first device, and the connection request may also be initiated by the second device.
  • connection request initiated by the first device is taken as an example for description.
  • connection request initiated by the second device the implementation process is similar.
  • connection credential is a credential used to establish a connection between the first device and the second device.
  • the connection credential can also be referred to as a security credential.
  • a local connection can be established between two devices with connection credentials.
  • the first device and the second device may establish a binding relationship.
  • a connection credential can be generated. In this way, the first device and the second device can use the connection credential to establish a local connection.
  • connection credential does not limit the generation process of the connection credential and the specific content in the connection credential.
  • connection credential does not limit the generation process of the connection credential and the specific content in the connection credential.
  • the process of establishing a connection between the first device and the second device may include one or more message exchanges between the first device and the second device, which is not limited in this embodiment.
  • connection credentials may be stored by the second device.
  • the second device uses the connection credential to verify the first device. That is, when the second device determines that there is a connection credential, the first device and the second device establish a connection.
  • connection credential may be stored by the first device.
  • the first device uses the connection credential to verify the second device. That is, when the first device determines that there is a connection credential, the first device and the second device establish a connection.
  • both the first device and the second device may store the connection credentials.
  • the first device uses the connection credential to verify the second device
  • the second device uses the connection credential to verify the first device. That is, when the first device and the second device both determine that there is a connection credential, the first device and the second device establish a connection.
  • other devices other than the first device and the second device may also store the connection credentials.
  • the first device and/or the second device can be verified by using the connection credential through the other device, that is, when the other device determines that the connection credential exists, the first device and the second device establish a connection.
  • the connection request message includes the identity of the first device; correspondingly, the second device determines whether the first connection credential exists, and the first connection credential is associated with the identity of the first device.
  • the second device determines that the first connection credential exists, the first device establishes a connection with the second device.
  • the first device carries the identity of the first device in the connection request message, and the second device verifies whether there is a connection credential associated with the identity of the first device. If it exists, the first device and the second device establish a connection successfully. , Otherwise, the connection between the first device and the second device fails.
  • the first connection credential may also be associated with both the identity of the first device and the identity of the second device.
  • the second device when the first device initiates a connection request, the second device needs to use the connection credential to verify the first device. That is, when the second device determines that there is a connection credential associated with the identity of the first device, the two can establish a successful connection. The second device uses the connection credential to verify the first device, ensuring the security of the connection between the first device and the second device.
  • the connection request message includes the identification of the first device.
  • the second device determines whether the first connection credential exists, and the first connection credential is associated with the identity of the first device; when the second device determines that the first connection credential exists, the second device sends the second device’s information to the first device.
  • Identification the first device determines whether there is a second connection credential, and the second connection credential is associated with the identity of the second device; when the first device determines that there is a second connection credential, the first device establishes a connection with the second device.
  • the first device carries the identity of the first device in the connection request message, and the second device verifies whether there is a connection credential associated with the identity of the first device; and the second device provides its own identity to the first device, The first device verifies whether there is a connection credential associated with the identity of the second device. If both the first device and the second device pass the verification, the first device and the second device have successfully established a connection; otherwise, the first device and the second device have failed to establish a connection.
  • the first connection credential may also be associated with both the identity of the first device and the identity of the second device.
  • the second connection credential may also be associated with both the identification of the first device and the identification of the second device.
  • first connection credential and the second connection credential may be the same connection credential.
  • the second device when the first device initiates a connection request, the second device needs to use the connection credential to verify the first device, and the first device also needs to use the connection credential to verify the second device. That is, when the second device determines that there is a connection credential associated with the identity of the first device, and the first device determines that there is a connection credential associated with the identity of the second device, the two can establish a successful connection.
  • the second device uses the connection credential to verify the first device, and the first device uses the connection credential to verify the second device, which further ensures the security of the connection between the first device and the second device.
  • association between the first connection credential and the identity of the first device may mean that the first connection credential explicitly or implicitly includes the identity of the first device.
  • the association of the second connection credential with the identity of the second device may mean that the second connection credential explicitly or implicitly includes the identity of the second device.
  • the identification of the first device may be one or more of the following: the device identification of the first device, and the user identification of the first device.
  • the device identification includes but is not limited to the device name, device ID, device serial number, etc.
  • the user identification includes but is not limited to the user account, user nickname, user ID, etc.
  • the second device may not store the connection credentials, but the second server stores the connection credentials.
  • determining whether the first connection credential exists by the second device may include: the second device determining whether the first connection credential exists on the second server. In this way, when the second device determines that the first connection credential exists in the second server, the first device establishes a connection with the second device. In other words, the second server may use the connection credential to verify the first device.
  • the second device may determine whether the first connection credential exists in the second server in the following feasible manner: the second device sends a verification request message to the second server, and the verification request message includes the identification of the first device .
  • the second server determines whether the first connection credential exists, and sends a verification result message to the second device, where the verification result message is used to indicate whether the second server has the first connection credential.
  • the second device receives the verification result message sent by the second server, and determines whether the second server has the first connection credential according to the verification result message.
  • the second server may send the first connection credential to the second device.
  • the second device can directly use the first connection credential to verify the first device subsequently, which improves the efficiency of connection establishment.
  • connection credentials can also be time-sensitive.
  • the connection credential may include information for indicating the valid time period of the connection credential. In this way, in S302, when it is determined that there is a connection credential and the timeliness of the connection credential is determined to be valid, the first device establishes a connection with the second device.
  • the first device is connected to the first server, the second device is connected to the second server, the first device sends a connection request message to the second device, and when it is determined that there is a connection
  • the first device establishes a connection with the second device.
  • the first device and the second device may also conduct a secure session based on the connection credential.
  • the description is given below in conjunction with FIG. 4.
  • FIG. 4 is a schematic flowchart of a communication method based on the Internet of Things provided by another embodiment of the application.
  • the first device has a second connection credential associated with the identity of the second device
  • the second device has a first connection credential associated with the identity of the first device.
  • the first device may further include:
  • the first device uses the first key to encrypt the first data to obtain the first ciphertext.
  • the first device sends the first ciphertext to the second device.
  • the second device receives the first ciphertext sent by the first device.
  • S403 The second device uses the second key to decrypt the first ciphertext to obtain the first data.
  • S404 The second device uses the second key to encrypt the second data to obtain the second ciphertext.
  • S405 The second device sends the second ciphertext to the first device.
  • the first device receives the second ciphertext sent by the second device.
  • the first device uses the first key to decrypt the second ciphertext to obtain the second data.
  • the first device uses the first key to perform encryption and decryption, where the first key can be the second connection credential, or the first key can also be a session key generated according to the second connection credential.
  • the second device uses a second key for encryption and decryption, where the second key can be the first connection credential, or the second key can also be a session key generated according to the first connection credential.
  • the first device and the second device encrypt the session process based on the connection credential to ensure the security of the session.
  • connection credentials is described below in conjunction with FIG. 5.
  • FIG. 5 is a schematic flowchart of a communication method based on the Internet of Things provided by another embodiment of this application. As shown in Figure 5, the method of this embodiment includes:
  • S501 The first device sends a first binding request message to the first server.
  • the first server receives the first binding request message sent by the first device.
  • the first binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device.
  • the first binding request message includes at least one of the following: the identification of the first device, the identification of the second device, and the identification of the second server.
  • the first device may further include: the first device obtains an identifier of the second device, where the identifier of the second device includes the identifier of the second server. Or, the first device obtains the identifier of the second device and the identifier of the second server.
  • S502 The first server sends a second binding request message to the second server according to the first binding request message.
  • the second server receives the second binding request message sent by the first server.
  • the second binding request message is used to enable the second server to generate a connection credential.
  • the first server and the second server establish an interconnection relationship.
  • Each server stores a preset correspondence relationship, and the preset correspondence relationship is used to indicate the correspondence relationship between the identifiers of different servers and the access information.
  • the first device may carry the identifier of the second server in the first binding request message, so that the first server may query the preset correspondence relationship according to the identifier of the second server to determine the access information of the second server ; Further, the first server may send a second binding request message to the second server according to the access information of the second server.
  • the access information refers to any information that can identify the network location of the server.
  • the access information may be a uniform resource identifier (URI) of the server.
  • URI uniform resource identifier
  • the preset correspondences stored in each server may be as shown in the following table.
  • the first server queries the foregoing preset correspondence relationship according to the identifier, and can determine that the access information of the second server is https://PlatformB_AccessURI. Therefore, the first server can send a second binding request message to the URI.
  • the second binding request message may include: the identification of the first device and/or the identification of the second device.
  • the second server can generate a connection credential according to the identity of the first device and/or the identity of the second device. For details, refer to the detailed description of S503.
  • S503 The second server generates a connection credential according to the second binding request message.
  • connection credential after the second server generates the connection credential, the corresponding relationship between the connection credential and the identity of the first device can be maintained; and the corresponding relationship between the connection credential and the identity of the second device can also be maintained.
  • the second server may further include:
  • S504 The second server sends the connection credential to the second device.
  • S505 The second server sends the connection credential to the first server.
  • S506 The first server sends the connection credential to the first device.
  • the first server may also send the connection credential to the first device.
  • the connection credential generated by the second server may include: the first connection credential and/or the second connection credential.
  • the first connection credential is used for the second device to verify the first device
  • the second connection credential is used for the first device to verify the second device.
  • the second server can send the first connection credential to the second device, so that the second device can use the first connection credential to verify the first device.
  • the second server may send the second connection credential to the first server, and then the first server forwards the second connection credential to the first device, so that the first device can use the second connection credential to verify the second device.
  • first connection credential and second connection credential may be the same or different.
  • the following describes how the second server generates and sends connection credentials in combination with several feasible methods.
  • the second binding request message includes the identification of the first device.
  • the second server generates the first connection credential according to the identification of the first device. That is, the first connection credential is associated with the identity of the first device.
  • the second server can send the first connection credential to the second device, so that the second device can use the first connection credential to verify the first device when receiving the connection request message from the first device.
  • this method can be used in the following application scenarios: when the first device initiates a connection request to the second device, the second device needs to verify the first device, but the first device does not need to verify the second device.
  • the second server may also use the first connection credential as the second connection credential, and send the second connection credential to the first server, and then the first server sends the second connection credential to the first device.
  • the first device and the second device both store the same connection credential.
  • the connection credential can be used to encrypt and decrypt the session to ensure the security of the session.
  • the second binding request message includes the identity of the first device and the identity of the second device.
  • the second server generates the first connection credential according to the identification of the first device, and generates the second connection credential according to the identification of the second device. That is, the first connection credential is associated with the identity of the first device, and the second connection credential is associated with the identity of the second device.
  • the second server can send the first connection credential to the second device, so that the second device can use the first connection credential to verify the first device when receiving the connection request message from the first device.
  • the second server may also send the second connection credential to the first server, and then the first server sends the second connection credential to the first device, so that the first device can use the second connection credential to verify the second device.
  • this method can be used in the following application scenarios: when the first device initiates a connection request to the second device, the second device needs to verify the first device, and the first device also needs to verify the second device.
  • the first device stores the second connection credential
  • the second device stores the first connection credential.
  • the connection credential stored in the first device can also be used to encrypt and decrypt the session to ensure Security of the session.
  • the second binding request message includes the identity of the first device and the identity of the second device.
  • the second server generates the first connection credential according to the identity of the first device and the identity of the second device, and generates the second connection credential according to the identity of the first device and the identity of the second device.
  • the first connection credential is associated with the identification of the first device and the identification of the second device
  • the second connection credential is associated with the identification of the first device and the identification of the second device.
  • first connection credential and the second connection credential in this manner may be the same or different.
  • the second server can send the first connection credential to the second device, so that the second device can use the first connection credential to verify the first device when receiving the connection request message from the first device.
  • the second server may also send the second connection credential to the first server, and then the first server sends the second connection credential to the first device, so that the first device can use the second connection credential to verify the second device.
  • this method can be used in the following application scenarios: when the first device initiates a connection request to the second device, the second device needs to verify the first device, and the first device also needs to verify the second device.
  • the first device stores the second connection credential
  • the second device stores the first connection credential.
  • the connection credential stored in the first device can also be used to encrypt and decrypt the session to ensure Security of the session.
  • the first device and the second device can be established based on the connection credential Local connection, so that the interaction process between the first device and the second device does not need to be forwarded through the cloud interface, shortening the communication link, reducing the interaction delay, and improving the user experience.
  • FIG. 6 is a schematic flowchart of a communication method based on the Internet of Things provided by another embodiment of this application. As shown in Figure 6, the method of this embodiment includes:
  • the first device discovers the second device, and obtains the identifier of the second device and the identifier of the second server.
  • the first device and the second device are located in the same local area network, and the first device discovers the second device in the local network through the device discovery mechanism.
  • the device discovery mechanism may be a mechanism based on an existing discovery protocol, which is not limited in this embodiment.
  • the identifier of the second device and the identifier of the second server are preset in the second device.
  • the first device obtains the identity of the second device and the identity of the second server through the device discovery process.
  • the identifier of the second server is the identifier of the server associated with the second device.
  • the identifier of the second device and the identifier of the second server may be generated after S602.
  • the first device may configure the network for the second device so that the second device is connected to the second server.
  • the second device obtains the identity of the second device and the identity of the second server.
  • the first device obtains the identification of the second device and the identification of the second server.
  • the identifier of the second device and the identifier of the second server may be two independent identifiers.
  • the identifier of the second device includes the identifier of the second server.
  • the identifier of the second server may be one or more of the following: the manufacturer identifier corresponding to the second device, the URI of the second server, the platform identifier of the second server, and so on.
  • S602 The first device performs network configuration on the second device, and the second device accesses the second server.
  • the identification of the second device and the identification of the second server are acquired.
  • the first device sends a first binding request message to the first server, where the first binding request message includes the identity of the second device and the identity of the second server.
  • the first server can determine which device the first device needs to establish a binding relationship with according to the identifier of the second device.
  • the first server can determine whether this binding is a cross-platform binding according to the identifier of the second server.
  • the first device may also provide the identification of the first device in the first binding request message, and the identification of the first device may be used in S608 to generate the connection credential according to the identification of the first device by the second server.
  • the first server determines that cross-platform binding is required according to the identifier of the second server.
  • the first server determines that the second device is not a device managed by the cloud platform. Therefore, it determines that cross-platform binding is required and continues to perform the subsequent steps of this embodiment.
  • the first server obtains the access token corresponding to the second server.
  • the first server obtains an access token (AccessToken) corresponding to the second server through a login authorization process (for example, an Oauth authorization process).
  • the access token authorizes the first device to access the resources of the second server through the first server.
  • the access token can also limit the scope of authority and timeliness of the first device to access the resource.
  • the access token is an access token allocated by the authorization server of the second server.
  • the authorization server of the second server and the second server may be the same entity or different entities.
  • the second server can directly allocate the access token.
  • the first server sends a second binding request message to the second server, where the second binding request message includes the identifier of the second device and the access token.
  • the first server may determine the access information of the second server by querying the preset correspondence relationship according to the identifier of the second server in the first binding request message. Furthermore, the first server sends a second binding request message to the second server according to the access information of the second server.
  • the second binding request message sent by the first server to the second server may also provide the identification of the first device.
  • the identification of the first device can be used to generate a connection credential according to the identification of the first device by the second server in S608.
  • the second server verifies the access token carried in the second binding message through interaction with the authorization server.
  • S609 The second server sends the connection credential to the second device.
  • S610 The second server sends a connection credential to the first server.
  • the first server sends a connection credential to the first device.
  • the binding relationship between the first device and the second device is established. Furthermore, the second server generates a connection credential for use when the first device and the second device establish a local connection.
  • connection credential There are multiple ways for the second server to generate the connection credential and send the connection credential. For details, refer to the detailed description of the embodiment shown in FIG. 5, which will not be repeated here.
  • the second server may maintain the corresponding relationship between the connection credential and the identity of the first device.
  • the second server may also maintain the correspondence between the connection credential and the identification of the second device.
  • S612 The first device and the second device use the connection credential to establish a secure connection.
  • the process in which the first device and the second device use the connection credential to establish a secure connection is similar to the embodiment shown in FIG. 3, and will not be repeated here.
  • S613 The first device and the second device use the connection credential to conduct a secure session.
  • the process in which the first device and the second device use the connection credential to conduct a secure session is similar to the embodiment shown in FIG. 4, and will not be repeated here.
  • the first device may be a control device (for example, a terminal device installed with IoT device control software), and the second device may be an IoT device (for example, lamps, televisions, air conditioners, etc.).
  • the first device discovers the second device
  • S601 to S613 of this embodiment can be executed, so as to realize the local communication between the first device and the second device.
  • both the first device and the second device may be IoT devices (for example, the first device is a switch, and the second device is a lamp).
  • the first device can interact with the control device and inquire whether the control device allows the first device to bind the second device.
  • S602 to S613 in this embodiment are executed, so as to realize the local communication between the first device and the second device.
  • the first device and the second device can be established based on the connection credential Local connection, so that the interaction process between the first device and the second device does not need to be forwarded through the cloud interface, shortening the communication link, reducing the interaction delay, and improving the user experience.
  • FIG. 7 is a schematic structural diagram of a communication device provided by an embodiment of the application.
  • the communication device 10 provided in this embodiment includes: a sending module 11, a processing module 12 and a receiving module 13.
  • the communication apparatus of this embodiment may be applied to a first device, and the first device may be an Internet of Things device.
  • the aforementioned modules can be used to implement the following functions:
  • the sending module 11 is configured to send a connection request message to a second device, where the connection request message is used to instruct the first device to request to establish a connection with the second device, and the first device is connected to a first server, The second device is connected to a second server;
  • the processing module 12 is configured to establish a connection between the first device and the second device when a connection credential exists, and the connection credential is a credential used to establish a connection between the first device and the second device.
  • connection request message includes the identifier of the first device
  • processing module is specifically configured to:
  • the first device When a first connection credential exists in the second device, the first device establishes a connection with the second device, and the first connection credential is associated with the identity of the first device.
  • the receiving module 13 is configured to receive the identifier of the second device sent by the second device when the first connection credential exists in the second device;
  • the processing module 12 is specifically configured to establish a connection between the first device and the second device when the second connection credential exists in the first device.
  • the first connection credential is associated with the identification of the first device and the identification of the second device;
  • the second connection credential is associated with the identification of the first device and the identification of the second device.
  • the receiving module 13 is further configured to:
  • the sending module 11 is further configured to:
  • a first binding request message is sent to the first server, where the first binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device, and the first binding request message It includes at least one of the following: the identifier of the first device, the identifier of the second device, and the identifier of the second server.
  • processing module 12 is further configured to:
  • the processing module 12 is further configured to: use a first key to encrypt the first data to obtain a first ciphertext, where the first key is the second connection credential, or, The first key is generated according to the second connection credential;
  • the sending module 11 is further configured to send the first ciphertext to the second device.
  • the receiving module 13 is further configured to: receive a second ciphertext sent by the second device;
  • the processing module 12 is further configured to: use a first key to decrypt the second ciphertext to obtain second data, where the first key is the second connection credential, or the first key Is generated based on the second connection credential.
  • the communication device of this embodiment can be used to execute the technical solution on the first device side in any of the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • the communication device of this embodiment may be applied to a second device, and the second device may be an Internet of Things device.
  • the aforementioned modules can be used to implement the following functions:
  • the receiving module 13 is configured to receive a connection request message sent by a first device, where the connection request message is used to instruct the first device to request to establish a connection with the second device, and the first device is connected to the first server , The second device is connected to the second server;
  • the processing module 12 is configured to establish a connection between the second device and the first device when a connection credential exists, and the connection credential is a credential used to establish a connection between the first device and the second device.
  • the connection request message includes the identifier of the first device
  • the processing module 12 is specifically configured to: determine whether there is a first connection credential, and the first connection credential and the first connection credential exist. The identification of the device is associated; and when the second device determines that the first connection credential exists, the second device establishes a connection with the first device.
  • the sending module 11 is configured to send the identification of the second device to the first device when the second device determines that the first connection credential exists;
  • the processing module 12 is specifically configured to: when a second connection credential exists in the first device, the second device establishes a connection with the first device, and the second connection credential is associated with the identification of the second device Associated.
  • the first connection credential is associated with the identification of the first device and the identification of the second device;
  • the second connection credential is associated with the identification of the first device and the identification of the second device.
  • processing module 12 is specifically configured to:
  • the second device It is determined whether the first connection credential exists in the second server, and when it is determined that the first connection credential exists in the second server, the second device establishes a connection with the first device.
  • the sending module 11 is further configured to send a verification request message to the second server, where the verification request message includes the identity of the first device;
  • the receiving module 13 is further configured to: receive a verification result message sent by the second server, where the verification result message is used to indicate whether the second server has the first connection credential;
  • the processing module 12 is specifically configured to determine whether the first connection credential exists in the second server according to the verification result message.
  • the receiving module 13 is further configured to: receive the first connection credential sent by the second server, where the first connection credential is generated by the second server.
  • the receiving module 13 is further configured to: receive the first ciphertext sent by the first device;
  • the processing module 12 is further configured to: use a second key to decrypt the first ciphertext to obtain first data, where the second key is the first connection credential, or the second key Is generated based on the first connection credential.
  • the processing module 12 is further configured to: use a second key to encrypt second data to obtain a second ciphertext, where the second key is the first connection credential, or, The second key is generated according to the first connection credential;
  • the sending module 11 is further configured to send the second ciphertext to the first device.
  • the communication device of this embodiment can be used to implement the technical solution on the second device side in any of the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • the communication device of this embodiment can also be applied to the first server.
  • the aforementioned modules can be used to implement the following functions:
  • the receiving module 13 is configured to receive a first binding request message sent by a first device, where the first binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device, and the first device accesses In the first server, the second device is connected to the second server;
  • the sending module 11 is configured to send a second binding request message to the second server according to the first binding request message, where the second binding request message is used to enable the second server to generate a connection credential,
  • the connection credential is a credential used to establish a connection between the first device and the second device.
  • connection credential includes a second connection credential
  • the receiving module 13 is further configured to: receive the second connection credential sent by the second server;
  • the sending module 11 is further configured to send the second connection credential to the first device.
  • the first binding request message includes the identification of the second device; correspondingly, the second binding request message includes the identification of the second device, and the second connection
  • the credential is associated with the identity of the second device.
  • the first binding request message includes the identity of the first device and the identity of the second device; correspondingly, the second binding request message includes the first device The identity of and the identity of the second device, and the second connection credential is associated with the identity of the first device and is associated with the identity of the second device.
  • the first binding request message includes the identifier of the second server
  • the processing module 12 is configured to query a preset correspondence relationship according to the identifier of the second server, and determine the The access information of the second server, where the preset correspondence is used to indicate the correspondence between the identities of different servers and the access information;
  • the sending module 11 is specifically configured to send the second binding request message to the second server according to the access information of the second server.
  • the sending module 11 is further configured to: obtain an access token corresponding to the second server; correspondingly, the second binding request message includes an access command corresponding to the second server Card.
  • the communication device of this embodiment can be used to execute the technical solution on the first server side in any of the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • the communication device of this embodiment can also be applied to a second server.
  • the aforementioned modules can be used to implement the following functions:
  • the receiving module 13 is configured to receive a second binding request message sent by the first server, where the second binding request message is used to instruct the first device to request the establishment of a binding relationship with the second device; wherein, the first device Is connected to the first server, and the second device is connected to the second server;
  • the processing module 12 is configured to generate a connection credential according to the second binding request message, where the connection credential is a credential used to establish a connection between the first device and the second device.
  • connection credential includes a first connection credential and/or a second connection credential
  • sending module 11 is configured to: send the first connection credential to the second device, and/or , Sending the second connection credential to the first server.
  • the second binding request message includes the identifier of the first device, and the processing module 12 is specifically configured to:
  • the first connection credential is generated.
  • the second binding request message includes the identifier of the first device and the identifier of the second device, and the processing module 12 is specifically configured to:
  • the second connection credential is generated.
  • the second binding request message includes the identifier of the first device and the identifier of the second device, and the processing module 12 is specifically configured to:
  • the second connection credential is generated according to the identification of the first device and the identification of the second device.
  • the second binding request message includes an access token
  • the processing module 12 is further configured to verify the access token, and determine that the verification result is passed.
  • the receiving module 13 is further configured to: receive a verification request message sent by the second device, where the verification request message includes the identity of the first device;
  • the sending module 11 is further configured to send a verification result message to the second device, where the verification result message is used to indicate whether a first connection credential exists in the second server, and the first connection credential is connected to the first connection credential.
  • the identification of a device is associated.
  • the communication device of this embodiment can be used to execute the technical solution on the second server side in any of the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 8 is a schematic structural diagram of a communication device provided by an embodiment of this application.
  • the communication device 20 may include: a transceiver 21, a memory 22, and a processor 23.
  • the transceiver 21 may include a transmitter and a receiver.
  • the transmitter can also be referred to as a transmitter, a transmitter, a transmitting port, or a transmitting interface
  • the receiver can also be referred to as a receiver, a receiver, a receiving port, or a receiving interface, and other similar descriptions.
  • the transceiver 21, the memory 22, and the processor 23 are connected to each other through a bus 24.
  • the memory 22 is used to store program instructions
  • the processor 23 is configured to execute the program instructions stored in the memory to enable the communication device 20 to execute the communication method on the first device side in any of the foregoing method embodiments, or execute the second device side in any of the foregoing method embodiments. Or, execute the communication method on the first server side in any of the foregoing method embodiments, or execute the communication method on the second server side in any of the foregoing method embodiments.
  • the transmitter in the transceiver 21 can be used to perform the sending function of each communication device in the foregoing method embodiment.
  • the receiver of the transceiver 21 may be used to perform the receiving function of each communication device in the foregoing method embodiment.
  • the embodiments of the present application may also provide a computer-readable storage medium on which a computer program is stored.
  • the computer program When the computer program is executed by a processor, it implements the communication method on the first device side in any of the foregoing method embodiments, or executes the foregoing The communication method on the second device side in any method embodiment, or executes the communication method on the first server side in any of the foregoing method embodiments, or executes the communication method on the second server side in any of the foregoing method embodiments.
  • the embodiments of the present application may also provide a computer program product, which can be executed by processing, for example, can be executed by the processor 23 of the communication device 20.
  • the computer program product When the computer program product is executed, it can implement any of the foregoing method embodiments.
  • the communication method on the first device side or executes the communication method on the second device side in any of the foregoing method embodiments, or executes the communication method on the first server side in any of the foregoing method embodiments, or executes any of the foregoing The communication method on the second server side in the method embodiment.
  • the communication device, computer-readable storage medium, and computer program product of the embodiments of the present application can execute the communication method in any of the above-mentioned method embodiments.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the aforementioned computer program can be stored in a computer readable storage medium.
  • the computer program When the computer program is executed by the processor, it realizes the steps including the foregoing method embodiments; and the foregoing storage medium includes: ROM, RAM, magnetic disk, or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本申请实施例提供一种基于物联网的通信方法、装置及设备,第一设备接入在第一服务器中,第二设备接入在第二服务器中,第一设备向第二设备发送连接请求消息,在存在连接凭证时,第一设备与第二设备建立连接。通过上述过程,第一设备与第二设备可以基于连接凭证建立本地连接,使得第一设备与第二设备之间的交互过程无需经过云云接口的转发,从而缩短通信链路,降低交互时延,提升用户体验。

Description

基于物联网的通信方法、装置及设备 技术领域
本申请涉及物联网技术领域,尤其涉及一种基于物联网的通信方法、装置及设备。
背景技术
随着物联网技术的发展,不同厂商的物联网设备之间可以进行通信。
目前,不同厂商的物联网设备接入不同的物联网云平台,并通过云云接口(源物联网云平台和目的物联网云平台之间的通信接口)实现物联网设备之间的互联互通。示例性的,假设物联网设备A接入云平台A,物联网设备B接入云平台B。物联网设备A与物联网设备B进行通信时,物联网设备A先将通信数据发送给云平台A,云平台A通过云云接口将通信数据转发给云平台B,云平台B再将通信数据转发给物联网设备B,从而实现物联网设备A与物联网设备B之间的通信。
然而,在上述通信过程中,接入不同云平台的物联网设备之间必须通过云云接口才能进行通信,使得通信链路较长,交互时延增加。
发明内容
本申请实施例提供一种基于物联网的通信方法、装置及设备,用以缩短通信链路,降低交互时延。
第一方面,本申请实施例提供一种基于物联网的通信方法,包括:
第一设备向第二设备发送连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
在存在连接凭证时,所述第一设备与所述第二设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第二方面,本申请实施例提供一种基于物联网的通信方法,包括:
第二设备接收第一设备发送的连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
在存在连接凭证时,所述第二设备与所述第一设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第三方面,本申请实施例提供一种基于物联网的通信方法,包括:
第一服务器接收第一设备发送的第一绑定请求消息,所述第一绑定请求消息用于指示第一设备请求与第二设备建立绑定关系,所述第一设备接入在所述第一服务器中,所述第二设备接入在第二服务器中;
所述第一服务器根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息,所述第二绑定请求消息用于使所述第二服务器生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第四方面,本申请实施例提供一种基于物联网的通信方法,包括:
第二服务器接收第一服务器发送的第二绑定请求消息,所述第二绑定请求消息用于指示第一设备请求与第二设备建立绑定关系;其中,所述第一设备接入在所述第一服务器中,所述第二设备接入在所述第二服务器中;
所述第二服务器根据所述第二绑定请求消息,生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第五方面,本申请实施例提供一种基于物联网的通信装置,应用于第一设备,包括:
发送模块,用于向第二设备发送连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
处理模块,用于在存在连接凭证时,所述第一设备与所述第二设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第六方面,本申请实施例提供一种基于物联网的通信装置,应用于第二设备,包括:
接收模块,用于接收第一设备发送的连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
处理模块,用于在存在连接凭证时,所述第二设备与所述第一设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第七方面,本申请实施例提供一种基于物联网的通信装置,应用于第一服务器,包括:
接收模块,用于接收第一设备发送的第一绑定请求消息,所述第一绑定请求消息用于指示第一设备请求与第二设备建立绑定关系,所述第一设备接入在所述第一服务器中,所述第二设备接入在第二服务器中;
发送模块,用于根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息,所述第二绑定请求消息用于使所述第二服务器生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第八方面,本申请实施例提供一种基于物联网的通信装置,应用于第二服务器,包括:
接收模块,用于接收第一服务器发送的第二绑定请求消息,所述第二绑定请求消息用于指示第一设备请求与第二设备建立绑定关系;其中,所述第一设备接入在所述第一服务器中,所述第二设备接入在所述第二服务器中;
处理模块,用于根据所述第二绑定请求消息,生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
第九方面,本申请实施例提供一种通信设备,包括:处理器和存储器;
所述存储器用于存储计算机执行指令;所述处理器执行所述计算机执行指令,使得所述通信设备执行如第一方面任一项所述的方法,或者,执行如第二方面任一项所述的方法,或者,执行如第三方面任一项所述的方法,或者,执行如第四方面任一项所述的方法。
第十方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当所述计算机执行指令被处理器执行时实现如第一方面任一项所述的方法,或者,实现如第二方面任一项所述的方法,或者,实现第三方面任一项所述的方法,或者,实现如第四方面任一项所述的方法。
本申请实施例提供的基于物联网的通信方法、装置及设备,第一设备接入在第一服务器中,第二设备接入在第二服务器中,第一设备向第二设备发送连接请求消息,在存在连接凭证时,第一设备与第二设备建立连接。通过上述过程,第一设备与第二设备可以基于连接凭证建立本地连接,使得第一设备与第二设备之间的交互过程无需经过云云接口的转发,从而缩短通信链路,降低交互时延,提升用户体验。
附图说明
图1为本申请实施例适用的网络系统的一种示意图;
图2为本申请实施例中物联网设备之间通过云云接口进行通信的过程示意图;
图3为本申请一个实施例提供的基于物联网的通信方法的流程示意图;
图4为本申请另一个实施例提供的基于物联网的通信方法的流程示意图;
图5为本申请又一个实施例提供的基于物联网的通信方法的流程示意图;
图6为本申请又一个实施例提供的基于物联网的通信方法的流程示意图;
图7为本申请实施例提供的通信装置的结构示意图;
图8为本申请实施例提供的通信设备的结构示意图。
具体实施方式
在介绍本申请实施例提供的方案之前,首先对本申请实施例所适用的网络系统进行说明。
本申请实施例适用于物联网领域中跨平台的网络系统。图1为本申请实施例适用的网络系统的一种示意图。如图1所示,设备A和设备B为接入不同物联网平台的终端设备。其中,设备A接入服务器A,设备B接入服务器B。可以理解的是,在实际应用中,每个服务器中接入的物联网设备可以为一个或多个,该图1仅以一个作为示例。
应理解,物联网设备接入服务器可以采用多种网络技术,本申请实施例对此不作限定。例如,物联网设备可以通过3GPP网络接入服务器。
图1中的设备A和设备B作为物联网设备。物联网设备可以为提供资源的实体,其可以为传感器或数据采集卡等数据采集设备,还可以为开关、插座或灯具等电器元件设备,也可以为空调、洗衣机、冰箱、音箱或电视机等电子设备。物联网设备还可以是安装了物联网设备控制软件的终端设备,包括但不限于:智能手机、智能手表、智能音箱等用户终端设备。当然,上述仅为物联网设备的一些可能的示例,物联网设备还可以为其它可提供资源,实现对应的功能服务的智能硬 件设备,本申请实施例在此不再赘述。
图1中的服务器A和服务器B作为物联网云端服务器。服务器用于向物联网设备提供各种服务。服务器可以连接业务应用,供用户访问。有些场景中,服务器可以为云平台、云服务器、网络侧服务器、网关等设备。
参见图1,服务器A和服务器B之间存在通信接口,本实施例中将不同服务器之间的通信接口称为云云接口。通过云云接口可以实现接入不同服务器的物联网设备之间的互联互通。
目前实际应用中,不同厂商的物联网设备接入不同的服务器。不同厂商的物联网设备之间需要通过云云接口进行互联互通。示例性的,如图1所示,设备A接入服务器A,设备B接入服务器B。当设备A和设备B进行通信时,需要通过服务器A和服务器B之间的云云接口进行远程通信。
图2为本申请实施例中物联网设备之间通过云云接口进行通信的过程示意图。如图2所示,以设备A请求与设备B进行通信的场景为例,通信过程包括如下步骤:
(1)设备A向服务器A发起授权认证(Open Authorization,Oauth)流程。其中,Oauth为用户资源的授权提供了一个安全的、开放而又简易的标准。Oauth的授权不会使第三方触及到用户的帐号信息(如用户名、密码),即第三方无需使用用户的账号信息就可以申请获得该用户资源的授权。
(2)服务器A从服务器B获取用于跨平台操作的访问令牌。
(3)服务器A通过云云接口找到服务器B管理的设备B。
(4)设备A与设备B通信时,设备A向服务器A发送通信数据。
(5)服务器A通过云云接口将通信数据转发给服务器B。
(6)服务器B向设备B转发该通信数据。
通过上述过程,实现设备A和设备B之间的通信。后续设备A和设备B之间的通信过程均需要通过云云接口进行数据转发。
在上述通信过程中,接入不同服务器的物联网设备之间必须通过云云接口才能进行通信,使得通信链路较长,交互时延增加。
为了解决上述技术问题,本申请实施例提供一种基于物联网的通信方法,接入不同服务器的物联网设备之间可以利用连接凭证建立本地连接,使得物联网设备之间可以进行本地通信,而无需通过云云接口进行通信,从而缩短通信链路,降低交互时延,提升用户体验。
下面,通过具体实施例对本申请所述的技术方案进行详细说明。需要说明的是,下面几个实施例可以独立,也可以相互结合,对于相同或相似的内容,在不同的实施例中不再进行重复说明。
图3为本申请一个实施例提供的基于物联网的通信方法的流程示意图。如图3所示,本实施例的方法包括:
S301:第一设备向第二设备发送连接请求消息,连接请求消息用于指示第一设备请求与第二设备建立连接。
本实施例适用于如图1所示的跨物联网平台的网络系统。第一设备和第二设备为物联网设备,其中,第一设备接入在第一服务器,第二设备接入在第二服务器。
当第一设备需要与第二设备交互时,第一设备向第二设备发送连接请求消息,以请求与第二设备建立连接。需要说明的是,本实施例中所建立的第一设备和第二设备之间的连接为本地连接,或者称为点对点连接,即用于第一设备和第二设备直接通信的连接,无需经过服务器之间的云云接口。示例性的,第一设备和第二设备可以位于同一局域网内,第一设备和第二设备基于该局域网建立连接。
应理解,本实施例中第一设备和第二设备之间的本地连接为传输层安全(transport layer security,TLS)或数据报传输层安全(datagram transport layer security,DTLS)连接。
一些示例中,第一设备为安装有物联网设备控制软件的设备,例如,第一设备可以为智能手机、平板电脑等。第二设备为物联网设备,例如,第二设备可以为灯具、开关、电视机、电冰箱、智能音箱等。该示例中,第一设备可用于控制第二设备。第一设备还可以称为控制设备,第二设备还可以称为受控设备。
另一些示例中,第一设备和第二设备均可以是物联网设备。例如,第一设备可以为开关,第二设备可以为灯具。再例如,第一设备可以为音箱,第二设备可以为电视机。
应理解,实际应用中,可以由第一设备发起连接请求,还可以由第二设备发起连接请求。本实施例中仅以第一设备发起连接请求为例进行描述,针对第二设备发起连接请求的情况,其实现过程是类似的。
S302:在存在连接凭证时,第一设备与第二设备建立连接。
其中,连接凭证为用于第一设备与第二设备建立连接的凭证。连接凭证也可以称为安全凭证。
本实施例中,存在连接凭证的两个设备之间可以建立本地连接。在S301之前,第一设备和第二设备可以建立绑定关系。在第一设备和第二设备建立绑定关系后,可以生成连接凭证。这样,第一设备和第二设备可以使用该连接凭证来建立本地连接。
需要说明的是,本实施例对于连接凭证的生成过程以及连接凭证中的具体内容不作限定。几种可能的生成连接凭证的方式可以参见后续实施例的详细描述。
具体实现中,第一设备与第二设备建立连接的过程,可以包括第一设备与第二设备之间的一次或者多次消息交互,本实施例对此不作限定。
一些示例中,可以由第二设备对连接凭证进行存储。这样,S302中由第二设备利用连接凭证对第一设备进行验证。即,在第二设备确定存在连接凭证时,第一设备和第二设备建立连接。
另一些示例中,可以由第一设备对连接凭证进行存储。这样,S302中由第一设备利用连接凭证对第二设备进行验证。即,在第一设备确定存在连接凭证时,第一设备和第二设备建立连接。
再一些示例中,可以由第一设备和第二设备均对连接凭证进行存储。这样,S302中由第一设备利用连接凭证对第二设备进行验证,并且由第二设备利用连接凭证对第一设备进行验证。即,在第一设备和第二设备均确定存在连接凭证时,第一设备和第二设备建立连接。
又一些示例中,还可以由除第一设备和第二设备之外的其他设备(例如第一服务器和/或第二服务器)对连接凭证进行存储。这样,S302中,可以通过其他设备利用连接凭证对第一设备和/或第二设备进行验证,即,在其他设备确定存在连接凭证时,第一设备和第二设备建立连接。
一种可能的实现方式中,连接请求消息包括第一设备的标识;相应的,第二设备确定是否存在第一连接凭证,第一连接凭证与第一设备的标识关联。在第二设备确定存在第一连接凭证时,第一设备与第二设备建立连接。
也就是说,第一设备在连接请求消息中携带第一设备的标识,第二设备验证是否存在与第一设备的标识关联的连接凭证,如果存在,则第一设备和第二设备建立连接成功,否则,第一设备和第二设备建立连接失败。
可选的,该实现方式中,第一连接凭证还可以与第一设备的标识和第二设备的标识均关联。
该实现方式中,当第一设备发起连接请求时,需要第二设备利用连接凭证对第一设备进行验证。即,当第二设备确定存在与第一设备的标识关联的连接凭证时,二者即可建立连接成功。通过第二设备利用连接凭证对第一设备进行验证,保证了第一设备和第二设备之间连接的安全性。
另一种可能的实现方式中,连接请求消息包括第一设备的标识。相应的,第二设备确定是否存在第一连接凭证,第一连接凭证与第一设备的标识关联;在第二设备确定存在第一连接凭证时,第二设备向第一设备发送第二设备的标识;第一设备确定是否存在第二连接凭证,第二连接凭证与第二设备的标识关联;在第一设备确定存在第二连接凭证时,第一设备与第二设备建立连接。
也就是说,第一设备在连接请求消息中携带第一设备的标识,第二设备验证是否存在与第一设备的标识关联的连接凭证;并且,第二设备向第一设备提供自己的标识,第一设备验证是否有存在与第二设备的标识关联的连接凭证。如果第一设备和第二设备均验证都通过,则第一设备和第二设备建立连接成功,否则,第一设备和第二设备建立连接失败。
可选的,该实现方式中,第一连接凭证还可以与第一设备的标识和第二设备的标识均关联。第二连接凭证还可以与第一设备的标识和第二设备的标识均关联。
可选的,第一连接凭证和第二连接凭证可以为相同的连接凭证。
该实现方式中,当第一设备发起连接请求时,第二设备需要利用连接凭证对第一设备进行验证,并且,第一设备也需要利用连接凭证对第二设备进行验证。即,当第二设备确定存在与第一设备的标识关联的连接凭证,并且第一设备确定存在与第二设备的标识关联的连接凭证时,二者即可建立连接成功。通过第二设备利用连接凭证对第一设备进行验证,并且第一设备利用连接凭证对第二设备进行验证,进一步保证了第一设备和第二设备之间连接的安全性。
应理解,本实施例中,第一连接凭证与第一设备的标识关联,可以是指:第一连接凭证中显式或者隐式的包括第一设备的标识。第二连接凭证与第二设备的标识关联,可以是指:第二连接凭证中显式或隐式的包括第二设备的标识。
其中,第一设备的标识可以为下述中的一种或多种:第一设备的设备标识、第一设备的用户标识。其中,设备标识包括但不限于设备名称、设备ID、设备序列号等,用户标识包括但不限于用户账号、用户昵称、用户ID等。
一些可能的场景中,第二设备可能未存储连接凭证,而由第二服务器对连接凭证进行存储。 该情况下,第二设备确定是否存在第一连接凭证,可以包括:第二设备确定第二服务器是否存在第一连接凭证。这样,在第二设备确定第二服务器存在第一连接凭证时,第一设备与第二设备建立连接。也就是说,可以由第二服务器利用连接凭证对第一设备进行验证。
一种可能的实施方式中,第二设备可以通过如下可行的方式确定第二服务器是否存在第一连接凭证:第二设备向第二服务器发送验证请求消息,该验证请求消息包括第一设备的标识。第二服务器确定是否存在第一连接凭证,并向第二设备发送验证结果消息,其中,验证结果消息用于指示第二服务器是否存在第一连接凭证。第二设备接收第二服务器发送的验证结果消息,并根据验证结果消息,确定出第二服务器是否存在第一连接凭证。
可选的,第二服务器可以把第一连接凭证发送给第二设备,这样,第二设备后续可以直接使用第一连接凭证对第一设备进行验证,提高连接建立效率。
一些可能的场景中,连接凭证还可以具有时效性。例如,连接凭证中可以包括用于指示该连接凭证的有效时间段的信息。这样,S302中,在确定存在连接凭证,并确定该连接凭证的时效性为有效的情况下,第一设备与第二设备建立连接。
本实施例提供的基于物联网的通信方法,第一设备接入在第一服务器中,第二设备接入在第二服务器中,第一设备向第二设备发送连接请求消息,在确定存在连接凭证时,第一设备与第二设备建立连接。通过上述过程,第一设备与第二设备可以基于连接凭证建立本地连接,使得第一设备与第二设备之间的交互过程无需经过云云接口的转发,从而缩短通信链路,降低交互时延,提升用户体验。
在上述任意实施例的基础上,第一设备与第二设备建立连接之后,第一设备和第二设备还可以基于该连接凭证进行安全会话。下面结合图4进行描述。
图4为本申请另一个实施例提供的基于物联网的通信方法的流程示意图。在图3所示实施例的基础上,假设第一设备存在与第二设备的标识关联的第二连接凭证,第二设备存在与第一设备的标识关联的第一连接凭证。第一设备与第二设备建立连接之后,还可以包括:
S401:第一设备采用第一密钥对第一数据进行加密得到第一密文。
S402:第一设备向第二设备发送第一密文。
相应的,第二设备接收第一设备发送的第一密文。
S403:第二设备采用第二密钥对第一密文进行解密得到第一数据。
S404:第二设备采用第二密钥对第二数据进行加密得到第二密文。
S405:第二设备向第一设备发送第二密文。
相应的,第一设备接收第二设备发送的第二密文。
S406:第一设备采用第一密钥对第二密文进行解密得到第二数据。
上述通信过程中,第一设备采用第一密钥进行加解密,其中,第一密钥可以为第二连接凭证,或者,第一密钥还可以是根据第二连接凭证生成的会话密钥。第二设备采用第二密钥进行加解密,其中,第二密钥可以为第一连接凭证,或者,第二密钥还可以是根据第一连接凭证生成的会话密钥。
本实施例中,第一设备和第二设备基于连接凭证对会话过程进行加密,保证了会话的安全性。
在上述任意实施例的基础上,下面结合图5描述连接凭证的生成过程。
图5为本申请又一个实施例提供的基于物联网的通信方法的流程示意图。如图5所示,本实施例的方法包括:
S501:第一设备向第一服务器发送第一绑定请求消息。
相应的,第一服务器接收第一设备发送的第一绑定请求消息。
其中,第一绑定请求消息用于指示第一设备请求与第二设备建立绑定关系。第一绑定请求消息包括下述中的至少一种:第一设备的标识、第二设备的标识、第二服务器的标识。
可选的,在S501之前,还可以包括:第一设备获取第二设备的标识,其中第二设备的标识中包括第二服务器的标识。或者,第一设备获取第二设备的标识和第二服务器的标识。
S502:第一服务器根据第一绑定请求消息,向第二服务器发送第二绑定请求消息。
相应的,第二服务器接收第一服务器发送的第二绑定请求消息。其中,第二绑定请求消息用于使第二服务器生成连接凭证。
一种可能的实施方式中,第一服务器和第二服务器建立互联互通的关系。每个服务器存储预设对应关系,预设对应关系用于指示不同服务器的标识与接入信息之间的对应关系。示例性的, 第一设备可以在第一绑定请求消息中携带第二服务器的标识,这样,第一服务器可以根据第二服务器的标识查询预设对应关系,确定出第二服务器的接入信息;进而,第一服务器可以根据第二服务器的接入信息,向第二服务器发送第二绑定请求消息。
其中,接入信息是指能够标识服务器的网络位置的任意信息。可选的,接入信息可以为服务器的统一资源标识符(uniform resource identifier,URI)。
例如,各服务器存储的预设对应关系可以如下表所示。
服务器的标识 接入信息
PID_A https://PlatformA_AccessURI
PID_B https://PlatformB_AccessURI
假设第一绑定请求消息中携带的第二服务器的标识为PID_B,第一服务器根据该标识查询上述的预设对应关系,可以确定出第二服务器的接入信息为https://PlatformB_AccessURI。因此,第一服务器可以向该URI发送第二绑定请求消息。
其中,第二绑定请求消息可以包括:第一设备的标识和/或第二设备的标识。这样,第二服务器可以根据第一设备的标识和/或第二设备的标识,生成连接凭证,具体可以参见S503的详细描述。
S503:第二服务器根据第二绑定请求消息,生成连接凭证。
可选的,第二服务器生成连接凭证之后,可以维护该连接凭证与第一设备的标识之间的对应关系;还可以维护该连接凭证与第二设备的标识之间的对应关系。
可选的,第二服务器生成连接凭证之后,还可以包括:
S504:第二服务器向第二设备发送所述连接凭证。
S505:第二服务器向第一服务器发送所述连接凭证。
S506:第一服务器向第一设备发送所述连接凭证。
在第一服务器接收到连接凭证之后,还可以将连接凭证发送给第一设备。
可选的,第二服务器生成的连接凭证可以包括:第一连接凭证和/或第二连接凭证。其中,第一连接凭证用于第二设备对第一设备进行验证,第二连接凭证用于第一设备对第二设备进行验证。这样,第二服务器可以向第二设备发送第一连接凭证,使得第二设备可以使用第一连接凭证对第一设备进行验证。第二服务器可以向第一服务器发送第二连接凭证,进而第一服务器将第二连接凭证转发给第一设备,使得第一设备可以使用第二连接凭证对第二设备进行验证。
需要说明的是,上述的第一连接凭证和第二连接凭证可以是相同的,也可以是不同的。下面结合几种可行的方式,描述第二服务器如何生成以及发送连接凭证。
方式1:第二绑定请求消息包括第一设备的标识。这样,第二服务器根据第一设备的标识,生成第一连接凭证。也就是说,第一连接凭证与第一设备的标识关联。
该方式下,第二服务器可以将第一连接凭证发送给第二设备,使得第二设备在接收到第一设备的连接请求消息时,可以利用第一连接凭证对第一设备进行验证。
应理解,该方式可用于下述应用场景:当第一设备向第二设备发起连接请求时,第二设备需要对第一设备进行验证,而第一设备无需对第二设备进行验证。
可选的,第二服务器还可以将第一连接凭证作为第二连接凭证,并将第二连接凭证发送给第一服务器,进而第一服务器将该第二连接凭证发送给第一设备。这样,第一设备和第二设备均存储有相同的连接凭证,第一设备和第二设备建立连接之后,可以使用连接凭证对会话进行加密解密,保证会话的安全性。
方式2:第二绑定请求消息包括第一设备的标识和第二设备的标识。这样,第二服务器根据第一设备的标识,生成第一连接凭证,并根据第二设备的标识,生成第二连接凭证。也就是说,第一连接凭证与第一设备的标识关联,第二连接凭证与第二设备的标识关联。
该方式下,第二服务器可以将第一连接凭证发送给第二设备,使得第二设备在接收到第一设备的连接请求消息时,可以利用第一连接凭证对第一设备进行验证。第二服务器还可以将第二连接凭证发送给第一服务器,进而第一服务器将第二连接凭证发送给第一设备,使得第一设备可以利用第二连接凭证对第二设备进行验证。
应理解,该方式可用于下述应用场景:当第一设备向第二设备发起连接请求时,第二设备需要对第一设备进行验证,并且,第一设备也需要对第二设备进行验证。
该方式下,第一设备存储有第二连接凭证,第二设备存储有第一连接凭证,第一设备和第二设备建立连接之后,还可以使用自身存储的连接凭证对会话进行加密解密,保证会话的安全性。
方式3:第二绑定请求消息包括第一设备的标识和第二设备的标识。这样,第二服务器根据第一设备的标识和第二设备的标识,生成第一连接凭证,并且,根据第一设备的标识和第二设备的标识,生成第二连接凭证。也就是说,第一连接凭证与第一设备的标识和第二设备的标识均关联,第二连接凭证与第一设备的标识和第二设备的标识均关联。
应理解,该方式中的第一连接凭证和第二连接凭证可以相同或者不同。
该方式下,第二服务器可以将第一连接凭证发送给第二设备,使得第二设备在接收到第一设备的连接请求消息时,可以利用第一连接凭证对第一设备进行验证。第二服务器还可以将第二连接凭证发送给第一服务器,进而第一服务器将第二连接凭证发送给第一设备,使得第一设备可以利用第二连接凭证对第二设备进行验证。
应理解,该方式可用于下述应用场景:当第一设备向第二设备发起连接请求时,第二设备需要对第一设备进行验证,并且,第一设备也需要对第二设备进行验证。
该方式下,第一设备存储有第二连接凭证,第二设备存储有第一连接凭证,第一设备和第二设备建立连接之后,还可以使用自身存储的连接凭证对会话进行加密解密,保证会话的安全性。
本实施例中,通过在第一设备和第二设备建立绑定关系过程中,生成用于第一设备和第二设备建立连接的连接凭证,使得第一设备与第二设备可以基于连接凭证建立本地连接,从而第一设备与第二设备之间的交互过程无需经过云云接口的转发,缩短通信链路,降低交互时延,提升用户体验。
下面结合一个具体的示例,对本申请实施例中基于物联网的通信方法进行更详细的描述。
图6为本申请又一个实施例提供的基于物联网的通信方法的流程示意图。如图6所示,本实施例的方法包括:
S601:第一设备发现第二设备,并获取第二设备的标识和第二服务器的标识。
示例性的,第一设备和第二设备位于相同的局域网中,第一设备通过设备发现机制,在本地网络中发现第二设备。其中,设备发现机制可以为基于现有的发现协议的机制,本实施例对此不作限定。
一种可能的场景中,第二设备中预置有第二设备的标识和第二服务器的标识。第一设备通过设备发现流程,获取到第二设备的标识和第二服务器的标识。其中,第二服务器的标识为第二设备所关联的服务器的标识。
另一种可能的场景中,第二设备的标识和第二服务器的标识可以是在S602之后产生的。示例性的,第一设备发现第二设备之后,可以对第二设备进行配网,使得第二设备接入到第二服务器中。第二设备在接入第二服务器的过程中,获取到第二设备的标识和第二服务器的标识。进而,第一设备获取到第二设备的标识和第二服务器的标识。
本实施例中,第二设备的标识和第二服务器的标识可以是两个相互独立的标识。或者,第二设备的标识中包括第二服务器的标识。
可选地,第二服务器的标识可以为下述中的一个或者多个:第二设备对应的厂商标识、第二服务器的URI、第二服务器的平台标识等。
S602:第一设备对第二设备进行配网,第二设备接入第二服务器。
可选地,第二设备接入第二服务器的过程中,获取到第二设备的标识和第二服务器的标识。
S603:第一设备向第一服务器发送第一绑定请求消息,第一绑定请求消息中包括第二设备的标识和第二服务器的标识。
其中,第一服务器根据第二设备的标识,可以确定出第一设备需要与哪个设备建立绑定关系。第一服务器根据第二服务器的标识,可以确定出本次绑定是否为跨平台绑定。
可选的,第一设备还可以在第一绑定请求消息中提供第一设备的标识,该第一设备的标识可用于在S608中第二服务器根据第一设备的标识生成连接凭证。
S604:第一服务器根据第二服务器的标识,确定需要跨平台绑定。
第一服务器根据第一绑定请求消息中的第二服务器的标识,确定第二设备不是本云平台管理的设备,因此,确定需要进行跨平台绑定,继续执行本实施例后续的步骤。
S605:第一服务器获取第二服务器对应的访问令牌。
第一服务器通过登录授权流程(例如,Oauth授权流程),获得第二服务器对应的访问令牌(AccessToken)。该访问令牌授权第一设备可以通过第一服务器访问第二服务器的资源。该访问令牌还可以限制第一设备访问资源的权限范围和时效。
其中,该访问令牌是由第二服务器的授权服务器分配的访问令牌。需要说明的是,第二服务 器的授权服务器和第二服务器可以是同一个实体,也可以是不同的实体。当第二服务器的授权服务器和第二服务器为同一实体时,第二服务器可以直接分配访问令牌。
S606:第一服务器向第二服务器发送第二绑定请求消息,第二绑定请求消息包括第二设备的标识和访问令牌。
具体的,第一服务器可以根据第一绑定请求消息中的第二服务器的标识,通过查询预设对应关系,确定出第二服务器的接入信息。进而第一服务器根据第二服务器的接入信息,向第二服务器发送第二绑定请求消息。
可选的,第一服务器向第二服务器发送的第二绑定请求消息中还可以提供第一设备的标识。该第一设备的标识可用于在S608中第二服务器根据第一设备的标识生成连接凭证。
S607:第二服务器对访问令牌进行校验。
示例性的,第二服务器通过与授权服务器的交互,对第二绑定消息中携带的访问令牌进行校验。
S608:在检验结果为通过时,第二服务器生成连接凭证。
S609:第二服务器向第二设备发送连接凭证。
S610:第二服务器向第一服务器发送连接凭证。
S611:第一服务器向第一设备发送连接凭证。
第二服务器对访问令牌校验通过后,建立第一设备与第二设备之间的绑定关系。进而,第二服务器生成连接凭证,用于第一设备和第二设备建立本地连接时使用。
其中,第二服务器生成连接凭证以及发送连接凭证可以有多种方式,具体可以参见图5所示实施例的详细描述,此处不再赘述。
进一步的,第二服务器可以维护连接凭证和第一设备的标识之间的对应关系。第二服务器还可以维护连接凭证和第二设备的标识之间的对应关系。
S612:第一设备和第二设备使用连接凭证建立安全连接。
本实施例中,第一设备和第二设备使用连接凭证建立安全连接的过程与图3所示实施例类似,此处不作赘述。
S613:第一设备和第二设备使用连接凭证进行安全会话。
本实施例中,第一设备和第二设备使用连接凭证进行安全会话的过程与图4所示实施例类似,此处不作赘述。
一些可能的应用场景中,第一设备可以为控制设备(例如,安装有物联网设备控制软件的终端设备),第二设备可以为物联网设备(例如,灯具、电视机、空调等)。当第一设备发现第二设备后,可以执行本实施例的S601至S613,从而实现第一设备和第二设备之间的本地通信。
另一些可能的应用场景中,第一设备和第二设备均可以为物联网设备(例如,第一设备为开关,第二设备为灯具)。该场景中,第一设备通过S601发现第二设备之后,第一设备可以与控制设备进行交互,询问控制设备是否允许第一设备绑定第二设备。在控制设备允许第一设备绑定第二设备的情况下,执行本实施例中的S602至S613,从而实现第一设备和第二设备之间的本地通信。
本实施例中,通过在第一设备和第二设备建立绑定关系过程中,生成用于第一设备和第二设备建立连接的连接凭证,使得第一设备与第二设备可以基于连接凭证建立本地连接,从而第一设备与第二设备之间的交互过程无需经过云云接口的转发,缩短通信链路,降低交互时延,提升用户体验。
图7为本申请实施例提供的通信装置的结构示意图。如图7所示,本实施例提供的通信装置10,包括:发送模块11、处理模块12和接收模块13。
本实施例的通信装置可应用于第一设备中,第一设备可以为物联网设备。当该通信装置10应用于第一设备中时,上述各模块可用于实现如下功能:
发送模块11,用于向第二设备发送连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
处理模块12,用于在存在连接凭证时,所述第一设备与所述第二设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
一种可能的实现方式中,所述连接请求消息包括所述第一设备的标识,所述处理模块具体用于:
在所述第二设备存在第一连接凭证时,所述第一设备与所述第二设备建立连接,所述第一连接凭证与所述第一设备的标识关联。
一种可能的实现方式中,所述接收模块13,用于在所述第二设备存在所述第一连接凭证时,接收所述第二设备发送的所述第二设备的标识;
所述处理模块12具体用于:在所述第一设备存在所述第二连接凭证时,所述第一设备与所述第二设备建立连接。
一种可能的实现方式中,所述第一连接凭证与所述第一设备的标识和所述第二设备的标识均关联;
一种可能的实现方式中,所述第二连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
一种可能的实现方式中,所述接收模块13还用于:
接收所述第一服务器发送的所述第二连接凭证,所述第二连接凭证由所述第二服务器生成。
一种可能的实现方式中,所述发送模块11还用于:
向所述第一服务器发送第一绑定请求消息,所述第一绑定请求消息用于指示所述第一设备请求与所述第二设备建立绑定关系,所述第一绑定请求消息包括下述中的至少一种:所述第一设备的标识、所述第二设备的标识、所述第二服务器的标识。
一种可能的实现方式中,所述处理模块12还用于:
获取所述第二设备的标识,所述第二设备的标识包括所述第二服务器的标识;
或者,
获取所述第二设备的标识和所述第二服务器的标识。
一种可能的实现方式中,所述处理模块12还用于:采用第一密钥对第一数据进行加密得到第一密文,所述第一密钥为所述第二连接凭证,或者,所述第一密钥是根据所述第二连接凭证生成的;
所述发送模块11还用于:向所述第二设备发送所述第一密文。
一种可能的实现方式中,所述接收模块13还用于:接收所述第二设备发送的第二密文;
所述处理模块12还用于:采用第一密钥对所述第二密文进行解密得到第二数据,所述第一密钥为所述第二连接凭证,或者,所述第一密钥是根据所述第二连接凭证生成的。
本实施例的通信装置可用于执行上述任一方法实施例中第一设备侧的技术方案,其实现原理和技术效果类似,此处不再赘述。
本实施例的通信装置可应用于第二设备中,第二设备可以为物联网设备。当该通信装置10应用于第二设备中时,上述各模块可用于实现如下功能:
接收模块13,用于接收第一设备发送的连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
处理模块12,用于在存在连接凭证时,所述第二设备与所述第一设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
一种可能的实现方式中,所述连接请求消息包括所述第一设备的标识,所述处理模块12具体用于:确定是否存在第一连接凭证,所述第一连接凭证与所述第一设备的标识关联;并在所述第二设备确定存在所述第一连接凭证时,所述第二设备与所述第一设备建立连接。
一种可能的实现方式中,所述发送模块11,用于在所述第二设备确定存在所述第一连接凭证时,向所述第一设备发送所述第二设备的标识;
所述处理模块12具体用于:在所述第一设备存在第二连接凭证时,所述第二设备与所述第一设备建立连接,所述第二连接凭证与所述第二设备的标识关联。
一种可能的实现方式中,所述第一连接凭证与所述第一设备的标识和所述第二设备的标识均关联;
一种可能的实现方式中,所述第二连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
一种可能的实现方式中,所述处理模块12具体用于:
确定所述第二服务器是否存在所述第一连接凭证,在确定所述第二服务器存在所述第一连接凭证时,所述第二设备与所述第一设备建立连接。
一种可能的实现方式中,所述发送模块11还用于:向所述第二服务器发送验证请求消息,所述验证请求消息包括所述第一设备的标识;
所述接收模块13还用于:接收所述第二服务器发送的验证结果消息,所述验证结果消息用于指示所述第二服务器是否存在所述第一连接凭证;
所述处理模块12具体用于:根据所述验证结果消息,确定所述第二服务器是否存在所述第一连接凭证。
一种可能的实现方式中,所述接收模块13还用于:接收所述第二服务器发送的所述第一连接凭证,所述第一连接凭证由所述第二服务器生成。
一种可能的实现方式中,所述接收模块13还用于:接收所述第一设备发送的第一密文;
所述处理模块12还用于:采用第二密钥对所述第一密文进行解密得到第一数据,所述第二密钥为所述第一连接凭证,或者,所述第二密钥是根据所述第一连接凭证生成的。
一种可能的实现方式中,所述处理模块12还用于:采用第二密钥对第二数据进行加密得到第二密文,所述第二密钥为所述第一连接凭证,或者,所述第二密钥是根据所述第一连接凭证生成的;
所述发送模块11还用于:向所述第一设备发送所述第二密文。
本实施例的通信装置可用于实现上述任一方法实施例中第二设备侧的技术方案,其实现原理和技术效果类似,此处不作赘述。
本实施例的通信装置还可应用于第一服务器中。当该通信装置10应用于第一服务器中时,上述各模块可用于实现如下功能:
接收模块13,用于接收第一设备发送的第一绑定请求消息,所述第一绑定请求消息用于指示第一设备请求与第二设备建立绑定关系,所述第一设备接入在所述第一服务器中,所述第二设备接入在第二服务器中;
发送模块11,用于根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息,所述第二绑定请求消息用于使所述第二服务器生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
一种可能的实现方式中,所述连接凭证包括第二连接凭证;
所述接收模块13还用于:接收所述第二服务器发送的所述第二连接凭证;
所述发送模块11还用于:向所述第一设备发送所述第二连接凭证。
一种可能的实现方式中,所述第一绑定请求消息包括所述第二设备的标识;相应的,所述第二绑定请求消息包括所述第二设备的标识,所述第二连接凭证与所述第二设备的标识关联。
一种可能的实现方式中,所述第一绑定请求消息包括所述第一设备的标识和所述第二设备的标识;相应的,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述第二连接凭证与所述第一设备的标识关联,并且与所述第二设备的标识关联。
一种可能的实现方式中,所述第一绑定请求消息包括所述第二服务器的标识,所述处理模块12用于:根据所述第二服务器的标识查询预设对应关系,确定所述第二服务器的接入信息,所述预设对应关系用于指示不同服务器的标识与接入信息之间的对应关系;
所述发送模块11具体用于:根据所述第二服务器的接入信息,向所述第二服务器发送所述第二绑定请求消息。
一种可能的实现方式中,所述发送模块11还用于:获取所述第二服务器对应的访问令牌;相应的,所述第二绑定请求消息包括所述第二服务器对应的访问令牌。
本实施例的通信装置可用于执行上述任一方法实施例中第一服务器侧的技术方案,其实现原理和技术效果类似,此处不作赘述。
本实施例的通信装置还可应用于第二服务器中。当该通信装置10应用于第二服务器中时,上述各模块可用于实现如下功能:
接收模块13,用于接收第一服务器发送的第二绑定请求消息,所述第二绑定请求消息用于指示第一设备请求与第二设备建立绑定关系;其中,所述第一设备接入在所述第一服务器中,所述第二设备接入在所述第二服务器中;
处理模块12,用于根据所述第二绑定请求消息,生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
一种可能的实现方式中,所述连接凭证包括第一连接凭证和/或第二连接凭证,所述发送模块11用于:向所述第二设备发送所述第一连接凭证,和/或,向所述第一服务器发送所述第二连接凭证。
一种可能的实现方式中,所述第二绑定请求消息包括所述第一设备的标识,所述处理模块12具体用于:
根据所述第一设备的标识,生成所述第一连接凭证。
一种可能的实现方式中,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述处理模块12具体用于:
根据所述第一设备的标识,生成所述第一连接凭证;
根据所述第二设备的标识,生成所述第二连接凭证。
一种可能的实现方式中,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述处理模块12具体用于:
根据所述第一设备的标识和所述第二设备的标识,生成所述第一连接凭证;
根据所述第一设备的标识和所述第二设备的标识,生成所述第二连接凭证。
一种可能的实现方式中,所述第二绑定请求消息包括访问令牌;
所述处理模块12还用于:对所述访问令牌进行校验,并确定所述校验结果为校验通过。
一种可能的实现方式中,所述接收模块13还用于:接收所述第二设备发送的验证请求消息,所述验证请求消息包括所述第一设备的标识;
所述发送模块11还用于:向所述第二设备发送验证结果消息,所述验证结果消息用于指示所述第二服务器是否存在第一连接凭证,所述第一连接凭证与所述第一设备的标识关联。
本实施例的通信装置可用于执行上述任一方法实施例中第二服务器侧的技术方案,其实现原理和技术效果类似,此处不作赘述。
图8为本申请实施例提供的通信设备的结构示意图。如图8所示,该通信设备20可以包括:收发器21、存储器22、处理器23。收发器21可包括:发射器和接收器。该发射器还可称为发送器、发射机、发送端口或发送接口等类似描述,接收器还可称为接收器、接收机、接收端口或接收接口等类似描述。示例性地,收发器21、存储器22、处理器23,各部分之间通过总线24相互连接。
存储器22用于存储程序指令;
处理器23用于执行该存储器所存储的程序指令,用以使得通信设备20执行上述任一方法实施例中第一设备侧的通信方法,或者,执行上述任一方法实施例中第二设备侧的通信方法,或者,执行上述任一方法实施例中第一服务器侧的通信方法,或者,执行上述任一方法实施例中第二服务器侧的通信方法。
其中,收发器21中的发射器,可用于执行上述方法实施例中各通信设备的发送功能。
收发器21的接收器,可用于执行上述方法实施例中各通信设备的接收功能。
本申请实施例还可提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述任一方法实施例中第一设备侧的通信方法,或者,执行上述任一方法实施例中第二设备侧的通信方法,或者,执行上述任一方法实施例中第一服务器侧的通信方法,或者,执行上述任一方法实施例中第二服务器侧的通信方法。
本申请实施例还可提供一种计算机程序产品,该计算机程序产品可以由处理执行,例如可由通信设备20的处理器23执行,在计算机程序产品被执行时,可实现上述任一方法实施例中第一设备侧的通信方法,或者,执行上述任一方法实施例中第二设备侧的通信方法,或者,执行上述任一方法实施例中第一服务器侧的通信方法,或者,执行上述任一方法实施例中第二服务器侧的通信方法。
本申请实施例的通信设备、计算机可读存储介质及计算机程序产品,可执行上述任一方法实施例中的通信方法,其具体的实现过程及有益效果参见上述,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
本申请实施例的说明书、权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的计算机程序可以存储于一计算机可读取存储介质中。该计算机程序在被处理器执行时,实现包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (68)

  1. 一种基于物联网的通信方法,其特征在于,包括:
    第一设备向第二设备发送连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
    在存在连接凭证时,所述第一设备与所述第二设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  2. 根据权利要求1所述的方法,其特征在于,所述连接凭证包括第一连接凭证,所述连接请求消息包括所述第一设备的标识,在存在连接凭证时,所述第一设备与所述第二设备建立连接,包括:
    在所述第二设备存在所述第一连接凭证时,所述第一设备与所述第二设备建立连接,所述第一连接凭证与所述第一设备的标识关联。
  3. 根据权利要求2所述的方法,其特征在于,所述第一连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  4. 根据权利要求2或3所述的方法,其特征在于,所述连接凭证还包括第二连接凭证,在所述第二设备存在第一连接凭证时,所述第一设备与所述第二设备建立连接,包括:
    在所述第二设备存在所述第一连接凭证时,所述第一设备接收所述第二设备发送的所述第二设备的标识;
    在所述第一设备存在所述第二连接凭证时,所述第一设备与所述第二设备建立连接,所述第二连接凭证与所述第二设备的标识关联。
  5. 根据权利要求4所述的方法,其特征在于,所述第二连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  6. 根据权利要求4或5所述的方法,其特征在于,所述方法还包括:
    所述第一设备接收所述第一服务器发送的所述第二连接凭证,所述第二连接凭证由所述第二服务器生成。
  7. 根据权利要求6所述的方法,其特征在于,所述第一设备接收所述第一服务器发送的所述第二连接凭证之前,还包括:
    所述第一设备向所述第一服务器发送第一绑定请求消息,所述第一绑定请求消息用于指示所述第一设备请求与所述第二设备建立绑定关系,所述第一绑定请求消息包括下述中的至少一种:所述第一设备的标识、所述第二设备的标识、所述第二服务器的标识。
  8. 根据权利要求7所述的方法,其特征在于,所述第一设备向所述第一服务器发送第一绑定请求消息之前,还包括:
    所述第一设备获取所述第二设备的标识,所述第二设备的标识包括所述第二服务器的标识;
    或者,
    所述第一设备获取所述第二设备的标识和所述第二服务器的标识。
  9. 根据权利要求4至8任一项所述的方法,其特征在于,所述第一设备与所述第二设备建立连接之后,还包括:
    所述第一设备采用第一密钥对第一数据进行加密得到第一密文,所述第一密钥为所述第二连接凭证,或者,所述第一密钥是根据所述第二连接凭证生成的;
    所述第一设备向所述第二设备发送所述第一密文。
  10. 根据权利要求4至8任一项所述的方法,其特征在于,所述第一设备与所述第二设备建立连接之后,还包括:
    所述第一设备接收所述第二设备发送的第二密文;
    所述第一设备采用第一密钥对所述第二密文进行解密得到第二数据,所述第一密钥为所述第二连接凭证,或者,所述第一密钥是根据所述第二连接凭证生成的。
  11. 一种基于物联网的通信方法,其特征在于,包括:
    第二设备接收第一设备发送的连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
    在存在连接凭证时,所述第二设备与所述第一设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  12. 根据权利要求11所述的方法,其特征在于,所述连接凭证包括第一连接凭证,所述连接请求消息包括所述第一设备的标识,在存在连接凭证时,所述第二设备与所述第一设备建立连接,包括:
    所述第二设备确定是否存在所述第一连接凭证,所述第一连接凭证与所述第一设备的标识关联;
    在所述第二设备确定存在所述第一连接凭证时,所述第二设备与所述第一设备建立连接。
  13. 根据权利要求12所述的方法,其特征在于,所述第一连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  14. 根据权利要求12或13所述的方法,其特征在于,在所述第二设备确定存在所述第一连接凭证时,所述第二设备与所述第一设备建立连接,包括:
    在所述第二设备确定存在所述第一连接凭证时,所述第二设备向所述第一设备发送所述第二设备的标识;
    在所述第一设备存在第二连接凭证时,所述第二设备与所述第一设备建立连接,所述第二连接凭证与所述第二设备的标识关联。
  15. 根据权利要求14所述的方法,其特征在于,所述第二连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  16. 根据权利要求12至15任一项所述的方法,其特征在于,所述第二设备确定是否存在第一连接凭证,包括:
    所述第二设备确定所述第二服务器是否存在所述第一连接凭证;
    在所述第二设备确定存在所述第一连接凭证时,所述第二设备与所述第一设备建立连接,包括:
    在所述第二设备确定所述第二服务器存在所述第一连接凭证时,所述第二设备与所述第一设备建立连接。
  17. 根据权利要求16所述的方法,其特征在于,所述第二设备确定所述第二服务器是否存在所述第一连接凭证,包括:
    所述第二设备向所述第二服务器发送验证请求消息,所述验证请求消息包括所述第一设备的标识;
    所述第二设备接收所述第二服务器发送的验证结果消息,所述验证结果消息用于指示所述第二服务器是否存在所述第一连接凭证;
    所述第二设备根据所述验证结果消息,确定所述第二服务器是否存在所述第一连接凭证。
  18. 根据权利要求12至17任一项所述的方法,其特征在于,所述方法还包括:
    所述第二设备接收所述第二服务器发送的所述第一连接凭证,所述第一连接凭证由所述第二服务器生成。
  19. 根据权利要求12至18任一项所述的方法,其特征在于,所述第二设备与所述第一设备建立连接之后,还包括:
    所述第二设备接收所述第一设备发送的第一密文;
    所述第二设备采用第二密钥对所述第一密文进行解密得到第一数据,所述第二密钥为所述第一连接凭证,或者,所述第二密钥是根据所述第一连接凭证生成的。
  20. 根据权利要求12至18任一项所述的方法,其特征在于,所述第二设备与所述第一设备建立连接之后,还包括:
    所述第二设备采用第二密钥对第二数据进行加密得到第二密文,所述第二密钥为所述第一连接凭证,或者,所述第二密钥是根据所述第一连接凭证生成的;
    所述第二设备向所述第一设备发送所述第二密文。
  21. 一种基于物联网的通信方法,其特征在于,包括:
    第一服务器接收第一设备发送的第一绑定请求消息,所述第一绑定请求消息用于指示第一设备请求与第二设备建立绑定关系,所述第一设备接入在所述第一服务器中,所述第二设备接入在第二服务器中;
    所述第一服务器根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息,所述第二绑定请求消息用于使所述第二服务器生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  22. 根据权利要求21所述的方法,其特征在于,所述连接凭证包括第二连接凭证,所述第一服务器根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息之后,还包括:
    所述第一服务器接收所述第二服务器发送的所述第二连接凭证,并向所述第一设备发送所述第二连接凭证。
  23. 根据权利要求22所述的方法,其特征在于,所述第一绑定请求消息包括所述第二设备的 标识;相应的,所述第二绑定请求消息包括所述第二设备的标识,所述第二连接凭证与所述第二设备的标识关联。
  24. 根据权利要求22所述的方法,其特征在于,所述第一绑定请求消息包括所述第一设备的标识和所述第二设备的标识;相应的,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述第二连接凭证与所述第一设备的标识关联,并且与所述第二设备的标识关联。
  25. 根据权利要求21至24任一项所述的方法,其特征在于,所述第一绑定请求消息包括所述第二服务器的标识,所述第一服务器根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息,包括:
    所述第一服务器根据所述第二服务器的标识查询预设对应关系,确定所述第二服务器的接入信息,所述预设对应关系用于指示不同服务器的标识与接入信息之间的对应关系;
    所述第一服务器根据所述第二服务器的接入信息,向所述第二服务器发送所述第二绑定请求消息。
  26. 根据权利要求21至25任一项所述的方法,其特征在于,所述第一服务器根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息之前,还包括:
    所述第一服务器获取所述第二服务器对应的访问令牌;
    相应的,所述第二绑定请求消息包括所述第二服务器对应的访问令牌。
  27. 一种基于物联网的通信方法,其特征在于,包括:
    第二服务器接收第一服务器发送的第二绑定请求消息,所述第二绑定请求消息用于指示第一设备请求与第二设备建立绑定关系;其中,所述第一设备接入在所述第一服务器中,所述第二设备接入在所述第二服务器中;
    所述第二服务器根据所述第二绑定请求消息,生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  28. 根据权利要求27所述的方法,其特征在于,所述连接凭证包括第一连接凭证和/或第二连接凭证,所述第二服务器根据所述第二绑定请求消息,生成连接凭证之后,还包括:
    所述第二服务器向所述第二设备发送所述第一连接凭证,和/或,
    所述第二服务器向所述第一服务器发送所述第二连接凭证。
  29. 根据权利要求28所述的方法,其特征在于,所述第二绑定请求消息包括所述第一设备的标识,所述第二服务器根据所述第二绑定请求消息,生成连接凭证,包括:
    所述第二服务器根据所述第一设备的标识,生成所述第一连接凭证。
  30. 根据权利要求28所述的方法,其特征在于,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述第二服务器根据所述第二绑定请求消息,生成连接凭证,包括:
    所述第二服务器根据所述第一设备的标识,生成所述第一连接凭证;
    所述第二服务器根据所述第二设备的标识,生成所述第二连接凭证。
  31. 根据权利要求28所述的方法,其特征在于,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述第二服务器根据所述第二绑定请求消息,生成连接凭证,包括:
    所述第二服务器根据所述第一设备的标识和所述第二设备的标识,生成所述第一连接凭证;
    所述第二服务器根据所述第一设备的标识和所述第二设备的标识,生成所述第二连接凭证。
  32. 根据权利要求27至31任一项所述的方法,其特征在于,所述第二绑定请求消息包括访问令牌,所述第二服务器根据所述第二绑定请求消息,生成连接凭证之前,还包括:
    所述第二服务器对所述访问令牌进行校验,并确定所述校验结果为校验通过。
  33. 根据权利要求27至32任一项所述的方法,其特征在于,所述第二服务器根据所述第二绑定请求消息,生成连接凭证之后,还包括:
    所述第二服务器接收所述第二设备发送的验证请求消息,所述验证请求消息包括所述第一设备的标识;
    所述第二服务器向所述第二设备发送验证结果消息,所述验证结果消息用于指示所述第二服务器是否存在第一连接凭证,所述第一连接凭证与所述第一设备的标识关联。
  34. 一种基于物联网的通信装置,其特征在于,应用于第一设备,所述装置包括:
    发送模块,用于向第二设备发送连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
    处理模块,用于在存在连接凭证时,所述第一设备与所述第二设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  35. 根据权利要求34所述的装置,其特征在于,所述连接凭证包括第一连接凭证,所述连接 请求消息包括所述第一设备的标识,所述处理模块具体用于:
    在所述第二设备存在所述第一连接凭证时,所述第一设备与所述第二设备建立连接,所述第一连接凭证与所述第一设备的标识关联。
  36. 根据权利要求35所述的装置,其特征在于,所述第一连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  37. 根据权利要求35或36所述的装置,其特征在于,所述连接凭证还包括第二连接凭证,所述装置还包括接收模块;
    所述接收模块,用于在所述第二设备存在所述第一连接凭证时,接收所述第二设备发送的所述第二设备的标识;
    所述处理模块具体用于:在所述第一设备存在所述第二连接凭证时,所述第一设备与所述第二设备建立连接,所述第二连接凭证与所述第二设备的标识关联。
  38. 根据权利要求37所述的装置,其特征在于,所述第二连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  39. 根据权利要求37或38所述的装置,其特征在于,所述接收模块还用于:
    接收所述第一服务器发送的所述第二连接凭证,所述第二连接凭证由所述第二服务器生成。
  40. 根据权利要求39所述的装置,其特征在于,所述发送模块还用于:
    向所述第一服务器发送第一绑定请求消息,所述第一绑定请求消息用于指示所述第一设备请求与所述第二设备建立绑定关系,所述第一绑定请求消息包括下述中的至少一种:所述第一设备的标识、所述第二设备的标识、所述第二服务器的标识。
  41. 根据权利要求40所述的装置,其特征在于,所述处理模块还用于:
    获取所述第二设备的标识,所述第二设备的标识包括所述第二服务器的标识;
    或者,
    获取所述第二设备的标识和所述第二服务器的标识。
  42. 根据权利要求37至41任一项所述的装置,其特征在于,
    所述处理模块还用于:采用第一密钥对第一数据进行加密得到第一密文,所述第一密钥为所述第二连接凭证,或者,所述第一密钥是根据所述第二连接凭证生成的;
    所述发送模块还用于:向所述第二设备发送所述第一密文。
  43. 根据权利要求37至41任一项所述的装置,其特征在于,
    所述接收模块还用于:接收所述第二设备发送的第二密文;
    所述处理模块还用于:采用第一密钥对所述第二密文进行解密得到第二数据,所述第一密钥为所述第二连接凭证,或者,所述第一密钥是根据所述第二连接凭证生成的。
  44. 一种基于物联网的通信装置,其特征在于,应用于第二设备,所述装置包括:
    接收模块,用于接收第一设备发送的连接请求消息,所述连接请求消息用于指示所述第一设备请求与所述第二设备建立连接,所述第一设备接入在第一服务器,所述第二设备接入在第二服务器;
    处理模块,用于在存在连接凭证时,所述第二设备与所述第一设备建立连接,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  45. 根据权利要求44所述的装置,其特征在于,所述连接凭证包括第一连接凭证,所述连接请求消息包括所述第一设备的标识,所述处理模块具体用于:确定是否存在第一连接凭证,所述第一连接凭证与所述第一设备的标识关联;并在所述第二设备确定存在所述第一连接凭证时,所述第二设备与所述第一设备建立连接。
  46. 根据权利要求45所述的装置,其特征在于,所述第一连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  47. 根据权利要求45或46所述的装置,其特征在于,所述装置还包括发送模块;
    所述发送模块,用于在所述第二设备确定存在所述第一连接凭证时,向所述第一设备发送所述第二设备的标识;
    所述处理模块具体用于:在所述第一设备存在第二连接凭证时,所述第二设备与所述第一设备建立连接,所述第二连接凭证与所述第二设备的标识关联。
  48. 根据权利要求47所述的装置,其特征在于,所述第二连接凭证与所述第一设备的标识和所述第二设备的标识均关联。
  49. 根据权利要求45至48任一项所述的装置,其特征在于,所述处理模块具体用于:
    确定所述第二服务器是否存在所述第一连接凭证,在确定所述第二服务器存在所述第一连接 凭证时,所述第二设备与所述第一设备建立连接。
  50. 根据权利要求49所述的装置,其特征在于,所述发送模块还用于:向所述第二服务器发送验证请求消息,所述验证请求消息包括所述第一设备的标识;
    所述接收模块还用于:接收所述第二服务器发送的验证结果消息,所述验证结果消息用于指示所述第二服务器是否存在所述第一连接凭证;
    所述处理模块具体用于:根据所述验证结果消息,确定所述第二服务器是否存在所述第一连接凭证。
  51. 根据权利要求45至50任一项所述的装置,其特征在于,所述接收模块还用于:接收所述第二服务器发送的所述第一连接凭证,所述第一连接凭证由所述第二服务器生成。
  52. 根据权利要求45至51任一项所述的装置,其特征在于,
    所述接收模块还用于:接收所述第一设备发送的第一密文;
    所述处理模块还用于:采用第二密钥对所述第一密文进行解密得到第一数据,所述第二密钥为所述第一连接凭证,或者,所述第二密钥是根据所述第一连接凭证生成的。
  53. 根据权利要求45至51任一项所述的装置,其特征在于,
    所述处理模块还用于:采用第二密钥对第二数据进行加密得到第二密文,所述第二密钥为所述第一连接凭证,或者,所述第二密钥是根据所述第一连接凭证生成的;
    所述发送模块还用于:向所述第一设备发送所述第二密文。
  54. 一种基于物联网的通信装置,其特征在于,应用于第一服务器,所述装置包括:
    接收模块,用于接收第一设备发送的第一绑定请求消息,所述第一绑定请求消息用于指示第一设备请求与第二设备建立绑定关系,所述第一设备接入在所述第一服务器中,所述第二设备接入在第二服务器中;
    发送模块,用于根据所述第一绑定请求消息,向所述第二服务器发送第二绑定请求消息,所述第二绑定请求消息用于使所述第二服务器生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  55. 根据权利要求54所述的装置,其特征在于,所述连接凭证包括第二连接凭证;
    所述接收模块还用于:接收所述第二服务器发送的所述第二连接凭证;
    所述发送模块还用于:向所述第一设备发送所述第二连接凭证。
  56. 根据权利要求55所述的装置,其特征在于,所述第一绑定请求消息包括所述第二设备的标识;相应的,所述第二绑定请求消息包括所述第二设备的标识,所述第二连接凭证与所述第二设备的标识关联。
  57. 根据权利要求55所述的装置,其特征在于,所述第一绑定请求消息包括所述第一设备的标识和所述第二设备的标识;相应的,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述第二连接凭证与所述第一设备的标识关联,并且与所述第二设备的标识关联。
  58. 根据权利要求54至57任一项所述的装置,其特征在于,所述第一绑定请求消息包括所述第二服务器的标识,所述装置还包括处理模块;
    所述处理模块用于:根据所述第二服务器的标识查询预设对应关系,确定所述第二服务器的接入信息,所述预设对应关系用于指示不同服务器的标识与接入信息之间的对应关系;
    所述发送模块具体用于:根据所述第二服务器的接入信息,向所述第二服务器发送所述第二绑定请求消息。
  59. 根据权利要求54至58任一项所述的装置,其特征在于,所述发送模块还用于:获取所述第二服务器对应的访问令牌;相应的,所述第二绑定请求消息包括所述第二服务器对应的访问令牌。
  60. 一种基于物联网的通信装置,其特征在于,应用于第二服务器,所述装置包括:
    接收模块,用于接收第一服务器发送的第二绑定请求消息,所述第二绑定请求消息用于指示第一设备请求与第二设备建立绑定关系;其中,所述第一设备接入在所述第一服务器中,所述第二设备接入在所述第二服务器中;
    处理模块,用于根据所述第二绑定请求消息,生成连接凭证,所述连接凭证为用于所述第一设备与所述第二设备建立连接的凭证。
  61. 根据权利要求60所述的装置,其特征在于,所述连接凭证包括第一连接凭证和/或第二连接凭证,所述装置还包括发送模块;
    所述发送模块用于:向所述第二设备发送所述第一连接凭证,和/或,向所述第一服务器发送所述第二连接凭证。
  62. 根据权利要求61所述的装置,其特征在于,所述第二绑定请求消息包括所述第一设备的标识,所述处理模块具体用于:
    根据所述第一设备的标识,生成所述第一连接凭证。
  63. 根据权利要求61所述的装置,其特征在于,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述处理模块具体用于:
    根据所述第一设备的标识,生成所述第一连接凭证;
    根据所述第二设备的标识,生成所述第二连接凭证。
  64. 根据权利要求61所述的装置,其特征在于,所述第二绑定请求消息包括所述第一设备的标识和所述第二设备的标识,所述处理模块具体用于:
    根据所述第一设备的标识和所述第二设备的标识,生成所述第一连接凭证;
    根据所述第一设备的标识和所述第二设备的标识,生成所述第二连接凭证。
  65. 根据权利要求60至64任一项所述的装置,其特征在于,所述第二绑定请求消息包括访问令牌;
    所述处理模块还用于:对所述访问令牌进行校验,并确定所述校验结果为校验通过。
  66. 根据权利要求60至65任一项所述的装置,其特征在于,
    所述接收模块还用于:接收所述第二设备发送的验证请求消息,所述验证请求消息包括所述第一设备的标识;
    所述发送模块还用于:向所述第二设备发送验证结果消息,所述验证结果消息用于指示所述第二服务器是否存在第一连接凭证,所述第一连接凭证与所述第一设备的标识关联。
  67. 一种通信设备,其特征在于,包括:处理器和存储器;
    所述存储器用于存储计算机执行指令;所述处理器执行所述计算机执行指令,使得所述通信设备执行如权利要求1至10任一项所述的方法,或者,执行如权利要求11至20任一项所述的方法,或者,执行如权利要求21至26任一项所述的方法,或者,执行如权利要求27至33任一项所述的方法。
  68. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当所述计算机执行指令被处理器执行时实现如权利要求1至10任一项所述的方法,或者,实现如权利要求11至20任一项所述的方法,或者,实现如权利要求21至26任一项所述的方法,或者,实现如权利要求27至33任一项所述的方法。
PCT/CN2020/092721 2020-05-27 2020-05-27 基于物联网的通信方法、装置及设备 WO2021237536A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202410366489.8A CN118118255A (zh) 2020-05-27 2020-05-27 基于物联网的通信方法、装置及设备
CN202080099164.8A CN115362664B (zh) 2020-05-27 2020-05-27 基于物联网的通信方法、装置及设备
PCT/CN2020/092721 WO2021237536A1 (zh) 2020-05-27 2020-05-27 基于物联网的通信方法、装置及设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/092721 WO2021237536A1 (zh) 2020-05-27 2020-05-27 基于物联网的通信方法、装置及设备

Publications (1)

Publication Number Publication Date
WO2021237536A1 true WO2021237536A1 (zh) 2021-12-02

Family

ID=78745434

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/092721 WO2021237536A1 (zh) 2020-05-27 2020-05-27 基于物联网的通信方法、装置及设备

Country Status (2)

Country Link
CN (2) CN118118255A (zh)
WO (1) WO2021237536A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108235283A (zh) * 2018-01-30 2018-06-29 深圳新融典科技有限公司 设备之间组网通信的方法及系统
CN108513716A (zh) * 2017-02-25 2018-09-07 华为技术有限公司 建立连接的方法和装置
CN109413120A (zh) * 2017-08-16 2019-03-01 北京小鸟听听科技有限公司 一种通信方法及装置、电子设备及服务器
CN110099461A (zh) * 2019-05-08 2019-08-06 腾讯科技(深圳)有限公司 终端之间的通信方法、装置、系统、电子设备及存储介质
US20190253844A1 (en) * 2015-07-07 2019-08-15 M87, Inc. Network methods and apparatus
CN110839271A (zh) * 2019-09-25 2020-02-25 阿里巴巴集团控股有限公司 设备连接方法、系统、平台及相应设备
CN111050379A (zh) * 2019-12-12 2020-04-21 四川爱联科技有限公司 支持多种云端服务的实现系统及方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8831568B2 (en) * 2011-09-27 2014-09-09 Qualcomm Incorporated Automatic configuration of a wireless device
US11025627B2 (en) * 2017-07-10 2021-06-01 Intel Corporation Scalable and secure resource isolation and sharing for IoT networks
CN110944035A (zh) * 2019-10-22 2020-03-31 珠海格力电器股份有限公司 一种物联网设备控制方法、系统以及可读介质
CN110972131B (zh) * 2019-10-31 2023-08-15 阿里巴巴集团控股有限公司 授权与管控方法、设备、系统及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190253844A1 (en) * 2015-07-07 2019-08-15 M87, Inc. Network methods and apparatus
CN108513716A (zh) * 2017-02-25 2018-09-07 华为技术有限公司 建立连接的方法和装置
CN109413120A (zh) * 2017-08-16 2019-03-01 北京小鸟听听科技有限公司 一种通信方法及装置、电子设备及服务器
CN108235283A (zh) * 2018-01-30 2018-06-29 深圳新融典科技有限公司 设备之间组网通信的方法及系统
CN110099461A (zh) * 2019-05-08 2019-08-06 腾讯科技(深圳)有限公司 终端之间的通信方法、装置、系统、电子设备及存储介质
CN110839271A (zh) * 2019-09-25 2020-02-25 阿里巴巴集团控股有限公司 设备连接方法、系统、平台及相应设备
CN111050379A (zh) * 2019-12-12 2020-04-21 四川爱联科技有限公司 支持多种云端服务的实现系统及方法

Also Published As

Publication number Publication date
CN115362664A (zh) 2022-11-18
CN118118255A (zh) 2024-05-31
CN115362664B (zh) 2024-04-02

Similar Documents

Publication Publication Date Title
CN101616410B (zh) 一种蜂窝移动通信网络的接入方法和系统
WO2017190616A1 (zh) 无线网络连接方法、无线接入点、服务器及系统
RU2414086C2 (ru) Аутентификация приложения
KR101438243B1 (ko) Sim 기반 인증방법
US8583794B2 (en) Apparatus, method, and computer program product for registering user address information
CN110800331A (zh) 网络验证方法、相关设备及系统
WO2019041802A1 (zh) 基于服务化架构的发现方法及装置
WO2019137030A1 (zh) 安全认证方法、相关设备及系统
JP2018529245A (ja) 認可処理方法およびデバイス
US20210120416A1 (en) Secure inter-mobile network communication
CN113518348B (zh) 业务处理方法、装置、系统及存储介质
WO2010078492A2 (en) Authentication method selection using a home enhanced node b profile
WO2013040957A1 (zh) 单点登录的方法、系统和信息处理方法、系统
US11140149B2 (en) Zero-touch bootstrap of an endpoint without admin pre-provisioning
CN117177266A (zh) 一种地址获取方法及装置
WO2023083170A1 (zh) 密钥生成方法、装置、终端设备及服务器
CN115989689A (zh) 用于边缘数据网络的用户装备认证和授权规程
KR102055911B1 (ko) 세션 연결을 위한 시그널링 방법, 그리고 이를 구현한 장치
WO2021237536A1 (zh) 基于物联网的通信方法、装置及设备
JP6153622B2 (ja) インターネットプロトコルマルチメディアサブシステム端末のネットワークへのアクセス方法及び装置
JP2006270431A (ja) 呼制御装置、端末、これらのプログラム、及び通信チャネル確立方法
WO2011131002A1 (zh) 身份管理方法及系统
WO2023208354A1 (en) Authentication of user tags obtaining communication services via i/o user devices performing user terminal emulation as a cloud computing service
JP7442690B2 (ja) 安全な通信方法、関連する装置、およびシステム
WO2016202397A1 (en) Dns based pki system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20937485

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20937485

Country of ref document: EP

Kind code of ref document: A1