WO2023184263A1 - Method and apparatus for establishing user datagram protocol (udp) transmission channel - Google Patents

Method and apparatus for establishing user datagram protocol (udp) transmission channel Download PDF

Info

Publication number
WO2023184263A1
WO2023184263A1 PCT/CN2022/084175 CN2022084175W WO2023184263A1 WO 2023184263 A1 WO2023184263 A1 WO 2023184263A1 CN 2022084175 W CN2022084175 W CN 2022084175W WO 2023184263 A1 WO2023184263 A1 WO 2023184263A1
Authority
WO
WIPO (PCT)
Prior art keywords
address information
terminal device
transmission channel
frame
udp
Prior art date
Application number
PCT/CN2022/084175
Other languages
French (fr)
Chinese (zh)
Inventor
李书珍
Original Assignee
北京小米移动软件有限公司
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 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2022/084175 priority Critical patent/WO2023184263A1/en
Priority to CN202280000848.7A priority patent/CN115280743A/en
Publication of WO2023184263A1 publication Critical patent/WO2023184263A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Definitions

  • the present disclosure relates to the technical field of the Internet of Things, and in particular to a method and device for establishing a User Datagram Protocol UDP transmission channel.
  • TCP Transmission Control Protocol
  • the present disclosure provides a method, device, electronic device and storage medium for establishing a User Datagram Protocol UDP transmission channel to at least solve the problem of long TCP connections between terminal devices and cloud servers as the number of terminal devices increases in related technologies. Increased pressure and reduced network service quality.
  • a method for establishing a User Datagram Protocol UDP transmission channel is provided, which is suitable for proxy devices, including: periodically broadcasting a detection request frame, wherein the detection request frame includes the proxy The first user identification and first address information corresponding to the device; receiving a detection response frame returned by a terminal device in the same Internet of Things as the proxy device, wherein the detection response frame includes the second user corresponding to the terminal device identification and second address information; based on the first address information and the second address information, establish a UDP local transmission channel with the terminal device.
  • a method of establishing a User Datagram Protocol UDP transmission channel is provided, which is suitable for terminal devices, including: obtaining a detection request frame periodically broadcast by a proxy device in the same Internet of Things, wherein: The detection request frame includes the first user identification and first address information corresponding to the proxy device; when it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, a detection is returned to the proxy device.
  • Response frame wherein the detection response frame includes the second user identification and the second address information of the terminal device; based on the first address information and the second address information, perform UDP link establishment with the proxy device Process to establish the UDP local transmission channel.
  • an apparatus for establishing a User Datagram Protocol UDP transmission channel which is suitable for a proxy device and includes: a broadcast module configured to perform periodic broadcast of a detection request frame, wherein the detection The request frame includes the first user identification and first address information corresponding to the proxy device; the receiving module is configured to receive a detection response frame returned by a terminal device in the same Internet of Things as the proxy device, wherein: The detection response frame includes the second user identification and second address information corresponding to the terminal device; the transmission module is configured to perform establishing UDP with the terminal device based on the first address information and the second address information. local transmission channel.
  • an apparatus for establishing a User Datagram Protocol UDP transmission channel which is suitable for terminal equipment and includes: a first acquisition module configured to perform acquisition of periodicity of agent devices in the same Internet of Things A broadcast detection request frame, wherein the detection request frame includes the first user identification and first address information corresponding to the proxy device; a return module configured to determine the first user identification and the terminal device When the corresponding second user identities are consistent, a detection response frame is returned to the proxy device, where the detection response frame includes the second user identity and the second address information of the terminal device; the transmission module is configured to perform The first address information and the second address information perform a UDP link establishment process with the proxy device to establish the UDP local transmission channel.
  • an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the instructions to Implement the method for establishing a User Datagram Protocol UDP transmission channel as described in the first aspect of this disclosure embodiment or the second aspect of this disclosure embodiment.
  • a computer-readable storage medium which when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the steps of the first embodiment of the present disclosure.
  • the method for establishing a User Datagram Protocol UDP transmission channel is described in one aspect or the second aspect of the embodiment of this disclosure.
  • the technical solution provided by the embodiments of the present disclosure at least brings the following beneficial effects: by periodically broadcasting the detection request frame and receiving the detection response frame returned by the terminal device in the same Internet of Things as the proxy device, the proxy device and the terminal device can be realized
  • the establishment of a UDP transmission channel between them enables the proxying of terminal device traffic, reduces the pressure on TCP connections between terminal devices and cloud servers, and improves network service quality.
  • Figure 1 is a flow chart of a method for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
  • Figure 2 is an interactive diagram illustrating the establishment of a UDP local transmission channel according to an exemplary embodiment.
  • Figure 3 is a flow chart of a traffic proxy method according to an exemplary embodiment.
  • Figure 3a is a schematic diagram of a traffic proxy mode according to an exemplary embodiment.
  • FIG. 4 is a flow chart of another method of establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
  • Figure 5 is a flow chart of another traffic proxy method according to an exemplary embodiment.
  • Figure 6 is an interactive diagram illustrating closing a UDP local transmission channel according to an exemplary embodiment.
  • FIG. 7 is a flow chart of another method of establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
  • Figure 8 is a flow chart of another traffic proxy method according to an exemplary embodiment.
  • Figure 9 is a block diagram of a device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
  • Figure 10 is a block diagram of another device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
  • FIG. 11 is a block diagram of an electronic device according to an exemplary embodiment.
  • Figure 1 is a flow chart of a method for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment. As shown in Figure 1, the method for establishing a User Datagram Protocol UDP transmission channel according to an embodiment of the present disclosure is performed by a proxy. Executed by the device, the method may include the following steps.
  • S101 Periodically broadcast a detection request frame, where the detection request frame includes the first user identification and first address information corresponding to the proxy device.
  • the execution subject of the method of establishing a User Datagram Protocol UDP transmission channel in the embodiment of the present disclosure is a proxy device, where the proxy device includes but is not limited to mobile phones, tablet computers, notebooks, desktop computers, vehicle-mounted terminals, and smart home appliances. wait.
  • the method for establishing a User Datagram Protocol UDP transmission channel in the embodiment of the present disclosure can be executed by the device for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure.
  • the device for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure can be configured In any proxy device, the method for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure is executed.
  • optical modems or fiber-to-the-home routers need to perform NAT (Network Address Translation) conversion for the TCP connection channels corresponding to all terminal devices connected to the router, and the operator's equipment hardware resources are limited.
  • NAT Network Address Translation
  • the more terminal devices users connect to the Internet the greater the NAT conversion pressure on optical modems or home routers, thereby reducing network quality and affecting users' Internet experience.
  • embodiments of the present disclosure propose a method of establishing a User Datagram Protocol UDP transmission channel, which uses the TCP connection channel and the UDP (User Datagram Protocol, User Datagram Protocol) local transmission channel to facilitate communication between the terminal device and the cloud server.
  • Data frames are required for transmission, so that the terminal device whose traffic is proxied no longer creates a separate TCP connection channel, thereby eliminating the NAT conversion pressure on the operator's equipment, breaking through the limit on the number of terminal devices connected to the network, and improving network service quality.
  • the proxy device periodically broadcasts the detection request frame to the terminal device, where the detection request frame is used by the proxy device to discover the terminal device under the same user name in the local area network and prepare for the establishment of the UDP local transmission channel.
  • a user identification is the UID (User Identity, User Identification Code) of the user account to which the proxy device belongs
  • the first address information is the source IP (Internet Protocol, IP address) information of the detection request frame sent by the proxy device.
  • the UID of the probe request frame has a byte length of 8.
  • broadcast refers to one-to-many information exchange.
  • one-to-one information exchange is unicast.
  • This disclosure does not place too many restrictions on the specific form of periodic broadcast by the agent device, and it can be carried out according to the actual situation. set up.
  • the proxy device can set 1 minute or 5 seconds as a cycle, and send a detection request frame to the terminal device once the set cycle is reached to meet the requirement of scheduled broadcast.
  • the probe request frame is probe_request and the probe response frame is probe_response.
  • the proxy device and the terminal device initialize and connect to the cloud server respectively, that is, establish a TCP connection channel with the server, the proxy device broadcasts to the terminal device.
  • initialization means initializing the parameters of the device and restoring the default state of the device.
  • the terminal device parses the UID field in the detection request frame. If the UID of the proxy device is the same as the UID of the terminal device itself, that is, both belong to the same user account, then the terminal device Record the source IP information of the UDP message of the received detection request frame, and return the detection response frame to the proxy device.
  • S102 Receive a detection response frame returned by the terminal device in the same Internet of Things as the proxy device, where the detection response frame includes the second user identification and second address information corresponding to the terminal device.
  • the terminal device determines that the first user identity and the second user identity are the same.
  • the second user identification is the UID of the user account to which the terminal device belongs
  • the second address information is the source IP information of the detection response frame sent by the terminal device.
  • both the proxy device and the terminal device obtain the other party's address information, that is, the source IP information. Based on the address information of the proxy device and the terminal device, in the proxy Establish a UDP local transmission channel between the device and the terminal device. That is to say, the proxy device can perform a UDP link establishment process with the terminal device based on the first address information and the second address information, thereby establishing a UDP local transmission channel.
  • the proxy device further sends a connection request frame link_request to the terminal device in the form of unicast to request the establishment of a local transmission channel.
  • the terminal device After receiving the link_request sent by the proxy device, the terminal device also returns the connection response frame link_response to the proxy device in the form of unicast. Agree to establish a local transmission channel to achieve the establishment of a local transmission channel.
  • Embodiments of the present disclosure provide a method for establishing a User Datagram Protocol UDP transmission channel.
  • the proxy device periodically broadcasts a detection request frame and receives a detection response frame returned by a terminal device in the same Internet of Things as the proxy device. Based on the first address information and second address information to establish a UDP local transmission channel with the terminal device.
  • the UDP transmission channel between the agent device and the terminal device can be established by periodically broadcasting the detection request frame and receiving the detection response frame returned by the terminal device in the same Internet of Things as the agent device, thus realizing the detection of the terminal device.
  • the proxy of device traffic reduces the pressure on TCP connections between terminal devices and cloud servers and improves network service quality.
  • FIG 3 is a flow chart of a traffic proxy method according to an exemplary embodiment, which is applicable to a proxy device. As shown in Figure 3, the traffic proxy method according to the embodiment of the present disclosure is executed by the proxy device and may include the following steps.
  • the proxy device is a central device that establishes a User Datagram Protocol UDP transmission channel for terminal devices in the Internet of Things
  • the cloud server is a cloud host that provides basic services and configurations to connected devices.
  • the proxy device A transmission control protocol TCP connection channel can be established with the cloud server for processing and forwarding of subsequent communication messages, as shown in Figure 3a.
  • S302 Establish a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things.
  • the terminal device is a device in the Internet of Things, and a User Datagram Protocol UDP local transmission channel is established between the proxy device and the terminal device in the same Internet of Things for subsequent information reception and forwarding.
  • the number of terminal devices may be one or more. It should be noted that the initial state of the proxy device is connected to the cloud server. After the terminal device establishes a UDP local transmission channel with the proxy device, it will disconnect from the cloud server, and then exchange information through the UDP local transmission channel.
  • the specific categories of terminal equipment are not too limited and can be set according to the actual situation.
  • the terminal equipment may specifically include but is not limited to air purification. devices, curtain controllers, smart door locks, etc.
  • each terminal device and the proxy device establish a local transmission channel of User Datagram Protocol UDP.
  • the terminal device no longer directly establishes a TCP connection channel with the cloud server. All traffic between the terminal device and the cloud server is handled by the proxy.
  • the device performs proxy forwarding.
  • UDP packets are used to exchange information between the proxy device and the terminal device of the proxy traffic.
  • S303 Transmit the data frames required when the terminal device communicates with the cloud server through the TCP connection channel and the UDP local transmission channel.
  • the proxy device proxies the data frames required for communication between the terminal device and the cloud server through the TCP connection channel established in step S301 and the UDP local transmission channel established in step S302.
  • the data frame is the data unit of communication data between the terminal device and the cloud server.
  • the terminal device sends the data frames required for communication to the proxy device through the UDP local transmission channel.
  • the proxy device After the proxy device receives the data frames sent by the terminal device, it sends the data frames through the TCP connection channel established with the cloud server.
  • the data frame is sent to the cloud server.
  • the cloud server receives the data frame sent by the proxy device and returns the corresponding data frame to the proxy device.
  • the proxy device After receiving the data frame returned by the cloud server, the proxy device sends it to the terminal device, thereby realizing Transmission of data frames required for communication between terminal devices and cloud servers.
  • Embodiments of the present disclosure provide a method for establishing a User Datagram Protocol UDP transmission channel.
  • the proxy device establishes a Transmission Control Protocol TCP connection channel with the cloud server, and establishes a User Datagram Protocol UDP local with one or more terminal devices in the Internet of Things.
  • Transmission channel through TCP connection channel and UDP local transmission channel, transmits the data frames required when the terminal device communicates with the cloud server.
  • the data frames required for communication between the terminal device and the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, realizing the proxy for the terminal device traffic and reducing the TCP connection between the terminal device and the cloud server. pressure, improving network service quality.
  • the probe request frame is probe_request and the probe response frame is probe_response.
  • the proxy device and the terminal device respectively initialize and connect to the cloud server, that is, establish a TCP connection channel with the server,
  • the proxy device sends the probe request frame probe_request to the terminal device in the form of broadcast.
  • initialization means initializing the parameters of the device and restoring the default state of the device.
  • the terminal device parses the UID field in the detection request frame. If the UID of the proxy device is the same as the UID of the terminal device itself, that is, both belong to the same user account, then the terminal device Record the source IP information of the UDP message of the received detection request frame, and return the detection response frame to the proxy device.
  • the proxy device parses the UID field in the detection response frame returned by the terminal device. After confirming that the UID of the proxy device is the same as the UID of the terminal device itself, the proxy device The device records the source IP of the UDP message of the received detection response frame and the unique DID (Device Identity, device identification code) of the terminal device.
  • the DID of the probe request frame can be all 0xFF, and the byte length of the DID is 8.
  • the proxy device can determine the validity of the data frame or detection response frame returned by the terminal device and process it accordingly.
  • the proxy device responds to receiving the data frame or the probe response frame, extracts a timestamp from the data frame or the probe response frame, and obtains a time difference based on the timestamp and the current time, in response to the time difference being less than or equal to the window time. , determine the data frame or detection response frame as a valid frame, process or transmit the valid frame; in response to the time difference being greater than the window time, determine the data frame or detection response frame as an invalid frame, and discard the invalid frame. It is not difficult to see that only when the time difference is less than or equal to the window time, the data frame or detection response frame sent by the terminal device received by the proxy device is valid.
  • timestamps are used to deduplicate messages and prevent replay attacks.
  • the timestamp (timestamp, ts for short) can be an international standard UNIX timestamp, and the byte length of the timestamp is 4.
  • Figure 4 is a flow chart of another method of establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment. As shown in Figure 4, the method of establishing a User Datagram Protocol UDP transmission channel according to an embodiment of the present disclosure, The following steps can be included.
  • S402. Periodically broadcast a detection request frame, where the detection request frame includes the first user identification and first address information corresponding to the proxy device.
  • the terminal device determines that the first user identity and the second user identity are the same.
  • S404 Send a key acquisition request to the cloud server based on the device identification and the second user identification.
  • the detection response frame also includes the device identification of the terminal device.
  • the device identification is the unique DID (Device Identity, device identification code) of the terminal device.
  • the key is generated by the cloud server when the terminal device binds the user account.
  • the proxy device can send a key acquisition request to the cloud server based on the device identification and the second user identification to obtain the key corresponding to the terminal device under the user account. It should be noted that one terminal device has and has only one corresponding key, and different user accounts and/or different terminal devices have different keys.
  • the proxy device can only obtain the key of the terminal device under the same user account name as the terminal device from the cloud server.
  • S405 In response to receiving the key corresponding to the second user ID returned by the cloud server, send a channel establishment request to the terminal device in a unicast manner, where the channel establishment request is used to request to establish a UDP local transmission channel with the terminal device.
  • the proxy device after receiving the key corresponding to the second user ID returned by the cloud server, the proxy device sends a channel establishment request to the terminal device in a unicast manner for requesting to establish a UDP local transmission channel with the terminal device.
  • the proxy device fails to successfully obtain the key of the terminal device corresponding to the second user ID from the cloud server, for example, the proxy device is not connected to the cloud server, the cloud server fails, etc., the proxy device will not send a channel establishment request (link_request ) to the terminal device, so that the UDP local transmission channel cannot be established. Then the terminal device will connect to the cloud server according to the normal startup process, keeping the original connection logic unchanged.
  • link_request channel establishment request
  • S406 Perform a UDP link establishment process with the terminal device based on the first address information and the second address information to establish a UDP local transmission channel.
  • steps S401 to 406 in this embodiment please refer to the relevant content records in the above embodiments, and will not be described again here.
  • the UDP local transmission channel After the UDP local transmission channel is established, if one of the address information in the proxy device and the terminal device is updated, but the UDP local transmission channel between the two is not updated synchronously, the local communication between the proxy device and the terminal device cannot be carried out. , often leading to data loss.
  • the proxy device needs to update and monitor the first address information and the second address information, promptly discover whether the address information has been updated, and reconstruct the UDP local communication path as soon as possible, which can make data transmission more secure.
  • the UDP local transmission channel is re-established based on the updated address information, that is, the link establishment process of the UDP local transmission channel is re-executed.
  • the proxy device after establishing a UDP local transmission channel, the proxy device regularly interacts with the terminal device with detection request frames and detection response frames.
  • the address information in the proxy device detection request frame is extracted.
  • the obtained address information of the proxy device is compared with the first address information. If the two comparisons are not consistent, it is determined that an address update has occurred on the proxy device.
  • the proxy device extracts the address information in the detection response frame and compares it with the second location information. If the two comparisons are not consistent, it is determined that the address update of the terminal device has occurred. That is to say, when the comparison of the first address information is not consistent and/or the comparison of the second address information is not consistent, it can be determined that the first address and/or the second address information are updated.
  • the UDP local transmission channel is re-established based on the updated address information.
  • the proxy device always sends the probe request frame probe_request in the form of broadcast regularly in the mode of establishing a User Datagram Protocol UDP transmission channel.
  • the terminal device that has established a local transmission channel with the proxy device receives the probe_request.
  • the probe response frame probe_response will also be returned in the form of unicast.
  • the proxy device and the terminal device maintain each other's IP address through the interaction of probe_request and probe_response. When the IP address of one party changes, the other party can discover and re-establish local transmission in time. aisle.
  • FIG. 5 is a flow chart of another traffic proxy method according to an exemplary embodiment. As shown in Figure 5, the traffic proxy method according to the embodiment of the present disclosure may include the following steps.
  • S502 Establish a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things.
  • steps S501 to 502 in this embodiment please refer to the relevant content records in the above embodiments, and will not be described again here.
  • the proxy device after the proxy device receives the uplink data frame sent by the terminal device through the UDP local transmission channel, it sends the uplink data frame to the cloud server through the TCP connection channel between the proxy device and the cloud server.
  • the control center agent device or cloud server
  • the message reported to the control center by this device notification is called an uplink message.
  • the uplink message here is encrypted by the terminal device. Upward news. It should be noted that when the terminal device sends an uplink message, it uses the key corresponding to the second user ID to encrypt the uplink message, and then packages the uplink message and sends it to the proxy device through the UDP local transmission channel.
  • the application layer protocol between the proxy device and the cloud server adopts the MQTT over TLS (Transport Layer Secure Message Queuing Telemetry Transmission Standard Protocol) scheme.
  • TLS Transport Layer Secure Message Queuing Telemetry Transmission Standard Protocol
  • the definition of the upstream data frame in this scheme is as follows: device/$ ⁇ DID ⁇ /up/$ ⁇ method ⁇ : Among them, the method is agreed between the cloud server and the agent device.
  • the DID is the agent device
  • the message is the uplink message of the agent device itself.
  • the DID is the terminal device
  • Agents for upstream messages from terminal devices are possible to be agreed between the cloud server and the agent device.
  • the proxy device may determine the key corresponding to the second user identification obtained from the cloud server based on the first device identification, decrypt the encrypted uplink data frame based on the key corresponding to the second user identification, and decrypt the encrypted uplink data frame based on the key corresponding to the second user identification.
  • the agent device's own key encrypts the decrypted uplink message and sends it to the cloud server.
  • the proxy device parses the DID field in the uplink data frame, and uses the key of the corresponding terminal device, that is, the key corresponding to the second user identification, to decrypt the uplink data frame.
  • S504 In response to receiving the downlink data frame sent by the cloud server through the TCP connection channel, send the downlink data frame to the terminal device through the UDP local transmission channel.
  • the proxy device after the proxy device receives the downlink data frame sent by the cloud server through the TCP connection channel, it sends the downlink data frame to the terminal device through the UDP local transmission channel.
  • the control center agents device or cloud server
  • This data frame containing the control instructions is called a downlink data frame.
  • the downlink data here The frame is the downlink data frame encrypted by the cloud server.
  • downlink data frames in the MQTT over TLS solution is as follows: device/$ ⁇ DID ⁇ /down/$ ⁇ method ⁇ : where method is agreed between the cloud server and the proxy device.
  • DID is the proxy device
  • the message is a downlink data frame sent by the cloud server to the proxy device.
  • the message is a downlink data frame of other terminal devices that the proxy device needs to process or forward on its behalf.
  • the proxy device can decrypt the encrypted downlink data frame based on the proxy device's own key, determine the key corresponding to the second user ID obtained from the cloud server based on the first device ID, and determine the key corresponding to the second user ID obtained from the cloud server based on the second user ID.
  • the key corresponding to the identifier encrypts the decrypted downlink data frame and sends it to the terminal device through the UDP local transmission channel.
  • the proxy device establishes a Transmission Control Protocol TCP connection channel with the cloud server, establishes a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things, and responds to receiving the UDP link from the terminal device.
  • the uplink data frame message sent by the local transmission channel is sent to the cloud server through the TCP connection channel.
  • the downlink data frame is sent through the UDP local transmission channel. sent to the terminal device.
  • the data frames required when the terminal device communicates with the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which can reduce the number of ports used by the cloud server, relieve the TCP connection pressure of the cloud server, and enhance the local The ability to automatically control terminal equipment.
  • the data frame is encrypted and decrypted through the key, which improves the security of the transmission and eliminates the risk of privacy leakage.
  • the UDP local transmission channel is closed.
  • the proxy device when the proxy device does not receive the probe response frame probe_response returned by the terminal device for a certain period of time, the proxy device considers that the terminal device has been lost, and thus closes the corresponding UDP local transmission channel.
  • the first preset duration is set in advance. This disclosure does not limit this too much and can be set according to actual conditions.
  • the first preset time period can be set to one hour, that is, when the proxy device does not receive a detection response frame returned by the terminal device within one hour, the UDP local transmission channel is closed.
  • broadcast a channel disconnection indication where the channel disconnection indication is used to inform the terminal device to close the UDP local transmission channel.
  • the proxy device no longer wants to proxy the data frames of the terminal device, it will exit the proxy mode.
  • the proxy device will Send unlink_notify in the form of broadcast to inform the terminal device to close the UDP local transmission channel.
  • the terminal device parses the DID and UID fields in it.
  • the terminal device will close the UDP local transmission channel and stop sending uplink data frames to the proxy device. At the same time, the terminal device will return to the initial state when it was just started and reconnect to the cloud server.
  • FIG. 7 is a schematic flowchart of a method for establishing a User Datagram Protocol UDP transmission channel according to another embodiment of the present disclosure. As shown in Figure 7, the method for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure is executed by the terminal device. The method may include the following steps:
  • S701 Obtain the detection request frame periodically broadcast by the proxy device.
  • the detection request frame includes the first user identification and first address information corresponding to the proxy device.
  • S702 When it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, return a detection response frame to the proxy device, where the detection response frame includes the second user identification and the second address information of the terminal device.
  • S703 Based on the first address information and the second address information, perform a UDP link establishment process with the proxy device to establish a UDP local transmission channel.
  • the terminal device needs to update and monitor the first address information and the second address information, promptly discover whether the address information has been updated, and reconstruct the UDP local communication path as soon as possible, which can make data transmission more secure.
  • the UDP local transmission channel is re-established based on the updated address information, that is, the link establishment process of the UDP local transmission channel is re-executed.
  • FIG 8 is a schematic flowchart of a traffic proxy method provided by another embodiment of the present disclosure.
  • the traffic proxy method of the embodiment of the present disclosure can be applied to the terminal device by the embodiment of the present disclosure.
  • the traffic proxy method according to the embodiment of the present disclosure may specifically include the following steps:
  • S801 In response to establishing a User Datagram Protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnect the first TCP connection channel with the cloud server.
  • step 801 For a detailed introduction to step 801, please refer to the relevant content recorded in the above embodiments, and will not be described again here.
  • the upstream data frames required for communication with the cloud server are transmitted through the UDP local transmission channel, and the proxy device sends the data frames to the cloud server through the TCP connection channel with the cloud server.
  • the terminal device can transmit the uplink data frame to the cloud server through the UDP local transmission channel and the proxy device, and receive the downlink data frame from the cloud server transmitted by the proxy device through the UDP local transmission channel.
  • Embodiments of the present disclosure provide a method for establishing a User Datagram Protocol UDP transmission channel.
  • a terminal device establishes a User Datagram Protocol UDP local transmission channel with a proxy device in the Internet of Things, and disconnects the first TCP connection channel with the cloud server.
  • the data frames required to communicate with the cloud server are transmitted through the UDP local transmission channel.
  • the data frames required when the terminal device communicates with the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which can reduce the number of ports used by the cloud server, relieve the TCP connection pressure of the cloud server, and enhance the local The ability to automatically control terminal equipment.
  • the terminal device stores the key corresponding to the bound second user identity.
  • the terminal device can encrypt the uplink data frame and send the encrypted uplink data frame to the proxy device through the UDP local transmission channel.
  • the proxy device can obtain the key corresponding to the second user identification from the cloud server, and then can decrypt the encrypted uplink data frame according to the key corresponding to the second user identification. Further, the proxy device encrypts the decrypted uplink data frame based on its own key and sends it to the cloud server.
  • the cloud server can send the downlink data frame to the terminal device through the TCP connection channel with the proxy device.
  • the cloud server can send the downlink data frame to the terminal device through the TCP connection channel with the proxy device.
  • the proxy device sends downlink data frames to the terminal device through the UDP local transmission channel.
  • the cloud server encrypts the downlink data frame through the key corresponding to the proxy device, obtains the encrypted downlink data frame, and sends the encrypted downlink data frame to the proxy device.
  • the proxy device performs encryption based on its own key. Decrypt and obtain the decrypted downlink data frame.
  • the decrypted downlink data frame is encrypted based on the key corresponding to the second user identification bound to the terminal device, and is sent to the terminal device through the UDP local transmission channel.
  • the terminal device receives the encrypted downlink data through the UDP local transmission channel. data frame, and decrypts the encrypted downlink data frame based on the key corresponding to the second user identification bound to the terminal device to obtain the downlink data frame.
  • the terminal device, the proxy device and the cloud server perform corresponding encryption and/or decryption processing on the data frame based on the key corresponding to the second user identification and/or the key of the proxy device itself, thereby improving the efficiency of transmission.
  • Security eliminating the risk of privacy leaks.
  • only the proxy device can obtain the key corresponding to the second user ID from the cloud server, which enhances the control capability of the proxy device and further improves the security of transmission.
  • the terminal device uses the first TCP connection channel to transfer the key corresponding to the second user ID, the second user ID and the first device ID of the terminal device. Synchronously sent to the cloud server.
  • the UDP local transmission channel After the UDP local transmission channel is established, if one of the address information in the proxy device and the terminal device is updated, but the UDP local transmission channel between the two is not updated synchronously, the local communication between the proxy device and the terminal device cannot be carried out. , often leading to data loss.
  • the terminal device needs to update and monitor the first address information and the second address information, promptly discover whether the address information has been updated, and reconstruct the UDP local communication path as soon as possible, which can make data transmission more secure.
  • the UDP local transmission channel is re-established based on the updated address information, that is, the link establishment process of the UDP local transmission channel is re-executed.
  • the terminal device after establishing a UDP local transmission channel, the terminal device regularly interacts with the proxy device with detection request frames and detection response frames.
  • the address information in the proxy device detection request frame is extracted.
  • the address information of the proxy device is compared with the first address information. If the two comparisons are not consistent, it is determined that the address update of the proxy device has occurred.
  • the proxy device extracts the address information in the detection response frame and compares it with the second location information. If the two comparisons are not consistent, it is determined that the address update of the terminal device has occurred. That is to say, when the comparison of the first address information is not consistent and/or the comparison of the second address information is not consistent, it can be determined that the first address and/or the second address information are updated.
  • the UDP local transmission channel is re-established based on the updated address information.
  • the UDP local transmission channel is closed and the first TCP connection channel between the terminal device and the cloud server is re-established.
  • the closing condition of the UDP local transmission channel includes at least one of the following: the terminal device does not receive the detection request frame broadcast by the proxy device within a preset time period; the terminal device receives the channel disconnection indication broadcast by the proxy device.
  • the channel disconnection indication includes a second device identification and a third user identification
  • closing the UDP local transmission channel includes: responding that the second device identification is the first device identification of the terminal device, and the third user identification is The second user ID bound to the terminal device closes the UDP local transmission channel.
  • the terminal device responds to establishing a User Datagram Protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnects the first TCP connection channel with the cloud server, and transmits data to the cloud server through the UDP local transmission channel.
  • Data frames required for communication Therefore, transmitting the data frames required for communication with the cloud server through the UDP local transmission channel can reduce the number of ports used by the cloud server, relieve the pressure on the cloud server for TCP connections, and improve the quality of network service.
  • FIG 9 is a block diagram of a device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
  • an apparatus 900 for establishing a User Datagram Protocol UDP transmission channel in an embodiment of the present disclosure includes a connection module 901, a first transmission module 902 and a second transmission module 903.
  • the connection module 901 is configured to establish a transmission control protocol TCP connection channel with the cloud server.
  • the first transmission module 902 is configured to establish a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things.
  • the second transmission module 903 is configured to transmit the data frames required when the terminal device communicates with the cloud server through the TCP connection channel and the UDP local transmission channel.
  • the first transmission module 902 is further configured to: periodically broadcast a detection request frame, where the detection request frame includes the first user identification and first address information corresponding to the proxy device; receive The detection response frame returned by the terminal device, where the detection response frame includes the second user identification and second address information corresponding to the terminal device; a UDP link establishment process is performed with the terminal device based on the first address information and the second address information to establish UDP local transmission channel.
  • the detection response frame also includes the device identification of the terminal device
  • the first transmission module 902 is also configured to perform: sending a key acquisition request to the cloud server based on the device identification and the second user identification; responding Upon receiving the key corresponding to the second user identification returned by the cloud server, a channel establishment request is sent to the terminal device in a unicast manner, where the channel establishment request is used to request the establishment of a UDP local transmission channel with the terminal device.
  • the second transmission module 903 is further configured to perform: in response to receiving the uplink data frame sent by the terminal device through the UDP local transmission channel, send the uplink data frame to the cloud through the TCP connection channel. server.
  • the second transmission module 903 is also configured to: respond to receiving the downlink data frame sent by the cloud server through the TCP connection channel; send the downlink data frame to the terminal through the UDP local transmission channel equipment.
  • the uplink data frame is an encrypted uplink data frame and includes a first device identification of the terminal device
  • the second transmission module 903 is further configured to perform: determining from the cloud server based on the first device identification Obtain the key corresponding to the second user ID, and decrypt the encrypted uplink data frame based on the key corresponding to the second user ID; encrypt the decrypted uplink data frame based on the proxy device's own key and send it to the cloud. server.
  • the downlink data frame is an encrypted downlink data frame and includes the first device identification of the terminal device
  • the second transmission module 903 is also configured to perform: encryption based on the key pair of the proxy device itself Decrypt the downlink data frame; determine the key corresponding to the second user identification obtained from the cloud server based on the first device identification, and encrypt the decrypted downlink data frame based on the key corresponding to the second user identification, and use UDP to The local transmission channel is sent to the terminal device.
  • the device 900 for establishing a User Datagram Protocol UDP transmission channel further includes: an acquisition module configured to execute, in response to receiving a data frame or a probe response frame, from the data frame or probe response frame. Extract the timestamp, and obtain the time difference based on the timestamp and the current time; the first determination module is configured to execute in response to the time difference being less than or equal to the window time, determine the data frame or the detection response frame as a valid frame, and process the valid frame or Transmit; the second determination module is configured to determine that the data frame or the detection response frame is an invalid frame in response to the time difference being greater than the window time, and discard the invalid frame.
  • the device 900 for establishing a User Datagram Protocol UDP transmission channel also includes: an interaction module configured to perform detection request frames and detection responses with the terminal device after establishing the UDP local transmission channel. Frame interaction;
  • the update module is configured to update the address information carried by the probe request frame and/or the probe response frame in response to each, and then re-establish the UDP local transmission channel based on the updated address information.
  • the device 900 for establishing a User Datagram Protocol UDP transmission channel also includes: a first shutdown module configured to execute a detection response that is not received from the terminal device within a first preset time period. frame, the UDP local transmission channel is closed.
  • the device 900 for establishing a User Datagram Protocol UDP transmission channel further includes: a second shutdown module configured to perform broadcasting a channel disconnection indication in response to the proxy device exiting the proxy mode, wherein the channel The disconnect indication is used to tell the terminal to close the UDP local transmission channel.
  • Embodiments of the present disclosure provide a device for establishing a User Datagram Protocol UDP transmission channel.
  • the proxy device establishes a Transmission Control Protocol TCP connection channel with the cloud server, and establishes a User Datagram Protocol UDP local with one or more terminal devices in the Internet of Things.
  • Transmission channel through TCP connection channel and UDP local transmission channel, transmits the data frames required when the terminal device communicates with the cloud server.
  • the data frames required for communication between the terminal device and the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which reduces the pressure on the TCP connection between the terminal device and the cloud server and improves network service quality.
  • FIG 10 is a block diagram of a device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
  • a device 1000 for establishing a User Datagram Protocol UDP transmission channel in an embodiment of the present disclosure includes a connection module 1001 and a transmission module 1002.
  • the connection module 1001 is configured to perform, in response to establishing a User Datagram Protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnecting the first TCP connection channel with the cloud server.
  • the transmission module 1002 is configured to transmit data frames required for communication with the cloud server through the UDP local transmission channel.
  • the transmission module 1002 is also configured to perform: transmit and transmit uplink data frames from the proxy device to the cloud server through the UDP local transmission channel; receive data from the cloud server transmitted by the proxy device through the UDP local transmission channel. Downstream data frame.
  • connection module 1001 is further configured to: obtain a detection request frame periodically broadcast by the proxy device, where the detection request frame includes the first user identification and first address information corresponding to the proxy device. ; When it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, return a detection response frame to the proxy device, where the detection response frame includes the second user identification and the second address information of the terminal device; based on the first address information and second address information, and performs the UDP link establishment process with the proxy device to establish a UDP local transmission channel.
  • the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: a sending module configured to, before establishing a UDP local transmission channel with the proxy device, based on the first TCP connection channel, The key corresponding to the second user identification, the second user identification and the first device identification of the terminal device are synchronously sent to the cloud server.
  • the transmission module 1002 is also configured to: encrypt the uplink data frame based on the key corresponding to the second user identification bound to the terminal device; and encrypt the encrypted data frame through the UDP local transmission channel. Uplink data frames are sent to the proxy device.
  • the downlink data frame is an encrypted downlink data frame
  • the transmission module 1002 is further configured to perform: receive the encrypted downlink data frame through the UDP local transmission channel, and receive the encrypted downlink data frame based on the third number bound to the terminal device.
  • the key corresponding to the two user IDs decrypts the encrypted downlink data frame.
  • the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: an acquisition module configured to extract from the received frame each time a data frame or a detection request frame is received. timestamp, and obtains the time difference based on the timestamp and the current time; the first determination module is configured to determine that the frame is a valid frame in response to the time difference being less than or equal to the window time, and process the valid frame; the second determination module, It is configured to respond to the time difference being greater than the window time, determine the frame as an invalid frame, and discard the invalid frame.
  • the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: an interaction module configured to periodically conduct detection request frames and detection responses with the proxy device after establishing the UDP local transmission channel. Interaction of frames; the update module is configured to update the address information carried in the detection request frame and/or the detection response frame in response to the detection request frame and/or the detection response frame, and then re-establish the UDP local transmission channel based on the updated address information.
  • the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: a shutdown module configured to close the UDP local transmission in response to the terminal device meeting the closing conditions of the UDP local transmission channel. channel, and re-establish the first TCP connection channel between the terminal device and the cloud server.
  • the closing condition of the UDP local transmission channel includes at least one of the following: the terminal device does not receive the detection request frame broadcast by the proxy device within a preset period of time; receives the channel disconnection indication broadcast by the proxy device .
  • the channel disconnection indication includes a second device identification and a third user identification
  • the shutdown module is further configured to perform: in response to the second device identification being the first device identification of the terminal device, If the third user ID is the second user ID bound to the terminal device, the UDP local transmission channel is closed.
  • the terminal device establishes a user datagram protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnects the first TCP connection channel with the cloud server, and transmits all communication data with the cloud server through the UDP local transmission channel. required data frame.
  • the data frames required for communication with the cloud server are transmitted through the UDP local transmission channel, which reduces the pressure on the TCP connection between the terminal device and the cloud server and improves the quality of network service.
  • FIG. 11 is a block diagram of an electronic device 1100 according to an exemplary embodiment.
  • the above-mentioned electronic device 1100 includes:
  • the memory 1101 and the processor 1102 are connected to the bus 1103 of different components (including the memory 1101 and the processor 1102).
  • the memory 1101 stores a computer program.
  • the processor 1102 executes the program, it implements the above-mentioned establishment of the user datagram protocol UDP in the embodiment of the present disclosure. Transmission channel method.
  • Bus 1103 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures.
  • these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect ( PCI) bus.
  • ISA Industry Standard Architecture
  • MAC Micro Channel Architecture
  • VESA Video Electronics Standards Association
  • PCI Peripheral Component Interconnect
  • Electronic device 1100 typically includes a variety of electronic device-readable media. These media can be any available media that can be accessed by electronic device 1100, including volatile and nonvolatile media, removable and non-removable media.
  • Memory 1101 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 1104 and/or cache memory 1105 .
  • Electronic device 1100 may further include other removable/non-removable, volatile/non-volatile computer system storage media.
  • storage system 1106 may be used to read and write to non-removable, non-volatile magnetic media (not shown in Figure 11 and commonly referred to as a "hard drive").
  • a disk drive for reading and writing removable non-volatile disks (e.g., "floppy disks"), and removable non-volatile optical disks (e.g., CD-ROM, DVD-ROM) may be provided.
  • each drive may be connected to bus 1103 through one or more data media interfaces.
  • the memory 1101 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of embodiments of the present disclosure.
  • Program modules 1107 generally perform functions and/or methods in the embodiments described in this disclosure.
  • Electronic device 1100 may also communicate with one or more external devices 1109 (e.g., keyboard, pointing device, display 1110, etc.), with one or more devices that enable a user to interact with electronic device 1100, and/or with Any device (eg, network card, modem, etc.) that enables the electronic device 1100 to communicate with one or more other computing devices. This communication may occur through an input/output (I/O) interface 1112. Furthermore, the electronic device 1100 may also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter 1113. As shown in FIG.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • network adapter 1113 communicates with other modules of electronic device 1100 through bus 1103 .
  • bus 1103 It should be understood that, although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
  • the processor 1102 executes various functional applications and data processing by running programs stored in the memory 1101 .
  • the electronic device can perform the method of establishing a User Datagram Protocol UDP transmission channel as described above, establish a Transmission Control Protocol TCP connection channel with the cloud server, and communicate with one or more terminal devices in the Internet of Things. Establish a user datagram protocol UDP local transmission channel, and transmit the data frames required when the terminal device communicates with the cloud server through the TCP connection channel and the UDP local transmission channel. As a result, the data frames required for communication between the terminal device and the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which reduces the pressure on the TCP connection between the terminal device and the cloud server and improves network service quality.
  • the present disclosure also proposes a computer-readable storage medium.
  • the electronic device when the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device can perform the method of establishing a User Datagram Protocol UDP transmission channel as described above.
  • the computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A method and apparatus for establishing a user datagram protocol (UDP) transmission channel, and an electronic device and a storage medium, which belong to the technical field of the Internet of Things. The method comprises: periodically broadcasting a probe request frame, wherein the probe request frame comprises a first user identifier and first address information that correspond to a proxy device (S101); receiving a probe response frame returned by a terminal device that is located in the same Internet of Things as the proxy device, wherein the probe response frame comprises a second user identifier and second address information that correspond to the terminal device (S102); and establishing a local UDP transmission channel between the proxy device and the terminal device on the basis of the first address information and the second address information (S103). Thus, the UDP transmission channel between the proxy device and the terminal device can be established by means of periodically broadcasting the probe request frame and by means of receiving the probe response frame returned by the terminal device that is located in the same Internet of Things as the proxy device, such that the proxy of the traffic of the terminal device is realized, the pressure of a TCP connection between the terminal device and a cloud server is reduced, and the quality of service of a network is improved.

Description

一种建立用户数据报协议UDP传输通道的方法及装置A method and device for establishing a User Datagram Protocol UDP transmission channel 技术领域Technical field
本公开涉及物联网技术领域,尤其涉及一种建立用户数据报协议UDP传输通道的方法及装置。The present disclosure relates to the technical field of the Internet of Things, and in particular to a method and device for establishing a User Datagram Protocol UDP transmission channel.
背景技术Background technique
目前,随着物联网技术的蓬勃发展,在普通家庭宽带下连网的终端设备的数量也越来越多。At present, with the vigorous development of Internet of Things technology, the number of terminal devices connected to the Internet under ordinary home broadband is also increasing.
随着终端设备的数量的增多,相应地终端设备与云服务器之间进行TCP(Transmission Control Protocol,传输控制协议)长连接的网络压力会增大,往往会降低网络服务质量。As the number of terminal devices increases, the network pressure on long TCP (Transmission Control Protocol) connections between terminal devices and cloud servers will increase, which often reduces network service quality.
发明内容Contents of the invention
本公开提供一种建立用户数据报协议UDP传输通道的方法、装置、电子设备及存储介质,以至少解决相关技术中随着终端设备的数量的增多,终端设备和云服务器之间进行TCP长连接的压力增大,降低网络服务质量的问题。The present disclosure provides a method, device, electronic device and storage medium for establishing a User Datagram Protocol UDP transmission channel to at least solve the problem of long TCP connections between terminal devices and cloud servers as the number of terminal devices increases in related technologies. Increased pressure and reduced network service quality.
本公开的技术方案如下:The technical solutions of the present disclosure are as follows:
根据本公开实施例的第一方面,提供一种建立用户数据报协议UDP传输通道的方法,适用于代理设备,包括:周期性广播探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;接收与所述代理设备处于同一物联网中的终端设备返回的探测响应帧,其中,所述探测响应帧包括所述终端设备对应的第二用户标识和第二地址信息;基于所述第一地址信息和所述第二地址信息,与所述终端设备建立UDP本地传输通道。According to a first aspect of an embodiment of the present disclosure, a method for establishing a User Datagram Protocol UDP transmission channel is provided, which is suitable for proxy devices, including: periodically broadcasting a detection request frame, wherein the detection request frame includes the proxy The first user identification and first address information corresponding to the device; receiving a detection response frame returned by a terminal device in the same Internet of Things as the proxy device, wherein the detection response frame includes the second user corresponding to the terminal device identification and second address information; based on the first address information and the second address information, establish a UDP local transmission channel with the terminal device.
根据本公开实施例的第二方面,提供一种建立用户数据报协议UDP传输通道的方法,适用于终端设备,包括:获取处于同一物联网中代理设备周期性广播的探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;确定所述第一用户标识和所述终端设备对应的第二用户标识一致时,向所述代理设备返回探测响应帧,其中,所述探测响应帧包括所述第二用户标识和终端设备的第二地址信息;基于所述第一地址信息和所述第二地址信息,与所述代理设备进行UDP建链流程,以建立所述UDP本地传输通道。According to a second aspect of the embodiment of the present disclosure, a method of establishing a User Datagram Protocol UDP transmission channel is provided, which is suitable for terminal devices, including: obtaining a detection request frame periodically broadcast by a proxy device in the same Internet of Things, wherein: The detection request frame includes the first user identification and first address information corresponding to the proxy device; when it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, a detection is returned to the proxy device. Response frame, wherein the detection response frame includes the second user identification and the second address information of the terminal device; based on the first address information and the second address information, perform UDP link establishment with the proxy device Process to establish the UDP local transmission channel.
根据本公开实施例的第三方面,提供一种建立用户数据报协议UDP传输通道的装置,适用于代理设备,包括:广播模块,被配置为执行周期性广播探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;接收模块,被配置为执行接收与所述代理设备处于同一物联网中的终端设备返回的探测响应帧,其中,所述探测响应帧包括所述终端设备对应的第二用户标识和第二地址信息;传输模块,被配置为执行基于所述第一地址信息和所述第二地址信息,与所述终端设备建立UDP本地传输通道。According to a third aspect of an embodiment of the present disclosure, an apparatus for establishing a User Datagram Protocol UDP transmission channel is provided, which is suitable for a proxy device and includes: a broadcast module configured to perform periodic broadcast of a detection request frame, wherein the detection The request frame includes the first user identification and first address information corresponding to the proxy device; the receiving module is configured to receive a detection response frame returned by a terminal device in the same Internet of Things as the proxy device, wherein: The detection response frame includes the second user identification and second address information corresponding to the terminal device; the transmission module is configured to perform establishing UDP with the terminal device based on the first address information and the second address information. local transmission channel.
根据本公开实施例的第四方面,提供一种建立用户数据报协议UDP传输通道的装置,适用于终端设备,包括:第一获取模块,被配置为执行获取处于同一物联网中代理设备周期性广播的探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;返回模块,被配置为 执行确定所述第一用户标识和所述终端设备对应的第二用户标识一致时,向所述代理设备返回探测响应帧,其中,所述探测响应帧包括所述第二用户标识和终端设备的第二地址信息;传输模块,被配置为执行基于所述第一地址信息和所述第二地址信息,与所述代理设备进行UDP建链流程,以建立所述UDP本地传输通道。According to a fourth aspect of the embodiment of the present disclosure, an apparatus for establishing a User Datagram Protocol UDP transmission channel is provided, which is suitable for terminal equipment and includes: a first acquisition module configured to perform acquisition of periodicity of agent devices in the same Internet of Things A broadcast detection request frame, wherein the detection request frame includes the first user identification and first address information corresponding to the proxy device; a return module configured to determine the first user identification and the terminal device When the corresponding second user identities are consistent, a detection response frame is returned to the proxy device, where the detection response frame includes the second user identity and the second address information of the terminal device; the transmission module is configured to perform The first address information and the second address information perform a UDP link establishment process with the proxy device to establish the UDP local transmission channel.
根据本公开实施例的第五方面,提供一种电子设备,包括:处理器;用于存储所述处理器的可执行指令的存储器;其中,所述处理器被配置为执行所述指令,以实现如本公开实施例第一方面或者本公开实施例第二方面所述的建立用户数据报协议UDP传输通道的方法。According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the instructions to Implement the method for establishing a User Datagram Protocol UDP transmission channel as described in the first aspect of this disclosure embodiment or the second aspect of this disclosure embodiment.
根据本公开实施例的第六方面,提供一种计算机可读存储介质,当所述计算机可读存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如本公开实施例第一方面或者本公开实施例第二方面所述的建立用户数据报协议UDP传输通道的方法。According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, which when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the steps of the first embodiment of the present disclosure. The method for establishing a User Datagram Protocol UDP transmission channel is described in one aspect or the second aspect of the embodiment of this disclosure.
本公开的实施例提供的技术方案至少带来以下有益效果:可通过周期性广播探测请求帧并接收与代理设备处于同一物联网中的终端设备返回的探测响应帧,实现了代理设备和终端设备之间UDP传输通道的建立,从而实现了对终端设备流量的代理,减少了终端设备和云端服务器之间进行TCP连接的压力,提高了网络服务质量。The technical solution provided by the embodiments of the present disclosure at least brings the following beneficial effects: by periodically broadcasting the detection request frame and receiving the detection response frame returned by the terminal device in the same Internet of Things as the proxy device, the proxy device and the terminal device can be realized The establishment of a UDP transmission channel between them enables the proxying of terminal device traffic, reduces the pressure on TCP connections between terminal devices and cloud servers, and improves network service quality.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The drawings herein are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the disclosure, and together with the description are used to explain the principles of the disclosure, and do not constitute undue limitations on the disclosure.
图1是根据一示例性实施例示出的一种建立用户数据报协议UDP传输通道的方法的流程图。Figure 1 is a flow chart of a method for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
图2是根据一示例性实施例示出的建立UDP本地传输通道的交互示意图。Figure 2 is an interactive diagram illustrating the establishment of a UDP local transmission channel according to an exemplary embodiment.
图3是根据一示例性实施例示出的一种流量代理方法的流程图。Figure 3 is a flow chart of a traffic proxy method according to an exemplary embodiment.
图3a是根据一示例性实施例示出的流量代理模式的示意图。Figure 3a is a schematic diagram of a traffic proxy mode according to an exemplary embodiment.
图4是根据一示例性实施例示出的另一种建立用户数据报协议UDP传输通道的方法的流程图。FIG. 4 is a flow chart of another method of establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
图5是根据一示例性实施例示出的另一种流量代理的方法的流程图。Figure 5 is a flow chart of another traffic proxy method according to an exemplary embodiment.
图6是根据一示例性实施例示出的关闭UDP本地传输通道的交互示意图。Figure 6 is an interactive diagram illustrating closing a UDP local transmission channel according to an exemplary embodiment.
图7是根据一示例性实施例示出的另一种建立用户数据报协议UDP传输通道的方法的流程图。FIG. 7 is a flow chart of another method of establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
图8是根据一示例性实施例示出的另一种流量代理方法的流程图。Figure 8 is a flow chart of another traffic proxy method according to an exemplary embodiment.
图9是根据一示例性实施例示出的一种建立用户数据报协议UDP传输通道的装置的框图。Figure 9 is a block diagram of a device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
图10是根据一示例性实施例示出的另一种建立用户数据报协议UDP传输通道的装置的框图。Figure 10 is a block diagram of another device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment.
图11是根据一示例性实施例示出的一种电子设备的框图。FIG. 11 is a block diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to allow ordinary people in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区 别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second", etc. in the description and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of the disclosure as detailed in the appended claims.
图1是根据一示例性实施例示出的一种建立用户数据报协议UDP传输通道的方法的流程图,如图1所示,本公开实施例的建立用户数据报协议UDP传输通道的方法由代理设备执行,该方法可以包括以下步骤。Figure 1 is a flow chart of a method for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment. As shown in Figure 1, the method for establishing a User Datagram Protocol UDP transmission channel according to an embodiment of the present disclosure is performed by a proxy. Executed by the device, the method may include the following steps.
S101,周期性广播探测请求帧,其中,探测请求帧中包括代理设备对应的第一用户标识和第一地址信息。S101. Periodically broadcast a detection request frame, where the detection request frame includes the first user identification and first address information corresponding to the proxy device.
需要说明的是,本公开实施例的建立用户数据报协议UDP传输通道的方法的执行主体为代理设备,其中,代理设备包括但不限于手机、平板电脑、笔记本、台式电脑、车载终端、智能家电等。本公开实施例的建立用户数据报协议UDP传输通道的方法可以由本公开实施例的建立用户数据报协议UDP传输通道的装置执行,本公开实施例的建立用户数据报协议UDP传输通道的装置可以配置在任意代理设备中,以执行本公开实施例的建立用户数据报协议UDP传输通道的方法。It should be noted that the execution subject of the method of establishing a User Datagram Protocol UDP transmission channel in the embodiment of the present disclosure is a proxy device, where the proxy device includes but is not limited to mobile phones, tablet computers, notebooks, desktop computers, vehicle-mounted terminals, and smart home appliances. wait. The method for establishing a User Datagram Protocol UDP transmission channel in the embodiment of the present disclosure can be executed by the device for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure. The device for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure can be configured In any proxy device, the method for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure is executed.
本领域可以理解的是,光猫或光纤入户路由器需要为所有接入路由器的终端设备对应的TCP连接通道进行NAT(Network Address Translation,网络地址转换)转换,而运营商的设备硬件资源有限,智能家居场景下用户连网的终端设备越多,光猫或入户路由器的NAT转换压力就越大,从而降低了网络质量,影响用户的上网体验。It can be understood in this field that optical modems or fiber-to-the-home routers need to perform NAT (Network Address Translation) conversion for the TCP connection channels corresponding to all terminal devices connected to the router, and the operator's equipment hardware resources are limited. In smart home scenarios, the more terminal devices users connect to the Internet, the greater the NAT conversion pressure on optical modems or home routers, thereby reducing network quality and affecting users' Internet experience.
基于此,本公开实施例提出了一种建立用户数据报协议UDP传输通道的方法,通过TCP连接通道和UDP(User Datagram Protocol,用户数据报协议)本地传输通道对终端设备与云服务器通信时所需数据帧进行传输,能够使流量被代理的终端设备不再单独创建TCP连接通道,从而消除运营商设备的NAT转换压力,突破终端设备连网数量限制,提高网络服务质量。Based on this, embodiments of the present disclosure propose a method of establishing a User Datagram Protocol UDP transmission channel, which uses the TCP connection channel and the UDP (User Datagram Protocol, User Datagram Protocol) local transmission channel to facilitate communication between the terminal device and the cloud server. Data frames are required for transmission, so that the terminal device whose traffic is proxied no longer creates a separate TCP connection channel, thereby eliminating the NAT conversion pressure on the operator's equipment, breaking through the limit on the number of terminal devices connected to the network, and improving network service quality.
本公开的实施例中,代理设备周期性广播探测请求帧至终端设备,其中,探测请求帧用于代理设备发现局域网内同一用户名下的终端设备,为建立UDP本地传输通道做好准备,第一用户标识为代理设备所属的用户账号的UID(User Identity,用户识别码),第一地址信息为代理设备发送的探测请求帧的源IP(Internet Protocol,IP地址)信息。可选地,探测请求帧的UID的字节长度为8。In the embodiment of the present disclosure, the proxy device periodically broadcasts the detection request frame to the terminal device, where the detection request frame is used by the proxy device to discover the terminal device under the same user name in the local area network and prepare for the establishment of the UDP local transmission channel. A user identification is the UID (User Identity, User Identification Code) of the user account to which the proxy device belongs, and the first address information is the source IP (Internet Protocol, IP address) information of the detection request frame sent by the proxy device. Optionally, the UID of the probe request frame has a byte length of 8.
需要说明的是,广播指一对多的信息交换,对应的,一对一的信息交换即为单播,本公开对代理设备周期性广播的具体形式不做过多限定,可根据实际情况进行设置。例如,代理设备可以将1分钟或5秒钟作为一个周期,到达设定周期后就向终端设备发送一次探测请求帧,以实现定时广播的需求。It should be noted that broadcast refers to one-to-many information exchange. Correspondingly, one-to-one information exchange is unicast. This disclosure does not place too many restrictions on the specific form of periodic broadcast by the agent device, and it can be carried out according to the actual situation. set up. For example, the proxy device can set 1 minute or 5 seconds as a cycle, and send a detection request frame to the terminal device once the set cycle is reached to meet the requirement of scheduled broadcast.
例如,如图2所示,探测请求帧为probe_request,探测响应帧为probe_response,代理设备和终端设备分别在初始化、连接云服务器即和服务器建立TCP连接通道后,代理设备向终端设备以广播的形式发送探测请求帧probe_request。其中,初始化即初始化设备的参数,恢复设备默认状态。For example, as shown in Figure 2, the probe request frame is probe_request and the probe response frame is probe_response. After the proxy device and the terminal device initialize and connect to the cloud server respectively, that is, establish a TCP connection channel with the server, the proxy device broadcasts to the terminal device. Send the probe request frame probe_request. Among them, initialization means initializing the parameters of the device and restoring the default state of the device.
进一步地,终端设备在接收到代理设备的探测请求帧后,对探测请求帧中的UID字段进行解析,如果代理设备的UID与终端设备自身的UID相同即两者同属一个用户账户,则终端设备记录收到的探测请求帧的UDP报文的源IP信息,并返回探测响应帧至代理设备。Further, after receiving the detection request frame from the proxy device, the terminal device parses the UID field in the detection request frame. If the UID of the proxy device is the same as the UID of the terminal device itself, that is, both belong to the same user account, then the terminal device Record the source IP information of the UDP message of the received detection request frame, and return the detection response frame to the proxy device.
S102,接收与代理设备处于同一物联网中的终端设备返回的探测响应帧,其中,探测响应帧包括终端设备对应的第二用户标识和第二地址信息。S102. Receive a detection response frame returned by the terminal device in the same Internet of Things as the proxy device, where the detection response frame includes the second user identification and second address information corresponding to the terminal device.
其中,探测响应帧由终端设备确定出第一用户标识和第二用户标识相同。In the detection response frame, the terminal device determines that the first user identity and the second user identity are the same.
本公开的实施例中,第二用户标识为终端设备所属的用户账户的UID,第二地址信息为终端设备发来的探测响应帧的源IP信息,当步骤S302的探测请求帧的第一用户标识和本步骤的探测响应帧的第二用户标识相同时即代理设备和终端设备处于同一用户账户下时,终端设备确定返回探测响应帧,代理设备对终端设备返回的探测响应帧进行接收,如图1所示,终端设备在接收到代理设备以广播的形式发送的探测请求帧probe_request后,以单播的形式向代理设备返回探测响应帧probe_response。In the embodiment of the present disclosure, the second user identification is the UID of the user account to which the terminal device belongs, and the second address information is the source IP information of the detection response frame sent by the terminal device. When the first user of the detection request frame in step S302 When the identification is the same as the second user identification of the detection response frame in this step, that is, when the proxy device and the terminal device are under the same user account, the terminal device determines to return the detection response frame, and the proxy device receives the detection response frame returned by the terminal device, such as As shown in Figure 1, after receiving the probe request frame probe_request sent by the proxy device in the form of broadcast, the terminal device returns the probe response frame probe_response to the proxy device in the form of unicast.
S103,基于第一地址信息和第二地址信息与终端设备进行UDP建链流程,以建立UDP本地传输通道。S103. Perform a UDP link establishment process with the terminal device based on the first address information and the second address information to establish a UDP local transmission channel.
本公开的实施例中,经过一轮探测请求帧和探测响应帧的信息交换,代理设备和终端设备均获得了对方的地址信息即源IP信息,基于代理设备和终端设备的地址信息,在代理设备和终端设备之间建立UDP本地传输通道。也就是说,代理设备可基于第一地址信息和第二地址信息,与终端设备进行UDP建链流程,从而建立UDP本地传输通道。代理设备以单播的形式进一步向终端设备发送连接请求帧link_request以请求建立本地传输通道,终端设备在接收到代理设备发送的link_request后,同样以单播的形式向代理设备返回连接响应帧link_response表示同意建立本地传输通道,以实现本地传输通道的建立。In the embodiment of the present disclosure, after a round of information exchange between the detection request frame and the detection response frame, both the proxy device and the terminal device obtain the other party's address information, that is, the source IP information. Based on the address information of the proxy device and the terminal device, in the proxy Establish a UDP local transmission channel between the device and the terminal device. That is to say, the proxy device can perform a UDP link establishment process with the terminal device based on the first address information and the second address information, thereby establishing a UDP local transmission channel. The proxy device further sends a connection request frame link_request to the terminal device in the form of unicast to request the establishment of a local transmission channel. After receiving the link_request sent by the proxy device, the terminal device also returns the connection response frame link_response to the proxy device in the form of unicast. Agree to establish a local transmission channel to achieve the establishment of a local transmission channel.
本公开的实施例提供的建立用户数据报协议UDP传输通道的方法,代理设备周期性广播探测请求帧,接收与代理设备处于同一物联网中的终端设备返回的探测响应帧,基于第一地址信息和第二地址信息,与终端设备建立UDP本地传输通道。由此,可通过周期性广播探测请求帧并接收与代理设备处于同一物联网中的终端设备返回的探测响应帧,实现了代理设备和终端设备之间UDP传输通道的建立,从而实现了对终端设备流量的代理,减少了终端设备和云端服务器之间进行TCP连接的压力,提高了网络服务质量。Embodiments of the present disclosure provide a method for establishing a User Datagram Protocol UDP transmission channel. The proxy device periodically broadcasts a detection request frame and receives a detection response frame returned by a terminal device in the same Internet of Things as the proxy device. Based on the first address information and second address information to establish a UDP local transmission channel with the terminal device. As a result, the UDP transmission channel between the agent device and the terminal device can be established by periodically broadcasting the detection request frame and receiving the detection response frame returned by the terminal device in the same Internet of Things as the agent device, thus realizing the detection of the terminal device. The proxy of device traffic reduces the pressure on TCP connections between terminal devices and cloud servers and improves network service quality.
图3是根据一示例性实施例示出的一种流量代理方法的流程图,适用于代理设备,如图3所示,本公开实施例的流量代理方法由代理设备执行,可以包括以下步骤。Figure 3 is a flow chart of a traffic proxy method according to an exemplary embodiment, which is applicable to a proxy device. As shown in Figure 3, the traffic proxy method according to the embodiment of the present disclosure is executed by the proxy device and may include the following steps.
S301,与云服务器建立传输控制协议TCP连接通道。S301: Establish a transmission control protocol TCP connection channel with the cloud server.
本公开的实施例中,代理设备即对处于物联网中的终端设备进行建立用户数据报协议UDP传输通道的的中枢设备,云服务器即对连接的设备提供基础服务和配置的云端主机,代理设备与云服务器可建立传输控制协议TCP连接通道,以进行后续通信消息的处理和转发,如图3a所示。In the embodiment of the present disclosure, the proxy device is a central device that establishes a User Datagram Protocol UDP transmission channel for terminal devices in the Internet of Things, and the cloud server is a cloud host that provides basic services and configurations to connected devices. The proxy device A transmission control protocol TCP connection channel can be established with the cloud server for processing and forwarding of subsequent communication messages, as shown in Figure 3a.
S302,与处于物联网中的一个或多个终端设备建立用户数据报协议UDP本地传输通道。S302: Establish a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things.
本公开的实施例中,终端设备即物联网中的设备,代理设备与处于同一物联网中的终端设备之间建立用户数据报协议UDP本地传输通道,以进行后续信息接收和转发。其中,终端设备的数量可以为一个或者多个。需要说明的是,代理设备的初始状态与云服务器连接,终端设备在与代理设备建立UDP本地传输通道后,会断开与云服务器的连接,之后通过UDP本地传输通道进行信息交互。In the embodiment of the present disclosure, the terminal device is a device in the Internet of Things, and a User Datagram Protocol UDP local transmission channel is established between the proxy device and the terminal device in the same Internet of Things for subsequent information reception and forwarding. The number of terminal devices may be one or more. It should be noted that the initial state of the proxy device is connected to the cloud server. After the terminal device establishes a UDP local transmission channel with the proxy device, it will disconnect from the cloud server, and then exchange information through the UDP local transmission channel.
还需要说明的是,本公开实施例中,对终端设备的具体类别不做过多限定,可根据实际情况进行设置,例如,继续如上图3a所示,终端设备具体可包括但不限于空气净化器、窗帘控制器、智能门锁等。在传输层上,每个终端设备与代理设备之间各自建立用户数据报协议UDP本地传输通道,则终端设备不再与云服务器直接建立TCP连接通道,所有终端设备与云服务器交互的流量由代理设备进行代理转发,在应用层上,代理设备与被代理流量的终端设备之间交换信息使用UDP报文。It should also be noted that in the embodiments of the present disclosure, the specific categories of terminal equipment are not too limited and can be set according to the actual situation. For example, as shown in Figure 3a above, the terminal equipment may specifically include but is not limited to air purification. devices, curtain controllers, smart door locks, etc. At the transport layer, each terminal device and the proxy device establish a local transmission channel of User Datagram Protocol UDP. The terminal device no longer directly establishes a TCP connection channel with the cloud server. All traffic between the terminal device and the cloud server is handled by the proxy. The device performs proxy forwarding. On the application layer, UDP packets are used to exchange information between the proxy device and the terminal device of the proxy traffic.
S303,通过TCP连接通道和UDP本地传输通道,传输终端设备与云服务器通信时所需数据帧。S303: Transmit the data frames required when the terminal device communicates with the cloud server through the TCP connection channel and the UDP local transmission channel.
本公开的实施例中,代理设备通过步骤S301建立的TCP连接通道和步骤S302建立的UDP本地传输通道对终端设备和云服务器之间通信时所需的消数据帧进行代理。其中,数据帧为终端设备与云服务器通信数据的数据单元。In the embodiment of the present disclosure, the proxy device proxies the data frames required for communication between the terminal device and the cloud server through the TCP connection channel established in step S301 and the UDP local transmission channel established in step S302. Among them, the data frame is the data unit of communication data between the terminal device and the cloud server.
作为一种可能的实现方式,终端设备通过UDP本地传输通道发送通信时所需数据帧至代理设备,代理设备接收到终端设备发送的数据帧后,通过与云服务器之间建立的TCP连接通道将该数据帧发送至云服务器,云服务器接受到代理设备发送的数据帧后返回相应的数据帧至代理设备,代理设备在接收到该云服务器返回的数据帧后将其发送至终端设备,从而实现对终端设备和云服务器之间通信时所需数据帧的传输。As a possible implementation method, the terminal device sends the data frames required for communication to the proxy device through the UDP local transmission channel. After the proxy device receives the data frames sent by the terminal device, it sends the data frames through the TCP connection channel established with the cloud server. The data frame is sent to the cloud server. The cloud server receives the data frame sent by the proxy device and returns the corresponding data frame to the proxy device. After receiving the data frame returned by the cloud server, the proxy device sends it to the terminal device, thereby realizing Transmission of data frames required for communication between terminal devices and cloud servers.
本公开的实施例提供的建立用户数据报协议UDP传输通道的方法,代理设备与云服务器建立传输控制协议TCP连接通道,与处于物联网中的一个或多个终端设备建立用户数据报协议UDP本地传输通道,通过TCP连接通道和UDP本地传输通道,传输终端设备与云服务器通信时所需数据帧。由此,可通过TCP连接通道和UDP本地传输通道对终端设备与云服务器通信时所需数据帧进行传输,实现了对终端设备流量的代理,减少了终端设备和云端服务器之间进行TCP连接的压力,提高了网络服务质量。Embodiments of the present disclosure provide a method for establishing a User Datagram Protocol UDP transmission channel. The proxy device establishes a Transmission Control Protocol TCP connection channel with the cloud server, and establishes a User Datagram Protocol UDP local with one or more terminal devices in the Internet of Things. Transmission channel, through TCP connection channel and UDP local transmission channel, transmits the data frames required when the terminal device communicates with the cloud server. As a result, the data frames required for communication between the terminal device and the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, realizing the proxy for the terminal device traffic and reducing the TCP connection between the terminal device and the cloud server. pressure, improving network service quality.
在上述实施例的基础之上,例如,如图2所示,探测请求帧为probe_request,探测响应帧为probe_response,代理设备和终端设备分别在初始化、连接云服务器即和服务器建立TCP连接通道后,代理设备向终端设备以广播的形式发送探测请求帧probe_request。其中,初始化即初始化设备的参数,恢复设备默认状态。On the basis of the above embodiments, for example, as shown in Figure 2, the probe request frame is probe_request and the probe response frame is probe_response. After the proxy device and the terminal device respectively initialize and connect to the cloud server, that is, establish a TCP connection channel with the server, The proxy device sends the probe request frame probe_request to the terminal device in the form of broadcast. Among them, initialization means initializing the parameters of the device and restoring the default state of the device.
进一步地,终端设备在接收到代理设备的探测请求帧后,对探测请求帧中的UID字段进行解析,如果代理设备的UID与终端设备自身的UID相同即两者同属一个用户账户,则终端设备记录收到的探测请求帧的UDP报文的源IP信息,并返回探测响应帧至代理设备。Further, after receiving the detection request frame from the proxy device, the terminal device parses the UID field in the detection request frame. If the UID of the proxy device is the same as the UID of the terminal device itself, that is, both belong to the same user account, then the terminal device Record the source IP information of the UDP message of the received detection request frame, and return the detection response frame to the proxy device.
需要说明的是,代理设备在接收到终端设备返回的探测响应帧后,对终端设备返回的探测响应帧中的UID字段进行解析,当确认代理设备的UID与终端设备自身的UID相同之后,代理设备记录接收到的探测响应帧的UDP报文的源IP和终端设备的唯一的DID(Device Identity,设备识别码)。可选地,探测请求帧的DID可为全0xFF,DID的字节长度为8。It should be noted that after receiving the detection response frame returned by the terminal device, the proxy device parses the UID field in the detection response frame returned by the terminal device. After confirming that the UID of the proxy device is the same as the UID of the terminal device itself, the proxy device The device records the source IP of the UDP message of the received detection response frame and the unique DID (Device Identity, device identification code) of the terminal device. Optionally, the DID of the probe request frame can be all 0xFF, and the byte length of the DID is 8.
需要说明的是,代理设备可对终端设备返回的数据帧或探测响应帧的有效性进行判断和相应的处理。It should be noted that the proxy device can determine the validity of the data frame or detection response frame returned by the terminal device and process it accordingly.
在一些实施方式中,代理设备响应于接收到数据帧或探测响应帧,从数据帧或探测响应帧中提取时间戳,并基于时间戳和当前时间,获取时间差,响应于时间差小于或者等于窗口时间,确定数据帧或探测响应帧为有效帧,对有效帧进行处理或传输;响应于时间差大于窗口时间,确定数据帧或探测响应帧 为无效帧,对无效帧进行丢弃。不难看出,只有当时间差小于或者等于窗口时间时,代理设备收到的终端设备发送的数据帧或探测响应帧才是有效的。In some embodiments, the proxy device responds to receiving the data frame or the probe response frame, extracts a timestamp from the data frame or the probe response frame, and obtains a time difference based on the timestamp and the current time, in response to the time difference being less than or equal to the window time. , determine the data frame or detection response frame as a valid frame, process or transmit the valid frame; in response to the time difference being greater than the window time, determine the data frame or detection response frame as an invalid frame, and discard the invalid frame. It is not difficult to see that only when the time difference is less than or equal to the window time, the data frame or detection response frame sent by the terminal device received by the proxy device is valid.
本领域人员可以理解的是,时间戳用于进行消息去重及防重放攻击。可选地,时间戳(timestamp,简称ts)可为国际标准UNIX时间戳,该时间戳的字节长度为4。Those in the art can understand that timestamps are used to deduplicate messages and prevent replay attacks. Optionally, the timestamp (timestamp, ts for short) can be an international standard UNIX timestamp, and the byte length of the timestamp is 4.
图4是根据一示例性实施例示出的另一种建立用户数据报协议UDP传输通道的方法的流程图,如图4所示,本公开实施例的建立用户数据报协议UDP传输通道的方法,可以包括以下步骤。Figure 4 is a flow chart of another method of establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment. As shown in Figure 4, the method of establishing a User Datagram Protocol UDP transmission channel according to an embodiment of the present disclosure, The following steps can be included.
S401,与云服务器建立传输控制协议TCP连接通道。S401: Establish a transmission control protocol TCP connection channel with the cloud server.
S402,周期性广播探测请求帧,其中,探测请求帧中包括代理设备对应的第一用户标识和第一地址信息。S402. Periodically broadcast a detection request frame, where the detection request frame includes the first user identification and first address information corresponding to the proxy device.
本实施例中的步骤S401~步骤402的介绍,可参见上述实施例中相关内容的记载,此处不再赘述。For an introduction to steps S401 to 402 in this embodiment, please refer to the relevant records in the above embodiments, and will not be described again here.
S403,接收终端设备返回的探测响应帧,其中,探测响应帧包括终端设备对应的第二用户标识和第二地址信息。S403. Receive a detection response frame returned by the terminal device, where the detection response frame includes the second user identification and second address information corresponding to the terminal device.
其中,探测响应帧由终端设备确定出第一用户标识和第二用户标识相同。In the detection response frame, the terminal device determines that the first user identity and the second user identity are the same.
本实施例中的步骤S401~步骤403的介绍,可参见上述实施例中相关内容的记载,此处不再赘述。For an introduction to steps S401 to 403 in this embodiment, please refer to the relevant records in the above embodiments and will not be described again here.
S404,基于设备标识和第二用户标识向云服务器发送密钥获取请求。S404: Send a key acquisition request to the cloud server based on the device identification and the second user identification.
本公开的实施例中,探测响应帧还包括终端设备的设备标识,设备标识为终端设备唯一的DID(Device Identity,设备识别码),密钥为终端设备绑定用户账户时由云服务器生成并下发到终端设备的Token(令牌),代理设备基于设备标识和第二用户标识可向云服务器发送密钥获取请求,以获取用户账户下的终端设备对应的密钥。需要说明的是,一个终端设备有且只有一个对应的密钥,不同用户账户和/或不同终端设备均有着不同的密钥。In the embodiment of the present disclosure, the detection response frame also includes the device identification of the terminal device. The device identification is the unique DID (Device Identity, device identification code) of the terminal device. The key is generated by the cloud server when the terminal device binds the user account. Based on the Token issued to the terminal device, the proxy device can send a key acquisition request to the cloud server based on the device identification and the second user identification to obtain the key corresponding to the terminal device under the user account. It should be noted that one terminal device has and has only one corresponding key, and different user accounts and/or different terminal devices have different keys.
需要说明的是,代理设备仅能从云服务器获取和终端设备相同用户账号名下的终端设备的密钥。It should be noted that the proxy device can only obtain the key of the terminal device under the same user account name as the terminal device from the cloud server.
S405,响应于接收到云服务器返回的第二用户标识对应的密钥,以单播方式向终端设备发送通道建立请求,其中,通道建立请求用于请求与终端设备建立UDP本地传输通道。S405: In response to receiving the key corresponding to the second user ID returned by the cloud server, send a channel establishment request to the terminal device in a unicast manner, where the channel establishment request is used to request to establish a UDP local transmission channel with the terminal device.
本公开的实施例中,代理设备在接收到云服务器返回的第二用户标识对应的密钥后,以单播方式向终端设备发送用于请求与终端设备建立UDP本地传输通道的通道建立请求。In the embodiment of the present disclosure, after receiving the key corresponding to the second user ID returned by the cloud server, the proxy device sends a channel establishment request to the terminal device in a unicast manner for requesting to establish a UDP local transmission channel with the terminal device.
如果代理设备未能从云服务器成功获取第二用户标识对应的终端设备的密钥,例如,发生代理设备未连接到云服务器、云服务器故障等情况,代理设备则不会发送通道建立请求(link_request)至终端设备,这样也就无法建立UDP本地传输通道,那么终端设备则按照正常启动流程连接云服务器,保持原有连接逻辑不变。If the proxy device fails to successfully obtain the key of the terminal device corresponding to the second user ID from the cloud server, for example, the proxy device is not connected to the cloud server, the cloud server fails, etc., the proxy device will not send a channel establishment request (link_request ) to the terminal device, so that the UDP local transmission channel cannot be established. Then the terminal device will connect to the cloud server according to the normal startup process, keeping the original connection logic unchanged.
S406,基于第一地址信息和第二地址信息与终端设备进行UDP建链流程,以建立UDP本地传输通道。S406: Perform a UDP link establishment process with the terminal device based on the first address information and the second address information to establish a UDP local transmission channel.
本实施例中的步骤S401~步骤406的介绍,可参见上述实施例中相关内容的记载,此处不再赘述。For the introduction of steps S401 to 406 in this embodiment, please refer to the relevant content records in the above embodiments, and will not be described again here.
在建立UDP本地传输通道之后,若代理设备和终端设备中的一个地址信息发生更新,而两者之间的UDP本地传输通道未进行同步更新,则代理设备与终端设备之间的本地通信无法进行,往往会导致数据丢失。After the UDP local transmission channel is established, if one of the address information in the proxy device and the terminal device is updated, but the UDP local transmission channel between the two is not updated synchronously, the local communication between the proxy device and the terminal device cannot be carried out. , often leading to data loss.
本公开实施例中,代理设备需要对第一地址信息和第二地址信息进行更新监控,以及时发现是否发生地址信息更新,尽快进行UDP本地通信道路的重建,能够使得数据的传输更加安全。响应于监测到第一地址和/或第二地址信息更新,则基于更新后地址信息对UDP本地传输通道进行重新建立,也就是重新执行UDP本地传输通道的建链流程。In this disclosed embodiment, the proxy device needs to update and monitor the first address information and the second address information, promptly discover whether the address information has been updated, and reconstruct the UDP local communication path as soon as possible, which can make data transmission more secure. In response to monitoring the update of the first address and/or the second address information, the UDP local transmission channel is re-established based on the updated address information, that is, the link establishment process of the UDP local transmission channel is re-executed.
作为一种可能的实现方式,在建立UDP本地传输通道之后,代理设备定期与终端设备进行探测请求帧和探测响应帧的交互,可选地,提取代理设备探测请求帧中的地址信息,将提取到的代理设备的地址信息与第一地址信息对比,若两者对比未一致确定代理设备发生地址更新。代理设备提取探测响应帧中的地址信息与第二地信息对比,若两者对比未一致确定终端设备发生地址更新。也就是说,当第一地址信息对比未一致和/或第二地址信息比对未一致,可以确定出第一地址和/或第二地址信息发生更新。As a possible implementation method, after establishing a UDP local transmission channel, the proxy device regularly interacts with the terminal device with detection request frames and detection response frames. Optionally, the address information in the proxy device detection request frame is extracted. The obtained address information of the proxy device is compared with the first address information. If the two comparisons are not consistent, it is determined that an address update has occurred on the proxy device. The proxy device extracts the address information in the detection response frame and compares it with the second location information. If the two comparisons are not consistent, it is determined that the address update of the terminal device has occurred. That is to say, when the comparison of the first address information is not consistent and/or the comparison of the second address information is not consistent, it can be determined that the first address and/or the second address information are updated.
进一步地,响应于探测请求帧和/或探测响应帧各自携带的地址信息更新,则基于更新后地址信息对UDP本地传输通道进行重新建立。Further, in response to the update of the address information carried by the probe request frame and/or the probe response frame, the UDP local transmission channel is re-established based on the updated address information.
例如,如上图2所示,代理设备在建立用户数据报协议UDP传输通道的模式下,始终定期以广播的形式发送探测请求帧probe_request,已与代理设备建立本地传输通道的终端设备在收到probe_request后也会以单播的形式返回探测响应帧probe_response,代理设备和终端设备通过probe_request和probe_response的交互来维护对方的IP地址,当其中一方IP地址改变时,另一方能够及时发现并重新建立本地传输通道。For example, as shown in Figure 2 above, the proxy device always sends the probe request frame probe_request in the form of broadcast regularly in the mode of establishing a User Datagram Protocol UDP transmission channel. The terminal device that has established a local transmission channel with the proxy device receives the probe_request. The probe response frame probe_response will also be returned in the form of unicast. The proxy device and the terminal device maintain each other's IP address through the interaction of probe_request and probe_response. When the IP address of one party changes, the other party can discover and re-establish local transmission in time. aisle.
图5是根据一示例性实施例示出的另一种流量代理方法的流程图,如图5所示,本公开实施例的流量代理方法,可以包括以下步骤。Figure 5 is a flow chart of another traffic proxy method according to an exemplary embodiment. As shown in Figure 5, the traffic proxy method according to the embodiment of the present disclosure may include the following steps.
S501,与云服务器建立传输控制协议TCP连接通道。S501: Establish a transmission control protocol TCP connection channel with the cloud server.
S502,与处于物联网中的一个或多个终端设备建立用户数据报协议UDP本地传输通道。S502: Establish a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things.
本实施例中的步骤S501~步骤502的介绍,可参见上述实施例中相关内容的记载,此处不再赘述。For the introduction of steps S501 to 502 in this embodiment, please refer to the relevant content records in the above embodiments, and will not be described again here.
S503,响应于接收到终端设备通过UDP本地传输通道发送的上行数据帧,通过TCP连接通道,将上行数据帧发送给云服务器。S503. In response to receiving the uplink data frame sent by the terminal device through the UDP local transmission channel, send the uplink data frame to the cloud server through the TCP connection channel.
本公开的实施例中,代理设备接收到终端设备通过UDP本地传输通道发送的上行数据帧后,通过代理设备和云服务器的TCP连接通道,将上行数据帧发送给云服务器。其中,一般情况下,终端设备的自身状态的改变会通知控制中心(代理设备或者云服务器),这种设备通知上报给控制中心的消息称为上行消息,此处的上行消息为终端设备加密后的上行消息。需要说明的是,终端设备发送上行消息时,使用第二用户标识对应的密钥加密上行消息,在将上行消息打包后通过UDP本地传输通道发送给代理设备。还需要说明的是,代理设备与云服务器的应用层协议采用MQTT over TLS(传输层安全的消息队列遥测传输标准协议)方案,该方案中对上行数据帧的定义如下:device/${DID}/up/${method}:其中,method由云服务器与代理设备约定而成,当DID为代理设备时,该消息为代理设备自身的上行消息,当DID为终端设备时,该消息为代理设备代理终端设备的上行消息。In the embodiment of the present disclosure, after the proxy device receives the uplink data frame sent by the terminal device through the UDP local transmission channel, it sends the uplink data frame to the cloud server through the TCP connection channel between the proxy device and the cloud server. Among them, under normal circumstances, the change of the terminal device's own status will notify the control center (agent device or cloud server). The message reported to the control center by this device notification is called an uplink message. The uplink message here is encrypted by the terminal device. Upward news. It should be noted that when the terminal device sends an uplink message, it uses the key corresponding to the second user ID to encrypt the uplink message, and then packages the uplink message and sends it to the proxy device through the UDP local transmission channel. It should also be noted that the application layer protocol between the proxy device and the cloud server adopts the MQTT over TLS (Transport Layer Secure Message Queuing Telemetry Transmission Standard Protocol) scheme. The definition of the upstream data frame in this scheme is as follows: device/${DID} /up/${method}: Among them, the method is agreed between the cloud server and the agent device. When the DID is the agent device, the message is the uplink message of the agent device itself. When the DID is the terminal device, the message is the agent device. Agents for upstream messages from terminal devices.
需要说明的是,本公开对代理设备发送上行数据帧至云服务器的具体方式不做过多限定,可根据实际情况进行设置。It should be noted that this disclosure does not place too many restrictions on the specific way in which the proxy device sends the uplink data frame to the cloud server, and it can be set according to the actual situation.
在一些实施方式中,代理设备可基于第一设备标识确定从云服务器获取到的第二用户标识对应的密 钥,并基于第二用户标识对应的密钥对加密上行数据帧进行解密,并基于代理设备自身的密钥对解密后的上行消息进行加密后发送给云服务器。其中,代理设备在接收到上行数据帧后,对上行数据帧中的DID字段进行解析,使用相应的终端设备的密钥即第二用户标识对应的密钥对上行数据帧进行解密。In some embodiments, the proxy device may determine the key corresponding to the second user identification obtained from the cloud server based on the first device identification, decrypt the encrypted uplink data frame based on the key corresponding to the second user identification, and decrypt the encrypted uplink data frame based on the key corresponding to the second user identification. The agent device's own key encrypts the decrypted uplink message and sends it to the cloud server. After receiving the uplink data frame, the proxy device parses the DID field in the uplink data frame, and uses the key of the corresponding terminal device, that is, the key corresponding to the second user identification, to decrypt the uplink data frame.
S504,响应于接收到云服务器通过TCP连接通道发送的下行数据帧,通过UDP本地传输通道,将下行数据帧发送给终端设备。S504: In response to receiving the downlink data frame sent by the cloud server through the TCP connection channel, send the downlink data frame to the terminal device through the UDP local transmission channel.
本公开的实施例中,代理设备接收到云服务器通过TCP连接通道发送的下行数据帧后,通过UDP本地传输通道,将下行数据帧发送给终端设备。其中,一般情况下,用户想要控制终端设备时,控制中心(代理设备或者云服务器)会给终端设备发送控制指令,这种包含控制指令的数据帧称为下行数据帧,此处的下行数据帧为云服务器加密后的下行数据帧。In the embodiment of the present disclosure, after the proxy device receives the downlink data frame sent by the cloud server through the TCP connection channel, it sends the downlink data frame to the terminal device through the UDP local transmission channel. Among them, under normal circumstances, when the user wants to control the terminal device, the control center (agent device or cloud server) will send control instructions to the terminal device. This data frame containing the control instructions is called a downlink data frame. The downlink data here The frame is the downlink data frame encrypted by the cloud server.
需要说明的是,MQTT over TLS方案中对下行数据帧的定义如下:device/${DID}/down/${method}:其中,method由云服务器与代理设备约定而成,当DID为代理设备时,该消息为云服务器发给代理设备的下行数据帧,当DID为终端设备时,该消息为代理设备需要代为处理或转发的其他终端设备的下行数据帧。It should be noted that the definition of downlink data frames in the MQTT over TLS solution is as follows: device/${DID}/down/${method}: where method is agreed between the cloud server and the proxy device. When DID is the proxy device When the DID is a terminal device, the message is a downlink data frame sent by the cloud server to the proxy device. When the DID is a terminal device, the message is a downlink data frame of other terminal devices that the proxy device needs to process or forward on its behalf.
需要说明的是,本公开对代理设备发送下行数据帧的方式不做过多限定,可根据实际情况进行设置。It should be noted that this disclosure does not place too many restrictions on the way in which the proxy device sends downlink data frames, and it can be set according to actual conditions.
在一些实施方式中,代理设备可基于代理设备自身的密钥对加密下行数据帧进行解密,基于第一设备标识确定从云服务器获取到的第二用户标识对应的密钥,并基于第二用户标识对应的密钥对解密后的下行数据帧进行加密,并通过UDP本地传输通道发送给终端设备。In some embodiments, the proxy device can decrypt the encrypted downlink data frame based on the proxy device's own key, determine the key corresponding to the second user ID obtained from the cloud server based on the first device ID, and determine the key corresponding to the second user ID obtained from the cloud server based on the second user ID. The key corresponding to the identifier encrypts the decrypted downlink data frame and sends it to the terminal device through the UDP local transmission channel.
本公开的实施例中,代理设备与云服务器建立传输控制协议TCP连接通道,与处于物联网中的一个或多个终端设备建立用户数据报协议UDP本地传输通道,响应于接收到终端设备通过UDP本地传输通道发送的上行数据帧消息,通过TCP连接通道,将上行数据帧发送给云服务器,响应于接收到云服务器通过TCP连接通道发送的下行数据帧,通过UDP本地传输通道,将下行数据帧发送给终端设备。由此,可通过TCP连接通道和UDP本地传输通道对终端设备与云服务器通信时所需数据帧进行传输,可以减少云服务器的端口的使用数量,缓解了云端服务器的TCP连接压力,增强了本地自动化控制终端设备的能力。同时,通过密钥对数据帧进行加密和解密,提高了传输的安全性,消除了隐私泄露风险。In the embodiment of the present disclosure, the proxy device establishes a Transmission Control Protocol TCP connection channel with the cloud server, establishes a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things, and responds to receiving the UDP link from the terminal device. The uplink data frame message sent by the local transmission channel is sent to the cloud server through the TCP connection channel. In response to the downlink data frame sent by the cloud server through the TCP connection channel, the downlink data frame is sent through the UDP local transmission channel. sent to the terminal device. As a result, the data frames required when the terminal device communicates with the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which can reduce the number of ports used by the cloud server, relieve the TCP connection pressure of the cloud server, and enhance the local The ability to automatically control terminal equipment. At the same time, the data frame is encrypted and decrypted through the key, which improves the security of the transmission and eliminates the risk of privacy leakage.
进一步地,关闭UDP本地传输通道的方式可以有以下两种:Furthermore, there are two ways to close the UDP local transmission channel:
一、响应于第一预设时长内未收到终端设备返回的探测响应帧,则关闭UDP本地传输通道。例如,如图6所示,当代理设备超过一定时间未收到终端设备返回的探测响应帧probe_response,代理设备则认为终端设备已经丢失,从而对相应的UDP本地传输通道进行关闭。需要说明的是,第一预设时长为事先设置,本公开对此不做过多限定,可根据实际情况进行设置。例如,可以将第一预设时长设置为一小时,即当代理设备一小时内未收到终端设备返回的探测响应帧,则关闭UDP本地传输通道。1. In response to not receiving the detection response frame returned by the terminal device within the first preset time period, the UDP local transmission channel is closed. For example, as shown in Figure 6, when the proxy device does not receive the probe response frame probe_response returned by the terminal device for a certain period of time, the proxy device considers that the terminal device has been lost, and thus closes the corresponding UDP local transmission channel. It should be noted that the first preset duration is set in advance. This disclosure does not limit this too much and can be set according to actual conditions. For example, the first preset time period can be set to one hour, that is, when the proxy device does not receive a detection response frame returned by the terminal device within one hour, the UDP local transmission channel is closed.
二、响应于代理设备退出代理模式,广播通道断开指示,其中,通道断开指示用于告知终端设备关闭UDP本地传输通道。例如,如图6所示,UDP本地传输通道建立后,如果代理设备不希望再代理终端设备的数据帧即退出代理模式,比如,代理设备出现更换、重启或故障等情况时,代理设备会以广播的形式发送unlink_notify以告知终端设备关闭UDP本地传输通道,终端设备在接收到代理设备的unlink_notify后对其中的DID和UID字段进行解析,如果DID、UID与当前跟终端设备建立UDP本地 传输通道的代理设备相匹配,终端设备则会关闭UDP本地传输通道,停止向该代理设备发送上行数据帧,同时,终端设备则退回刚启动时的初始状态,重新连接云服务器。2. In response to the proxy device exiting the proxy mode, broadcast a channel disconnection indication, where the channel disconnection indication is used to inform the terminal device to close the UDP local transmission channel. For example, as shown in Figure 6, after the UDP local transmission channel is established, if the proxy device no longer wants to proxy the data frames of the terminal device, it will exit the proxy mode. For example, when the proxy device is replaced, restarted, or malfunctions, the proxy device will Send unlink_notify in the form of broadcast to inform the terminal device to close the UDP local transmission channel. After receiving the unlink_notify from the proxy device, the terminal device parses the DID and UID fields in it. If the DID and UID are the same as the UDP local transmission channel currently established with the terminal device, If the proxy device matches, the terminal device will close the UDP local transmission channel and stop sending uplink data frames to the proxy device. At the same time, the terminal device will return to the initial state when it was just started and reconnect to the cloud server.
图7为本公开另一实施例提供的建立用户数据报协议UDP传输通道的方法的流程示意图。如图7所示,本公开实施例的建立用户数据报协议UDP传输通道的方法由终端设备执行,该方法可包括以下步骤:FIG. 7 is a schematic flowchart of a method for establishing a User Datagram Protocol UDP transmission channel according to another embodiment of the present disclosure. As shown in Figure 7, the method for establishing a User Datagram Protocol UDP transmission channel according to the embodiment of the present disclosure is executed by the terminal device. The method may include the following steps:
S701,获取代理设备周期性广播的探测请求帧。S701: Obtain the detection request frame periodically broadcast by the proxy device.
其中,探测请求帧中包括代理设备对应的第一用户标识和第一地址信息。The detection request frame includes the first user identification and first address information corresponding to the proxy device.
S702,确定第一用户标识和终端设备对应的第二用户标识一致时,向代理设备返回探测响应帧,其中,探测响应帧包括第二用户标识和终端设备的第二地址信息。S702: When it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, return a detection response frame to the proxy device, where the detection response frame includes the second user identification and the second address information of the terminal device.
S703,基于第一地址信息和第二地址信息,与代理设备进行UDP建链流程,以建立UDP本地传输通道。S703: Based on the first address information and the second address information, perform a UDP link establishment process with the proxy device to establish a UDP local transmission channel.
关于终端设备与代理设备建立UDP本地传输通道的具体过程,可参见上述实施例中相关内容的记载,此处不再赘述。Regarding the specific process of establishing a UDP local transmission channel between the terminal device and the proxy device, please refer to the relevant records in the above embodiments, and will not be described again here.
本公开实施例中,终端设备需要对第一地址信息和第二地址信息进行更新监控,以及时发现是否发生地址信息更新,尽快进行UDP本地通信道路的重建,能够使得数据的传输更加安全。响应于监测到第一地址和/或第二地址信息更新,则基于更新后地址信息对UDP本地传输通道进行重新建立,也就是重新执行UDP本地传输通道的建链流程。In this disclosed embodiment, the terminal device needs to update and monitor the first address information and the second address information, promptly discover whether the address information has been updated, and reconstruct the UDP local communication path as soon as possible, which can make data transmission more secure. In response to monitoring the update of the first address and/or the second address information, the UDP local transmission channel is re-established based on the updated address information, that is, the link establishment process of the UDP local transmission channel is re-executed.
图8为本公开另一实施例提供的流量代理方法的流程示意图。本公开实施例的流量代理方法,可由本公开实施例适用于终端设备。如图8所示,本公开实施例的流量代理方法具体可包括以下步骤:Figure 8 is a schematic flowchart of a traffic proxy method provided by another embodiment of the present disclosure. The traffic proxy method of the embodiment of the present disclosure can be applied to the terminal device by the embodiment of the present disclosure. As shown in Figure 8, the traffic proxy method according to the embodiment of the present disclosure may specifically include the following steps:
S801,响应于与处于物联网中的代理设备建立用户数据报协议UDP本地传输通道,断开与云服务器的第一TCP连接通道。S801: In response to establishing a User Datagram Protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnect the first TCP connection channel with the cloud server.
具体的,关于步骤801的具体介绍,可参加上述实施例中相关内容的记载,此处不再赘述。Specifically, for a detailed introduction to step 801, please refer to the relevant content recorded in the above embodiments, and will not be described again here.
S802,通过UDP本地传输通道传输与云服务器通信所需的数据帧。S802, transmit the data frames required for communication with the cloud server through the UDP local transmission channel.
本申请实施例中,代理设备与云服务器之间存在TCP连接通道。In the embodiment of this application, there is a TCP connection channel between the proxy device and the cloud server.
通过UDP本地传输通道传输与云服务器通信所需的上行数据帧,代理设备通过与云服务器之间的TCP连接通道,将数据帧发送给云服务器。The upstream data frames required for communication with the cloud server are transmitted through the UDP local transmission channel, and the proxy device sends the data frames to the cloud server through the TCP connection channel with the cloud server.
作为一种可能的实施方式,终端设备可以通过UDP本地传输通道传输和代理设备向云服务器传输上行数据帧,通过UDP本地传输通道接收代理设备传输的来自云服务器的下行数据帧。As a possible implementation, the terminal device can transmit the uplink data frame to the cloud server through the UDP local transmission channel and the proxy device, and receive the downlink data frame from the cloud server transmitted by the proxy device through the UDP local transmission channel.
本公开的实施例提供的建立用户数据报协议UDP传输通道的方法,终端设备与处于物联网中的代理设备建立用户数据报协议UDP本地传输通道,断开与云服务器的第一TCP连接通道,通过UDP本地传输通道传输与云服务器通信所需的数据帧。由此,可通过TCP连接通道和UDP本地传输通道对终端设备与云服务器通信时所需数据帧进行传输,可以减少云服务器的端口的使用数量,缓解了云端服务器的TCP连接压力,增强了本地自动化控制终端设备的能力。Embodiments of the present disclosure provide a method for establishing a User Datagram Protocol UDP transmission channel. A terminal device establishes a User Datagram Protocol UDP local transmission channel with a proxy device in the Internet of Things, and disconnects the first TCP connection channel with the cloud server. The data frames required to communicate with the cloud server are transmitted through the UDP local transmission channel. As a result, the data frames required when the terminal device communicates with the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which can reduce the number of ports used by the cloud server, relieve the TCP connection pressure of the cloud server, and enhance the local The ability to automatically control terminal equipment.
可选地,终端设备存储有所绑定的第二用户标识对应的密钥,终端设备可以对上行数据帧进行加密,并通过UDP本地传输通道,将加密上行数据帧发送给代理设备。相应地,代理设备可以从云服务器获取到第二用户标识对应的密钥,进而可以根据第二用户标识对应的密钥对加密上行数据帧进行解密。进一步地,代理设备基于自身的密钥对解密后的上行数据帧进行加密后发送给云服务器。Optionally, the terminal device stores the key corresponding to the bound second user identity. The terminal device can encrypt the uplink data frame and send the encrypted uplink data frame to the proxy device through the UDP local transmission channel. Correspondingly, the proxy device can obtain the key corresponding to the second user identification from the cloud server, and then can decrypt the encrypted uplink data frame according to the key corresponding to the second user identification. Further, the proxy device encrypts the decrypted uplink data frame based on its own key and sends it to the cloud server.
可选地,云服务器可以通过与代理设备之间的TCP连接通道,将下行数据帧发送给终端设备,实现中,云服务器可以通过与代理设备之间的TCP连接通道,将下行数据帧发送给代理设备,代理设备通过UDP本地传输通道将下行数据帧发送给终端设备。Optionally, the cloud server can send the downlink data frame to the terminal device through the TCP connection channel with the proxy device. In implementation, the cloud server can send the downlink data frame to the terminal device through the TCP connection channel with the proxy device. The proxy device sends downlink data frames to the terminal device through the UDP local transmission channel.
可选地,为了保证通信安全,云服务器通过代理设备对应的密钥对下行数据帧进行加密,得到加密下行数据帧,并将加密下行数据帧发送给代理设备,代理设备基于自身的密钥进行解密,得到解密后下行数据帧。进一步地,基于终端设备所绑定的第二用户标识对应的密钥对解密后下行数据帧进行加密,通过UDP本地传输通道发送至终端设备,相应地,终端设备通过UDP本地传输通道接收加密下行数据帧,并基于终端设备所绑定的第二用户标识对应的密钥对加密下行数据帧进行解密,得到下行数据帧。Optionally, in order to ensure communication security, the cloud server encrypts the downlink data frame through the key corresponding to the proxy device, obtains the encrypted downlink data frame, and sends the encrypted downlink data frame to the proxy device. The proxy device performs encryption based on its own key. Decrypt and obtain the decrypted downlink data frame. Further, the decrypted downlink data frame is encrypted based on the key corresponding to the second user identification bound to the terminal device, and is sent to the terminal device through the UDP local transmission channel. Correspondingly, the terminal device receives the encrypted downlink data through the UDP local transmission channel. data frame, and decrypts the encrypted downlink data frame based on the key corresponding to the second user identification bound to the terminal device to obtain the downlink data frame.
本公开的实施例中,终端设备、代理设备和云服务器基于第二用户标识对应的密钥和/或代理设备自身的密钥对数据帧进行相应的加密和/或解密处理,提高了传输的安全性,消除了隐私泄露的风险。此外,只有代理设备可以在云服务器获取到第二用户标识对应的密钥,增强了代理设备的控制能力,进一步提高了传输的安全性。In the embodiments of the present disclosure, the terminal device, the proxy device and the cloud server perform corresponding encryption and/or decryption processing on the data frame based on the key corresponding to the second user identification and/or the key of the proxy device itself, thereby improving the efficiency of transmission. Security, eliminating the risk of privacy leaks. In addition, only the proxy device can obtain the key corresponding to the second user ID from the cloud server, which enhances the control capability of the proxy device and further improves the security of transmission.
可选地,与处于同一物联网中代理设备建立UDP本地传输通道之前,终端设备基于第一TCP连接通道,将第二用户标识对应的密钥、第二用户标识和终端设备的第一设备标识同步发送给云服务器。Optionally, before establishing a UDP local transmission channel with the proxy device in the same Internet of Things, the terminal device uses the first TCP connection channel to transfer the key corresponding to the second user ID, the second user ID and the first device ID of the terminal device. Synchronously sent to the cloud server.
在建立UDP本地传输通道之后,若代理设备和终端设备中的一个地址信息发生更新,而两者之间的UDP本地传输通道未进行同步更新,则代理设备与终端设备之间的本地通信无法进行,往往会导致数据丢失。After the UDP local transmission channel is established, if one of the address information in the proxy device and the terminal device is updated, but the UDP local transmission channel between the two is not updated synchronously, the local communication between the proxy device and the terminal device cannot be carried out. , often leading to data loss.
本公开实施例中,终端设备需要对第一地址信息和第二地址信息进行更新监控,以及时发现是否发生地址信息更新,尽快进行UDP本地通信道路的重建,能够使得数据的传输更加安全。响应于监测到第一地址和/或第二地址信息更新,则基于更新后地址信息对UDP本地传输通道进行重新建立,也就是重新执行UDP本地传输通道的建链流程。In this disclosed embodiment, the terminal device needs to update and monitor the first address information and the second address information, promptly discover whether the address information has been updated, and reconstruct the UDP local communication path as soon as possible, which can make data transmission more secure. In response to monitoring the update of the first address and/or the second address information, the UDP local transmission channel is re-established based on the updated address information, that is, the link establishment process of the UDP local transmission channel is re-executed.
作为一种可能的实现方式,建立UDP本地传输通道之后,终端设备定期与代理设备进行探测请求帧和探测响应帧的交互,可选地,提取代理设备探测请求帧中的地址信息,将提取到的代理设备的地址信息与第一地址信息对比,若两者对比未一致确定代理设备发生地址更新。代理设备提取探测响应帧中的地址信息与第二地信息对比,若两者对比未一致确定终端设备发生地址更新。也就是说,当第一地址信息对比未一致和/或第二地址信息比对未一致,可以确定出第一地址和/或第二地址信息发生更新。As a possible implementation method, after establishing a UDP local transmission channel, the terminal device regularly interacts with the proxy device with detection request frames and detection response frames. Optionally, the address information in the proxy device detection request frame is extracted. The address information of the proxy device is compared with the first address information. If the two comparisons are not consistent, it is determined that the address update of the proxy device has occurred. The proxy device extracts the address information in the detection response frame and compares it with the second location information. If the two comparisons are not consistent, it is determined that the address update of the terminal device has occurred. That is to say, when the comparison of the first address information is not consistent and/or the comparison of the second address information is not consistent, it can be determined that the first address and/or the second address information are updated.
响应于探测请求帧和/或探测响应帧内携带的地址信息更新,则基于更新后地址信息对UDP本地传输通道进行重新建立。In response to the update of the address information carried in the probe request frame and/or the probe response frame, the UDP local transmission channel is re-established based on the updated address information.
可选地,响应于终端设备满足UDP本地传输通道的关闭条件,则关闭UDP本地传输通道,并重新建立终端设备与云服务器之间的第一TCP连接通道。Optionally, in response to the terminal device meeting the closing condition of the UDP local transmission channel, the UDP local transmission channel is closed and the first TCP connection channel between the terminal device and the cloud server is re-established.
可选地,UDP本地传输通道的关闭条件包括以下中的至少一项:预设时长内终端设备未收到代理 设备广播的探测请求帧;接收代理设备广播的通道断开指示。Optionally, the closing condition of the UDP local transmission channel includes at least one of the following: the terminal device does not receive the detection request frame broadcast by the proxy device within a preset time period; the terminal device receives the channel disconnection indication broadcast by the proxy device.
可选地,通道断开指示包括第二设备标识和第三用户标识,其中,关闭UDP本地传输通道,包括:响应于第二设备标识为终端设备的第一设备标识,且第三用户标识为终端设备所绑定的第二用户标识,则关闭UDP本地传输通道。Optionally, the channel disconnection indication includes a second device identification and a third user identification, wherein closing the UDP local transmission channel includes: responding that the second device identification is the first device identification of the terminal device, and the third user identification is The second user ID bound to the terminal device closes the UDP local transmission channel.
此处需要说明的是,上述对建立用户数据报协议UDP传输通道的方法实施例的解释说明,也适用于本公开实施例的建立用户数据报协议UDP传输通道的方法,具体过程此处不再赘述。It should be noted here that the above explanation of the method embodiment of establishing a User Datagram Protocol UDP transmission channel is also applicable to the method of establishing a User Datagram Protocol UDP transmission channel in the embodiment of the present disclosure, and the specific process will not be described here. Repeat.
本公开的实施例中,终端设备响应于与处于物联网中的代理设备建立用户数据报协议UDP本地传输通道,断开与云服务器的第一TCP连接通道,通过UDP本地传输通道传输与云服务器通信所需的数据帧。由此,通过UDP本地传输通道传输与云服务器通信所需的数据帧,可以减少云服务器的端口的使用数量,缓云服务器进行TCP连接的压力,提高了网络服务质量。In an embodiment of the present disclosure, the terminal device responds to establishing a User Datagram Protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnects the first TCP connection channel with the cloud server, and transmits data to the cloud server through the UDP local transmission channel. Data frames required for communication. Therefore, transmitting the data frames required for communication with the cloud server through the UDP local transmission channel can reduce the number of ports used by the cloud server, relieve the pressure on the cloud server for TCP connections, and improve the quality of network service.
图9是根据一示例性实施例示出的一种建立用户数据报协议UDP传输通道的装置的框图。如图9所示,本公开实施例的建立用户数据报协议UDP传输通道的装置900,包括连接模块901、第一传输模块902和第二传输模块903。Figure 9 is a block diagram of a device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment. As shown in Figure 9, an apparatus 900 for establishing a User Datagram Protocol UDP transmission channel in an embodiment of the present disclosure includes a connection module 901, a first transmission module 902 and a second transmission module 903.
连接模块901,被配置为执行与云服务器建立传输控制协议TCP连接通道。The connection module 901 is configured to establish a transmission control protocol TCP connection channel with the cloud server.
第一传输模块902,被配置为执行与处于物联网中的一个或多个终端设备建立用户数据报协议UDP本地传输通道。The first transmission module 902 is configured to establish a User Datagram Protocol UDP local transmission channel with one or more terminal devices in the Internet of Things.
第二传输模块903,被配置为执行通过TCP连接通道和UDP本地传输通道,传输终端设备与云服务器通信时所需数据帧。The second transmission module 903 is configured to transmit the data frames required when the terminal device communicates with the cloud server through the TCP connection channel and the UDP local transmission channel.
在本公开的一个实施例中,第一传输模块902,还被配置为执行:周期性广播探测请求帧,其中,探测请求帧中包括代理设备对应的第一用户标识和第一地址信息;接收终端设备返回的探测响应帧,其中,探测响应帧包括终端设备对应的第二用户标识和第二地址信息;基于第一地址信息和第二地址信息与终端设备进行UDP建链流程,以建立UDP本地传输通道。In one embodiment of the present disclosure, the first transmission module 902 is further configured to: periodically broadcast a detection request frame, where the detection request frame includes the first user identification and first address information corresponding to the proxy device; receive The detection response frame returned by the terminal device, where the detection response frame includes the second user identification and second address information corresponding to the terminal device; a UDP link establishment process is performed with the terminal device based on the first address information and the second address information to establish UDP local transmission channel.
在本公开的一个实施例中,探测响应帧还包括终端设备的设备标识,第一传输模块902,还被配置为执行:基于设备标识和第二用户标识向云服务器发送密钥获取请求;响应于接收到云服务器返回的第二用户标识对应的密钥,以单播方式向终端设备发送通道建立请求,其中,通道建立请求用于请求与终端设备建立UDP本地传输通道。In one embodiment of the present disclosure, the detection response frame also includes the device identification of the terminal device, and the first transmission module 902 is also configured to perform: sending a key acquisition request to the cloud server based on the device identification and the second user identification; responding Upon receiving the key corresponding to the second user identification returned by the cloud server, a channel establishment request is sent to the terminal device in a unicast manner, where the channel establishment request is used to request the establishment of a UDP local transmission channel with the terminal device.
在本公开的一个实施例中,第二传输模块903,还被配置为执行:响应于接收到终端设备通过UDP本地传输通道发送的上行数据帧,通过TCP连接通道,将上行数据帧发送给云服务器。In one embodiment of the present disclosure, the second transmission module 903 is further configured to perform: in response to receiving the uplink data frame sent by the terminal device through the UDP local transmission channel, send the uplink data frame to the cloud through the TCP connection channel. server.
在本公开的一个实施例中,第二传输模块903,还被配置为执行:响应于接收到云服务器通过TCP连接通道发送的下行数据帧;通过UDP本地传输通道,将下行数据帧发送给终端设备。In one embodiment of the present disclosure, the second transmission module 903 is also configured to: respond to receiving the downlink data frame sent by the cloud server through the TCP connection channel; send the downlink data frame to the terminal through the UDP local transmission channel equipment.
在本公开的一个实施例中,上行数据帧为加密上行数据帧且包括终端设备的第一设备标识,其中,第二传输模块903,还被配置为执行:基于第一设备标识确定从云服务器获取到的第二用户标识对应的密钥,并基于第二用户标识对应的密钥对加密上行数据帧进行解密;基于代理设备自身的密钥对解密后的上行数据帧进行加密后发送给云服务器。In one embodiment of the present disclosure, the uplink data frame is an encrypted uplink data frame and includes a first device identification of the terminal device, wherein the second transmission module 903 is further configured to perform: determining from the cloud server based on the first device identification Obtain the key corresponding to the second user ID, and decrypt the encrypted uplink data frame based on the key corresponding to the second user ID; encrypt the decrypted uplink data frame based on the proxy device's own key and send it to the cloud. server.
在本公开的一个实施例中,下行数据帧为加密下行数据帧且包括终端设备的第一设备标识,其中,第二传输模块903,还被配置为执行:基于代理设备自身的密钥对加密下行数据帧进行解密;基于第一设备标识确定从云服务器获取到的第二用户标识对应的密钥,并基于第二用户标识对应的密钥对解密后的下行数据帧进行加密,并通过UDP本地传输通道发送给终端设备。In one embodiment of the present disclosure, the downlink data frame is an encrypted downlink data frame and includes the first device identification of the terminal device, wherein the second transmission module 903 is also configured to perform: encryption based on the key pair of the proxy device itself Decrypt the downlink data frame; determine the key corresponding to the second user identification obtained from the cloud server based on the first device identification, and encrypt the decrypted downlink data frame based on the key corresponding to the second user identification, and use UDP to The local transmission channel is sent to the terminal device.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置900还包括:获取模块,被配置为执行响应于接收到数据帧或探测响应帧,从数据帧或探测响应帧中提取时间戳,并基于时间戳和当前时间,获取时间差;第一确定模块,被配置为执行响应于时间差小于或者等于窗口时间,确定数据帧或探测响应帧为有效帧,对有效帧进行处理或传输;第二确定模块,被配置为执行响应于时间差大于窗口时间,确定数据帧或探测响应帧为无效帧,对无效帧进行丢弃。In one embodiment of the present disclosure, the device 900 for establishing a User Datagram Protocol UDP transmission channel further includes: an acquisition module configured to execute, in response to receiving a data frame or a probe response frame, from the data frame or probe response frame. Extract the timestamp, and obtain the time difference based on the timestamp and the current time; the first determination module is configured to execute in response to the time difference being less than or equal to the window time, determine the data frame or the detection response frame as a valid frame, and process the valid frame or Transmit; the second determination module is configured to determine that the data frame or the detection response frame is an invalid frame in response to the time difference being greater than the window time, and discard the invalid frame.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置900,还包括:交互模块,被配置为执行建立UDP本地传输通道之后,定期与终端设备进行探测请求帧和探测响应帧的交互;In one embodiment of the present disclosure, the device 900 for establishing a User Datagram Protocol UDP transmission channel also includes: an interaction module configured to perform detection request frames and detection responses with the terminal device after establishing the UDP local transmission channel. Frame interaction;
更新模块,被配置为执行响应于探测请求帧和/或探测响应帧各自携带的地址信息更新,则基于更新后地址信息对UDP本地传输通道进行重新建立。The update module is configured to update the address information carried by the probe request frame and/or the probe response frame in response to each, and then re-establish the UDP local transmission channel based on the updated address information.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置900还包括:第一关闭模块,被配置为执行响应于第一预设时长内未收到终端设备返回的探测响应帧,则关闭UDP本地传输通道。In one embodiment of the present disclosure, the device 900 for establishing a User Datagram Protocol UDP transmission channel also includes: a first shutdown module configured to execute a detection response that is not received from the terminal device within a first preset time period. frame, the UDP local transmission channel is closed.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置900还包括:第二关闭模块,被配置为执行响应于代理设备退出代理模式,广播通道断开指示,其中,通道断开指示用于告知终端关闭UDP本地传输通道。In one embodiment of the present disclosure, the device 900 for establishing a User Datagram Protocol UDP transmission channel further includes: a second shutdown module configured to perform broadcasting a channel disconnection indication in response to the proxy device exiting the proxy mode, wherein the channel The disconnect indication is used to tell the terminal to close the UDP local transmission channel.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the devices in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
本公开的实施例提供的建立用户数据报协议UDP传输通道的装置,代理设备与云服务器建立传输控制协议TCP连接通道,与处于物联网中的一个或多个终端设备建立用户数据报协议UDP本地传输通道,通过TCP连接通道和UDP本地传输通道,传输终端设备与云服务器通信时所需数据帧。由此,可通过TCP连接通道和UDP本地传输通道对终端设备与云服务器通信时所需数据帧进行传输,减少了终端设备和云端服务器之间进行TCP连接的压力,提高了网络服务质量。Embodiments of the present disclosure provide a device for establishing a User Datagram Protocol UDP transmission channel. The proxy device establishes a Transmission Control Protocol TCP connection channel with the cloud server, and establishes a User Datagram Protocol UDP local with one or more terminal devices in the Internet of Things. Transmission channel, through TCP connection channel and UDP local transmission channel, transmits the data frames required when the terminal device communicates with the cloud server. As a result, the data frames required for communication between the terminal device and the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which reduces the pressure on the TCP connection between the terminal device and the cloud server and improves network service quality.
图10是根据一示例性实施例示出的一种建立用户数据报协议UDP传输通道的装置的框图。如图10所示,本公开实施例的建立用户数据报协议UDP传输通道的装置1000,包括连接模块1001和传输模块1002。Figure 10 is a block diagram of a device for establishing a User Datagram Protocol UDP transmission channel according to an exemplary embodiment. As shown in Figure 10, a device 1000 for establishing a User Datagram Protocol UDP transmission channel in an embodiment of the present disclosure includes a connection module 1001 and a transmission module 1002.
连接模块1001,被配置为执行响应于与处于物联网中的代理设备建立用户数据报协议UDP本地传输通道,断开与云服务器的第一TCP连接通道。The connection module 1001 is configured to perform, in response to establishing a User Datagram Protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnecting the first TCP connection channel with the cloud server.
传输模块1002,被配置为执行通过UDP本地传输通道传输与云服务器通信所需的数据帧。The transmission module 1002 is configured to transmit data frames required for communication with the cloud server through the UDP local transmission channel.
在本公开的一个实施例中,传输模块1002,还被配置为执行:通过UDP本地传输通道传输和代理设备向云服务器传输上行数据帧;通过UDP本地传输通道接收代理设备传输的来自云服务器的下行数 据帧。In one embodiment of the present disclosure, the transmission module 1002 is also configured to perform: transmit and transmit uplink data frames from the proxy device to the cloud server through the UDP local transmission channel; receive data from the cloud server transmitted by the proxy device through the UDP local transmission channel. Downstream data frame.
在本公开的一个实施例中,连接模块1001,还被配置为执行:获取代理设备周期性广播的探测请求帧,其中,探测请求帧中包括代理设备对应的第一用户标识和第一地址信息;确定第一用户标识和终端设备对应的第二用户标识一致时,向代理设备返回探测响应帧,其中,探测响应帧包括第二用户标识和终端设备的第二地址信息;基于第一地址信息和第二地址信息,与代理设备进行UDP建链流程,以建立UDP本地传输通道。In one embodiment of the present disclosure, the connection module 1001 is further configured to: obtain a detection request frame periodically broadcast by the proxy device, where the detection request frame includes the first user identification and first address information corresponding to the proxy device. ; When it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, return a detection response frame to the proxy device, where the detection response frame includes the second user identification and the second address information of the terminal device; based on the first address information and second address information, and performs the UDP link establishment process with the proxy device to establish a UDP local transmission channel.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置1000,还包括:发送模块,被配置为执行与代理设备建立UDP本地传输通道之前,基于第一TCP连接通道,将第二用户标识对应的密钥、第二用户标识和终端设备的第一设备标识同步发送给云服务器。In one embodiment of the present disclosure, the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: a sending module configured to, before establishing a UDP local transmission channel with the proxy device, based on the first TCP connection channel, The key corresponding to the second user identification, the second user identification and the first device identification of the terminal device are synchronously sent to the cloud server.
在本公开的一个实施例中,传输模块1002,还被配置为执行:基于终端设备所绑定的第二用户标识对应的密钥,对上行数据帧进行加密;通过UDP本地传输通道,将加密上行数据帧发送给代理设备。In one embodiment of the present disclosure, the transmission module 1002 is also configured to: encrypt the uplink data frame based on the key corresponding to the second user identification bound to the terminal device; and encrypt the encrypted data frame through the UDP local transmission channel. Uplink data frames are sent to the proxy device.
在本公开的一个实施例中,下行数据帧为加密下行数据帧,其中,传输模块1002,还被配置为执行:通过UDP本地传输通道接收加密下行数据帧,并基于终端设备所绑定的第二用户标识对应的密钥对加密下行数据帧进行解密。In one embodiment of the present disclosure, the downlink data frame is an encrypted downlink data frame, wherein the transmission module 1002 is further configured to perform: receive the encrypted downlink data frame through the UDP local transmission channel, and receive the encrypted downlink data frame based on the third number bound to the terminal device. The key corresponding to the two user IDs decrypts the encrypted downlink data frame.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置1000,还包括:获取模块,被配置为执行每接收到数据帧或探测请求帧,从接收到的该帧中提取时间戳,并基于时间戳和当前时间,获取时间差;第一确定模块,被配置为执行响应于时间差小于或者等于窗口时间,确定该帧为有效帧,对有效帧进行处理;第二确定模块,被配置为执行响应于时间差大于窗口时间,确定该帧为无效帧,对无效帧进行丢弃。In one embodiment of the present disclosure, the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: an acquisition module configured to extract from the received frame each time a data frame or a detection request frame is received. timestamp, and obtains the time difference based on the timestamp and the current time; the first determination module is configured to determine that the frame is a valid frame in response to the time difference being less than or equal to the window time, and process the valid frame; the second determination module, It is configured to respond to the time difference being greater than the window time, determine the frame as an invalid frame, and discard the invalid frame.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置1000,还包括:交互模块,被配置为执行建立UDP本地传输通道之后,定期与代理设备进行探测请求帧和探测响应帧的交互;更新模块,被配置为执行响应于探测请求帧和/或探测响应帧内携带的地址信息更新,则基于更新后地址信息对UDP本地传输通道进行重新建立。In one embodiment of the present disclosure, the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: an interaction module configured to periodically conduct detection request frames and detection responses with the proxy device after establishing the UDP local transmission channel. Interaction of frames; the update module is configured to update the address information carried in the detection request frame and/or the detection response frame in response to the detection request frame and/or the detection response frame, and then re-establish the UDP local transmission channel based on the updated address information.
在本公开的一个实施例中,该建立用户数据报协议UDP传输通道的装置1000,还包括:关闭模块,被配置为执行响应于终端设备满足UDP本地传输通道的关闭条件,则关闭UDP本地传输通道,并重新建立终端设备与云服务器之间的第一TCP连接通道。In one embodiment of the present disclosure, the device 1000 for establishing a User Datagram Protocol UDP transmission channel also includes: a shutdown module configured to close the UDP local transmission in response to the terminal device meeting the closing conditions of the UDP local transmission channel. channel, and re-establish the first TCP connection channel between the terminal device and the cloud server.
在本公开的一个实施例中,UDP本地传输通道的关闭条件包括以下中的至少一项:预设时长内终端设备未收到代理设备广播的探测请求帧;接收代理设备广播的通道断开指示。In one embodiment of the present disclosure, the closing condition of the UDP local transmission channel includes at least one of the following: the terminal device does not receive the detection request frame broadcast by the proxy device within a preset period of time; receives the channel disconnection indication broadcast by the proxy device .
在本公开的一个实施例中,通道断开指示包括第二设备标识和第三用户标识,其中,关闭模块,还被配置为执行:响应于第二设备标识为终端设备的第一设备标识,且第三用户标识为终端设备所绑定的第二用户标识,则关闭UDP本地传输通道。In one embodiment of the present disclosure, the channel disconnection indication includes a second device identification and a third user identification, wherein the shutdown module is further configured to perform: in response to the second device identification being the first device identification of the terminal device, If the third user ID is the second user ID bound to the terminal device, the UDP local transmission channel is closed.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the devices in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
本公开的实施例中,终端设备与处于物联网中的代理设备建立用户数据报协议UDP本地传输通道,断开与云服务器的第一TCP连接通道,通过UDP本地传输通道传输与云服务器通信所需的数据帧。由 此,通过UDP本地传输通道传输与云服务器通信所需数据帧,减少了终端设备和云端服务器之间进行TCP连接的压力,提高了网络服务质量。In the embodiment of the present disclosure, the terminal device establishes a user datagram protocol UDP local transmission channel with the proxy device in the Internet of Things, disconnects the first TCP connection channel with the cloud server, and transmits all communication data with the cloud server through the UDP local transmission channel. required data frame. As a result, the data frames required for communication with the cloud server are transmitted through the UDP local transmission channel, which reduces the pressure on the TCP connection between the terminal device and the cloud server and improves the quality of network service.
图11是根据一示例性实施例示出的一种电子设备1100的框图。FIG. 11 is a block diagram of an electronic device 1100 according to an exemplary embodiment.
如图11所示,上述电子设备1100包括:As shown in Figure 11, the above-mentioned electronic device 1100 includes:
存储器1101及处理器1102,连接不同组件(包括存储器1101和处理器1102)的总线1103,存储器1101存储有计算机程序,当处理器1102执行程序时实现本公开实施例上述的建立用户数据报协议UDP传输通道的方法。The memory 1101 and the processor 1102 are connected to the bus 1103 of different components (including the memory 1101 and the processor 1102). The memory 1101 stores a computer program. When the processor 1102 executes the program, it implements the above-mentioned establishment of the user datagram protocol UDP in the embodiment of the present disclosure. Transmission channel method.
总线1103表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。 Bus 1103 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect ( PCI) bus.
电子设备1100典型地包括多种电子设备可读介质。这些介质可以是任何能够被电子设备1100访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。 Electronic device 1100 typically includes a variety of electronic device-readable media. These media can be any available media that can be accessed by electronic device 1100, including volatile and nonvolatile media, removable and non-removable media.
存储器1101还可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)1104和/或高速缓存存储器1105。电子设备1100可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统1106可以用于读写不可移动的、非易失性磁介质(图11未显示,通常称为“硬盘驱动器”)。尽管图11中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线1103相连。存储器1101可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本公开各实施例的功能。 Memory 1101 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 1104 and/or cache memory 1105 . Electronic device 1100 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, storage system 1106 may be used to read and write to non-removable, non-volatile magnetic media (not shown in Figure 11 and commonly referred to as a "hard drive"). Although not shown in FIG. 11, a disk drive for reading and writing removable non-volatile disks (e.g., "floppy disks"), and removable non-volatile optical disks (e.g., CD-ROM, DVD-ROM) may be provided. or other optical media) that can read and write optical disc drives. In these cases, each drive may be connected to bus 1103 through one or more data media interfaces. The memory 1101 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of embodiments of the present disclosure.
具有一组(至少一个)程序模块1107的程序/实用工具1108,可以存储在例如存储器1101中,这样的程序模块1107包括——但不限于——操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块1107通常执行本公开所描述的实施例中的功能和/或方法。A program/utility 1108 having a set of (at least one) program modules 1107 , which may be stored, for example, in memory 1101 , such program modules 1107 including but not limited to an operating system, one or more applications, other programs Modules, as well as program data, each of these examples or some combination may include an implementation of a network environment. Program modules 1107 generally perform functions and/or methods in the embodiments described in this disclosure.
电子设备1100也可以与一个或多个外部设备1109(例如键盘、指向设备、显示器1110等)通信,还可与一个或者多个使得用户能与该电子设备1100交互的设备通信,和/或与使得该电子设备1100能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1112进行。并且,电子设备1100还可以通过网络适配器1113与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图11所示,网络适配器1113通过总线1103与电子设备1100的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备1100使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。 Electronic device 1100 may also communicate with one or more external devices 1109 (e.g., keyboard, pointing device, display 1110, etc.), with one or more devices that enable a user to interact with electronic device 1100, and/or with Any device (eg, network card, modem, etc.) that enables the electronic device 1100 to communicate with one or more other computing devices. This communication may occur through an input/output (I/O) interface 1112. Furthermore, the electronic device 1100 may also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter 1113. As shown in FIG. 11 , network adapter 1113 communicates with other modules of electronic device 1100 through bus 1103 . It should be understood that, although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
处理器1102通过运行存储在存储器1101中的程序,从而执行各种功能应用以及数据处理。The processor 1102 executes various functional applications and data processing by running programs stored in the memory 1101 .
需要说明的是,本实施例的电子设备的实施过程和技术原理参见前述对本公开实施例的建立用户数据报协议UDP传输通道的方法的解释说明,此处不再赘述。It should be noted that, for the implementation process and technical principles of the electronic device of this embodiment, please refer to the aforementioned explanation of the method of establishing a User Datagram Protocol UDP transmission channel in this embodiment of the present disclosure, and will not be described again here.
本公开实施例提供的电子设备,可以执行如前所述的建立用户数据报协议UDP传输通道的方法,与云服务器建立传输控制协议TCP连接通道,与处于物联网中的一个或多个终端设备建立用户数据报协议UDP本地传输通道,通过TCP连接通道和UDP本地传输通道,传输终端设备与云服务器通信时所需数据帧。由此,可通过TCP连接通道和UDP本地传输通道对终端设备与云服务器通信时所需数据帧进行传输,减少了终端设备和云端服务器之间进行TCP连接的压力,提高了网络服务质量。The electronic device provided by the embodiment of the present disclosure can perform the method of establishing a User Datagram Protocol UDP transmission channel as described above, establish a Transmission Control Protocol TCP connection channel with the cloud server, and communicate with one or more terminal devices in the Internet of Things. Establish a user datagram protocol UDP local transmission channel, and transmit the data frames required when the terminal device communicates with the cloud server through the TCP connection channel and the UDP local transmission channel. As a result, the data frames required for communication between the terminal device and the cloud server can be transmitted through the TCP connection channel and the UDP local transmission channel, which reduces the pressure on the TCP connection between the terminal device and the cloud server and improves network service quality.
为了实现上述实施例,本公开还提出一种计算机可读存储介质。In order to implement the above embodiments, the present disclosure also proposes a computer-readable storage medium.
其中,该计算机可读存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如前所述的建立用户数据报协议UDP传输通道的方法。可选的,计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。Wherein, when the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device can perform the method of establishing a User Datagram Protocol UDP transmission channel as described above. Optionally, the computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common common sense or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.

Claims (36)

  1. 一种建立用户数据报协议UDP传输通道的方法,其特征在于,适用于代理设备,所述方法包括:A method for establishing a User Datagram Protocol UDP transmission channel, which is characterized in that it is suitable for proxy equipment, and the method includes:
    周期性广播探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;Periodically broadcast a detection request frame, wherein the detection request frame includes the first user identification and first address information corresponding to the proxy device;
    接收与所述代理设备处于同一物联网中的终端设备返回的探测响应帧,其中,所述探测响应帧包括所述终端设备对应的第二用户标识和第二地址信息;Receive a detection response frame returned by a terminal device in the same Internet of Things as the proxy device, where the detection response frame includes a second user identification and second address information corresponding to the terminal device;
    基于所述第一地址信息和所述第二地址信息,与所述终端设备建立UDP本地传输通道。Based on the first address information and the second address information, a UDP local transmission channel is established with the terminal device.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述第一地址信息和所述第二地址信息,与所述终端设备建立UDP本地传输通道,包括:The method of claim 1, wherein establishing a UDP local transmission channel with the terminal device based on the first address information and the second address information includes:
    基于所述第一地址信息和所述第二地址信息,与所述终端设备进行UDP建链流程,以建立所述UDP本地传输通道。Based on the first address information and the second address information, a UDP link establishment process is performed with the terminal device to establish the UDP local transmission channel.
  3. 根据权利要求2所述的方法,其特征在于,所述探测响应帧还包括所述终端设备的第一设备标识,所述基于所述第一地址信息和所述第二地址信息与所述终端设备进行UDP建链流程,以建立所述UDP本地传输通道,包括:The method of claim 2, wherein the detection response frame further includes a first device identification of the terminal device, and the detection response frame is based on the first address information and the second address information and the terminal device. The device performs the UDP link establishment process to establish the UDP local transmission channel, including:
    基于所述设备标识和所述第二用户标识向所述云服务器发送密钥获取请求;Send a key acquisition request to the cloud server based on the device identification and the second user identification;
    响应于接收到所述云服务器返回的所述第二用户标识对应的密钥,以单播方式向所述终端设备发送通道建立请求,其中,所述通道建立请求用于请求与所述终端设备建立UDP本地传输通道。In response to receiving the key corresponding to the second user identification returned by the cloud server, sending a channel establishment request to the terminal device in a unicast manner, wherein the channel establishment request is used to request communication with the terminal device. Establish a UDP local transmission channel.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    响应于接收到所述探测响应帧,从所述探测响应帧中提取时间戳,并基于所述时间戳和当前时间,获取时间差;In response to receiving the probe response frame, extract a timestamp from the probe response frame, and obtain a time difference based on the timestamp and the current time;
    响应于所述时间差小于或者等于窗口时间,确定所述探测响应帧为有效帧,从所述有效帧中获取所述第二地址信息;In response to the time difference being less than or equal to the window time, determining the detection response frame to be a valid frame, and obtaining the second address information from the valid frame;
    响应于所述时间差大于所述窗口时间,确定所述探测响应帧为无效帧,对所述无效帧进行丢弃。In response to the time difference being greater than the window time, it is determined that the detection response frame is an invalid frame, and the invalid frame is discarded.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述建立所述UDP本地传输通道之后,还包括:The method according to any one of claims 1 to 4, characterized in that after establishing the UDP local transmission channel, it further includes:
    对所述第一地址信息和所述第二地址信息进行更新监控;Perform update monitoring on the first address information and the second address information;
    响应于监测到所述第一地址和/或所述第二地址信息更新,则基于更新后地址信息对所述UDP本地传输通道进行重新建立。In response to monitoring that the first address and/or the second address information are updated, the UDP local transmission channel is re-established based on the updated address information.
  6. 根据权利要求5所述的方法,其特征在于,所述对所述第一地址信息和所述第二地址信息进行 更新监控,包括:The method according to claim 5, characterized in that the update monitoring of the first address information and the second address information includes:
    周期性与所述终端设备进行所述探测请求帧和所述探测响应帧的交互;Periodically interact with the terminal device with the detection request frame and the detection response frame;
    提取所述探测请求帧中的地址信息与所述第一地址信息对比;Extract the address information in the detection request frame and compare it with the first address information;
    提取所述探测响应帧中的地址信息与所述第二地信息对比;Extract the address information in the detection response frame and compare it with the second location information;
    响应于所述第一地址信息对比未一致和/或所述第二地址信息比对未一致,则确定所述第一地址和/或所述第二地址信息发生更新。In response to the comparison of the first address information being inconsistent and/or the comparison of the second address information being inconsistent, it is determined that the first address and/or the second address information are updated.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6, further comprising:
    响应于第一预设时长内未收到所述终端设备返回的所述探测响应帧,则关闭所述UDP本地传输通道。In response to not receiving the detection response frame returned by the terminal device within the first preset time period, the UDP local transmission channel is closed.
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    响应于所述代理设备退出代理模式,广播通道断开指示,其中,所述通道断开指示用于告知所述终端关闭所述UDP本地传输通道。In response to the proxy device exiting the proxy mode, a channel disconnection indication is broadcast, where the channel disconnection indication is used to inform the terminal to close the UDP local transmission channel.
  9. 一种建立UDP传输通道方法,其特征在于,适用于终端设备,所述方法包括:A method for establishing a UDP transmission channel, characterized in that it is suitable for terminal equipment, and the method includes:
    获取处于同一物联网中代理设备周期性广播的探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;Obtain a detection request frame periodically broadcast by a proxy device in the same Internet of Things, where the detection request frame includes the first user identification and first address information corresponding to the proxy device;
    确定所述第一用户标识和所述终端设备对应的第二用户标识一致时,向所述代理设备返回探测响应帧,其中,所述探测响应帧包括所述第二用户标识和终端设备的第二地址信息;When it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, a detection response frame is returned to the proxy device, wherein the detection response frame includes the second user identification and the third user identification of the terminal device. 2. Address information;
    基于所述第一地址信息和所述第二地址信息,与所述代理设备进行UDP建链流程,以建立所述UDP本地传输通道。Based on the first address information and the second address information, a UDP link establishment process is performed with the proxy device to establish the UDP local transmission channel.
  10. 根据权利要求9所述的方法,其特征在于,所述建立所述UDP本地传输通道后,所述方法还包括:The method according to claim 9, characterized in that after establishing the UDP local transmission channel, the method further includes:
    断开与云服务器之间的第一TCP连接通道。Disconnect the first TCP connection channel with the cloud server.
  11. 根据权利要求9所述的方法,其特征在于,所述获取处于同一物联网中代理设备周期性广播的探测请求帧之前,还包括:The method according to claim 9, characterized in that, before obtaining the detection request frame periodically broadcast by the proxy device in the same Internet of Things, it further includes:
    基于所述第一TCP连接通道,将所述第二用户标识对应的密钥、所述第二用户标识和所述终端设备的第一设备标识同步发送给所述云服务器。Based on the first TCP connection channel, the key corresponding to the second user identification, the second user identification and the first device identification of the terminal device are synchronously sent to the cloud server.
  12. 根据权利要求9-11任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 9-11, characterized in that the method further includes:
    每接收到所述探测请求帧,从接收到的所述探测请求帧中提取时间戳,并基于所述时间戳和当前时间,获取时间差;Each time the detection request frame is received, extract a timestamp from the received detection request frame, and obtain the time difference based on the timestamp and the current time;
    响应于所述时间差小于或者等于窗口时间,确定所述探测请求帧为有效帧,从所述有效帧中提取所述第一地址信息;In response to the time difference being less than or equal to the window time, determining the detection request frame to be a valid frame, and extracting the first address information from the valid frame;
    响应于所述时间差大于所述窗口时间,确定所述探测请求帧为无效帧,对所述无效帧进行丢弃。In response to the time difference being greater than the window time, it is determined that the detection request frame is an invalid frame, and the invalid frame is discarded.
  13. 根据权利要求12所述的方法,其特征在于,所述建立所述UDP本地传输通道之后,还包括:The method according to claim 12, characterized in that after establishing the UDP local transmission channel, it further includes:
    对所述第一地址信息和所述第二地址信息进行更新监控;Perform update monitoring on the first address information and the second address information;
    响应于监测到所述第一地址和/或所述第二地址信息更新,则基于更新后地址信息对所述UDP本地传输通道进行重新建立。In response to monitoring that the first address and/or the second address information are updated, the UDP local transmission channel is re-established based on the updated address information.
  14. 根据权利要求13所述的方法,其特征在于,所述对所述第一地址信息和所述第二地址信息进行更新监控,包括:The method according to claim 13, characterized in that the update monitoring of the first address information and the second address information includes:
    周期性与所述终端设备进行所述探测请求帧和所述探测响应帧的交互;Periodically interact with the terminal device with the detection request frame and the detection response frame;
    提取所述探测请求帧中的地址信息与所述第一地址信息对比;Extract the address information in the detection request frame and compare it with the first address information;
    提取所述探测响应帧中的地址信息与所述第二地信息对比;Extract the address information in the detection response frame and compare it with the second location information;
    响应于所述第一地址信息对比未一致和/或所述第二地址信息比对未一致,则确定所述第一地址和/或所述第二地址信息发生更新。In response to the comparison of the first address information being inconsistent and/or the comparison of the second address information being inconsistent, it is determined that the first address and/or the second address information are updated.
  15. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9, further comprising:
    响应于所述终端设备满足所述UDP本地传输通道的关闭条件,则关闭所述UDP本地传输通道,并重新建立所述终端设备与所述云服务器之间的第一TCP连接通道。In response to the terminal device meeting the closing condition of the UDP local transmission channel, the UDP local transmission channel is closed, and the first TCP connection channel between the terminal device and the cloud server is re-established.
  16. 根据权利要求15所述的方法,其特征在于,所述UDP本地传输通道的关闭条件包括以下中的至少一项:The method according to claim 15, characterized in that the closing conditions of the UDP local transmission channel include at least one of the following:
    预设时长内所述终端设备未收到所述代理设备广播的所述探测请求帧;The terminal device does not receive the detection request frame broadcast by the proxy device within a preset time period;
    接收所述代理设备广播的通道断开指示。Receive the channel disconnection indication broadcast by the proxy device.
  17. 根据权利要求16所述的方法,其特征在于,所述通道断开指示包括第二设备标识和第三用户标识,其中,所述关闭所述UDP本地传输通道,包括:The method according to claim 16, wherein the channel disconnection indication includes a second device identification and a third user identification, wherein the closing of the UDP local transmission channel includes:
    响应于所述第二设备标识为所述终端设备的第一设备标识,且所述第三用户标识为所述终端设备所绑定的第二用户标识,则关闭所述UDP本地传输通道。In response to the second device identifier being the first device identifier of the terminal device, and the third user identifier being the second user identifier bound to the terminal device, the UDP local transmission channel is closed.
  18. 一种建立用户数据报协议UDP传输通道的装置,其特征在于,适用于代理设备,所述装置包括:A device for establishing a User Datagram Protocol UDP transmission channel, which is characterized in that it is suitable for proxy equipment, and the device includes:
    广播模块,被配置为执行周期性广播探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;A broadcast module configured to perform periodic broadcast of a detection request frame, wherein the detection request frame includes the first user identification and first address information corresponding to the proxy device;
    接收模块,被配置为执行接收与所述代理设备处于同一物联网中的终端设备返回的探测响应帧,其中,所述探测响应帧包括所述终端设备对应的第二用户标识和第二地址信息;A receiving module configured to receive a detection response frame returned by a terminal device in the same Internet of Things as the proxy device, wherein the detection response frame includes a second user identification and a second address information corresponding to the terminal device. ;
    传输模块,被配置为执行基于所述第一地址信息和所述第二地址信息,与所述终端设备建立UDP本地传输通道。A transmission module configured to establish a UDP local transmission channel with the terminal device based on the first address information and the second address information.
  19. 根据权利要求18所述的装置,其特征在于,所述传输模块,还被配置为执行:The device according to claim 18, wherein the transmission module is further configured to execute:
    基于所述第一地址信息和所述第二地址信息,与所述终端设备进行UDP建链流程,以建立所述UDP本地传输通道。Based on the first address information and the second address information, a UDP link establishment process is performed with the terminal device to establish the UDP local transmission channel.
  20. 根据权利要求19所述的装置,其特征在于,所述探测响应帧还包括所述终端设备的第一设备标识,所述传输模块,还被配置为执行:The apparatus according to claim 19, wherein the detection response frame further includes the first device identification of the terminal device, and the transmission module is further configured to perform:
    基于所述设备标识和所述第二用户标识向所述云服务器发送密钥获取请求;Send a key acquisition request to the cloud server based on the device identification and the second user identification;
    响应于接收到所述云服务器返回的所述第二用户标识对应的密钥,以单播方式向所述终端设备发送通道建立请求,其中,所述通道建立请求用于请求与所述终端设备建立UDP本地传输通道。In response to receiving the key corresponding to the second user identification returned by the cloud server, sending a channel establishment request to the terminal device in a unicast manner, wherein the channel establishment request is used to request communication with the terminal device. Establish a UDP local transmission channel.
  21. 根据权利要求18所述的装置,其特征在于,所述装置还包括:The device according to claim 18, characterized in that the device further includes:
    获取模块,被配置为执行响应于接收到所述探测响应帧,从所述探测响应帧中提取时间戳,并基于所述时间戳和当前时间,获取时间差;An acquisition module configured to perform, in response to receiving the detection response frame, extract a timestamp from the detection response frame, and obtain a time difference based on the timestamp and the current time;
    第一确定模块,被配置为执行响应于所述时间差小于或者等于窗口时间,确定所述探测响应帧为有效帧,从所述有效帧中获取所述第二地址信息;A first determination module configured to determine that the detection response frame is a valid frame in response to the time difference being less than or equal to the window time, and obtain the second address information from the valid frame;
    第二确定模块,被配置为执行响应于所述时间差大于所述窗口时间,确定所述探测响应帧为无效帧,对所述无效帧进行丢弃。The second determination module is configured to determine that the detection response frame is an invalid frame in response to the time difference being greater than the window time, and discard the invalid frame.
  22. 根据权利要求18-21任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 18-21, characterized in that the device further includes:
    监控模块,被配置为执行所述建立所述UDP本地传输通道之后,对所述第一地址信息和所述第二地址信息进行更新监控;A monitoring module configured to update and monitor the first address information and the second address information after establishing the UDP local transmission channel;
    更新模块,被配置为执行响应于监测到所述第一地址和/或所述第二地址信息更新,则基于更新后地址信息对所述UDP本地传输通道进行重新建立。The update module is configured to, in response to monitoring the update of the first address and/or the second address information, re-establish the UDP local transmission channel based on the updated address information.
  23. 根据权利要求22所述的装置,其特征在于,所述监控模块,还被配置为执行:The device according to claim 22, wherein the monitoring module is further configured to execute:
    周期性与所述终端设备进行所述探测请求帧和所述探测响应帧的交互;Periodically interact with the terminal device with the detection request frame and the detection response frame;
    提取所述探测请求帧中的地址信息与所述第一地址信息对比;Extract the address information in the detection request frame and compare it with the first address information;
    提取所述探测响应帧中的地址信息与所述第二地信息对比;Extract the address information in the detection response frame and compare it with the second location information;
    响应于所述第一地址信息对比未一致和/或所述第二地址信息比对未一致,则确定所述第一地址和/或所述第二地址信息发生更新。In response to the comparison of the first address information being inconsistent and/or the comparison of the second address information being inconsistent, it is determined that the first address and/or the second address information are updated.
  24. 根据权利要求23所述的装置,其特征在于,所述装置还包括:The device of claim 23, further comprising:
    第一关闭模块,被配置为执行响应于第一预设时长内未收到所述终端设备返回的所述探测响应帧,则关闭所述UDP本地传输通道。The first closing module is configured to close the UDP local transmission channel in response to not receiving the detection response frame returned by the terminal device within a first preset time period.
  25. 根据权利要求18所述的装置,其特征在于,所述装置还包括:The device according to claim 18, characterized in that the device further includes:
    第二关闭模块,被配置为执行响应于所述代理设备退出代理模式,广播通道断开指示,其中,所述通道断开指示用于告知所述终端关闭所述UDP本地传输通道。The second closing module is configured to broadcast a channel disconnection indication in response to the proxy device exiting the proxy mode, wherein the channel disconnection indication is used to inform the terminal to close the UDP local transmission channel.
  26. 一种建立UDP传输通道装置,其特征在于,适用于终端设备,所述装置包括:A device for establishing a UDP transmission channel, which is characterized in that it is suitable for terminal equipment, and the device includes:
    第一获取模块,被配置为执行获取处于同一物联网中代理设备周期性广播的探测请求帧,其中,所述探测请求帧中包括所述代理设备对应的第一用户标识和第一地址信息;The first acquisition module is configured to acquire detection request frames periodically broadcast by proxy devices in the same Internet of Things, where the detection request frames include the first user identification and first address information corresponding to the proxy device;
    返回模块,被配置为执行确定所述第一用户标识和所述终端设备对应的第二用户标识一致时,向所述代理设备返回探测响应帧,其中,所述探测响应帧包括所述第二用户标识和终端设备的第二地址信息;a return module, configured to return a detection response frame to the proxy device when it is determined that the first user identification and the second user identification corresponding to the terminal device are consistent, wherein the detection response frame includes the second User identification and second address information of the terminal device;
    传输模块,被配置为执行基于所述第一地址信息和所述第二地址信息,与所述代理设备进行UDP建链流程,以建立所述UDP本地传输通道。The transmission module is configured to perform a UDP link establishment process with the proxy device based on the first address information and the second address information to establish the UDP local transmission channel.
  27. 根据权利要求26所述的装置,其特征在于,所述装置还包括:The device of claim 26, further comprising:
    断开模块,被配置为执行所述建立所述UDP本地传输通道后,断开与云服务器的第一TCP连接通道。The disconnection module is configured to disconnect the first TCP connection channel with the cloud server after establishing the UDP local transmission channel.
  28. 根据权利要26所述的装置,其特征在于,所述第一获取模块,还被配置为执行:The device according to claim 26, wherein the first acquisition module is further configured to execute:
    所述获取处于同一物联网中代理设备周期性广播的探测请求帧之前,基于所述第一TCP连接通道,将所述第二用户标识对应的密钥、所述第二用户标识和所述终端设备的第一设备标识同步发送给所述云服务器。Before obtaining the detection request frame periodically broadcast by the agent device in the same Internet of Things, based on the first TCP connection channel, the key corresponding to the second user identification, the second user identification and the terminal The first device identification of the device is synchronously sent to the cloud server.
  29. 根据权利要求26-28任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 26-28, characterized in that the device further includes:
    第二获取模块,被配置为执行每接收到所述探测请求帧,从接收到的所述探测请求帧中提取时间戳,并基于所述时间戳和当前时间,获取时间差;The second acquisition module is configured to extract a timestamp from the received detection request frame every time the detection request frame is received, and obtain the time difference based on the timestamp and the current time;
    第一确定模块,被配置为执行响应于所述时间差小于或者等于窗口时间,确定所述探测请求帧为有效帧,从所述有效帧中提取所述第一地址信息;A first determination module configured to determine that the detection request frame is a valid frame in response to the time difference being less than or equal to the window time, and extract the first address information from the valid frame;
    第二确定模块,被配置为执行响应于所述时间差大于所述窗口时间,确定所述探测请求帧为无效帧,对所述无效帧进行丢弃。The second determination module is configured to determine that the detection request frame is an invalid frame in response to the time difference being greater than the window time, and discard the invalid frame.
  30. 根据权利要求29所述的装置,其特征在于,所述装置还包括:The device of claim 29, further comprising:
    监控模块,被配置为执行所述建立所述UDP本地传输通道之后,对所述第一地址信息和所述第二地址信息进行更新监控;A monitoring module configured to update and monitor the first address information and the second address information after establishing the UDP local transmission channel;
    更新模块,被配置为执行响应于监测到所述第一地址和/或所述第二地址信息更新,则基于更新后地址信息对所述UDP本地传输通道进行重新建立。The update module is configured to, in response to monitoring the update of the first address and/or the second address information, re-establish the UDP local transmission channel based on the updated address information.
  31. 根据权利要求30所述的装置,其特征在于,所述监控模块,还被配置为执行:The device according to claim 30, wherein the monitoring module is further configured to execute:
    周期性与所述终端设备进行所述探测请求帧和所述探测响应帧的交互;Periodically interact with the terminal device with the detection request frame and the detection response frame;
    提取所述探测请求帧中的地址信息与所述第一地址信息对比;Extract the address information in the detection request frame and compare it with the first address information;
    提取所述探测响应帧中的地址信息与所述第二地信息对比;Extract the address information in the detection response frame and compare it with the second location information;
    响应于所述第一地址信息对比未一致和/或所述第二地址信息比对未一致,则确定所述第一地址和/或所述第二地址信息发生更新。In response to the comparison of the first address information being inconsistent and/or the comparison of the second address information being inconsistent, it is determined that the first address and/or the second address information are updated.
  32. 根据权利要26所述的装置,其特征在于,所述装置还包括:The device according to claim 26, characterized in that the device further includes:
    关闭模块,被配置为执行响应于所述终端设备满足所述UDP本地传输通道的关闭条件,则关闭所述UDP本地传输通道,并重新建立所述终端设备与所述云服务器之间的所述第一TCP连接通道。A shutdown module configured to close the UDP local transmission channel in response to the terminal device meeting the closing condition of the UDP local transmission channel, and re-establish the connection between the terminal device and the cloud server. The first TCP connection channel.
  33. 根据权利要求32所述的装置,其特征在于,所述UDP本地传输通道的关闭条件包括以下中的至少一项:The device according to claim 32, characterized in that the closing conditions of the UDP local transmission channel include at least one of the following:
    预设时长内所述终端设备未收到所述代理设备广播的所述探测请求帧;The terminal device does not receive the detection request frame broadcast by the proxy device within a preset time period;
    接收所述代理设备广播的通道断开指示。Receive the channel disconnection indication broadcast by the proxy device.
  34. 根据权利要求33所述的装置,其特征在于,所述通道断开指示包括第二设备标识和第三用户标识,其中,所述关闭模块,还被配置为执行:The device according to claim 33, wherein the channel disconnection indication includes a second device identification and a third user identification, wherein the shutdown module is further configured to execute:
    响应于所述第二设备标识为所述终端设备的第一设备标识,且所述第三用户标识为所述终端设备所绑定的第二用户标识,则关闭所述UDP本地传输通道。In response to the second device identifier being the first device identifier of the terminal device, and the third user identifier being the second user identifier bound to the terminal device, the UDP local transmission channel is closed.
  35. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    处理器;processor;
    用于存储所述处理器的可执行指令的存储器;memory for storing executable instructions for the processor;
    其中,所述处理器被配置为执行所述指令,以实现如权利要求1-8中任一项所述的方法,或者如权利要求9-17中任一项所述的方法。Wherein, the processor is configured to execute the instructions to implement the method according to any one of claims 1-8, or the method according to any one of claims 9-17.
  36. 一种计算机可读存储介质,其特征在于,当所述计算机可读存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如权利要求1-8中任一项所述的方法,或者如权利要求9-17中任一项所述的方法。A computer-readable storage medium, characterized in that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is capable of executing the method described in any one of claims 1-8. Method, or the method according to any one of claims 9-17.
PCT/CN2022/084175 2022-03-30 2022-03-30 Method and apparatus for establishing user datagram protocol (udp) transmission channel WO2023184263A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/084175 WO2023184263A1 (en) 2022-03-30 2022-03-30 Method and apparatus for establishing user datagram protocol (udp) transmission channel
CN202280000848.7A CN115280743A (en) 2022-03-30 2022-03-30 Method and device for establishing User Datagram Protocol (UDP) transmission channel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/084175 WO2023184263A1 (en) 2022-03-30 2022-03-30 Method and apparatus for establishing user datagram protocol (udp) transmission channel

Publications (1)

Publication Number Publication Date
WO2023184263A1 true WO2023184263A1 (en) 2023-10-05

Family

ID=83758080

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084175 WO2023184263A1 (en) 2022-03-30 2022-03-30 Method and apparatus for establishing user datagram protocol (udp) transmission channel

Country Status (2)

Country Link
CN (1) CN115280743A (en)
WO (1) WO2023184263A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243267A (en) * 2014-09-18 2014-12-24 百度在线网络技术(北京)有限公司 Data transmission method and device
CN104566783A (en) * 2014-12-05 2015-04-29 广东志高空调有限公司 Air conditioner control method and air conditioner control system
CN104618988A (en) * 2015-01-21 2015-05-13 青岛海尔智能家电科技有限公司 Smart device network access method and device
US20190334995A1 (en) * 2018-04-27 2019-10-31 EMC IP Holding Company LLC Internet of Things Gateway Service for a Cloud Foundry Platform
CN110635942A (en) * 2019-09-02 2019-12-31 上海商米科技集团股份有限公司 Device discovery method, Internet of things device and Internet of things server
CN112243002A (en) * 2020-10-10 2021-01-19 腾讯科技(深圳)有限公司 Data forwarding method and device, electronic equipment and computer readable medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109495258B (en) * 2018-12-19 2022-05-13 天翼数字生活科技有限公司 Method and device for decrypting monitoring data, computer equipment and storage medium
CN112637344A (en) * 2020-12-23 2021-04-09 苏州三六零智能安全科技有限公司 Monitoring method, equipment and device of Internet of things equipment and storage medium
CN114244886B (en) * 2021-11-22 2024-04-30 北京小米移动软件有限公司 Device control method, device control apparatus, and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243267A (en) * 2014-09-18 2014-12-24 百度在线网络技术(北京)有限公司 Data transmission method and device
CN104566783A (en) * 2014-12-05 2015-04-29 广东志高空调有限公司 Air conditioner control method and air conditioner control system
CN104618988A (en) * 2015-01-21 2015-05-13 青岛海尔智能家电科技有限公司 Smart device network access method and device
US20190334995A1 (en) * 2018-04-27 2019-10-31 EMC IP Holding Company LLC Internet of Things Gateway Service for a Cloud Foundry Platform
CN110635942A (en) * 2019-09-02 2019-12-31 上海商米科技集团股份有限公司 Device discovery method, Internet of things device and Internet of things server
CN112243002A (en) * 2020-10-10 2021-01-19 腾讯科技(深圳)有限公司 Data forwarding method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN115280743A (en) 2022-11-01

Similar Documents

Publication Publication Date Title
US7376831B2 (en) Selectively encrypting different portions of data sent over a network
US11936638B2 (en) Link protocol agents for inter-application communications
WO2021104408A1 (en) Key agreement method and electronic device
CN111428225A (en) Data interaction method and device, computer equipment and storage medium
WO2023184262A1 (en) Secure transmission method and apparatus for data frames, electronic device and storage medium
WO2012100677A1 (en) Identity management method and device for mobile terminal
WO2007124693A1 (en) Method for encrypting and decrypting instant communication data
WO2014135050A1 (en) Message processing method, device, gateway, set-top box and internet protocol television system
US10218681B2 (en) Home network controlling apparatus and method to obtain encrypted control information
CA2578053C (en) System and method for accessing host computer via remote computer
CN112769868A (en) Communication method, communication device, electronic device and storage medium
WO2020237880A1 (en) Data exchange method based on asymmetric encryption technology, sending terminal and computer readable storage medium
WO2023184264A1 (en) Traffic proxy methods and apparatuses, electronic device and storage medium
CN113992427B (en) Data encryption sending method and device based on adjacent nodes
US11349818B2 (en) Secure virtual personalized network
WO2023184263A1 (en) Method and apparatus for establishing user datagram protocol (udp) transmission channel
CN111866060A (en) TLS (transport layer service) connection method of communication equipment, communication equipment and communication system
CN112187726A (en) Data transmission method, device, storage medium and terminal
WO2009132551A1 (en) Obtaining method of the meida stream key, session equipment and key management function entity
JP5326815B2 (en) Packet transmitting / receiving apparatus and packet transmitting / receiving method
CN115412597B (en) Real-time data communication method
JP7366115B2 (en) Delivering notifications to mobile devices
WO2014205703A1 (en) Method and device for detecting shared access, and terminal device
US12015702B2 (en) Key sharing for media frames using blockchain
CN112333088B (en) Compatible instant messaging transmission method

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: 22934114

Country of ref document: EP

Kind code of ref document: A1