CN108712485B - Resource subscription method and device for Internet of things equipment - Google Patents

Resource subscription method and device for Internet of things equipment Download PDF

Info

Publication number
CN108712485B
CN108712485B CN201810443341.4A CN201810443341A CN108712485B CN 108712485 B CN108712485 B CN 108712485B CN 201810443341 A CN201810443341 A CN 201810443341A CN 108712485 B CN108712485 B CN 108712485B
Authority
CN
China
Prior art keywords
internet
things
resource
subscription
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810443341.4A
Other languages
Chinese (zh)
Other versions
CN108712485A (en
Inventor
张琨
刁克刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Group Co Ltd
Original Assignee
Hisense Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Group Co Ltd filed Critical Hisense Group Co Ltd
Priority to CN201810443341.4A priority Critical patent/CN108712485B/en
Publication of CN108712485A publication Critical patent/CN108712485A/en
Priority to PCT/CN2018/113514 priority patent/WO2019205557A1/en
Application granted granted Critical
Publication of CN108712485B publication Critical patent/CN108712485B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The embodiment of the invention provides a resource subscription method and a resource subscription device of Internet of things equipment, wherein the method comprises the following steps: registering the Internet of things equipment; if the service platform requests to subscribe the equipment resources of the Internet of things equipment, generating a target token for the Internet of things equipment; sending a resource subscription request message carrying the target token and subscribing the equipment resource to the Internet of things equipment; if a resource subscription response message sent by the internet of things equipment to the resource subscription request message is not received within a preset time period, confirming that the equipment resource subscription is overtime; and storing the target token according to the waiting overtime of the equipment resource subscription. And under the condition that the internet of things equipment generates the resource subscription response message and considers that the subscription is successful but does not send the resource subscription response message successfully, the internet of things platform considers that the waiting time is overtime, and the target token is still stored, so that the states of the internet of things equipment and the internet of things platform are consistent when communication is abnormal.

Description

Resource subscription method and device for Internet of things equipment
Technical Field
The invention relates to the technical field of communication, in particular to a resource subscription method and device of Internet of things equipment.
Background
The internet technology revolution brings human beings into the virtual world, while the internet of things revolution brings the virtual world back to reality, and the boundary between the virtual world and the real world will become increasingly blurred in life, work, and business and industrial scenes.
After the Internet of things equipment is accessed to the Internet of things platform, the service platform can subscribe the resources of the Internet of things equipment through the Internet of things platform, and the Internet of things equipment returns a confirmation message to the subscription.
However, the wireless network of the internet of things has the characteristics of wide coverage, weak signals, small bandwidth and the like, the transmission loss rate of the confirmation message of the internet of things equipment is high, and once the confirmation message is lost, the internet of things equipment considers that subscription is successful and the internet of things platform determines that subscription is failed, so that the states of the internet of things equipment and the internet of things platform are inconsistent.
On one hand, according to the protocol specification of the internet of things, if the subscription of a certain resource fails, the internet of things platform cannot subscribe the same resource again, and on the other hand, the resource reported by the internet of things equipment reaches the internet of things platform, and the resource is discarded, so that waste is caused.
Disclosure of Invention
The embodiment of the invention provides a resource subscription method and device for Internet of things equipment, and aims to solve the problem of inconsistent states between the Internet of things equipment and an Internet of things platform due to the fact that the transmission of a confirmation message of the Internet of things equipment is lost.
According to an aspect of the present invention, a resource subscription method for an internet of things device is provided, including:
registering the Internet of things equipment;
if the service platform requests to subscribe the equipment resources of the Internet of things equipment, generating a target token for the Internet of things equipment;
sending a resource subscription request message carrying the target token and subscribing the equipment resource to the Internet of things equipment;
if a resource subscription response message sent by the internet of things equipment to the resource subscription request message is not received within a preset time period, confirming that the equipment resource subscription is overtime;
and storing the target token according to the waiting overtime of the equipment resource subscription.
Optionally, the generating a target token for the internet of things device includes:
judging whether a target token generated for the Internet of things equipment in advance is stored;
if so, deleting the previously generated target token, and generating the target token for the Internet of things equipment again;
and if not, generating a target token for the Internet of things equipment for the first time.
Optionally, the method further comprises:
generating a subscription overtime message according to the waiting overtime of the subscription of the equipment resource;
and sending the subscription overtime message to the service platform to wait for the subscribed equipment resources.
Optionally, the method further comprises:
if a resource subscription response message sent by the Internet of things equipment is received within a preset time period, confirming that the equipment resource subscription is successful;
storing the target token according to the success of subscribing the equipment resource;
generating a subscription success message according to the success of subscribing the equipment resource;
and sending the successful subscription message to the service platform to wait for the subscribed equipment resources.
Optionally, the method further comprises:
receiving a resource subscription notification message sent by the internet of things device, wherein the resource subscription notification message comprises device resources and a reference token;
matching the target token with the reference token;
and when the matching is successful, the equipment resource is sent to the service platform.
According to another aspect of the present invention, there is provided a resource subscription device for an internet of things device, including:
the equipment registration module is used for registering the equipment of the Internet of things;
the token generation module is used for generating a target token for the Internet of things equipment if the service platform requests to subscribe the equipment resources of the Internet of things equipment;
a subscription request sending module, configured to send a resource subscription request message carrying the target token and subscribing to the device resource to the internet of things device;
a subscription overtime confirmation module, configured to confirm that subscription to the device resource is overtime if a resource subscription response message sent by the internet of things device to the resource subscription request message is not received within a preset time period;
and the overtime storage module is used for storing the target token according to the overtime waiting of the equipment resource subscribed.
Optionally, the token generation module includes:
the token storage judging submodule is used for judging whether a target token generated for the Internet of things equipment in advance is stored; if yes, calling the regeneration submodule, and if not, calling the primary generation submodule;
the regeneration sub-module is used for deleting the previously generated target token and regenerating the target token for the Internet of things equipment;
and the primary generation submodule is used for generating a target token for the Internet of things equipment for the first time.
Optionally, the method further comprises:
a subscription overtime message generating module, configured to generate a subscription overtime message according to a wait overtime for subscribing to the device resource;
and the subscription timeout message sending module is used for sending the subscription timeout message to the service platform so as to wait for the subscribed equipment resources.
Optionally, the method further comprises:
the subscription success confirmation module is used for confirming that the device resources are subscribed successfully if the resource subscription response message sent by the Internet of things device is received within a preset time period;
a successful storage module, configured to store the target token according to success of subscribing to the device resource;
a subscription success message generation module, configured to generate a subscription success message according to success of subscribing to the device resource;
and the subscription success message sending module is used for sending the subscription success message to the service platform so as to wait for the subscribed equipment resources.
Optionally, the method further comprises:
a subscription notification receiving module, configured to receive a resource subscription notification message sent by the internet of things device, where the resource subscription notification message includes a device resource and a reference token;
a token matching module for matching the target token with the reference token;
and the equipment resource sending module is used for sending the equipment resources to the service platform when the matching is successful.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, if a service platform requests to subscribe equipment resources of internet of things equipment, a target token is generated for the internet of things equipment, a resource subscription request message carrying the target token and subscribing the equipment resources is sent to the internet of things equipment, if a resource subscription response message sent by the internet of things equipment to the resource subscription request message is not received within a preset time period, the subscription equipment resource is confirmed to be overtime, the target token is stored according to the overtime of the subscription equipment resource, and under the condition that the resource subscription response message generated by the internet of things equipment considers that the subscription is successful but the resource subscription response message is not sent successfully, the internet of things platform considers that the subscription is overtime, the target token is still stored, so that the subscription state of the internet of things equipment and the internet of things platform is kept consistent when communication is abnormal, and equipment resources reported by subsequent internet of things equipment can be, the successful subscription of the device resource is guaranteed.
Drawings
Fig. 1 is a flowchart illustrating steps of a resource subscription method for an internet of things device according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an architecture of an internet of things according to an embodiment of the present invention;
fig. 3 is a communication example diagram of an internet of things according to an embodiment of the invention;
fig. 4 is a flowchart illustrating steps of a resource subscription method for an internet of things device according to another embodiment of the present invention;
fig. 5 is a flowchart illustrating steps of a resource subscription method for an internet of things device according to another embodiment of the present invention;
fig. 6 is a flowchart illustrating steps of a resource subscription method for an internet of things device according to another embodiment of the present invention;
fig. 7 is a block diagram of a resource subscription apparatus of an internet of things device according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of a resource subscription method for an internet of things device according to an embodiment of the present invention is shown, and the method specifically includes the following steps:
step 101, registering Internet of things equipment.
In a specific implementation, the embodiment of the present invention may be applied to an internet of things platform, where the internet of things platform may be an independent computing device or a computing cluster, and the embodiment of the present invention is not limited thereto.
On the one hand, the internet of things equipment, such as an electric meter, a water meter, a meteorological monitor and the like, is registered in the internet of things platform, and is accessed into the internet of things platform, and the internet of things platform is communicated with the internet of things platform according to an internet of things protocol, so that the instruction of the internet of things platform is received, and corresponding processing is carried out, or subscribed equipment resources, such as user electricity consumption, user water consumption, temperature and the like, are reported to the internet of things platform.
On the other hand, the service platform is connected with the internet of things platform, and subscribes the equipment resources of the internet of things equipment according to service requirements, performs corresponding service processing, such as statistics of daily or monthly user electricity consumption to generate an electricity consumption billing list, and draws a daily or daily temperature curve change chart.
In an embodiment, as shown in fig. 2, the internet of things device 200 is configured with an internet of things communication module 211, and the internet of things communication module 211 may access a processor of the internet of things device 200 through RS485, UART (Universal Asynchronous receiver transmitter), I2C (Inter Integrated Circuit), and communicate with the processor.
Generally, the Internet of things device 200 (Internet of things communication module 211) is located in an intranet 210 of an operator, and the Internet of things platform 231 is located in a public Network 230 of the operator, so that data sent to the base station 212 by the Internet of things device 200 (Internet of things communication module 211) is subjected to Address mapping from the intranet 210 to the public Network 230 through a NAT (Network Address Translation) server 220, and then is forwarded to the Internet of things platform 231 through a UDP (User data Protocol)/IP (Internet Protocol Address), and similarly, data of the Internet of things platform 231 is subjected to Address mapping from the public Network 230 to the intranet 210 through the NAT server 220, and then is forwarded to the base station 212 through the UDP/IP, and the base station 212 is sent to the Internet of things device 200 (Internet of things communication module 211).
Since the internet of things platform 231 and the service platform 232 belong to the public network 230, communication can be directly performed through a Transmission Control Protocol (TCP)/Internet Protocol (IP), and the service platform 232 subscribes to the device resource of the internet of things device 200, or receives the device resource of the internet of things device 200 from the service platform 232.
In practical applications, the types of the devices of the Internet of Things are different, and the protocols of the Internet of Things are different, so that those skilled in the art can better understand the embodiments of the present invention, NB-IoT (Narrow Band Internet of Things based on cellular) is described as an example of the devices of the Internet of Things.
In this example, the internet of things platform communicates with the NB-IoT device over RFC7641 protocol to subscribe to device resources of the NB-IoT device.
As shown in fig. 3, after the internet of things device (e.g., NB-IoT device) is started, the internet of things communication module is notified to register, and establishes a wireless connection with the base station, and sends a registration request through the wireless connection.
The base station sends a registration request of the communication module of the Internet of things to the NAT server, and the NAT server carries out address conversion from an internal network to a public network on the registration request and then sends the registration request to the platform of the Internet of things.
And the Internet of things platform authenticates the Internet of things equipment according to the registration request, if the Internet of things equipment is identified as legal equipment, the successful registration is confirmed, and the Internet of things equipment is allowed to access the Internet of things platform.
On the one hand, the internet of things platform sends the successful registration notice to the NAT server, the NAT server performs address conversion from a public network to an intranet on the successful registration notice and then sends the successful registration notice to the base station, the base station sends the successful registration notice to the internet of things communication module through wireless connection, and the internet of things communication module informs the internet of things equipment of completion of registration.
On the other hand, the Internet of things platform sends the online notification to the service platform to notify the Internet of things equipment to register online, and the service platform sends a confirmation message to the service platform after receiving the online notification.
Step 102, if the service platform requests to subscribe the device resource of the internet of things device, generating a target token for the internet of things device.
As shown in fig. 3, after the internet of things device is successfully registered, the internet of things cloud platform notifies the service platform that the internet of things device is online, then monitors the service platform, and waits for a subscription request of the service platform for the interested device resource.
The user can operate on the service platform, select subscribed equipment resources, generate a subscription request according to the TCP/IP, and send the subscription request to the Internet of things platform.
And the Internet of things platform generates a target token of the subscription according to the subscription request.
In one embodiment of the present invention, step 102 may include the following sub-steps:
the substep S11 is used for judging whether a target token generated for the Internet of things equipment in advance is stored; if yes, go to substep S12, otherwise go to substep S13.
And a substep S12, deleting the previously generated target token, and generating the target token for the Internet of things equipment again.
And a substep S13, generating a target token for the Internet of things equipment for the first time.
After the initial registration is successful, for the internet of things device, a resource subscription request message of the internet of things platform is waited for within a preset time period.
In one case, if the resource subscription request message is received within the time period, the internet of things device sends a resource subscription response message to the internet of things platform for confirmation, and at this time, the internet of things device considers that the device resource subscription is successful.
In another case, if the resource subscription request message is not received within the time period, the internet of things device re-registers.
In this case, for the internet of things platform, the internet of things platform has generated the target token, stored in the monitoring table, and sends the resource subscription request message, and the resource subscription request message cannot be sent to the internet of things device due to the transmission problem of the NAT server, the base station, and the like.
And then, when the Internet of things equipment is registered again, a new session is generated with the Internet of things platform again.
The target token is effective in a session between the internet of things platform and the internet of things equipment, so that the internet of things platform can check whether the target token generated for the internet of things equipment in advance is stored in the monitoring table after the internet of things equipment is registered.
If the target token is not registered for the first time, the target token generated in advance is deleted, monitoring of the device resources required to be subscribed by the previous session is stopped, the resources occupied by the Internet of things platform are released, resource consumption is reduced, a new target token is generated for the session again, and the device resources required to be subscribed by the session are monitored.
If not, the Internet of things equipment is registered for the first time, a target token is generated for the session for the first time, and the equipment resources which require subscription for the session are monitored.
Step 103, sending a resource subscription request message carrying the target token and subscribing the device resource to the internet of things device.
In the embodiment of the present invention, the internet of things platform may generate a resource subscription request message (i.e., CoAP Registration message) according to protocols such as RFC7641, and send the resource subscription request message carrying the target token to the internet of things device (e.g., NB-IoT device).
As shown in fig. 3, the internet of things platform sends the resource subscription request message to the NAT server, the NAT server performs address conversion from the public network to the intranet on the resource subscription request message and sends the resource subscription request message to the base station, the base station sends the resource subscription request message to the internet of things communication module through wireless connection, and the internet of things communication module sends a related subscription request to the internet of things device.
And step 104, if a resource subscription response message sent by the internet of things device to the resource subscription request message is not received within a preset time period, determining that the subscription of the device resource is overtime.
And 105, storing the target token according to the waiting overtime of the equipment resource subscription.
After the internet of things platform sends the resource subscription request message, the resource subscription response message sent by the internet of things equipment to the resource subscription request message is waited for in a preset time period.
In general, if the internet of things device receives the resource subscription request message, the resource subscription request message is confirmed, a resource subscription response message (i.e., CoAP 2.xx message) is generated according to RFC7641/7252, the subscription is successful, the message is sent to the internet of things platform, and the target token in the resource subscription request message is stored.
As shown in fig. 3, if the internet of things device confirms the subscription, the internet of things communication module is notified, the internet of things communication module generates a resource subscription response message, the resource subscription response message is sent to the base station through the wireless connection, the base station sends the resource subscription response message to the NAT server, and the NAT server performs address conversion from the intranet to the public network on the resource subscription response message and then sends the address conversion to the internet of things platform.
Therefore, if the internet of things platform does not receive the resource subscription response message of the internet of things device within the time period, the resource waiting timeout of the subscription device occurs, and there may be two cases as follows:
1. and the resource subscription request message of the Internet of things platform is not sent to the Internet of things equipment.
In this case, the internet of things platform has generated the resource subscription request message and sent the resource subscription request message to the internet of things device through the NAT server, the base station, and other devices, and because the NAT server, the base station, and other devices have a problem in transmission, the resource subscription request message is not sent to the internet of things device, and therefore the internet of things device does not generate the resource subscription response message accordingly, and the internet of things platform cannot receive the resource subscription response message.
Because the internet of things equipment is registered again under the condition (step 101), and the internet of things platform subscribes the equipment resource again, the internet of things platform stores the target token and does not influence subsequent subscription.
2. And the resource subscription response message of the Internet of things equipment is not sent to the Internet of things platform.
In this case, the internet of things device has received the resource subscription request message and generated a resource subscription response message, and the resource subscription response message is sent to the internet of things device through the NAT server, the base station, and other devices.
At this time, the internet of things device considers that the subscription is successful, and does not perform registration again (i.e., step 101), and for the internet of things platform, the target token is stored, so that the internet of things platform can still perform correct verification when the internet of things device subsequently uses the target token to report the subscribed device resources.
In the embodiment of the invention, if a service platform requests to subscribe equipment resources of internet of things equipment, a target token is generated for the internet of things equipment, a resource subscription request message carrying the target token and subscribing the equipment resources is sent to the internet of things equipment, if a resource subscription response message sent by the internet of things equipment to the resource subscription request message is not received within a preset time period, the subscription equipment resource is confirmed to be overtime, the target token is stored according to the overtime of the subscription equipment resource, and under the condition that the resource subscription response message generated by the internet of things equipment considers that the subscription is successful but the resource subscription response message is not sent successfully, the internet of things platform considers that the subscription is overtime, the target token is still stored, so that the subscription state of the internet of things equipment and the internet of things platform is kept consistent when communication is abnormal, and equipment resources reported by subsequent internet of things equipment can be, the successful subscription of the device resource is guaranteed.
Referring to fig. 4, a flowchart illustrating steps of another method for subscribing to resources of an internet of things device according to an embodiment of the present invention is shown, and the method specifically includes the following steps:
step 401, registering the internet of things device.
Step 402, if the service platform requests to subscribe the device resource of the internet of things device, generating a target token for the internet of things device.
Step 403, sending a resource subscription request message carrying the target token and subscribing the device resource to the internet of things device.
Step 404, if a resource subscription response message sent by the internet of things device to the resource subscription request message is not received within a preset time period, determining to subscribe to the device resource for timeout.
Step 405, storing the target token according to the timeout waiting of the device resource subscription.
Step 406, generating a subscription timeout message according to the timeout of the device resource subscription.
Step 407, sending the subscription timeout message to the service platform to wait for the subscribed device resource.
In the embodiment of the invention, for the subscription equipment resource waiting overtime, the subscription equipment resource is not considered to be failed, and at the moment, a subscription overtime message can be generated and sent to the service platform through TCP/IP.
After receiving the subscription overtime message, the service platform learns that the subscription equipment resource is overtime, and then continues to wait for the internet of things platform to report the equipment resource subscribed to the internet of things equipment.
Referring to fig. 5, a flowchart illustrating steps of a resource subscription method for an internet of things device according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 501, registering the Internet of things equipment.
Step 502, if the service platform requests to subscribe the device resource of the internet of things device, a target token is generated for the internet of things device.
Step 503, sending a resource subscription request message carrying the target token and subscribing the device resource to the internet of things device.
Step 504, if the resource subscription response message sent by the internet of things device is received within a preset time period, it is confirmed that the device resource subscription is successful.
And 505, storing the target token according to the success of subscribing the equipment resource.
After the internet of things platform sends the resource subscription request message, the resource subscription response message sent by the internet of things equipment to the resource subscription request message is waited for in a preset time period.
If the internet of things platform receives the resource subscription response message of the internet of things equipment in the time period, the success of subscribing the equipment resources can be confirmed, and at the moment, the target token is stored in the monitoring table, so that the internet of things platform can correctly check when the internet of things equipment reports the subscribed equipment resources by using the target token subsequently.
Step 506, generating a subscription success message according to the success of subscribing the device resource.
And 507, sending the successful subscription message to the service platform to wait for the subscribed device resources.
As shown in fig. 3, when the internet of things platform subscribes to the device resource successfully, a subscription success message is generated and sent to the service platform through TCP/IP, so as to confirm the subscription.
After receiving the successful subscription message, the service platform learns that the equipment resource is successfully subscribed, and normally waits for the internet of things equipment to report the subscribed equipment resource.
Referring to fig. 6, a flowchart illustrating steps of a resource subscription method for an internet of things device according to another embodiment of the present invention is shown, and the method specifically includes the following steps:
step 601, registering the Internet of things equipment.
Step 602, if the service platform requests to subscribe the device resource of the internet of things device, a target token is generated for the internet of things device.
Step 603, sending a resource subscription request message carrying the target token and subscribing the device resource to the internet of things device.
Step 604, judging whether a resource subscription response message sent by the internet of things device to the resource subscription request message is received within a preset time period; if yes, go to step 605, otherwise go to step 607.
Step 605, confirming that the subscription of the device resource is successful.
Step 606, storing the target token according to the success of subscribing the device resource.
Step 607, confirming that subscribing to the device resource waits for a timeout.
Step 608, storing the target token according to the timeout of the device resource subscription.
Step 609, receiving a resource subscription notification message sent by the internet of things device.
Step 610, matching the target token with the reference token.
Step 611, when the matching is successful, sending the device resource to the service platform.
As shown in fig. 3, for the requirement of low power consumption of the internet of things device in application scenarios such as NB-IoT, in many cases, the internet of things device enters a sleep state as soon as possible after initialization is completed, and the internet of things device cannot receive data during the sleep period.
For example, in NB-IoT, the internet of things device may sleep in a power saving mode PSM, an extended discontinuous reception eDRX, or the like.
Therefore, the Internet of things equipment completes initialization after being started and before sleeping, the subscription state of the Internet of things equipment and the subscription state of the Internet of things platform are guaranteed to be consistent, and the equipment resources subscribed are normally reported after the Internet of things equipment is awakened.
After the internet of things equipment is awakened, subscribed equipment resources are collected, a resource subscription Notification message (namely, a CoAP Notification message) is generated according to RFC7641/7252, and a certain target token stored in advance is used as a reference token and is sent to the internet of things platform.
The method comprises the steps that the Internet of things platform receives a resource subscription notification message of the Internet of things equipment during operation, wherein the resource subscription notification message comprises equipment resources and a reference token.
And the Internet of things platform extracts the equipment resources and the reference token from the resource subscription notification message and extracts the target token corresponding to the Internet of things equipment from the monitoring table.
For the internet of things platform, the target token may be a target token stored when the resource of the first subscription device waits for timeout, or may be a target token stored when the resource of the first subscription device succeeds, which is not limited in the embodiment of the present invention.
And the Internet of things platform matches the reference token with the target token, if the reference token and the target token are successfully matched, the resource subscription notification message is considered to be legal, and the equipment resource can be sent to the service platform through the TCP/IP.
As shown in fig. 3, if the internet of things device collects the device resource, the device resource can be transmitted to the internet of things communication module, the internet of things communication module packages the device resource into a resource subscription notification message, the resource subscription notification message is sent to the base station through wireless connection, the base station sends the resource subscription notification message to the NAT server, the NAT server performs address conversion from the intranet to the public network on the resource subscription notification message, and sends the resource subscription notification message to the internet of things platform, and the internet of things platform sends the device resource to the service platform after checking the token.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 7, a block diagram of a resource subscription apparatus of an internet of things device according to an embodiment of the present invention is shown, and specifically includes the following modules:
an equipment registration module 701, configured to register an internet of things equipment;
a token generation module 702, configured to generate a target token for the internet of things device if a service platform requests to subscribe to a device resource of the internet of things device;
a subscription request sending module 703, configured to send a resource subscription request message that carries the target token and subscribes to the device resource to the internet of things device;
a subscription timeout determining module 704, configured to determine to subscribe to the device resource for timeout if a resource subscription response message sent by the internet of things device to the resource subscription request message is not received within a preset time period;
a timeout storing module 705, configured to store the target token according to a wait timeout of subscribing to the device resource.
In one embodiment of the present invention, the token generation module 702 includes:
the token storage judging submodule is used for judging whether a target token generated for the Internet of things equipment in advance is stored; if yes, calling the regeneration submodule, and if not, calling the primary generation submodule;
the regeneration sub-module is used for deleting the previously generated target token and regenerating the target token for the Internet of things equipment;
and the primary generation submodule is used for generating a target token for the Internet of things equipment for the first time.
In one embodiment of the present invention, further comprising:
a subscription overtime message generating module, configured to generate a subscription overtime message according to a wait overtime for subscribing to the device resource;
and the subscription timeout message sending module is used for sending the subscription timeout message to the service platform so as to wait for the subscribed equipment resources.
In one embodiment of the present invention, further comprising:
the subscription success confirmation module is used for confirming that the device resources are subscribed successfully if the resource subscription response message sent by the Internet of things device is received within a preset time period;
a successful storage module, configured to store the target token according to success of subscribing to the device resource;
a subscription success message generation module, configured to generate a subscription success message according to success of subscribing to the device resource;
and the subscription success message sending module is used for sending the subscription success message to the service platform so as to wait for the subscribed equipment resources.
In one embodiment of the present invention, further comprising:
a subscription notification receiving module, configured to receive a resource subscription notification message sent by the internet of things device, where the resource subscription notification message includes a device resource and a reference token;
a token matching module for matching the target token with the reference token;
and the equipment resource sending module is used for sending the equipment resources to the service platform when the matching is successful.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In the embodiment of the invention, if a service platform requests to subscribe equipment resources of internet of things equipment, a target token is generated for the internet of things equipment, a resource subscription request message carrying the target token and subscribing the equipment resources is sent to the internet of things equipment, if a resource subscription response message sent by the internet of things equipment to the resource subscription request message is not received within a preset time period, the subscription equipment resource is confirmed to be overtime, the target token is stored according to the overtime of the subscription equipment resource, and under the condition that the resource subscription response message generated by the internet of things equipment considers that the subscription is successful but the resource subscription response message is not sent successfully, the internet of things platform considers that the subscription is overtime, the target token is still stored, so that the subscription state of the internet of things equipment and the internet of things platform is kept consistent when communication is abnormal, and equipment resources reported by subsequent internet of things equipment can be, the successful subscription of the device resource is guaranteed.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may 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, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The resource subscription method of the internet of things equipment and the resource subscription device of the internet of things equipment provided by the invention are introduced in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A resource subscription method for Internet of things equipment is characterized by comprising the following steps:
registering the Internet of things equipment;
if the service platform requests to subscribe the equipment resources of the Internet of things equipment, generating a target token for the Internet of things equipment;
sending a resource subscription request message carrying the target token and subscribing the equipment resource to the Internet of things equipment;
if the resource subscription request message is not sent to the Internet of things equipment within a preset time period, re-registering the Internet of things equipment;
when the Internet of things equipment is re-registered, deleting a target token generated for the Internet of things equipment in advance;
if a resource subscription response message sent by the internet of things equipment to the resource subscription request message is not received within a preset time period, confirming that the equipment resource subscription is overtime;
and storing the target token according to the waiting overtime of the equipment resource subscription.
2. The method of claim 1, wherein generating the target token for the internet of things device comprises:
judging whether a target token generated for the Internet of things equipment in advance is stored;
if so, deleting the previously generated target token, and generating the target token for the Internet of things equipment again;
and if not, generating a target token for the Internet of things equipment for the first time.
3. The method of claim 1, further comprising:
generating a subscription overtime message according to the waiting overtime of the subscription of the equipment resource;
and sending the subscription overtime message to the service platform to wait for the subscribed equipment resources.
4. The method of claim 1, further comprising:
if a resource subscription response message sent by the Internet of things equipment is received within a preset time period, confirming that the equipment resource subscription is successful;
storing the target token according to the success of subscribing the equipment resource;
generating a subscription success message according to the success of subscribing the equipment resource;
and sending the successful subscription message to the service platform to wait for the subscribed equipment resources.
5. The method of claim 1, 2, 3 or 4, further comprising:
receiving a resource subscription notification message sent by the internet of things device, wherein the resource subscription notification message comprises device resources and a reference token;
matching the target token with the reference token;
and when the matching is successful, the equipment resource is sent to the service platform.
6. A resource subscription device of Internet of things equipment is characterized by comprising:
the equipment registration module is used for registering the equipment of the Internet of things;
the token generation module is used for generating a target token for the Internet of things equipment if the service platform requests to subscribe the equipment resources of the Internet of things equipment;
a subscription request sending module, configured to send a resource subscription request message carrying the target token and subscribing to the device resource to the internet of things device;
the device registration module is further configured to re-register the internet of things device if the resource subscription request message is not sent to the internet of things device within a preset time period;
the token generation module is further configured to delete a target token generated for the internet of things device in advance when the internet of things device is re-registered;
a subscription overtime confirmation module, configured to confirm that subscription to the device resource is overtime if a resource subscription response message sent by the internet of things device to the resource subscription request message is not received within a preset time period;
and the overtime storage module is used for storing the target token according to the overtime waiting of the equipment resource subscribed.
7. The apparatus of claim 6, wherein the token generation module comprises:
the token storage judging submodule is used for judging whether a target token generated for the Internet of things equipment in advance is stored; if yes, calling the regeneration submodule, and if not, calling the primary generation submodule;
the regeneration sub-module is used for deleting the previously generated target token and regenerating the target token for the Internet of things equipment;
and the primary generation submodule is used for generating a target token for the Internet of things equipment for the first time.
8. The apparatus of claim 6, further comprising:
a subscription overtime message generating module, configured to generate a subscription overtime message according to a wait overtime for subscribing to the device resource;
and the subscription timeout message sending module is used for sending the subscription timeout message to the service platform so as to wait for the subscribed equipment resources.
9. The apparatus of claim 6, further comprising:
the subscription success confirmation module is used for confirming that the device resources are subscribed successfully if the resource subscription response message sent by the Internet of things device is received within a preset time period;
a successful storage module, configured to store the target token according to success of subscribing to the device resource;
a subscription success message generation module, configured to generate a subscription success message according to success of subscribing to the device resource;
and the subscription success message sending module is used for sending the subscription success message to the service platform so as to wait for the subscribed equipment resources.
10. The apparatus of claim 6, 7, 8 or 9, further comprising:
a subscription notification receiving module, configured to receive a resource subscription notification message sent by the internet of things device, where the resource subscription notification message includes a device resource and a reference token;
a token matching module for matching the target token with the reference token;
and the equipment resource sending module is used for sending the equipment resources to the service platform when the matching is successful.
CN201810443341.4A 2018-04-24 2018-05-10 Resource subscription method and device for Internet of things equipment Active CN108712485B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810443341.4A CN108712485B (en) 2018-05-10 2018-05-10 Resource subscription method and device for Internet of things equipment
PCT/CN2018/113514 WO2019205557A1 (en) 2018-04-24 2018-11-01 Resource subscription for internet of things device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810443341.4A CN108712485B (en) 2018-05-10 2018-05-10 Resource subscription method and device for Internet of things equipment

Publications (2)

Publication Number Publication Date
CN108712485A CN108712485A (en) 2018-10-26
CN108712485B true CN108712485B (en) 2019-12-20

Family

ID=63867912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810443341.4A Active CN108712485B (en) 2018-04-24 2018-05-10 Resource subscription method and device for Internet of things equipment

Country Status (1)

Country Link
CN (1) CN108712485B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712485B (en) * 2018-05-10 2019-12-20 海信集团有限公司 Resource subscription method and device for Internet of things equipment
WO2019205557A1 (en) * 2018-04-24 2019-10-31 海信集团有限公司 Resource subscription for internet of things device
CN111125648B (en) * 2018-11-01 2022-03-29 大唐移动通信设备有限公司 Equipment change method and device
CN112448822B (en) * 2019-09-02 2022-03-01 华为云计算技术有限公司 Cross-network awakening method and related equipment
CN111260304B (en) * 2019-11-26 2024-03-08 上海赛连信息科技有限公司 Trial account management and issuing method and device
CN114651434A (en) * 2020-01-02 2022-06-21 Oppo广东移动通信有限公司 Method and device for information interaction with user
CN111474902B (en) * 2020-03-30 2021-02-05 新疆天地集团有限公司 Intelligent control system applied to aerial villa building structure
CN112199210A (en) * 2020-09-21 2021-01-08 中国建设银行股份有限公司 Data processing method and device based on Internet of things, computer equipment and medium
CN112905320A (en) * 2021-02-05 2021-06-04 北京邮电大学 System, method and device for executing tasks of Internet of things
CN113163029B (en) * 2021-05-20 2023-06-30 厦门亿联网络技术股份有限公司 Network session account deployment method, device, terminal, server and storage medium
WO2023115585A1 (en) * 2021-12-24 2023-06-29 Oppo广东移动通信有限公司 Subscription configuration method and apparatus, computer device, and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105656768A (en) * 2014-11-14 2016-06-08 北京海尔广科数字技术有限公司 Method for improving resource utilization rate of Alloyn gateway and Alloyn gateway
CN107018147A (en) * 2017-05-09 2017-08-04 上海斐讯数据通信技术有限公司 A kind of Internet of Things communication means and system, gateway module
CN108712485A (en) * 2018-05-10 2018-10-26 海信集团有限公司 A kind of resource subscription method and apparatus of internet of things equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9396337B2 (en) * 2012-04-11 2016-07-19 Intermec Ip Corp. Wireless sensor field enumeration
CN103780663B (en) * 2012-10-26 2019-05-07 中兴通讯股份有限公司 A kind of method for remote management of terminal peripheral hardware, device and system
US9774604B2 (en) * 2015-01-16 2017-09-26 Zingbox, Ltd. Private cloud control

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105656768A (en) * 2014-11-14 2016-06-08 北京海尔广科数字技术有限公司 Method for improving resource utilization rate of Alloyn gateway and Alloyn gateway
CN107018147A (en) * 2017-05-09 2017-08-04 上海斐讯数据通信技术有限公司 A kind of Internet of Things communication means and system, gateway module
CN108712485A (en) * 2018-05-10 2018-10-26 海信集团有限公司 A kind of resource subscription method and apparatus of internet of things equipment

Also Published As

Publication number Publication date
CN108712485A (en) 2018-10-26

Similar Documents

Publication Publication Date Title
CN108712485B (en) Resource subscription method and device for Internet of things equipment
CN107087033B (en) Message pushing method and device, storage medium and computer equipment
US11563649B2 (en) NF service consumer restart detection using direct signaling between NFs
EP3489825A1 (en) Method, apparatus and computer readable storage medium for processing service
CN104679528B (en) The newer method and apparatus of application program remote
CN104601702B (en) Cluster remote procedure calling (PRC) method and system
CN108429739B (en) Method, system and terminal equipment for identifying honeypots
CN101160880A (en) Communications device and method
CN106357609A (en) User creation method and system, public network server and private cloud equipment
CN109525620B (en) Message pushing system, method and device
CN106357654B (en) Remote procedure calling method, device and communication system
CN103716230A (en) Message sending method, device and server
WO2013189398A2 (en) Application data push method, device, and system
CN105721231A (en) Service quality sensing detection method and service quality sensing detection device
CN106899652B (en) Method and device for pushing service processing result
CN111200578A (en) Communication method, client device and server device
CN111935316B (en) Method and device for acquiring front-end equipment catalog
CN113746794B (en) Account processing method and device, electronic equipment and computer storage medium
CN104468514B (en) Information processing method, electronic equipment and server
WO2019074032A1 (en) Apparatus, method and program for transmitting and receiving data to and from iot device
CN114285658B (en) System mutual jump login-free method based on WeChat authorization login
CN113301556B (en) User internet access record storage method, system and server
JP6509413B1 (en) Device, method and program for transmitting and receiving data with IoT device
CN108206856B (en) Information feedback method and device
US10356581B2 (en) Login processing method and device of machine-to-machine/man communication terminal equipment

Legal Events

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