WO2019205557A1 - 物联网设备的资源订阅 - Google Patents

物联网设备的资源订阅 Download PDF

Info

Publication number
WO2019205557A1
WO2019205557A1 PCT/CN2018/113514 CN2018113514W WO2019205557A1 WO 2019205557 A1 WO2019205557 A1 WO 2019205557A1 CN 2018113514 W CN2018113514 W CN 2018113514W WO 2019205557 A1 WO2019205557 A1 WO 2019205557A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
subscription
internet
iot
iot device
Prior art date
Application number
PCT/CN2018/113514
Other languages
English (en)
French (fr)
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
Priority claimed from CN201810443341.4A external-priority patent/CN108712485B/zh
Application filed by 海信集团有限公司 filed Critical 海信集团有限公司
Publication of WO2019205557A1 publication Critical patent/WO2019205557A1/zh

Links

Images

Classifications

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

Definitions

  • the present application relates to the technical field of communication, and in particular, to a resource subscription method and apparatus for an Internet of Things device.
  • the embodiment of the present application proposes a resource subscription method and device for an Internet of Things device to solve the problem that the status of the IoT device and the Internet of Things platform are inconsistent due to the loss of the confirmation message transmission of the Internet of Things device.
  • Some embodiments of the present disclosure provide a resource subscription method for an Internet of Things device, including:
  • the target token is saved according to the subscription of the device resource waiting timeout.
  • the generating the target token for the IoT device includes:
  • a target token is initially generated for the IoT device in response to not storing the target token previously generated for the IoT device.
  • it also includes:
  • the subscription timeout message is sent to the service platform to wait for a subscribed device resource.
  • it also includes:
  • the subscription success message is sent to the service platform to wait for a subscribed device resource.
  • it also includes:
  • the device resource is sent to the service platform.
  • Some embodiments of the present disclosure provide a resource subscription device of an Internet of Things device, including:
  • Device registration module for registering IoT devices
  • a token generating module configured to generate a target token for the IoT device if the service platform requests to subscribe to the device resource of the IoT device;
  • a subscription request sending module configured to send, to the IoT device, a resource subscription request message that carries the target token and subscribes to the device resource;
  • a subscription timeout confirmation module configured to: if the resource subscription response message sent by the IoT device to the resource subscription request message is not received within a preset time period, confirming that the subscription of the device resource waits for a timeout;
  • a timeout saving module configured to save the target token according to a subscription timeout of the device resource waiting for a subscription.
  • the token generating module includes:
  • a token storage judging module configured to determine whether a target token previously generated for the IoT device is stored; if yes, a regenerating submodule is invoked, and if not, a first generation submodule is invoked;
  • the sub-module is generated for the first time to generate a target token for the IoT device for the first time.
  • it also includes:
  • a subscription timeout message generating module configured to determine whether a waiting time for subscribing to the device resource exceeds a predetermined threshold, and generate a subscription timeout message in response to the waiting time for subscribing to the device resource exceeds a predetermined threshold;
  • a subscription timeout message sending module configured to send the subscription timeout message to the service platform to wait for a subscribed device resource.
  • it also includes:
  • a subscription success confirmation module configured to determine whether a resource subscription response message sent by the IoT device is received within a preset time period, and receiving a resource subscription sent by the IoT device in response to a preset time period Responding to the message, confirming that the subscription of the device resource is successful;
  • a subscription success message generating module configured to generate a subscription success message according to the success of subscribing to the device resource
  • a subscription success message sending module configured to send the subscription success message to the service platform to wait for a subscribed device resource.
  • it also includes:
  • a subscription notification receiving module configured to receive a resource subscription notification message sent by the IoT device, where the resource subscription notification message includes a device resource and a reference token;
  • a token matching module configured to match the target token with the reference token
  • the device resource sending module is configured to send the device resource to the service platform when the matching is successful.
  • An embodiment of the present application provides a computer device, including:
  • a memory for storing computer instructions
  • the processor is configured to execute the computer instructions to implement any of the methods provided by the embodiments of the present application.
  • the embodiment of the present application provides a machine-readable non-volatile storage medium, where the storage medium stores computer-executable instructions for causing the computer to perform any of the embodiments provided by the embodiments of the present application. A method as described.
  • FIG. 1 is a flow chart showing the steps of a resource subscription method for an Internet of Things device according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an Internet of Things according to an embodiment of the present application.
  • FIG. 3 is a diagram showing an example of communication of an Internet of Things according to an embodiment of the present application.
  • FIG. 4 is a flow chart showing the steps of a resource subscription method of another Internet of Things device according to an embodiment of the present application.
  • FIG. 5 is a flowchart of steps of a resource subscription method of another Internet of Things device according to an embodiment of the present application.
  • FIG. 6 is a flow chart showing the steps of a resource subscription method of another Internet of Things device according to an embodiment of the present application.
  • FIG. 7 is a flowchart of an improved subscription request processing of the Internet of Things platform according to an embodiment of the present application.
  • FIG. 8 is a flowchart of processing data reporting by the Internet of Things platform according to an embodiment of the present application.
  • FIG. 9 is a structural block diagram of a resource subscription device of an Internet of Things device according to an embodiment of the present application.
  • FIG. 10 is a structural block diagram of a computer device according to an embodiment of the present application.
  • the service platform can subscribe to the resources of the IoT device through the Internet of Things platform, and the IoT device returns a confirmation message for the subscription.
  • the Internet of Things wireless network has wide coverage, weak signal, and small bandwidth.
  • the loss rate of acknowledgment message transmission of IoT devices is high. Once there is a loss, the IoT device considers that the subscription is successful and the IoT platform determines that it has failed. The status of the two is inconsistent.
  • the IoT platform will not be able to subscribe to the same resource again.
  • the resources reported by the IoT device will reach the IoT platform, and the resource will be discarded. , causing waste.
  • FIG. 1 a flow chart of steps of a resource subscription method for an Internet of Things device according to an embodiment of the present application is shown, which may specifically include the following steps:
  • Step 101 Register an IoT device.
  • the embodiment of the present application may be applied to the Internet of Things platform, and the Internet of Things platform may be an independent computing device or a computing cluster.
  • Internet of Things devices such as electricity meters, water meters, weather monitors, etc.
  • the Internet of Things platform access to the Internet of Things platform, communicating with the Internet of Things platform in accordance with the Internet of Things protocol, and receiving instructions from the Internet of Things platform. And corresponding processing, or report the subscribed device resources to the Internet of Things platform, such as user power consumption, user water consumption, temperature, and the like.
  • the service platform is connected with the Internet of Things platform, and subscribes to the device resources of the IoT device according to the business requirements, and performs corresponding business processing, such as counting daily or monthly user power consumption, thereby generating a power bill, drawing Time-varying curve of time or day, etc.
  • the Internet of Things device 200 is configured with an Internet of Things communication module 211, and the Internet of Things communication module 211 can pass RS485, UART (Universal Asynchronous Receiver Transmitter) ), I2C (Inter Integrated Circuit) and the like are connected to the processor of the Internet of Things device 200 and communicate with the processor.
  • RS485 Universal Asynchronous Receiver Transmitter
  • I2C Inter Integrated Circuit
  • the Internet of Things device 200 (the Internet of Things communication module 211) is located in the operator's intranet 210, and the Internet of Things platform 231 is located in the operator's public network 230. Therefore, the Internet of Things device 200 (the Internet of Things communication module) 211)
  • the data sent to the base station 212 is mapped by the NAT (Network Address Translation) server 220 to the address mapping of the intranet 210 to the public network 230, and then UDP (User Datagram Protocol)/IP ( The Internet Protocol Address (Internet Protocol Address) is forwarded to the Internet of Things platform 231.
  • NAT Network Address Translation
  • the data of the Internet of Things platform 231 is mapped by the NAT server 220 to the address of the internal network 210, and then forwarded to the base station 212 by UDP/IP.
  • the base station 212 transmits to the Internet of Things device 200 (IoT communication module 211).
  • the communication can be directly performed through the TCP (Transmission Control Protocol)/IP, and the device resources of the Internet of Things device 200 can be subscribed through the service platform 232. Alternatively, the device resources of the Internet of Things device 200 are received from the service platform 232.
  • TCP Transmission Control Protocol
  • IP Transmission Control Protocol
  • NB-IoT Near Band Internet of Things, Cellular-based narrowband Internet of Things
  • the IoT platform communicates with the NB-IoT device via the RFC7641 protocol to subscribe to the device resources of the NB-IoT device.
  • the IoT communication module is notified to register, and the IoT communication module establishes a wireless connection with the base station, and sends a registration request through the wireless connection.
  • the base station sends the registration request of the IoT communication module to the NAT server, and the NAT server performs address translation of the intranet to the public network for the registration request, and then sends the request to the Internet of Things platform.
  • the Internet of Things platform authenticates the IoT device according to the registration request. If the IoT device is authenticated as a legitimate device, it confirms that the registration is successful and allows it to access the Internet of Things platform.
  • the Internet of Things platform sends a notification of successful registration to the NAT server.
  • the NAT server performs the address translation of the public network to the internal network
  • the NAT server sends the notification to the base station, and the base station sends the notification of successful registration through the wireless connection.
  • the Internet of Things communication module notifies the registration of the Internet of Things device.
  • the Internet of Things platform sends an online notification to the service platform to notify the IoT device to register online. After receiving the online notification, the service platform sends a confirmation message to the service platform.
  • Step 102 Generate a target token for the IoT device if the service platform requests to subscribe to the device resource of the IoT device.
  • the IoT cloud platform notifies the IoT device of the service platform to go online, and then listens to the service platform and waits for the service platform to subscribe to the device resource of interest.
  • the user can operate on the service platform, select the subscribed device resources, generate a subscription request according to TCP/IP, and send it to the Internet of Things platform.
  • the Internet of Things platform generates a target token token for this subscription based on the subscription request.
  • step 102 may include the following sub-steps:
  • Sub-step S11 it is determined whether the target token previously generated for the IoT device is stored; if so, sub-step S12 is performed, and if not, sub-step S13 is performed.
  • Sub-step S12 deleting the target token formed by Mr., and re-generating the target token for the IoT device.
  • Sub-step S13 the target token is generated for the first time for the Internet of Things device.
  • the resource subscription request message of the IoT platform is awaited within a preset time period.
  • the IoT device sends a resource subscription response message to the Internet of Things platform for confirmation. At this time, the IoT device considers that the device resource subscription is successful.
  • the IoT device re-registers.
  • the IoT platform has generated the target token token, stored in the listener table, and issued a resource subscription request message, and the resource cannot be accessed due to a problem with the transmission of the NAT server or the base station.
  • the subscription request message is sent to the IoT device.
  • the IoT platform can check whether the object generated by the IoT device is stored in the monitoring table after the IoT device is registered. Token token.
  • the target token token is generated for the session for the first time, and the device resources that the session requires to subscribe to are monitored.
  • Step 103 Send, to the IoT device, a resource subscription request message that carries the target token and subscribes to the device resource.
  • the Internet of Things platform may generate a resource subscription request message (ie, a CoAP Registration message) according to a protocol such as RFC7641, and carry the target token token to the IoT device (such as an NB-IoT device).
  • a resource subscription request message ie, a CoAP Registration message
  • RFC7641 a protocol such as RFC7641
  • the Internet of Things platform sends a resource subscription request message to the NAT server.
  • the NAT server After the NAT server performs address translation of the resource subscription request message from the public network to the internal network, the NAT server sends the resource subscription request message to the base station, and the base station subscribes the resource through the wireless connection.
  • the request message is sent to the IoT communication module, and the IoT communication module sends the relevant subscription request to the IoT device.
  • Step 104 If the resource subscription response message sent by the IoT device to the resource subscription request message is not received within a preset time period, confirm that the subscription to the device resource waits for a timeout.
  • Step 105 Save the target token according to the subscription of the device resource waiting timeout.
  • the Internet of Things platform After the Internet of Things platform sends the resource subscription request message, it waits for the resource subscription response message sent by the IoT device to the resource subscription request message within a preset time period.
  • the IoT device receives the resource subscription request message, the resource subscription request message is confirmed, and a resource subscription response message (ie, a CoAP 2.xx message) is generated according to RFC7641/7252, indicating that the subscription is successful and sent to The IoT platform and save the target token token in the resource subscription request message.
  • a resource subscription response message ie, a CoAP 2.xx message
  • the IoT communication module As shown in FIG. 3, if the IoT device confirms the subscription, the IoT communication module is notified, and the IoT communication module generates a resource subscription response message, and sends the message to the base station through the wireless connection, and the base station sends the resource subscription response message.
  • the NAT server sends the address translation response message to the Internet of Things to the Internet of Things platform.
  • the IoT platform does not receive the resource subscription response message of the IoT device during the time period, the subscription device resource waits for the timeout, and the following two situations may exist:
  • the resource subscription request message of the Internet of Things platform is not sent to the IoT device.
  • the IoT platform has generated a resource subscription request message and sent it to the IoT device through a device such as a NAT server or a base station.
  • the resource subscription request message is not sent to the IoT device due to a problem in the transmission of the NAT server or the base station. Therefore, the IoT device will not generate a resource subscription response message accordingly, and the IoT platform cannot receive the resource subscription response message.
  • the IoT platform Since the IoT device will be re-registered in this case (ie, step 101), the IoT platform re-subscribes the device resource. Therefore, the IoT platform stores the target token and does not affect subsequent subscriptions.
  • the resource subscription response message of the IoT device is not sent to the Internet of Things platform.
  • the IoT device has received the resource subscription request message and generates a resource subscription response message, which is sent to the Internet of Things device through a device such as a NAT server or a base station, and causes a resource subscription response message due to a problem in transmission of the NAT server or the base station. Not sent to the IoT platform.
  • the IoT device considers that the subscription is successful and does not re-register (ie, step 101).
  • storing the target token may enable the IoT device to subsequently use the target token to report the subscribed device resource.
  • the IoT platform can still be verified correctly.
  • the target token is generated for the IoT device, and the resource subscription request message carrying the target token and subscribing the device resource is sent to the IoT device. If the resource subscription response message sent by the IoT device to the resource subscription request message is not received within the preset time period, it is confirmed that the subscription device resource waits for timeout, and the target token is saved according to the subscription device resource waiting timeout, and is generated on the Internet of Things device.
  • the IoT platform If the resource subscription response message considers that the subscription is successful but the resource subscription response message is not sent successfully, the IoT platform considers that the waiting timeout still saves the target token, so that the IoT device and the IoT platform are in the state of the subscription when the communication is abnormal. Consistently, the device resources reported by the IoT device can be verified and reported to the service platform to ensure successful subscription of device resources.
  • FIG. 4 a flow chart of steps of a resource subscription method of another IoT device according to an embodiment of the present application is shown, which may specifically include the following steps:
  • Step 401 registering an IoT device.
  • Step 402 Generate a target token for the IoT device if the service platform requests to subscribe to the device resource of the IoT device.
  • Step 403 Send, to the IoT device, a resource subscription request message that carries the target token and subscribes to the device resource.
  • Step 404 If the resource subscription response message sent by the IoT device to the resource subscription request message is not received within a preset time period, confirm that the subscription to the device resource waits for a timeout.
  • Step 405 Save the target token according to the subscription of the device resource waiting timeout.
  • Step 406 Determine whether a waiting time for subscribing to the device resource exceeds a predetermined threshold, and generate a subscription timeout message in response to the waiting time for subscribing to the device resource exceeds a predetermined threshold.
  • Step 407 Send the subscription timeout message to the service platform to wait for a subscribed device resource.
  • a subscription timeout message may be generated and sent to the service platform through TCP/IP.
  • the service platform learns that the subscription device resource waits for timeout, and then waits for the IoT platform to report the device resource of the subscription IoT device.
  • FIG. 5 a flow chart of steps of a resource subscription method of another IoT device according to an embodiment of the present application is shown, which may specifically include the following steps:
  • Step 501 Register an IoT device.
  • Step 502 Generate a target token for the IoT device if the service platform requests to subscribe to the device resource of the IoT device.
  • Step 503 Send, to the IoT device, a resource subscription request message that carries the target token and subscribes to the device resource.
  • Step 504 Determine whether a resource subscription response message sent by the object network device is received within a preset time period, and in response to receiving the resource subscription response message sent by the object network device within a preset time period, Confirm that the subscription to the device resource is successful.
  • Step 505 Save the target token according to the success of subscribing to the device resource.
  • the Internet of Things platform After the Internet of Things platform sends the resource subscription request message, it waits for the resource subscription response message sent by the IoT device to the resource subscription request message within a preset time period.
  • the IoT platform receives the resource subscription response message of the IoT device in the time period, it can confirm that the subscription device resource is successful.
  • the target token is stored to the listening table, so that the object network device subsequently uses the target token to report.
  • the IoT platform can be properly verified when subscribing to device resources.
  • Step 506 Generate a subscription success message according to the success of subscribing to the device resource.
  • Step 507 Send the subscription success message to the service platform to wait for a subscribed device resource.
  • the IoT platform when the subscription device resource is successful, the IoT platform generates a subscription success message and sends it to the service platform through TCP/IP to confirm the subscription.
  • the service platform learns that the subscription device resource is successful, and waits for the IoT device to report the subscribed device resource.
  • FIG. 6 a flow chart of steps of a resource subscription method for another Internet of Things device according to an embodiment of the present application is shown. Specifically, the method may include the following steps:
  • Step 601 registering an IoT device.
  • Step 602 Generate a target token for the IoT device if the service platform requests to subscribe to the device resource of the IoT device.
  • Step 603 Send, to the IoT device, a resource subscription request message that carries the target token and subscribes to the device resource.
  • step 604 it is determined whether the resource subscription response message sent by the IoT device to the resource subscription request message is received in a preset time period; if yes, step 605 is performed, and if no, step 607 is performed.
  • Step 605 confirming that the subscription of the device resource is successful.
  • Step 606 Save the target token according to the success of subscribing to the device resource.
  • Step 607 confirming that the subscription of the device resource waits for a timeout.
  • Step 608 Save the target token according to the subscription of the device resource waiting timeout.
  • Step 609 Receive a resource subscription notification message sent by the Internet of Things device.
  • Step 610 Match the target token with the reference token.
  • Step 611 When the matching is successful, send the device resource to the service platform.
  • IoT devices In many cases, IoT devices enter a sleep state as soon as they are initialized, while IoT devices are in sleep. Unable to receive data.
  • IoT devices can sleep in modes such as power-saving mode PSM and extended discontinuous reception of eDRX.
  • the IoT device and the IoT platform are in the same state, and the device resources are normally reported after the IoT device wakes up.
  • the IoT device After waking up, the IoT device collects the subscribed device resources, generates a resource subscription notification message (ie, a CoAP Notification message) according to RFC7641/7252, and sends a previously saved target token as a reference token to the Internet of Things platform.
  • a resource subscription notification message ie, a CoAP Notification message
  • the IoT platform receives the resource subscription notification message of the IoT device at runtime, where the resource subscription notification message includes a device resource and a reference token.
  • the IoT platform extracts the device resource and the reference token from the resource subscription notification message, and extracts the target token corresponding to the IoT device in the listening table.
  • the target token may be a target token that is saved when the device resource is waiting for a timeout, or may be a target token that is saved when the device resource is successfully subscribed to. Limit it.
  • the IoT platform matches the reference token with the target token. If the two match is successful, the resource subscription notification message is considered to be valid, and the device resource can be sent to the service platform through TCP/IP.
  • the IoT device collects the device resource, it can transmit to the IoT communication module, and the IoT communication module encapsulates the device resource into a resource subscription notification message, and sends the message to the base station through the wireless connection, and the base station will
  • the resource subscription notification message is sent to the NAT server, and the NAT server sends the resource subscription notification message to the Internet of Things platform after the address translation of the intranet to the public network, and the IoT platform sends the device resource to the IoT platform after verifying the token. business platform.
  • the improved subscription request processing process of the Internet of Things platform includes:
  • the business platform sends a subscription request.
  • the IoT platform saves the generated token when sending the subscription request, and is mainly used for the IoT platform to process the data report of the NB-IOT device (the Internet of Things device) while waiting for the subscription request confirmation.
  • the process of processing data reporting by the Internet of Things platform includes:
  • FIG. 9 a structural block diagram of a resource subscription device of an Internet of Things device according to an embodiment of the present application is shown, which may specifically include the following modules:
  • a device registration module 701, configured to register an IoT device
  • a token generating module 702 configured to generate a target token for the IoT device if the service platform requests to subscribe to the device resource of the IoT device;
  • a subscription request sending module 703, configured to send, to the IoT device, a resource subscription request message that carries the target token and subscribes to the device resource;
  • the subscription timeout confirmation module 704 is configured to: if the resource subscription response message sent by the IoT device to the resource subscription request message is not received within a preset time period, confirm that the subscription of the device resource waits for timeout;
  • the timeout saving module 705 is configured to save the target token according to the subscription of the device resource waiting timeout.
  • the token generating module 702 includes:
  • a token storage judging module configured to determine whether a target token previously generated for the IoT device is stored; if yes, a regenerating submodule is invoked, and if not, a first generation submodule is invoked;
  • the sub-module is generated for the first time to generate a target token for the IoT device for the first time.
  • the method further includes:
  • a subscription timeout message generating module configured to determine whether a waiting time for subscribing to the device resource exceeds a predetermined threshold, and generate a subscription timeout message in response to the waiting time for subscribing to the device resource exceeds a predetermined threshold;
  • a subscription timeout message sending module configured to send the subscription timeout message to the service platform to wait for a subscribed device resource.
  • the method further includes:
  • a subscription success confirmation module configured to determine whether a resource subscription response message sent by the IoT device is received within a preset time period, and receiving a resource subscription sent by the IoT device in response to a preset time period Responding to the message, confirming that the subscription of the device resource is successful;
  • a subscription success message generating module configured to generate a subscription success message according to the success of subscribing to the device resource
  • a subscription success message sending module configured to send the subscription success message to the service platform to wait for a subscribed device resource.
  • the method further includes:
  • a subscription notification receiving module configured to receive a resource subscription notification message sent by the IoT device, where the resource subscription notification message includes a device resource and a reference token;
  • a token matching module configured to match the target token with the reference token
  • the device resource sending module is configured to send the device resource to the service platform when the matching is successful.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • FIG. 10 a structural block diagram of a computer device according to an embodiment of the present application is shown, which may specifically include the following modules:
  • a memory 11 for storing program instructions
  • the processor 12 is configured to invoke a program instruction stored in the memory, and execute any of the methods provided in the embodiments of the present application according to the obtained program.
  • the embodiment of the present application provides any device, which may be a server, or a computing device, and the computing device may be a desktop computer, a portable computer, a smart phone, a tablet computer, or a personal digital assistant (Personal Digital Assistant). , PDA) and so on.
  • the computing device may include a central processing unit (CPU), a memory, an input/output device, etc., the input device may include a keyboard, a mouse, a touch screen, etc., and the output device may include a display device such as a liquid crystal display (Liquid Crystal Display, LCD), cathode ray tube (CRT), etc.
  • LCD liquid crystal display
  • CRT cathode ray tube
  • the memory can include read only memory (ROM) and random access memory (RAM) and provides program instructions and data stored in the memory to the processor.
  • ROM read only memory
  • RAM random access memory
  • the memory may be used to store a program of any of the methods provided by the embodiments of the present application.
  • the processor is configured to execute any of the methods provided by the embodiments of the present application according to the obtained program instructions by calling a program instruction stored in the memory.
  • the processor 12 can be a central buried device (CPU), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a complex programmable logic device (Complex Programmable Logic Device). , CPLD).
  • the embodiment of the present application provides a machine readable non-volatile storage medium for storing the computer program instructions used by the apparatus provided in the foregoing application, which includes the foregoing A method of procedure.
  • the computer storage medium can be any available media or data storage device accessible by a computer, including but not limited to magnetic storage (eg, floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (eg, CD, DVD, BD, HVD, etc.), and semiconductor memories (for example, ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state hard disk (SSD)).
  • magnetic storage eg, floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.
  • optical storage eg, CD, DVD, BD, HVD, etc.
  • semiconductor memories for example, ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state hard disk (SSD)).
  • the method provided by the embodiment of the present application can be applied to a terminal device, and can also be applied to a network device.
  • the terminal device may also be referred to as a user equipment (User Equipment, referred to as "UE"), a mobile station (Mobile Station, referred to as "MS”), a mobile terminal (Mobile Terminal), etc.
  • UE User Equipment
  • MS Mobile Station
  • Mobile Terminal Mobile Terminal
  • the terminal may The ability to communicate with one or more core networks via a Radio Access Network (RAN), for example, the terminal can be a mobile phone (or “cellular” phone), or a computer with mobile nature, etc.
  • RAN Radio Access Network
  • the terminal can also be a portable, pocket, handheld, computer built-in or in-vehicle mobile device.
  • a network device may be a base station (e.g., an access point) that refers to a device in the access network that communicates with the wireless terminal over one or more sectors over the air interface.
  • the base station can be used to convert the received air frame to the IP packet as a router between the wireless terminal and the rest of the access network, wherein the remainder of the access network can include an Internet Protocol (IP) network.
  • IP Internet Protocol
  • the base station can also coordinate attribute management of the air interface.
  • the base station may be a base station (BTS, Base Transceiver Station) in GSM or CDMA, or may be a base station (NodeB) in WCDMA, or may be an evolved base station in LTE (NodeB or eNB or e-NodeB, evolutional Node B), or it may be gNB in a 5G system.
  • BTS Base Transceiver Station
  • NodeB base station
  • NodeB evolved base station in LTE
  • eNB evolved base station
  • e-NodeB evolutional Node B
  • the target token is generated for the IoT device, and the resource subscription request message carrying the target token and subscribing the device resource is sent to the IoT device. If the resource subscription response message sent by the IoT device to the resource subscription request message is not received within the preset time period, it is confirmed that the subscription device resource waits for timeout, and the target token is saved according to the subscription device resource waiting timeout, and is generated on the Internet of Things device.
  • the IoT platform If the resource subscription response message considers that the subscription is successful but the resource subscription response message is not sent successfully, the IoT platform considers that the waiting timeout still saves the target token, so that the IoT device and the IoT platform are in the state of the subscription when the communication is abnormal. Consistently, the device resources reported by the IoT device can be verified and reported to the service platform to ensure successful subscription of device resources.
  • embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
  • Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请实施例提供了一种物联网设备的资源订阅方法和装置,该方法包括:注册物联网设备;若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌;向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息;若在预设的时间段内未接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息,则确认订阅所述设备资源等待超时;依据订阅所述设备资源等待超时,保存所述目标令牌。在物联网设备生成资源订阅响应消息认为订阅成功、但未发送资源订阅响应消息成功的情况下,物联网平台认为等待超时,依然保存目标令牌,使得物联网设备与物联网平台在出现通信异常时对订阅的状态保持一致。

Description

物联网设备的资源订阅
本申请要求在2018年4月24日提交中国专利局、申请号为201810373823.7、发明名称为“一种物联网设备的资源订阅方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信的技术领域,特别是涉及一种物联网设备的资源订阅方法和装置。
背景技术
互联网技术革命把人类带入虚拟世界,而物联网革命将虚拟世界带回现实,无论生活、工作,还是商业、工业场景中,虚拟世界和现实世界之间的界限将越来越模糊。
发明内容
本申请实施例提出了一种物联网设备的资源订阅方法和装置,以解决物联网设备的确认消息传输丢失造成物联网设备与物联网平台之间状态不一致的问题。
本公开的一些实施方式,提供了一种物联网设备的资源订阅方法,包括:
注册物联网设备;
若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌;
向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息;
若在预设的时间段内未接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息,则确认订阅所述设备资源等待超时;
依据订阅所述设备资源等待超时,保存所述目标令牌。
可选地,所述对所述物联网设备生成目标令牌,包括:
确定是否存储有在先对所述物联网设备生成的目标令牌;
响应于存储有在先对所述物联网设备生成的目标令牌,则删除在先生成的目标令牌,重新对所述物联网设备生成目标令牌;
响应于不存储有在先对所述物联网设备生成的目标令牌,则初次对所述物联网设备生成目标令牌。
可选地,还包括:
确定订阅所述设备资源的等待时间是否超过预定阈值,响应于订阅所述设备资源的等 待时间超过预定阈值,生成订阅超时消息;
将所述订阅超时消息发送至所述业务平台,以等待订阅的设备资源。
可选地,还包括:
确定在预设的时间段内是否接收到所述物联网设备发送的资源订阅响应消息,响应于在预设的时间段内接收到所述物联网设备发送的资源订阅响应消息,则确认订阅所述设备资源成功;
依据订阅所述设备资源成功,保存所述目标令牌;
依据订阅所述设备资源成功,生成订阅成功消息;
将所述订阅成功消息发送至所述业务平台,以等待订阅的设备资源。
可选地,还包括:
接收所述物联网设备发送的资源订阅通知消息,所述资源订阅通知消息中包括设备资源与参考令牌;
将所述目标令牌与所述参考令牌进行匹配;
当匹配成功时,将所述设备资源发送至所述业务平台。
本公开的一些实施方式,提供了一种物联网设备的资源订阅装置,包括:
设备注册模块,用于注册物联网设备;
令牌生成模块,用于若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌;
订阅请求发送模块,用于向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息;
订阅超时确认模块,用于若在预设的时间段内未接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息,则确认订阅所述设备资源等待超时;
超时保存模块,用于依据订阅所述设备资源等待超时,保存所述目标令牌。
可选地,所述令牌生成模块包括:
令牌存储判断子模块,用于确定是否存储有在先对所述物联网设备生成的目标令牌;若是,则调用重新生成子模块,若否,则调用初次生成子模块;
重新生成子模块,用于删除在先生成的目标令牌,重新对所述物联网设备生成目标令牌;
初次生成子模块,用于初次对所述物联网设备生成目标令牌。
可选地,还包括:
订阅超时消息生成模块,用于确定订阅所述设备资源的等待时间是否超过预定阈值,响应于订阅所述设备资源的等待时间超过预定阈值,生成订阅超时消息;
订阅超时消息发送模块,用于将所述订阅超时消息发送至所述业务平台,以等待订阅 的设备资源。
可选地,还包括:
订阅成功确认模块,用于确定在预设的时间段内是否接收到所述物联网设备发送的资源订阅响应消息,响应于在预设的时间段内接收到所述物联网设备发送的资源订阅响应消息,则确认订阅所述设备资源成功;
成功保存模块,用于依据订阅所述设备资源成功,保存所述目标令牌;
订阅成功消息生成模块,用于依据订阅所述设备资源成功,生成订阅成功消息;
订阅成功消息发送模块,用于将所述订阅成功消息发送至所述业务平台,以等待订阅的设备资源。
可选地,还包括:
订阅通知接收模块,用于接收所述物联网设备发送的资源订阅通知消息,所述资源订阅通知消息中包括设备资源与参考令牌;
令牌匹配模块,用于将所述目标令牌与所述参考令牌进行匹配;
设备资源发送模块,用于当匹配成功时,将所述设备资源发送至所述业务平台。
本申请实施例提供一种计算机设备,包括:
存储器,用于存储计算机指令;
处理器,配置为运行所述计算机指令以实现本申请实施例提供的任一所述的方法。
本申请实施例提供的一种机器可读的非易失性存储介质,所述存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行本申请实施例提供的任一所述的方法。
附图说明
图1是本申请一个实施例的一种物联网设备的资源订阅方法的步骤流程图;
图2是本申请一个实施例的一种物联网的架构示意图;
图3是本申请一个实施例的一种物联网的通信示例图;
图4是本申请一个实施例的另一种物联网设备的资源订阅方法的步骤流程图;
图5是本申请一个实施例的又一种物联网设备的资源订阅方法的步骤流程图;
图6是本申请一个实施例的再一种物联网设备的资源订阅方法的步骤流程图;
图7是本申请一个实施例的物联网平台改进的订阅请求处理流程图;
图8是本申请一个实施例的物联网平台处理数据上报流程图;
图9是本申请一个实施例的一种物联网设备的资源订阅装置的结构框图;
图10是本申请一个实施例的一种计算机设备的结构框图。
具体实施方式
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
物联网设备接入物联网平台后,业务平台通过物联网平台可以对该物联网设备的资源进行订阅,物联网设备对此订阅返回确认消息。
但是,物联网无线网覆盖广、信号弱、带宽小等特点,物联网设备的确认消息传输丢失率较高,一旦出现丢失,会出现物联网设备认为订阅成功、物联网平台确定认为失败,使得两者状态不一致情况。
一方面,按照物联网的协议规定,如果订阅某项资源失败,物联网平台将不能再次对相同资源进行订阅,另一方面,物联网设备上报的资源到达物联网平台,该资源将会被丢弃,造成浪费。
参照图1,示出了本申请一个实施例的一种物联网设备的资源订阅方法的步骤流程图,具体可以包括如下步骤:
步骤101,注册物联网设备。
在具体实现中,本申请实施例可以应用在物联网平台中,该物联网平台可以为独立的计算设备,也可以为计算集群,本申请实施例对此不加以限制。
一方面,物联网设备,如电表、水表、气象监测仪等,在物联网平台中进行注册,并接入物联网平台,按照物联网协议与物联网平台进行通信,接收物联网平台的指令,并进行相应的处理,或者,向物联网平台上报订阅的设备资源,如用户用电量、用户用水量、温度等。
另一方面,业务平台与物联网平台连接,根据业务需求订阅物联网设备的设备资源,进行相应的业务处理,如统计每日或每月用户用电量、从而生成用电计费单,绘制每时或每日的温度曲线变化图,等等。
在一种实施方式中,如图2所示,物联网设备200中配置有物联网通信模组211,该物联网通信模组211可以通过RS485、UART(Universal Asynchronous Receiver Transmitter,通用异步收发传输器)、I2C(Inter Integrated Circuit,内置集成电路)等方式接入物联网设备200的处理器中,并与该处理器进行通信。
一般情况下,物联网设备200(物联网通信模组211)位于运营商的内网210中,而物联网平台231位于运营商的公网230中,因此,物联网设备200(物联网通信模块211)发送至基站212的数据,经过NAT(Network Address Translation,网络地址转换)服务器220进行内网210到公网230的地址映射,再通过UDP(User Datagram Protocol,用户数据报协议)/IP(Internet Protocol Address,互联网协议地址)转发到物联网平台231,同理,物联网平台231的数据,经过NAT服务器220进行公网230到内网210的地址映射,再通过 UDP/IP转发基站212,基站212发送至物联网设备200(物联网通信模组211)。
由于物联网平台231与业务平台232同属于公网230,因此,可以直接通过TCP(Transmission Control Protocol,传输控制协议)/IP进行通信,通过业务平台232对物联网设备200的设备资源进行订阅,或者,从业务平台232接收物联网设备200的设备资源。
在实际应用中,物联网设备的类型有所不同,所应用的物联网协议有所不同,为使本领域技术人员更好地理解本申请实施例,将NB-IoT(Narrow Band Internet of Things,基于蜂窝的窄带物联网)作为物联网设备的一种示例进行说明。
在此示例中,物联网平台通过RFC7641协议与NB-IoT设备进行通信,以订阅NB-IoT设备的设备资源。
如图3所示,物联网设备(如NB-IoT设备)在启动之后,通知物联网通信模组进行注册,物联网通信模组与基站建立无线连接,并通过该无线连接发送注册请求。
基站将物联网通信模组的注册请求发送至NAT服务器,NAT服务器对该注册请求进行内网至公网的地址转换之后,发送至物联网平台。
物联网平台依据该注册请求对物联网设备进行鉴权,如果鉴定该物联网设备为合法设备,则确认注册成功,允许其接入物联网平台。
一方面,物联网平台将注册成功的通知发送至NAT服务器,NAT服务器对该注册成功的通知进行公网至内网的地址转换之后,发送至基站,基站通过无线连接将该注册成功的通知发送至物联网通信模组,物联网通信模组通知物联网设备注册完成。
另一方面,物联网平台将上线通知发送至业务平台,通知物联网设备注册上线,业务平台收到该上线通知后,向业务平台发送确认的消息。
步骤102,若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌。
如图3所示,物联网云平台在物联网设备注册成功后会通知业务平台物联网设备上线,然后对业务平台进行监听,等待业务平台对感兴趣的设备资源的订阅请求。
用户可以在业务平台上进行操作,选定订阅的设备资源,按照TCP/IP生成订阅请求,发送至物联网平台。
物联网平台依据该订阅请求,生成本次订阅的目标令牌token。
在本申请的一个实施例中,步骤102可以包括如下子步骤:
子步骤S11,确定是否存储有在先对所述物联网设备生成的目标令牌;若是,则执行子步骤S12,若否,则执行子步骤S13。
子步骤S12,删除在先生成的目标令牌,重新对所述物联网设备生成目标令牌。
子步骤S13,初次对所述物联网设备生成目标令牌。
在初次注册成功之后,对于物联网设备而言,会在预设的时间段内等待物联网平台的 资源订阅请求消息。
在一种情况中,如果在该时间段内接收到资源订阅请求消息,则物联网设备向物联网平台发送资源订阅响应消息进行确认,此时,物联网设备认为设备资源订阅成功。
在另一种情况中,如果在该时间段内未接收到资源订阅请求消息,则物联网设备重新进行注册。
在此情况下,对于物联网平台而言,物联网平台已经生成目标令牌token、存储在监听表中,并发出资源订阅请求消息,而由于NAT服务器、基站等传输出现问题,导致无法将资源订阅请求消息发送至物联网设备。
此后,在物联网设备重新进行注册时,重新与物联网平台生成新的会话。
由于目标令牌token在一次物联网平台与物联网设备之间的会话内有效,因此,物联网平台在物联网设备注册之后,可以在监听表检查是否存储有在先对物联网设备生成的目标令牌token。
如果有,表示物联网设备并非首次注册,则删除在先生成的目标令牌token,停止监听上次会话要求订阅的设备资源,释放物联网平台占用的资源,降低资源耗费,重新对本次会话生成新的目标令牌token,监听本次会话要求订阅的设备资源。
如果没有,表示物联网设备首次注册,初次对会话生成目标令牌token,监听本次会话要求订阅的设备资源。
步骤103,向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息。
在本申请实施例中,物联网平台可以按照RFC7641等协议生成资源订阅请求消息(即CoAP Registration消息),携带目标令牌token发送至物联网设备(如NB-IoT设备)。
如图3所示,物联网平台将资源订阅请求消息发送至NAT服务器,NAT服务器对该资源订阅请求消息进行公网至内网的地址转换之后,发送至基站,基站通过无线连接将该资源订阅请求消息发送至物联网通信模组,物联网通信模组向物联网设备发送相关的订阅请求。
步骤104,若在预设的时间段内未接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息,则确认订阅所述设备资源等待超时。
步骤105,依据订阅所述设备资源等待超时,保存所述目标令牌。
物联网平台发送至资源订阅请求消息后,则在预设的时间段内等待物联网设备对资源订阅请求消息发送的资源订阅响应消息。
一般情况下,若物联网设备接收到资源订阅请求消息,则对资源订阅请求消息进行确认,根据RFC7641/7252生成资源订阅响应消息(即CoAP 2.xx消息),表示本次订阅成功,发送至物联网平台,并保存资源订阅请求消息中的目标令牌token。
如图3所示,若物联网设备对订阅进行了确认,则通知物联网通信模组,物联网通信模组生成资源订阅响应消息,通过无线连接发送至基站,基站将该资源订阅响应消息发送至NAT服务器,NAT服务器对该资源订阅响应消息进行内网至公网的地址转换之后,发送至物联网平台。
因此,如果物联网平台在该时间段内未接收到物联网设备的资源订阅响应消息,出现订阅设备资源等待超时,可能存在如下两种情况:
1、物联网平台的资源订阅请求消息未发送至物联网设备。
在此情况中,物联网平台已生成资源订阅请求消息,并通过NAT服务器、基站等设备发送至物联网设备,由于NAT服务器、基站等传输出现问题,导致资源订阅请求消息未发送至物联网设备,因此,物联网设备也不会相应地生成资源订阅响应消息,物联网平台也就无法接收到资源订阅响应消息。
由于物联网设备在此种情况下会重新进行注册(即步骤101),物联网平台重新对设备资源进行订阅,因此,物联网平台存储目标令牌,并不会对后续的订阅造成影响。
2、物联网设备的资源订阅响应消息未发送至物联网平台。
在此情况中,物联网设备已接收到资源订阅请求消息并生成资源订阅响应消息,通过NAT服务器、基站等设备发送至物联网设备,由于NAT服务器、基站等传输出现问题,导致资源订阅响应消息未发送至物联网平台。
此时,物联网设备认为订阅成功,并不会重新进行注册(即步骤101),对于物联网平台而言,存储目标令牌,可以使得物联网设备后续使用该目标令牌上报订阅的设备资源时,物联网平台依然可以正确进行校验。
在本申请实施例中,若业务平台请求订阅物联网设备的设备资源,则对物联网设备生成目标令牌,向物联网设备发送携带目标令牌、且订阅设备资源的资源订阅请求消息,若在预设的时间段内未接收到物联网设备对资源订阅请求消息发送的资源订阅响应消息,则确认订阅设备资源等待超时,依据订阅设备资源等待超时,保存目标令牌,在物联网设备生成资源订阅响应消息认为订阅成功、但未发送资源订阅响应消息成功的情况下,物联网平台认为等待超时,依然保存目标令牌,使得物联网设备与物联网平台在出现通信异常时对订阅的状态保持一致,使得后续物联网设备上报的设备资源可以进行校验并上报业务平台,保证设备资源的订阅成功。
参照图4,示出了本申请一个实施例的另一种物联网设备的资源订阅方法的步骤流程图,具体可以包括如下步骤:
步骤401,注册物联网设备。
步骤402,若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌。
步骤403,向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息。
步骤404,若在预设的时间段内未接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息,则确认订阅所述设备资源等待超时。
步骤405,依据订阅所述设备资源等待超时,保存所述目标令牌。
步骤406,确定订阅所述设备资源的等待时间是否超过预定阈值,响应于订阅所述设备资源的等待时间超过预定阈值,生成订阅超时消息。
步骤407,将所述订阅超时消息发送至所述业务平台,以等待订阅的设备资源。
在本申请实施例中,对于订阅设备资源等待超时,并不认为订阅设备资源失败,此时,可以生成订阅超时消息,通过TCP/IP发送至业务平台。
业务平台接收到该订阅超时消息后,获知订阅设备资源等待超时,则继续等待物联网平台上报其订阅物联网设备的设备资源。
参照图5,示出了本申请一个实施例的又一种物联网设备的资源订阅方法的步骤流程图,具体可以包括如下步骤:
步骤501,注册物联网设备。
步骤502,若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌。
步骤503,向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息。
步骤504,确定在预设的时间段内是否接收到所述物联网设备发送的资源订阅响应消息,响应于在预设的时间段内接收到所述物联网设备发送的资源订阅响应消息,则确认订阅所述设备资源成功。
步骤505,依据订阅所述设备资源成功,保存所述目标令牌。
物联网平台发送至资源订阅请求消息后,则在预设的时间段内等待物联网设备对资源订阅请求消息发送的资源订阅响应消息。
如果物联网平台在该时间段内接收到物联网设备的资源订阅响应消息,则可以确认订阅设备资源成功,此时,存储目标令牌至监听表,使得物联网设备后续使用该目标令牌上报订阅的设备资源时,物联网平台可以正确进行校验。
步骤506,依据订阅所述设备资源成功,生成订阅成功消息。
步骤507,将所述订阅成功消息发送至所述业务平台,以等待订阅的设备资源。
如图3所示,物联网平台在订阅设备资源成功时,生成订阅成功消息,通过TCP/IP发送至业务平台,对订阅进行确认。
业务平台接收到该订阅成功消息后,获知订阅设备资源成功,正常等待物联网设备上 报其订阅的设备资源。
参照图6,示出了本申请一个实施例的再一种物联网设备的资源订阅方法的步骤流程图,具体可以包括如下步骤:
步骤601,注册物联网设备。
步骤602,若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌。
步骤603,向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息。
步骤604,在预设的时间段内判断是否接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息;若是,则执行步骤605,若否,则执行步骤607。
步骤605,确认订阅所述设备资源成功。
步骤606,依据订阅所述设备资源成功,保存所述目标令牌。
步骤607,确认订阅所述设备资源等待超时。
步骤608,依据订阅所述设备资源等待超时,保存所述目标令牌。
步骤609,接收所述物联网设备发送的资源订阅通知消息。
步骤610,将所述目标令牌与所述参考令牌进行匹配。
步骤611,当匹配成功时,将所述设备资源发送至所述业务平台。
如图3所示,针对NB-IoT等应用场景下对物联网设备低功耗的要求,很多数情况下,物联网设备在完成初始化后尽快进入睡眠的状态,而物联网设备在睡眠的期间无法接收数据。
例如,在NB-IoT中,物联网设备可以通过节能模式PSM、扩展不连续接收eDRX等模式进行睡眠。
因此,在物联网设备在启动之后、睡眠之前完成初始化,保证物联网设备与物联网平台的订阅状态一致,保证物联网设备唤醒后正常地上报订阅的设备资源。
物联网设备在唤醒后,采集订阅的设备资源,根据RFC7641/7252生成资源订阅通知消息(即CoAP Notification消息),并将在先保存的某个目标令牌作为参考令牌发送至物联网平台。
物联网平台在运行时接收物联网设备的资源订阅通知消息,其中,资源订阅通知消息中包括设备资源与参考令牌。
物联网平台从资源订阅通知消息中提取设备资源与参考令牌,并在监听表中提取该物联网设备对应的目标令牌。
对于物联网平台而言,该目标令牌可以为在先订阅设备资源等待超时时保存的目标令牌,也可以为在先订阅设备资源成功时保存的目标令牌,本申请实施例对此不加以限制。
物联网平台将参考令牌与目标令牌进行匹配,如果两者匹配成功,则认为该资源订阅通知消息合法,可以通过TCP/IP将设备资源发送至业务平台。
如图3所示,若物联网设备采集了设备资源,则可以传输至物联网通信模组,物联网通信模组将该设备资源封装为资源订阅通知消息,通过无线连接发送至基站,基站将该资源订阅通知消息发送至NAT服务器,NAT服务器对该资源订阅通知消息进行内网至公网的地址转换之后,发送至物联网平台,物联网平台在校验令牌之后,将设备资源发送至业务平台。
参见图7,本申请实施例提供的物联网平台改进的订阅请求处理流程包括:
监听物联网设备的业务请求。
业务平台发送订阅请求。
生成token[设备ID]=x,并保存,通过coap(物联网应用层协议)向物联网设备发送订阅(observe(token=x))请求,其中携带生成的token。物联网平台在发送订阅请求时即保存生成的token,主要用于物联网平台在等待订阅请求确认期间能够处理NB-IOT设备(物联网设备)的数据上报。
判断是否收到物联网设备回复的确认(ACK)消息,如果是,则订阅成功,并通知业务平台,继续保存token[设备ID]=x,用于后续订阅匹配。否则,认为订阅请求确认等待超时,通知业务平台,但是,同样保存token[设备ID]=x,用于后续订阅匹配。物联网平台在等待订阅请求确认超时时,继续保存前面生成的token,主要用于处理前面提到的订阅请求确认消息丢包引起的状态不一致情况,保证物联网平台在此情况下可以处理后续该NB-IOT设备的数据上报。
参见图8,本申请实施例提供的物联网平台处理数据上报的流程,具体包括:
监听数据上报。
判断是否收到物联网设备发送的数据上报,如果是,则开启任务处理该数据上报;否则,继续监听数据上报。
开启任务处理该数据上报后,继续监听其他数据上报,并且判断是否存在token[设备ID]=x,如果是,则处理并转发该数据上报给业务平台,否则,订阅失败,通知业务平台。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图9,示出了本申请一个实施例的一种物联网设备的资源订阅装置的结构框图,具体可以包括如下模块:
设备注册模块701,用于注册物联网设备;
令牌生成模块702,用于若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌;
订阅请求发送模块703,用于向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息;
订阅超时确认模块704,用于若在预设的时间段内未接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息,则确认订阅所述设备资源等待超时;
超时保存模块705,用于依据订阅所述设备资源等待超时,保存所述目标令牌。
在本申请的一个实施例中,所述令牌生成模块702包括:
令牌存储判断子模块,用于确定是否存储有在先对所述物联网设备生成的目标令牌;若是,则调用重新生成子模块,若否,则调用初次生成子模块;
重新生成子模块,用于删除在先生成的目标令牌,重新对所述物联网设备生成目标令牌;
初次生成子模块,用于初次对所述物联网设备生成目标令牌。
在本申请的一个实施例中,还包括:
订阅超时消息生成模块,用于确定订阅所述设备资源的等待时间是否超过预定阈值,响应于订阅所述设备资源的等待时间超过预定阈值,生成订阅超时消息;
订阅超时消息发送模块,用于将所述订阅超时消息发送至所述业务平台,以等待订阅的设备资源。
在本申请的一个实施例中,还包括:
订阅成功确认模块,用于确定在预设的时间段内是否接收到所述物联网设备发送的资源订阅响应消息,响应于在预设的时间段内接收到所述物联网设备发送的资源订阅响应消息,则确认订阅所述设备资源成功;
成功保存模块,用于依据订阅所述设备资源成功,保存所述目标令牌;
订阅成功消息生成模块,用于依据订阅所述设备资源成功,生成订阅成功消息;
订阅成功消息发送模块,用于将所述订阅成功消息发送至所述业务平台,以等待订阅的设备资源。
在本申请的一个实施例中,还包括:
订阅通知接收模块,用于接收所述物联网设备发送的资源订阅通知消息,所述资源订阅通知消息中包括设备资源与参考令牌;
令牌匹配模块,用于将所述目标令牌与所述参考令牌进行匹配;
设备资源发送模块,用于当匹配成功时,将所述设备资源发送至所述业务平台。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之 处参见方法实施例的部分说明即可。
参照图10,示出了本申请一个实施例的一种计算机设备的结构框图,具体可以包括如下模块:
存储器11,用于存储程序指令;
处理器12,用于调用所述存储器中存储的程序指令,按照获得的程序执行本申请实施例提供的任一所述的方法。
本申请实施例提供任一所述装置,可以是一种服务器,也可以是一种计算设备,该计算设备具体可以为桌面计算机、便携式计算机、智能手机、平板电脑、个人数字助理(Personal Digital Assistant,PDA)等。该计算设备可以包括中央处理器(Center Processing Unit,CPU)、存储器、输入/输出设备等,输入设备可以包括键盘、鼠标、触摸屏等,输出设备可以包括显示设备,如液晶显示器(Liquid Crystal Display,LCD)、阴极射线管(Cathode Ray Tube,CRT)等。
所述存储器可以包括只读存储器(ROM)和随机存取存储器(RAM),并向处理器提供存储器中存储的程序指令和数据。在本申请实施例中,存储器可以用于存储本申请实施例提供的任一所述方法的程序。
所述处理器通过调用存储器存储的程序指令,处理器用于按照获得的程序指令执行本申请实施例提供的任一所述方法。处理器12可以是中央处埋器(CPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD)。
本申请实施例提供了一种机器可读的非易失性存储介质,用于储存为上述本申请实施例提供的装置所用的计算机程序指令,其包含用于执行上述本申请实施例提供的任一方法的程序。
所述计算机存储介质可以是计算机能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器(例如软盘、硬盘、磁带、磁光盘(MO)等)、光学存储器(例如CD、DVD、BD、HVD等)、以及半导体存储器(例如ROM、EPROM、EEPROM、非易失性存储器(NAND FLASH)、固态硬盘(SSD))等。
本申请实施例提供的方法可以应用于终端设备,也可以应用于网络设备。
其中,终端设备也可称之为用户设备(User Equipment,简称为“UE”)、移动台(Mobile Station,简称为“MS”)、移动终端(Mobile Terminal)等,可选的,该终端可以具备经无线接入网(Radio Access Network,RAN)与一个或多个核心网进行通信的能力,例如,终端可以是移动电话(或称为“蜂窝”电话)、或具有移动性质的计算机等,例如,终端还可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置。
网络设备可以为基站(例如,接入点),指接入网中在空中接口上通过一个或多个扇 区与无线终端通信的设备。基站可用于将收到的空中帧与IP分组进行相互转换,作为无线终端与接入网的其余部分之间的路由器,其中接入网的其余部分可包括网际协议(IP)网络。基站还可协调对空中接口的属性管理。例如,基站可以是GSM或CDMA中的基站(BTS,Base Transceiver Station),也可以是WCDMA中的基站(NodeB),还可以是LTE中的演进型基站(NodeB或eNB或e-NodeB,evolutional Node B),或者也可以是5G系统中的gNB等。本申请实施例中不做限定。
在本申请实施例中,若业务平台请求订阅物联网设备的设备资源,则对物联网设备生成目标令牌,向物联网设备发送携带目标令牌、且订阅设备资源的资源订阅请求消息,若在预设的时间段内未接收到物联网设备对资源订阅请求消息发送的资源订阅响应消息,则确认订阅设备资源等待超时,依据订阅设备资源等待超时,保存目标令牌,在物联网设备生成资源订阅响应消息认为订阅成功、但未发送资源订阅响应消息成功的情况下,物联网平台认为等待超时,依然保存目标令牌,使得物联网设备与物联网平台在出现通信异常时对订阅的状态保持一致,使得后续物联网设备上报的设备资源可以进行校验并上报业务平台,保证设备资源的订阅成功。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计 算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种物联网设备的资源订阅方法和一种物联网设备的资源订阅装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (7)

  1. 一种物联网设备的资源订阅方法,包括:
    注册物联网设备;
    若业务平台请求订阅所述物联网设备的设备资源,则对所述物联网设备生成目标令牌;
    向所述物联网设备发送携带所述目标令牌、且订阅所述设备资源的资源订阅请求消息;
    若在预设的时间段内未接收到所述物联网设备对所述资源订阅请求消息发送的资源订阅响应消息,则确认订阅所述设备资源等待超时;
    依据订阅所述设备资源等待超时,保存所述目标令牌。
  2. 根据权利要求1所述的方法,对所述物联网设备生成目标令牌,包括:
    确定是否存储有在先对所述物联网设备生成的目标令牌;
    响应于存储有在先对所述物联网设备生成的目标令牌,则删除在先生成的目标令牌,重新对所述物联网设备生成目标令牌;
    响应于不存储有在先对所述物联网设备生成的目标令牌,则初次对所述物联网设备生成目标令牌。
  3. 根据权利要求1所述的方法,还包括:
    确定订阅所述设备资源的等待时间是否超过预定阈值,响应于订阅所述设备资源的等待时间超过预定阈值,生成订阅超时消息;
    将所述订阅超时消息发送至所述业务平台,以等待订阅的设备资源。
  4. 根据权利要求1所述的方法,还包括:
    确定在预设的时间段内是否接收到所述物联网设备发送的资源订阅响应消息,响应于在预设的时间段内接收到所述物联网设备发送的资源订阅响应消息,则确认订阅所述设备资源成功;
    依据订阅所述设备资源成功,保存所述目标令牌;
    依据订阅所述设备资源成功,生成订阅成功消息;
    将所述订阅成功消息发送至所述业务平台,以等待订阅的设备资源。
  5. 根据权利要求1或2或3或4所述的方法,还包括:
    接收所述物联网设备发送的资源订阅通知消息,所述资源订阅通知消息中包括设备资源与参考令牌;
    将所述目标令牌与所述参考令牌进行匹配;
    当匹配成功时,将所述设备资源发送至所述业务平台。
  6. 一种计算机设备,包括:
    存储器,用于存储计算机指令;
    处理器,配置为运行所述计算机指令以实现权利要求1至5任一项所述的方法。
  7. 一种机器可读的非易失性存储介质,所述存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行1至5任一项所述的方法。
PCT/CN2018/113514 2018-04-24 2018-11-01 物联网设备的资源订阅 WO2019205557A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201810373823.7 2018-04-24
CN201810373823 2018-04-24
CN201810443341.4A CN108712485B (zh) 2018-05-10 2018-05-10 一种物联网设备的资源订阅方法和装置
CN201810443341.4 2018-05-10

Publications (1)

Publication Number Publication Date
WO2019205557A1 true WO2019205557A1 (zh) 2019-10-31

Family

ID=68293420

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/113514 WO2019205557A1 (zh) 2018-04-24 2018-11-01 物联网设备的资源订阅

Country Status (1)

Country Link
WO (1) WO2019205557A1 (zh)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488225A (zh) * 2020-04-09 2020-08-04 深圳精智达技术股份有限公司 集成对象的消息传输方法、服务器及计算机可读存储介质
CN112910954A (zh) * 2021-01-14 2021-06-04 国网安徽省电力有限公司信息通信分公司 一种电力物联网设备远程管理方法及系统
CN113032483A (zh) * 2021-03-12 2021-06-25 北京百度网讯科技有限公司 跨平台的数据资产共享方法、装置及电子设备
CN113556389A (zh) * 2021-07-14 2021-10-26 山东新一代信息产业技术研究院有限公司 一种rpc式的云边端通信方法、系统及存储介质
CN113852696A (zh) * 2021-09-30 2021-12-28 济南浪潮数据技术有限公司 一种带内资源信息查询的方法、系统、设备和存储介质
CN113940037A (zh) * 2019-11-26 2022-01-14 Oppo广东移动通信有限公司 资源订阅方法、装置、计算机设备和存储介质
CN114095571A (zh) * 2020-07-30 2022-02-25 中移(苏州)软件技术有限公司 数据处理方法、数据服务总线、终端和存储介质
CN114500669A (zh) * 2021-12-31 2022-05-13 珠海派诺科技股份有限公司 基于物联网的实时通信方法及系统、存储介质、电子设备
CN115460211A (zh) * 2021-06-07 2022-12-09 中移物联网有限公司 一种信息交互方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130276144A1 (en) * 2012-04-11 2013-10-17 Intermec Ip Corp. Wireless sensor field enumeration
CN103780663A (zh) * 2012-10-26 2014-05-07 中兴通讯股份有限公司 一种终端外设的远程管理方法、装置和系统
CN105656768A (zh) * 2014-11-14 2016-06-08 北京海尔广科数字技术有限公司 一种提高Alljoyn网关的资源利用率的方法和Alljoyn网关
US20160212099A1 (en) * 2015-01-16 2016-07-21 Zingbox, Ltd. Private cloud control
CN107018147A (zh) * 2017-05-09 2017-08-04 上海斐讯数据通信技术有限公司 一种物联网通信方法及系统、网关模块
CN108712485A (zh) * 2018-05-10 2018-10-26 海信集团有限公司 一种物联网设备的资源订阅方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130276144A1 (en) * 2012-04-11 2013-10-17 Intermec Ip Corp. Wireless sensor field enumeration
CN103780663A (zh) * 2012-10-26 2014-05-07 中兴通讯股份有限公司 一种终端外设的远程管理方法、装置和系统
CN105656768A (zh) * 2014-11-14 2016-06-08 北京海尔广科数字技术有限公司 一种提高Alljoyn网关的资源利用率的方法和Alljoyn网关
US20160212099A1 (en) * 2015-01-16 2016-07-21 Zingbox, Ltd. Private cloud control
CN107018147A (zh) * 2017-05-09 2017-08-04 上海斐讯数据通信技术有限公司 一种物联网通信方法及系统、网关模块
CN108712485A (zh) * 2018-05-10 2018-10-26 海信集团有限公司 一种物联网设备的资源订阅方法和装置

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113940037B (zh) * 2019-11-26 2023-09-05 Oppo广东移动通信有限公司 资源订阅方法、装置、计算机设备和存储介质
CN113940037A (zh) * 2019-11-26 2022-01-14 Oppo广东移动通信有限公司 资源订阅方法、装置、计算机设备和存储介质
CN111488225A (zh) * 2020-04-09 2020-08-04 深圳精智达技术股份有限公司 集成对象的消息传输方法、服务器及计算机可读存储介质
CN111488225B (zh) * 2020-04-09 2023-09-05 深圳精智达技术股份有限公司 集成对象的消息传输方法、服务器及计算机可读存储介质
CN114095571A (zh) * 2020-07-30 2022-02-25 中移(苏州)软件技术有限公司 数据处理方法、数据服务总线、终端和存储介质
CN112910954A (zh) * 2021-01-14 2021-06-04 国网安徽省电力有限公司信息通信分公司 一种电力物联网设备远程管理方法及系统
CN112910954B (zh) * 2021-01-14 2023-12-29 国网安徽省电力有限公司信息通信分公司 一种电力物联网设备远程管理方法及系统
CN113032483B (zh) * 2021-03-12 2023-08-08 北京百度网讯科技有限公司 跨平台的数据资产共享方法、装置及电子设备
CN113032483A (zh) * 2021-03-12 2021-06-25 北京百度网讯科技有限公司 跨平台的数据资产共享方法、装置及电子设备
CN115460211A (zh) * 2021-06-07 2022-12-09 中移物联网有限公司 一种信息交互方法及装置
CN113556389A (zh) * 2021-07-14 2021-10-26 山东新一代信息产业技术研究院有限公司 一种rpc式的云边端通信方法、系统及存储介质
CN113556389B (zh) * 2021-07-14 2024-02-09 山东新一代信息产业技术研究院有限公司 一种rpc式的云边端通信方法、系统及存储介质
CN113852696A (zh) * 2021-09-30 2021-12-28 济南浪潮数据技术有限公司 一种带内资源信息查询的方法、系统、设备和存储介质
CN114500669A (zh) * 2021-12-31 2022-05-13 珠海派诺科技股份有限公司 基于物联网的实时通信方法及系统、存储介质、电子设备

Similar Documents

Publication Publication Date Title
WO2019205557A1 (zh) 物联网设备的资源订阅
US11444986B2 (en) Device triggering
US20150229669A1 (en) Method and device for detecting distributed denial of service attack
US10181963B2 (en) Data transfer method and system
CN110999257B (zh) 用于服务器通知的递送的传送方法选择
EP3836577A1 (en) Session management method and device for user groups
EP3621360B1 (en) System information transmission method and related device
WO2017107550A1 (zh) 网络连接方法和装置
US20160212728A1 (en) Paging method, network device and communication system
CN108712485A (zh) 一种物联网设备的资源订阅方法和装置
US11831736B2 (en) System and methods for service layer cache management
WO2017088498A1 (zh) 一种用户设备能力信息上报的方法、装置及系统
US8457030B2 (en) Mobile phone and method for receiving calls
WO2022105711A1 (zh) Ims注册方法、终端设备及存储介质
US11985195B2 (en) Methods to enable data continuity service
WO2018214762A1 (zh) 一种获取寻呼参数的方法及装置
US9866641B2 (en) Information query method and device
IL272881B2 (en) Method and device for wireless communication
JP2017525251A (ja) コア・ネットワークとの無線ノード認証のオフローディング
WO2018107368A1 (zh) 数据传输的连接建立方法及装置
US11522962B2 (en) Methods and apparatuses for IP and non-IP data communication using a unified interface
US9860840B2 (en) System, method, and server for keeping wireless local area network terminal online all the time
US9774566B2 (en) Communication method and mobile electronic device using the same
WO2020009797A1 (en) Efficient resource representation exchange between service layers
WO2023143420A1 (zh) 设备管理方法及装置

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18916181

Country of ref document: EP

Kind code of ref document: A1