Authorization token refreshing method, home host, server, device and medium

The home host receives token invalidation information from the Internet of Things server, sends authorization invalidation information to the message protocol server, and updates the token when it expires, solving the problem of the home host being unable to connect to the Internet after timeout, realizing automatic authorization updates and improving user experience.

CN119892411AActive Publication Date: 2025-04-25GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411857760.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-25
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

The home host cannot be connected to the Internet after timeout, resulting in limited operation of the device and poor user experience.

Method used

The home host receives the token invalidation information sent by the Internet of Things server, sends authorization invalidation information to the message protocol server, determines the cloud status information, and sends to the Internet of Things server to update the token when it is invalid, and obtains the update token information to refresh.

Benefits of technology

Improves the ability to automatically authorize updates in the case of authorization failure, enhances the user experience, and improves the security of token update requests through two-factor verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892411A_ABST
    Figure CN119892411A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an authorization token refreshing method, a home host, a server, equipment and a medium. The authorization token refreshing method comprises the steps that the home host receives token failure information sent by an Internet of Things server; the home host receives the token-based failure information and sends authorization failure information to a message protocol server; the message protocol server determines cloud state information based on the authorization failure information, and sends the cloud state information and the authorization failure information to the Internet of Things server; the home host sends a token updating request to the Internet of Things server; when the Internet of Things server determines that the cloud state information is invalid and the authorization failure information is invalid, the token updating request is responded to feed back token updating information; and the home host refreshes the authorization token according to the token updating information. According to the embodiment of the invention, the authorization updating function can be automatically completed under the condition of authorization failure, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to an authorization token refreshing method, a home host, an Internet of Things server, an electronic device and a storage medium. Background Art

[0002] With the increasing popularity of the Internet of Things, the demand for using smart homes in local area networks has become more and more prominent, and home host products that support controlling devices and scenes in local area networks have emerged. As a local storage and computing center, the home host needs information security verification to obtain cloud data. In related technologies, when the home host times out and cannot be used online, the operation of related devices is restricted, resulting in a poor user experience. Summary of the invention

[0003] In view of the above problems, embodiments of the present invention are proposed to provide an authorization token refresh method, a home host, an Internet of Things server, an electronic device and a storage medium that overcome the above problems or at least partially solve the above problems.

[0004] In order to solve the above problems, in a first aspect of the present invention, an embodiment of the present invention discloses an authorization token refresh method, which is applied to a home host, wherein the home host is connected to an Internet of Things server and a message protocol server, and the method comprises:

[0005] Receiving token expiration information sent by the Internet of Things server;

[0006] Based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information, and send the cloud status information and the authorization expiration information to the Internet of Things server;

[0007] Sending a token update request to the IoT server, wherein the IoT server is configured to respond to the token update request and feedback update token information when determining that the cloud status information is invalid and the authorization expiration information is invalid;

[0008] The authorization token is refreshed according to the updated token information.

[0009] Optionally, before the step of sending authorization expiration information to the message protocol server based on the token expiration information, the method further includes:

[0010] Refresh token interface; send a refresh token request to the Internet of Things server through the token interface; the Internet of Things server is also used to generate refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host has failed.

[0011] Optionally, before the step of receiving token expiration information sent by the Internet of Things server, the method further includes:

[0012] A home data request is sent to the Internet of Things server, and the Internet of Things server is used to feedback the token expiration information based on the home data request.

[0013] Optionally, the step of refreshing the authorization token according to the update token information includes:

[0014] Determine the target interface according to the update token information;

[0015] The target interface is called to send a refresh code update request to the Internet of Things server; the Internet of Things server is used to respond to the refresh code update request and feedback refresh code information;

[0016] The authorization token is refreshed according to the refresh code information.

[0017] In a second aspect of the present invention, an embodiment of the present invention discloses a method for refreshing an authorization token, which is applied to an Internet of Things server, wherein the Internet of Things server is connected to a home host and a message protocol server, and the method comprises:

[0018] Sending token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information;

[0019] Receiving the cloud status information and the authorization expiration information sent by the message protocol server;

[0020] Receiving a token update request sent by the home host;

[0021] When it is determined that the cloud status information is invalid and the authorization expiration information is invalid, respond to the token update request and generate update token information; the home host refreshes the authorization token according to the update token information.

[0022] Optionally, the home host is also used to refresh a token interface; the method further includes:

[0023] Receiving a refresh token request sent by the home host through the token interface;

[0024] Refresh code expiration information is generated based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host is invalid.

[0025] Optionally, the method further comprises:

[0026] receiving a home data request sent by the home host;

[0027] Based on the home data request, the token expiration information is fed back.

[0028] In a third aspect of the present invention, an embodiment of the present invention discloses an authorization token refresh method, which is applied to a home Internet of Things architecture, wherein the home Internet of Things architecture includes a home host, an Internet of Things server, and a message protocol server connected to each other, and the method includes:

[0029] The home host receives token expiration information sent by the Internet of Things server;

[0030] The home host sends authorization expiration information to the message protocol server based on the token expiration information;

[0031] The message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and the authorization expiration information to the Internet of Things server;

[0032] The home host sends a token update request to the IoT server;

[0033] When determining that the cloud status information is invalid and the authorization expiration information is invalid, the IoT server responds to the token update request and feeds back updated token information;

[0034] The home host refreshes the authorization token according to the update token information.

[0035] In a fourth aspect of the present invention, an embodiment of the present invention discloses a home host, wherein the home host is connected to an Internet of Things server and a message protocol server, and the home host comprises:

[0036] A first receiving module, used to receive token expiration information sent by the Internet of Things server;

[0037] A first sending module, configured to send authorization expiration information to the message protocol server based on the token expiration information, wherein the message protocol server is configured to determine cloud status information based on the authorization expiration information, and send the cloud status information and the authorization expiration information to the Internet of Things server;

[0038] A second sending module is used to send a token update request to the Internet of Things server, and the Internet of Things server is used to respond to the token update request and feedback update token information when it is determined that the cloud status information is invalid and the authorization expiration information is invalid;

[0039] A refresh module is used to refresh the authorization token according to the update token information.

[0040] In a fifth aspect of the present invention, an embodiment of the present invention discloses an Internet of Things server, wherein the Internet of Things server is connected to a home host and a message protocol server, and the Internet of Things server comprises:

[0041] A third sending module is used to send token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, send authorization expiration information to the message protocol server, and the message protocol server is used to determine cloud status information based on the authorization expiration information;

[0042] A second receiving module, used to receive the cloud status information and the authorization expiration information sent by the message protocol server;

[0043] A third receiving module, used for receiving a token update request sent by the home host;

[0044] The indication module is used to respond to the token update request and generate update token information when it is determined that the cloud status information is invalid and the authorization expiration information is invalid; the home host refreshes the authorization token according to the update token information.

[0045] In the sixth aspect of the present invention, an embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the authorization token refresh method as described above when executed by the processor.

[0046] In a seventh aspect of the present invention, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the authorization token refresh method as described above are implemented.

[0047] The embodiments of the present invention include the following advantages:

[0048] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, which can improve the security of the request to update the token, verify the authenticity of the host and the service, and feed back updated token information, so that the home host can perform authorization update, and realize the function of automatically completing the authorization update in the case of authorization expiration, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a flowchart of the steps of an embodiment of an authorization token refresh method of the present invention;

[0050] Figure 2 is a flowchart of another authorization token refresh method embodiment of the present invention;

[0051] Figure 3 is a flowchart of steps of another embodiment of an authorization token refresh method of the present invention;

[0052] Figure 4 is a flowchart of an example of a method for refreshing an authorization token according to the present invention;

[0053] Figure 5 It is a structural block diagram of a home host embodiment of the present invention;

[0054] Figure 6 It is a structural block diagram of an Internet of Things server embodiment of the present invention;

[0055] Figure 7 is a structural block diagram of an electronic device provided by an embodiment of the present invention;

[0056] Figure 8 It is a structural block diagram of a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0058] Reference Figure 1, showing a flow chart of the steps of an authorization token refresh method embodiment of the present invention, the authorization token refresh method is applied to a home host, and the home host is connected to an Internet of Things server and a message protocol server. The home host is a host device with the ability to connect to various protocol devices and local storage computing capabilities, such as smart home appliances. The Internet of Things server is a server associated with the home host in the same Internet of Things as the home host, and is used to store device information, room information, scene information, etc. under an account, such as an IoT server. The message protocol server is a relay server for the message protocol used by the home host, such as an MQTT (Message Queuing Telemetry Transport) server. The home host, the Internet of Things server, and the message protocol server are connected to each other.

[0059] The authorization token refresh method may specifically include the following steps:

[0060] Step 101, receiving token expiration information sent by the IoT server;

[0061] When the IoT server generates token expiration information, the token expiration information can be sent to the home host. The token expiration information is information indicating that the home host token is invalid. The token expiration information can be received.

[0062] Step 102: Based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information, and sending the cloud status information and the authorization expiration information to the Internet of Things server;

[0063] Based on the token expiration information, it can be determined that the token has expired, and authorization expiration information can be sent to the message protocol server to report the expiration of the token. The authorization expiration information can be preset in the home host and triggered when the token is determined to be invalid.

[0064] After receiving the authorization expiration information, the message protocol server updates its own status and determines the cloud status information. The message protocol server then forwards the cloud status information and authorization expiration information to the IoT server.

[0065] Step 103, sending a token update request to the IoT server, wherein the IoT server is configured to respond to the token update request and feedback update token information when determining that the cloud status information is invalid and the authorization expiration information is invalid;

[0066] After determining that its own token has expired, it can send a token update request to the IoT server to request the IoT server to renew its own authorization token through the token update request.

[0067] The IoT server can verify whether the cloud status information and the authorization expiration information are in an invalid state. When the cloud status information is invalid and the authorization expiration information is invalid, it can be determined that the token of the home host needs to be renewed, and the token update request can be responded to to feed back the updated token information to the home host.

[0068] Step 104: Refresh the authorization token according to the updated token information.

[0069] The authorization token can be refreshed by updating the token information so that it can be used online.

[0070] Specifically, the step of refreshing the authorization token according to the update token information includes: determining a target interface according to the update token information; calling the target interface to send a refresh code update request to the Internet of Things server; the Internet of Things server is used to feedback refresh code information in response to the refresh code update request; and refreshing the authorization token according to the refresh code information.

[0071] In actual applications, the target interface can be determined from its own interface according to the interface identifier in the update token information, and then the target interface is called to send a refresh code update request to the IoT server, and the refresh code corresponding to the interface is updated through the refresh code update request.

[0072] After receiving the refresh code update request, the IoT server can generate refresh code information in response to the refresh code update request. The refresh code information includes the corresponding refresh code and feeds back the refresh code information to the home host.

[0073] The home host can use the refresh code in the refresh code information to refresh the authorization token and renew the authorization token.

[0074] In an optional embodiment of the present invention, before the step of receiving the token expiration information sent by the Internet of Things server, the method further includes: sending a home data request to the Internet of Things server, and the Internet of Things server is used to feedback the token expiration information based on the home data request.

[0075] When the user uses the home host, the home host will also send a home data request to the IoT server. The home data request is used to obtain the corresponding control instructions to implement related remote functions. When the IoT server receives the home data request and finds that the home host authorization has timed out, it will feedback token expiration information to the home host to inform the home host of the authorization timeout.

[0076] In an optional embodiment of the present invention, before the step of sending authorization expiration information to the message protocol server based on the token expiration information, the method further includes: refreshing a token interface; sending a refresh token request to the Internet of Things server through the token interface; the Internet of Things server is further used to generate refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host has expired.

[0077] When receiving the token expiration information, the home host itself can also verify whether the authorization has really expired. The token interface corresponding to the current authorization token can be refreshed. A refresh token request is sent to the IoT server through the token interface, and the refresh code is requested to be refreshed through the refresh token request. After receiving the refresh token request, the IoT server can generate refresh code expiration information when the home host authorization times out; the refresh code expiration information indicates that the home host authorization has expired. The refresh code expiration information can be fed back to the home host.

[0078] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, thereby improving the security of the request to update the token, verifying the authenticity of the host and the service, and feeding back updated token information, so that the home host can perform authorization update, realizing the function of automatically completing authorization update in the case of authorization expiration, and improving the user experience.

[0079] Reference Figure 2 , shows a flowchart of another authorization token refresh method embodiment of the present invention, the authorization token refresh method is applied to an Internet of Things server, the Internet of Things server is connected to a home host and a message protocol server. The authorization token refresh method may specifically include the following steps:

[0080] Step 201, sending token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, sends authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information;

[0081] When the home host authorization is recognized, the token expiration information can be sent to the home host. After receiving the token expiration information, the home host can determine that its own token has expired and can send authorization expiration information to the message protocol server to report the expiration of its own token.

[0082] The message protocol server determines the cloud status information based on the authorization expiration information, and sends the cloud status information and the authorization expiration information.

[0083] Step 202, receiving the cloud status information and the authorization expiration information sent by the message protocol server;

[0084] The cloud status information and authorization expiration information sent by the message protocol server can be received to verify whether the token is updated.

[0085] Step 203, receiving a token update request sent by the home host;

[0086] It can also receive token update requests sent by the home host.

[0087] Step 204, when it is determined that the cloud status information is invalid and the authorization expiration information is invalid, respond to the token update request and generate update token information; the home host refreshes the authorization token according to the update token information.

[0088] When it is determined that the cloud status information and authorization expiration information are invalid, the verification is passed. The token of the home host can be updated, and the token update request can be responded to to generate updated token information. The updated token information is fed back to the home host. The home host can refresh the authorization token according to the updated token information.

[0089] In an optional embodiment of the present invention, the home host is also used to refresh the token interface; the method also includes: receiving a refresh token request sent by the home host through the token interface; generating refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host has expired.

[0090] In the embodiment of the present invention, a refresh token request sent by the home host through the token interface can also be received, and when the authorization fails, refresh code expiration information corresponding to the refresh token request is generated. The refresh code expiration information indicates that the authorization of the home host has failed, and can be fed back to the home host.

[0091] In an optional embodiment of the present invention, the method further includes: receiving a home data request sent by the home host; and feeding back the token expiration information based on the home data request.

[0092] During daily operation, the home host can send a home data request to obtain relevant data to support its own operation. The IoT server can receive the home data request. When receiving it, it determines whether the authorization of the home host has timed out and expired. When the authorization expires, it can respond to the home data request and feedback token expiration information.

[0093] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, which can improve the security of the request to update the token, verify the authenticity of the host and the service, and feed back updated token information, so that the home host can perform authorization update, and realize the function of automatically completing the authorization update in the case of authorization expiration, thereby improving the user experience.

[0094] Reference Figure 3 , shows a flowchart of steps of another embodiment of an authorization token refresh method of the present invention, the authorization token refresh method is applied to a home Internet of Things architecture, the home Internet of Things architecture includes a home host, an Internet of Things server and a message protocol server connected to each other. The authorization token refresh method may specifically include the following steps:

[0095] Step 301, the home host receives token expiration information sent by the IoT server;

[0096] The home host can receive the token expiration information sent by the IoT server, and determine the expiration of its own authorization token based on the token expiration information.

[0097] Step 302, the home host sends authorization expiration information to the message protocol server based on the token expiration information;

[0098] After receiving the token expiration information, the home host determines that its own authorization token has expired, and can use the token expiration information to generate authorization expiration information, and send the authorization expiration information to the message protocol server.

[0099] Step 303: the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and the authorization expiration information to the Internet of Things server;

[0100] After receiving the authorization expiration information, the message protocol server updates the cloud status information based on the authorization expiration information, and sends the cloud status information and the authorization expiration information to the IoT server.

[0101] Step 304, the home host sends a token update request to the IoT server;

[0102] After the home host determines that its authorization token has expired, it will also send a token update request to the IoT server.

[0103] Step 305: When determining that the cloud status information is invalid and the authorization expiration information is invalid, the IoT server responds to the token update request and feeds back updated token information;

[0104] When the IoT server determines that both the cloud status information and the authorization expiration information are in an invalid state, it can respond to the token update request, determine a new authorization token to generate updated token information, and feed back the updated token information to the home host.

[0105] Step 306: the home host refreshes the authorization token according to the updated token information.

[0106] The home host refreshes the authorization token based on the obtained update token information and renews its own authorization token.

[0107] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, which can improve the security of the request to update the token, verify the authenticity of the host and the service, and feed back updated token information, so that the home host can perform authorization update, and realize the function of automatically completing the authorization update in the case of authorization expiration, thereby improving the user experience.

[0108] In order to make the implementation process of the embodiments of the present invention clear to those skilled in the art, the following reference is made to Figure 4 Let me explain this with an example:

[0109] First, the home host requests home data from the IoT server (Internet of Things server), and the server returns information that the host token is invalid.

[0110] Second, the home host calls the refresh token interface with the refresh code to request a new token. The server returns that the refresh code has expired and the token renewal is invalid.

[0111] Third, the home host reports the device status (authorization expired) to the MQTT server (message protocol server), and the MQTT server pushes the host authorization expiration information to the IOT server.

[0112] Fourth, the home host calls the token replacement interface to request a token replacement.

[0113] Fifth, the IoT server verifies the host device status and the cloud status. When both are unauthorized and the host requests a token replacement, a new token is allowed to be returned.

[0114] Sixth, the home host obtains a new token and calls the interface with the new token to change the refresh code. The IoT server returns a new refresh code. After the home host is connected to the Internet, it renews the token with the refresh code.

[0115] After obtaining the new token, the home host requests home data from the IoT server, and the IoT server returns the data, thus completing the entire token invalidation refresh process.

[0116] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0117] Reference Figure 5 , shows a structural block diagram of a home host embodiment of the present invention, wherein the home host is connected to an Internet of Things server and a message protocol server. The home host may specifically include the following modules:

[0118] The first receiving module 501 is used to receive token expiration information sent by the Internet of Things server;

[0119] A first sending module 502 is used to send authorization expiration information to the message protocol server based on the token expiration information, and the message protocol server is used to determine cloud status information based on the authorization expiration information, and send the cloud status information and the authorization expiration information to the Internet of Things server;

[0120] The second sending module 503 is used to send a token update request to the Internet of Things server, and the Internet of Things server is used to respond to the token update request and feedback update token information when it is determined that the cloud status information is invalid and the authorization expiration information is invalid;

[0121] The refresh module 504 is used to refresh the authorization token according to the update token information.

[0122] In an optional embodiment of the present invention, the home host further includes:

[0123] The interface calling module is used to refresh the token interface; send a refresh token request to the Internet of Things server through the token interface; the Internet of Things server is also used to generate refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host is invalid.

[0124] In an optional embodiment of the present invention, the home host further includes:

[0125] The fourth sending module is used to send a home data request to the Internet of Things server, and the Internet of Things server is used to feed back the token expiration information based on the home data request.

[0126] In an optional embodiment of the present invention, the refresh module 504 includes:

[0127] A target interface determination submodule, used to determine the target interface according to the update token information;

[0128] A calling submodule is used to call the target interface to send a refresh code update request to the Internet of Things server; the Internet of Things server is used to respond to the refresh code update request and feedback refresh code information;

[0129] The refresh submodule is used to refresh the authorization token according to the refresh code information.

[0130] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, which can improve the security of the request to update the token, verify the authenticity of the host and the service, and feed back updated token information, so that the home host can perform authorization update, and realize the function of automatically completing the authorization update in the case of authorization expiration, thereby improving the user experience.

[0131] Reference Figure 6 , shows a structural block diagram of an Internet of Things server embodiment of the present invention, wherein the Internet of Things server is connected to a home host and a message protocol server. The Internet of Things server may specifically include the following modules:

[0132] A third sending module 601 is used to send token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, send authorization expiration information to the message protocol server, and the message protocol server is used to determine cloud status information based on the authorization expiration information;

[0133] A second receiving module 602 is used to receive the cloud status information and the authorization expiration information sent by the message protocol server;

[0134] The third receiving module 603 is used to receive a token update request sent by the home host;

[0135] The indication module 604 is used to respond to the token update request and generate update token information when it is determined that the cloud status information is invalid and the authorization expiration information is invalid; the home host refreshes the authorization token according to the update token information.

[0136] In an optional embodiment of the present invention, the home host is also used to refresh the token interface; the Internet of Things server also includes:

[0137] A fourth receiving module, configured to receive a refresh token request sent by the home host through the token interface;

[0138] A generation module is used to generate refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host is invalid.

[0139] In an optional embodiment of the present invention, the Internet of Things server further includes:

[0140] A fifth receiving module, configured to receive a home data request sent by the home host;

[0141] A feedback module is used to feedback the token expiration information based on the family data request.

[0142] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, which can improve the security of the request to update the token, verify the authenticity of the host and the service, and feed back updated token information, so that the home host can perform authorization update, and realize the function of automatically completing the authorization update in the case of authorization expiration, thereby improving the user experience.

[0143] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0144] Reference Figure 7 , an embodiment of the present invention further provides an electronic device, including:

[0145] A processor 701 and a storage medium 702, wherein the storage medium 702 stores a computer program executable by the processor 701, and when the electronic device is controlled to run, the processor 701 executes the computer program to implement the authorization token refresh method as described in any one of the embodiments of the present invention.

[0146] In a first aspect, the authorization token refresh method is applied to a home host, the home host is connected to an Internet of Things server and a message protocol server, and the method includes:

[0147] Receiving token expiration information sent by the Internet of Things server;

[0148] Based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information, and send the cloud status information and the authorization expiration information to the Internet of Things server;

[0149] Sending a token update request to the IoT server, wherein the IoT server is configured to respond to the token update request and feedback update token information when determining that the cloud status information is invalid and the authorization expiration information is invalid;

[0150] The authorization token is refreshed according to the updated token information.

[0151] Optionally, before the step of sending authorization expiration information to the message protocol server based on the token expiration information, the method further includes:

[0152] Refresh token interface; send a refresh token request to the Internet of Things server through the token interface; the Internet of Things server is also used to generate refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host has failed.

[0153] Optionally, before the step of receiving token expiration information sent by the Internet of Things server, the method further includes:

[0154] A home data request is sent to the Internet of Things server, and the Internet of Things server is used to feedback the token expiration information based on the home data request.

[0155] Optionally, the step of refreshing the authorization token according to the update token information includes:

[0156] Determine the target interface according to the update token information;

[0157] The target interface is called to send a refresh code update request to the Internet of Things server; the Internet of Things server is used to respond to the refresh code update request and feedback refresh code information;

[0158] The authorization token is refreshed according to the refresh code information.

[0159] In a second aspect, the authorization token refresh method is applied to an Internet of Things server, wherein the Internet of Things server is connected to a home host and a message protocol server, and the method comprises:

[0160] Sending token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information;

[0161] Receiving the cloud status information and the authorization expiration information sent by the message protocol server;

[0162] Receiving a token update request sent by the home host;

[0163] When it is determined that the cloud status information is invalid and the authorization expiration information is invalid, respond to the token update request and generate update token information; the home host refreshes the authorization token according to the update token information.

[0164] Optionally, the home host is also used to refresh a token interface; the method further includes:

[0165] Receiving a refresh token request sent by the home host through the token interface;

[0166] Refresh code expiration information is generated based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host is invalid.

[0167] Optionally, the method further comprises:

[0168] receiving a home data request sent by the home host;

[0169] Based on the home data request, the token expiration information is fed back.

[0170] In a third aspect, the authorization token refresh method is applied to a home Internet of Things architecture, wherein the home Internet of Things architecture includes a home host, an Internet of Things server, and a message protocol server connected to each other, and the method includes:

[0171] The home host receives token expiration information sent by the Internet of Things server;

[0172] The home host sends authorization expiration information to the message protocol server based on the token expiration information;

[0173] The message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and the authorization expiration information to the Internet of Things server;

[0174] The home host sends a token update request to the IoT server;

[0175] When determining that the cloud status information is invalid and the authorization expiration information is invalid, the IoT server responds to the token update request and feeds back updated token information;

[0176] The home host refreshes the authorization token according to the update token information.

[0177] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, which can improve the security of the request to update the token, verify the authenticity of the host and the service, and feed back updated token information, so that the home host can perform authorization update, and realize the function of automatically completing the authorization update in the case of authorization expiration, thereby improving the user experience.

[0178] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor.

[0179] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0180] Reference Figure 8 The embodiment of the present invention further provides a computer-readable storage medium 801, on which a computer program is stored. When the computer program is executed by a processor, the authorization token refresh method as described in any one of the embodiments of the present invention is executed.

[0181] In a first aspect, the authorization token refresh method is applied to a home host, the home host is connected to an Internet of Things server and a message protocol server, and the method includes:

[0182] Receiving token expiration information sent by the Internet of Things server;

[0183] Based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information, and send the cloud status information and the authorization expiration information to the Internet of Things server;

[0184] Sending a token update request to the IoT server, wherein the IoT server is configured to respond to the token update request and feedback update token information when determining that the cloud status information is invalid and the authorization expiration information is invalid;

[0185] The authorization token is refreshed according to the updated token information.

[0186] Optionally, before the step of sending authorization expiration information to the message protocol server based on the token expiration information, the method further includes:

[0187] Refresh token interface; send a refresh token request to the Internet of Things server through the token interface; the Internet of Things server is also used to generate refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host has failed.

[0188] Optionally, before the step of receiving token expiration information sent by the Internet of Things server, the method further includes:

[0189] A home data request is sent to the Internet of Things server, and the Internet of Things server is used to feedback the token expiration information based on the home data request.

[0190] Optionally, the step of refreshing the authorization token according to the update token information includes:

[0191] Determine the target interface according to the update token information;

[0192] The target interface is called to send a refresh code update request to the Internet of Things server; the Internet of Things server is used to respond to the refresh code update request and feedback refresh code information;

[0193] The authorization token is refreshed according to the refresh code information.

[0194] In a second aspect, the authorization token refresh method is applied to an Internet of Things server, wherein the Internet of Things server is connected to a home host and a message protocol server, and the method comprises:

[0195] Sending token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information;

[0196] Receiving the cloud status information and the authorization expiration information sent by the message protocol server;

[0197] Receiving a token update request sent by the home host;

[0198] When it is determined that the cloud status information is invalid and the authorization expiration information is invalid, respond to the token update request and generate update token information; the home host refreshes the authorization token according to the update token information.

[0199] Optionally, the home host is also used to refresh a token interface; the method further includes:

[0200] Receiving a refresh token request sent by the home host through the token interface;

[0201] Refresh code expiration information is generated based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host is invalid.

[0202] Optionally, the method further comprises:

[0203] receiving a home data request sent by the home host;

[0204] Based on the home data request, the token expiration information is fed back.

[0205] In a third aspect, the authorization token refresh method is applied to a home Internet of Things architecture, wherein the home Internet of Things architecture includes a home host, an Internet of Things server, and a message protocol server connected to each other, and the method includes:

[0206] The home host receives token expiration information sent by the Internet of Things server;

[0207] The home host sends authorization expiration information to the message protocol server based on the token expiration information;

[0208] The message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and the authorization expiration information to the Internet of Things server;

[0209] The home host sends a token update request to the IoT server;

[0210] When determining that the cloud status information is invalid and the authorization expiration information is invalid, the IoT server responds to the token update request and feeds back updated token information;

[0211] The home host refreshes the authorization token according to the update token information.

[0212] In the embodiment of the present invention, a home host receives token expiration information sent by an Internet of Things server; the home host receives authorization expiration information based on the token expiration information and sends authorization expiration information to a message protocol server; the message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and authorization expiration information to the Internet of Things server; the home host sends a token update request to the Internet of Things server; when the Internet of Things server determines that the cloud status information is invalid and the authorization expiration information is invalid, it responds to the token update request and feeds back updated token information; the home host refreshes the authorization token based on the updated token information. When the home host times out and is not connected to the Internet, the message protocol server sends authorization expiration information, and the Internet of Things server can double-verify the cloud status information and the authorization expiration information, which can improve the security of the request to update the token, verify the authenticity of the host and the service, and feed back updated token information, so that the home host can perform authorization update, and realize the function of automatically completing the authorization update in the case of authorization expiration, thereby improving the user experience.

[0213] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0214] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0215] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0216] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0217] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0218] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0219] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0220] The above is a detailed introduction to an authorization token refresh method, a home host, an Internet of Things server, an electronic device and a storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for refreshing an authorization token, characterized in that: Applied to a home host, the home host is connected to an Internet of Things server and a message protocol server, and the method includes: Receiving token expiration information sent by the Internet of Things server; Based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information, and send the cloud status information and the authorization expiration information to the Internet of Things server; Sending a token update request to the IoT server, wherein the IoT server is configured to respond to the token update request and feedback update token information when determining that the cloud status information is invalid and the authorization expiration information is invalid; The authorization token is refreshed according to the updated token information.

2. The method according to claim 1, characterized in that Before the step of sending authorization expiration information to the message protocol server based on the token expiration information, the method further includes: Refresh token interface; send a refresh token request to the Internet of Things server through the token interface; the Internet of Things server is also used to generate refresh code expiration information based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host has failed.

3. The method according to claim 1, characterized in that Before the step of receiving token expiration information sent by the Internet of Things server, the method further includes: A home data request is sent to the Internet of Things server, and the Internet of Things server is used to feedback the token expiration information based on the home data request.

4. The method according to claim 1, characterized in that: The step of refreshing the authorization token according to the updated token information includes: Determine the target interface according to the update token information; The target interface is called to send a refresh code update request to the Internet of Things server; the Internet of Things server is used to respond to the refresh code update request and feedback refresh code information; The authorization token is refreshed according to the refresh code information.

5. A method for refreshing an authorization token, characterized in that: Applied to an Internet of Things server, the Internet of Things server is connected to a home host and a message protocol server, and the method includes: Sending token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, sending authorization expiration information to the message protocol server, the message protocol server is used to determine cloud status information based on the authorization expiration information; Receiving the cloud status information and the authorization expiration information sent by the message protocol server; Receiving a token update request sent by the home host; When it is determined that the cloud status information is invalid and the authorization expiration information is invalid, respond to the token update request and generate update token information; the home host refreshes the authorization token according to the update token information.

6. The method according to claim 5, characterized in that The home host is also used to refresh the token interface; the method also includes: Receiving a refresh token request sent by the home host through the token interface; Refresh code expiration information is generated based on the refresh token request; the refresh code expiration information is used to indicate that the authorization of the home host is invalid.

7. The method according to claim 5, characterized in that The method further comprises: receiving a home data request sent by the home host; Based on the home data request, the token expiration information is fed back.

8. A method for refreshing an authorization token, characterized in that: Applied to a home Internet of Things architecture, the home Internet of Things architecture includes a home host, an Internet of Things server, and a message protocol server connected to each other, and the method includes: The home host receives token expiration information sent by the Internet of Things server; The home host sends authorization expiration information to the message protocol server based on the token expiration information; The message protocol server determines cloud status information based on the authorization expiration information, and sends the cloud status information and the authorization expiration information to the Internet of Things server; The home host sends a token update request to the IoT server; When determining that the cloud status information is invalid and the authorization expiration information is invalid, the IoT server responds to the token update request and feeds back updated token information; The home host refreshes the authorization token according to the update token information.

9. A home host, characterized in that: The home host is connected to the Internet of Things server and the message protocol server, and the home host includes: A first receiving module, used to receive token expiration information sent by the Internet of Things server; A first sending module, configured to send authorization expiration information to the message protocol server based on the token expiration information, wherein the message protocol server is configured to determine cloud status information based on the authorization expiration information, and send the cloud status information and the authorization expiration information to the Internet of Things server; A second sending module is used to send a token update request to the Internet of Things server, and the Internet of Things server is used to respond to the token update request and feedback update token information when it is determined that the cloud status information is invalid and the authorization expiration information is invalid; A refresh module is used to refresh the authorization token according to the update token information.

10. An Internet of Things server, characterized in that: The Internet of Things server is connected to the home host and the message protocol server, and the Internet of Things server includes: A third sending module is used to send token expiration information to the home host, the home host is used to receive the token expiration information, and based on the token expiration information, send authorization expiration information to the message protocol server, and the message protocol server is used to determine cloud status information based on the authorization expiration information; A second receiving module, used to receive the cloud status information and the authorization expiration information sent by the message protocol server; A third receiving module, used for receiving a token update request sent by the home host; The indication module is used to respond to the token update request and generate update token information when it is determined that the cloud status information is invalid and the authorization expiration information is invalid; the home host refreshes the authorization token according to the update token information.

11. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the authorization token refresh method according to any one of claims 1 to 8 are implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the authorization token refresh method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Cloud MQTT access authority control method

    CN114205112A

  • Resource access implementation method and device, electronic equipment and storage medium

    CN114764507A

  • Network token authentication renewal method and device

    CN117014155A

  • Gateway authentication method, device and system

    CN118316688A

  • Internet of things device binding method, apparatus and system, and cloud server and storage medium

    WO2023011016A1