Method, device and network device for authenticating IoT device to be authenticated
By preloading the validity period and first moment of authentication information based on the historical login information of the Internet of Things device, dynamically loading the device authentication information cache, solving the problem of excessive server memory usage in the Internet of Things device authentication method, realizing resource saving and service quality assurance.
Patent Information
- Application Number
- CN202210166860.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-02-23
AI Technical Summary
In the IoT device authentication method, it is necessary to store and cache the device authentication information in a full amount, resulting in excessive server memory usage and waste of resources.
By obtaining the historical login information of the device to be authenticated, determining the first time and validity period for preloading the authentication information for the next login, authenticating the validity of the login within the validity period, and dynamically loading the authentication information cache of the hot spot device.
It saves server resources, ensures service quality, enhances the security of the Internet of Things environment, and improves the efficiency of device authentication and management.
Smart Images

Figure CN116701090B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an authentication method, device and network equipment for an Internet of Things device to be authenticated. Background Art
[0002] With the popularity of smart devices, there are more and more smart devices in various industries. From large-scale production equipment in factories to numerous household appliances, the Internet of Things has gradually penetrated into people's lives, and the demand for realizing real smart production and smart life through the Internet of Things platform is also increasing. However, while the Internet of Things is developing in full swing, various security issues are also coming with it. In the Internet of Things, there are many problems and challenges in user privacy, authorization, verification, access control, system configuration, information storage and management. At the same time, with the exponential increase of IoT terminal devices, the management and maintenance of many IoT devices has become a major problem.
[0003] The IoT device authentication methods and systems in the prior art require the IoT cloud platform to perform full persistent storage and cache of device authentication information. However, due to the particularity of IoT industry equipment and unique industry characteristics, IoT devices do not all remain online 24 hours a day. If our authentication system keeps caching the authentication information of all devices on the entire platform, not only will the authentication service occupy too much server memory, but it will also cause a considerable waste of resources. Summary of the invention
[0004] The purpose of the present invention is to provide a scheduling method, device and equipment to avoid the influence of intermodulation interference.
[0005] To achieve the above object, an embodiment of the present invention provides an authentication method for an IoT device to be authenticated, comprising:
[0006] According to the historical log information of the device to be authenticated, the historical login information corresponding to the device to be authenticated is obtained, wherein the historical login information includes the historical online time and offline time of the device to be authenticated;
[0007] Determine, based on the historical login information, a first time to preload the authentication information for the next login of the device to be authenticated and a validity period of the authentication information;
[0008] Within the validity period of the authentication information, if a login request of the device to be authenticated is received, the login validity is authenticated according to the preloaded authentication information.
[0009] Optionally, the validity period includes: the validity period of the local cache authentication information,
[0010] Within the validity period of the authentication information, if a login request of the device to be authenticated is received, authentication of the login validity is performed according to the preloaded authentication information, including:
[0011] Within the validity period of the locally cached authentication information, if a login request from the device to be authenticated is received, the login validity is authenticated according to the preloaded authentication information.
[0012] Optionally, the validity period also includes: the validity period of the cache database,
[0013] Within the validity period of the authentication information, if a login request of the device to be authenticated is received, authentication of the login validity is performed according to the preloaded authentication information, further comprising:
[0014] When the local cache authentication information is not within the validity period, but within the validity period of the cache database, if a login request of the device to be authenticated is received, the login validity is authenticated according to the authentication information in the cache database.
[0015] Optionally, within the validity period of the authentication information, if a login request of the device to be authenticated is received, authentication of the login validity is performed according to the preloaded authentication information, further comprising:
[0016] When the validity period of the cache database is not reached, if a login request of the device to be authenticated is received, the login validity is authenticated according to the authentication information in the persistent database.
[0017] Optionally, determining, according to the historical login information, a first moment for preloading authentication information for a next login of the device to be authenticated includes:
[0018] Selecting N login information from the historical login information, where N is determined by the accuracy and efficiency value of each login information obtained by parsing the historical login information;
[0019] Predicting the next login time of the device to be authenticated based on the N login information;
[0020] According to the login time of the next login, a first time for preloading authentication information for the next login of the device to be authenticated is determined.
[0021] Optionally, determining, based on the historical login information, a method for obtaining a validity period of pre-loaded authentication information for the next login of the device to be authenticated includes:
[0022] According to the historical login information, determine the number of historical device logins of the device to be authenticated within the same period of time;
[0023] According to the number of historical device logins within the same period, the validity period of the authentication information preloaded for the next login of the device to be authenticated is determined.
[0024] Optionally, before acquiring historical login information corresponding to the device to be authenticated according to historical log information of the device to be authenticated, the method includes:
[0025] Receiving a registration request sent by the device to be authenticated, the registration request including user information, product information, and device information sent by the device to be authenticated;
[0026] The user information, product information and device information corresponding to the device to be authenticated are stored in a persistent database.
[0027] Optionally, the historical log information includes at least:
[0028] User information, product information, device information, address information when the device is logged in, and device login information.
[0029] To achieve the above object, an embodiment of the present invention provides an authentication device for an IoT device to be authenticated, comprising:
[0030] An acquisition module, configured to acquire historical login information corresponding to the device to be authenticated according to historical log information of the device to be authenticated, wherein the historical login information includes historical online time and offline time of the device to be authenticated;
[0031] A first determination module, configured to determine, based on the historical login information, a first time to preload the authentication information for the next login of the device to be authenticated and a validity period of the authentication information;
[0032] The second determination module is used to authenticate the login validity according to the preloaded authentication information if a login request of the device to be authenticated is received within the validity period of the authentication information.
[0033] Optionally, the second determining module includes:
[0034] The first determining unit is configured to, within the validity period of the locally cached authentication information, authenticate the login validity according to the preloaded authentication information if a login request from the device to be authenticated is received.
[0035] Optionally, the second determining module further includes:
[0036] The second determining unit is used to authenticate the login validity according to the authentication information in the cache database if a login request of the device to be authenticated is received when the local cache authentication information is not within the validity period and the cache database is within the validity period.
[0037] Optionally, the second determining module further includes:
[0038] The third determining unit is configured to authenticate the login validity according to the authentication information in the persistent database if a login request from the device to be authenticated is received when the validity period of the cache database is not within the validity period.
[0039] Optionally, the first determining module includes:
[0040] A selection unit, configured to select N login information from the historical login information, where N is determined by the accuracy and efficiency value of each login information obtained by parsing the historical login information;
[0041] A prediction unit, configured to predict a login time of the next login of the device to be authenticated based on the N login information;
[0042] The fourth determining unit is used to determine a first time for preloading authentication information for the next login of the device to be authenticated according to the login time of the next login.
[0043] Optionally, the acquisition module includes:
[0044] A fifth determining unit, configured to determine, based on the historical login information, the number of historical device logins of the device to be authenticated within the same period of time;
[0045] The sixth determining unit is used to determine the validity period of the authentication information preloaded for the next login of the device to be authenticated according to the number of historical device logins within the same period of time.
[0046] Optionally, the device further comprises:
[0047] A receiving module, configured to receive a registration request sent by the device to be authenticated, wherein the registration request includes user information, product information, and device information sent by the device to be authenticated;
[0048] The storage module is used to store the user information, product information and device information corresponding to the device to be authenticated in a persistent database.
[0049] It should be noted that the historical log information at least includes:
[0050] User information, product information, device information, address information when the device is logged in, and device login information.
[0051] To achieve the above-mentioned purpose, an embodiment of the present invention provides a network device, including: a transceiver, a processor, a memory, and a program or instruction stored on the memory and executable on the processor; when the processor executes the program or instruction, an authentication device for an IoT device to be authenticated as described in any one of the above items is implemented.
[0052] To achieve the above-mentioned purpose, an embodiment of the present invention provides a readable storage medium having a program or instruction stored thereon, and when the program or instruction is executed by a processor, an authentication device for an IoT device to be authenticated as described in any one of the above items is implemented.
[0053] The beneficial effects of the above technical solution of the present invention are as follows:
[0054] In the above technical scheme, the method includes: according to the historical log information of the device to be authenticated, obtaining the historical login information corresponding to the device to be authenticated, the historical login information includes the historical online time and offline time of the device to be authenticated; according to the historical login information, determining the first moment of preloading the authentication information for the next login of the device to be authenticated and the validity period of the authentication information; here, by determining the first moment and the validity period, that is, predicting the next login authentication time of the device and the expiration time of the authentication information according to the unique online and offline periodic characteristics of the platform device, the dynamic loading of the hotspot device authentication information cache is realized, saving server resources while ensuring the service quality, within the validity period of the authentication information, if the login request of the device to be authenticated is received, the login validity is authenticated according to the preloaded authentication information. The technical scheme of the present invention ensures that while enhancing the security of the Internet of Things environment, it overcomes many defects such as a large number of Internet of Things devices, limited terminal resources, large authentication overhead, and cumbersome operations, enhances the security of Internet of Things environment authentication and improves the efficiency of device authentication and management. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A schematic diagram of a flow chart of an authentication method for an IoT device to be authenticated provided in an embodiment of the present invention;
[0056] Figure 2 A schematic diagram of the structure of an authentication system for an IoT device to be authenticated provided by an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of a module of an authentication device for an IoT device to be authenticated provided by an embodiment of the present invention;
[0058] Figure 4 A schematic diagram of the structure of a network device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0060] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0061] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0062] Additionally, the terms "system" and "network" are often used interchangeably herein.
[0063] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0064] like Figure 1 As shown, an authentication method for an IoT device to be authenticated according to an embodiment of the present invention is mainly applied to a server, and includes:
[0065] Step 100, according to the historical log information of the device to be authenticated, obtain the historical login information corresponding to the device to be authenticated, the historical login information includes the historical online time and offline time of the device to be authenticated;
[0066] Step 200, determining the first time to preload the authentication information for the next login of the device to be authenticated and the validity period of the authentication information according to the historical login information;
[0067] Here, the device log information can be pulled from an open source stream processing platform (such as Kafka) and parsed to obtain the historical login information corresponding to the device to be authenticated, that is, the historical online time and offline time of the device to be authenticated. Based on this information, the first moment of the authentication information of the next login of the device to be authenticated and the validity period of the authentication information, that is, the next online time of the device and the expiration time of the device authentication information cache, can be predicted.
[0068] Step 300: within the validity period of the authentication information, if a login request of the device to be authenticated is received, the login validity is authenticated according to the preloaded authentication information. Here, the authentication information at least includes: user information, product information, and device information.
[0069] In this embodiment, a timed task is set based on the first moment and validity period determined in step 200. During the validity period of the authentication information, the authentication cache information of the device that needs to be loaded in the time period is loaded at a scheduled time, and the login validity is authenticated based on the preloaded authentication information.
[0070] It should be noted that the present invention predicts the next online authentication time of the industry equipment in advance based on the characteristic information of the industry equipment, pre-loads the cache of this part of the authentication information, and sets an expiration time, and releases the unused cache information after a period of time. While ensuring fast and efficient device authentication, it can also ensure efficient use of server memory resources.
[0071] The present invention predicts the next authentication time of the user's device, i.e., the first moment, and the centralized authentication time period based on learning and analyzing the working characteristics of the IoT device industry, and pre-loads the cache information and expiration time, i.e., the validity period, of the device to be authenticated. Compared with the cache loading of authentication information of all IoT devices, the cache loading of authentication information of hotspot devices or devices to be authenticated saves more server resources, and the authentication process is more efficient.
[0072] Optionally, the historical log information includes at least:
[0073] User information, product information, device information, address information when the device is logged in, and device login information.
[0074] In this embodiment, the historical log information includes but is not limited to: user information, i.e., user ID, which is the user identification of all users of the device; product information, i.e., product ID, which is the product identification of the device; device information, i.e., device ID, which is the unique identification of the device in the cloud platform service; address information when the device logs in, i.e., the IP address when the device logs in; device login information, i.e., the time when the device goes online and offline.
[0075] It is understandable that the user information includes but is not limited to the user's username, password, mobile phone number, ID number and login name, etc. The user ID is used to identify the same user. There may be multiple product information under the user information, and there may be multiple device information corresponding to each product information. When the login validity is authenticated in step 300, the user information, product information and device information need to be verified. If any one of the verifications fails, the verification result is determined to be verification failure.
[0076] Of course, the user information may include user identity information, where the user identity information includes the user name. The user name may be the user's name, and the user identity information may include the user's mobile phone number, ID card number, passport number, nickname, etc. in addition to the user's name.
[0077] Optionally, the validity period includes: the validity period of the locally cached authentication information, and the step 300 includes:
[0078] Step 310: within the validity period of the locally cached authentication information, if a login request of the device to be authenticated is received, the login validity is authenticated according to the preloaded authentication information.
[0079] In this embodiment, within the validity period of the local cache authentication information, if a login request from the device to be authenticated is received, the efficiency of authenticating the login validity is greatly improved by querying whether the user information is stored in the preloaded local cache authentication information.
[0080] Optionally, the validity period further includes: the validity period of the cache database, and step 300 further includes:
[0081] Step 320: When the local cache authentication information is not within the validity period but within the validity period of the cache database, if a login request of the device to be authenticated is received, the login validity is authenticated according to the authentication information in the cache database.
[0082] In this embodiment, when the user information is not stored in the local cache authentication information, the user information and the user ID corresponding to the user information are queried from the cache database, and authentication is performed through the database. When the login authentication request message is authenticated by the user information queried from the database, the user ID and the corresponding user information are stored in the cache according to the pre-configured two-layer cache storage structure, so that when the user performs login authentication, the response time of the user login authentication will not be affected by the need to cache the user information. While using the cache for authentication, the response time of the login authentication is shortened, thereby improving the efficiency of the login authentication.
[0083] Optionally, the step 300 further includes:
[0084] Step 330: When the validity period of the cache database is not reached, if a login request of the device to be authenticated is received, the login validity is authenticated according to the authentication information in the persistent database.
[0085] Of course, when both the local cache authentication information and the authentication information in the cache database fail to be authenticated, the login validity can also be authenticated through the authentication information in the persistent database.
[0086] To sum up, the present invention realizes three methods to authenticate the validity of login, namely, querying the authentication information of the device to be authenticated from the local cache, cache database, and persistent database in turn, without affecting the original structure and query method of the database. While using the cache for authentication, it shortens the response time of login authentication and improves the efficiency of login authentication.
[0087] It should be noted that the above-mentioned cache database can be a Redis database, and the persistent database is a MySQL database; MySQL is a relational database, mainly used to store persistent data, storing data on the hard disk, and has a slow reading speed; Redis is a non-relational database and also a cache database, that is, it stores data in the cache, and the cache has a fast reading speed, which can greatly improve the operating efficiency, but the storage time is limited.
[0088] In summary, in step 300, after receiving the device authentication request, the present invention queries the authentication information of the device according to the user ID, product ID, and device ID, and the query order is local cache-cache database-persistent database, and then the authentication result is calculated and returned according to the authentication algorithm. Among them, the cache database time can be slightly longer than the local cache time (such as 1.5 times), and it is guaranteed that after the validity period (the validity period includes the validity period of the cache database and the validity period of the local cache authentication information), the authentication of the device to be authenticated directly queries the persistent database, which brings fault tolerance for the decrease in authentication efficiency, and at the same time will not occupy system resources for too long, and dynamically loads the hotspot device authentication information cache, saving server resources while ensuring service quality.
[0089] Furthermore, before the above step 200, the online and offline log information of the device to be authenticated can be pulled from an open source stream processing platform (such as Kafka) to parse and obtain key information such as the user and product to which the device belongs.
[0090] Specifically, determining the first moment of preloading the authentication information for the next login of the device to be authenticated in step 200 includes:
[0091] Step 210, selecting N login information from the historical login information, where N is determined by the accuracy and efficiency value of each login information obtained by parsing the historical login information;
[0092] In this embodiment, N login information is selected from the historical login information, and N is set according to accuracy and efficiency, such as 3, 5, etc., or if there is a certain relationship between the online time, such as periodicity, then N can also be determined according to the periodicity, such as every 1 day, 1 hour, etc. Generally speaking, IoT industry equipment such as meter reading industry equipment will go online regularly to perform data collection, such as smart home monitoring will remain online 24 hours a day, and such industry equipment can ignore preloading.
[0093] Step 220, predicting the next login time of the device to be authenticated based on the N login information;
[0094] Step 230: Determine the first time to preload the authentication information for the next login of the device to be authenticated according to the login time of the next login.
[0095] Here, it should be known that the first moment is the time before the predicted login moment of the next login of the device to be authenticated.
[0096] In this embodiment, the login time of the device to be authenticated for the next login is predicted, and the first time for preloading the authentication information of the device to be authenticated for the next login is further predicted. The cache of this part of the authentication information is preloaded at the first time, which ensures fast and efficient device authentication while ensuring efficient use of server memory resources.
[0097] Optionally, the present invention can generate a device operation heat map based on historical login information to provide a reference for analyzing the industry corresponding to the user device and subsequent marketing strategies.
[0098] Specifically, the method for obtaining the validity period in step 100 includes:
[0099] Step 240, determining the number of historical device logins of the device to be authenticated within the same period of time according to the historical login information;
[0100] Step 250: Determine the validity period of the authentication information preloaded for the next login of the device to be authenticated according to the number of historical device logins within the same period of time.
[0101] In this embodiment, the present invention can set the validity period of the authentication information preloaded for the next login of the device to be authenticated according to the number of terminal devices logged in at the same time. The more devices logged in at the same time, the longer the validity period of the authentication information preloaded for the next login of the device to be authenticated, thereby saving server resources while ensuring service quality.
[0102] Here, the validity period can be understood as the cache expiration period for authenticating the validity of the login. Of course, it can also be understood as a certain moment in some cases, and there is no specific limitation here.
[0103] In a specific embodiment, a scheduled task is created for the predicted login time of the next login of the device to be authenticated, the first time of preloading the authentication information of the next login of the device to be authenticated, and the validity period of the authentication information determined in the above step 200. The scheduled task is executed at the first time before the login time of the next login of the device to be authenticated, and the authentication information of the device to be authenticated is pre-pulled from the persistent database and stored in the cache. After the validity period of the authentication information, it is determined that the authentication information is expired. The present invention sets the validity period of the authentication information preloaded for the next login of the device to be authenticated, avoiding the waste of resources caused by long-term authentication.
[0104] It can be understood that the scheduled task can exist in the scheduled task queue: based on the user ID, product ID, device ID, the login time of the next login, the first moment of preloading the authentication information of the next login of the device to be authenticated, and the validity period of the authentication information, a scheduled task is created and added to the scheduled task queue. When the time meets the conditions (if the login time of the next login is 7:00, the first moment can be set to 6:55), the authentication information of the device is pre-pull from the persistent database and stored in the cache. At this time, the service local cache expiration time and the validity period of the authentication information in the cache database can be set according to the cache expiration time.
[0105] Optionally, before step 100, the method includes:
[0106] Receiving a registration request sent by the device to be authenticated, the registration request including user information, product information, and device information sent by the device to be authenticated;
[0107] The user information, product information and device information corresponding to the device to be authenticated are stored in a persistent database.
[0108] In this embodiment, the device to be authenticated is pre-registered. Here, when a registration request sent by the device to be authenticated is received, corresponding feature information such as user ID, product ID, device ID, etc. is saved. When the device to be authenticated is connected to the IoT gateway, the IoT gateway records device-related information and the access time of the device to be authenticated; similarly, when the device goes offline, the device-related information and the offline time are also recorded.
[0109] To summarize, the present invention predicts the next login authentication time of the device, the first preloaded moment and the validity period based on the online and offline periodic characteristics obtained by parsing the historical login information; preloads the device authentication information according to the predicted device login authentication time and sets the expiration time of the changed authentication information; dynamically loads the hotspot device authentication information cache to save server resources while ensuring service quality.
[0110] The present invention more comprehensively ensures that while enhancing the security of the Internet of Things environment, it overcomes many defects such as a large number of Internet of Things devices, limited terminal resources, high authentication overhead, and cumbersome operations, thereby enhancing the security of Internet of Things environment authentication and improving the efficiency of device authentication and management.
[0111] like Figure 2 As shown, the present invention also provides an Internet of Things device authentication system, comprising:
[0112] The IoT platform and the IoT gateway connected to the IoT platform are connected to the log collection system and multiple devices. Here, the log collection system is the open source stream processing platform (such as Kafka) mentioned above. The device can be the device to be authenticated or other devices in the same time period in the historical log information. It should be noted that the above connections are all communication connections.
[0113] The system further includes: a preloading service and a device authentication service; the preloading service is connected to the log collection system and the device authentication service respectively; the device authentication service is also connected to a persistent database and a cache database. It should be noted that the above connections are all communication connections.
[0114] It should be noted that the IoT gateway mainly provides management of access authentication requests for IoT terminal devices, as well as management of subsequent device data uploads, platform command delivery to devices, and other operations. If an IoT terminal device (device to be authenticated) wants to access the platform, in addition to registering on the platform to obtain device authentication information, the first step is to connect to the IoT gateway module and send an access message containing authentication information. When the IoT gateway receives the access message, it will parse the platform authentication information and access time and send them to the device authentication module and the preloaded device authentication information module respectively. After receiving the successful authentication result from the device authentication module, maintain a long connection with the device and complete subsequent device-related operations; otherwise, disconnect from the device.
[0115] The log collection system mainly uses a lightweight log collector (such as Filebeat) to collect the relevant data logs of the terminal device going online and offline from the IoT gateway module, and sends the logs to the message queue kafka, so that the pre-loaded device authentication information module can obtain the terminal device online and offline data and analyze and predict the relevant device information of the pre-loaded authentication information. Kafka is an open source third-party software, lightweight application, with very little overhead to filter the online and offline logs of user devices from the IoT gateway, with almost no impact on the service. The message queue middleware kafka is a high-concurrency, low-latency distributed middleware used to cache the online and offline log information of user devices.
[0116] The IoT platform mainly provides functions such as terminal device registration, data upload, command issuance, data storage, and data visualization. In this system, the terminal device registration function is mainly provided to save the registration information of the terminal device and allocate platform authentication-related feature information for verification during terminal device login authentication.
[0117] The main function of the device authentication service is to verify the device authentication information sent by the IoT gateway. If the verification is passed, the IoT gateway will return the result of successful authentication; if the verification fails, the result of failed authentication will be returned. At the same time, after the device authentication module receives the user ID or device ID and preloading time information that needs to be preloaded from the preloading device authentication information module, it will save the information in the queue of the scheduled task. When the preloading execution time is met, the scheduled task will execute the preloading of the authentication information of the device under the user ID, ensuring that the device authentication module can use efficient and fast memory operations to complete the authentication process, avoiding a series of risks such as blocking and downtime caused by concurrent access to the database when a large number of devices are authenticated.
[0118] The main function of the preloading service is to analyze the time when each terminal accesses the IoT gateway, device feature information such as user ID, device ID, etc., and calculate the next online time of the device and the expiration time of the authentication information based on the access time and feature information. The predicted result is sent to the device authentication module to notify it to preload the device authentication information cache regularly.
[0119] The system provided by the present invention can obtain historical log information of the device to be authenticated from the log collection system, and obtain historical login information corresponding to the device to be authenticated, wherein the historical login information includes the historical online time and offline time of the device to be authenticated; the preloading service can determine the first moment of preloading the authentication information for the next login of the device to be authenticated and the validity period of the authentication information based on the historical login information, and send the predicted content (first moment, validity period) to the device authentication service. If the device authentication service receives a login request from the device to be authenticated within the validity period of the authentication information, it will authenticate the login validity based on the preloaded authentication information.
[0120] In summary, the present invention dynamically loads the hotspot device authentication information cache, saving server resources while ensuring service quality.
[0121] like Figure 3 As shown, an embodiment of the present invention further provides an authentication device for an IoT device to be authenticated, comprising:
[0122] An acquisition module 10 is used to acquire historical login information corresponding to the device to be authenticated according to historical log information of the device to be authenticated, wherein the historical login information includes historical online time and offline time of the device to be authenticated;
[0123] A first determination module 20, configured to determine, based on the historical login information, a first time to preload the authentication information for the next login of the device to be authenticated and a validity period of the authentication information;
[0124] The second determination module 30 is configured to perform authentication of the login validity according to the preloaded authentication information if a login request of the device to be authenticated is received within the validity period of the authentication information.
[0125] Optionally, the second determining module 30 includes:
[0126] The first determining unit is configured to, within the validity period of the locally cached authentication information, authenticate the login validity according to the preloaded authentication information if a login request from the device to be authenticated is received.
[0127] Optionally, the second determining module 30 further includes:
[0128] The second determining unit is used to authenticate the login validity according to the authentication information in the cache database if a login request of the device to be authenticated is received when the local cache authentication information is not within the validity period and the cache database is within the validity period.
[0129] Optionally, the second determining module 30 further includes:
[0130] The third determining unit is configured to authenticate the login validity according to the authentication information in the persistent database if a login request from the device to be authenticated is received when the validity period of the cache database is not within the validity period.
[0131] Optionally, the first determining module 20 includes:
[0132] A selection unit, configured to select N login information from the historical login information, where N is determined by the accuracy and efficiency value of each login information obtained by parsing the historical login information;
[0133] A prediction unit, configured to predict a login time of the next login of the device to be authenticated based on the N login information;
[0134] The fourth determining unit is used to determine a first time for preloading authentication information for the next login of the device to be authenticated according to the login time of the next login.
[0135] Optionally, the acquisition module 10 includes:
[0136] A fifth determining unit, configured to determine, based on the historical login information, the number of historical device logins of the device to be authenticated within the same period of time;
[0137] The sixth determining unit is used to determine the validity period of the authentication information preloaded for the next login of the device to be authenticated according to the number of historical device logins within the same period of time.
[0138] Optionally, the device further comprises:
[0139] The receiving module 40 is used to receive a registration request sent by the device to be authenticated, wherein the registration request includes user information, product information and device information sent by the device to be authenticated;
[0140] The storage module 50 is used to store the user information, product information and device information corresponding to the device to be authenticated in a persistent database.
[0141] It should be noted that the historical log information at least includes:
[0142] User information, product information, device information, address information when the device is logged in, and device login information.
[0143] It should be noted that the IoT device authentication apparatus provided in the embodiment of the present invention is a device capable of executing the above-mentioned IoT device authentication method. All embodiments of the above-mentioned IoT device authentication method are applicable to the apparatus and can achieve the same or similar technical effects.
[0144] like Figure 4 As shown, an embodiment of the present invention further provides a network device, including: a processor 401, a memory 402, and a program stored in the memory 402 and executable on the processor 401, and when the program is executed by the processor 401, the steps of the authentication method for the IoT device to be authenticated as described above are implemented.
[0145] Optionally, the network device further includes a transceiver 403 for receiving and sending data under the control of the processor 401 .
[0146] Among them, Figure 4In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 401 and various circuits of memory represented by memory 402 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides a user interface 404. The transceiver 403 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. For different electronic devices, the user interface 404 may also be an interface capable of externally connecting or internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like. The processor 401 is responsible for managing the bus architecture and general processing, and the memory 402 may store data used by the processor 401 when performing operations.
[0147] An embodiment of the present invention further provides a readable storage medium, on which a program is stored. When the program is executed by a processor, the steps of the above-mentioned method for authenticating an IoT device to be authenticated are implemented.
[0148] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0149] In the embodiment of the present invention, module can be implemented with software so that it can be executed by various types of processors. For example, an executable code module of an identification can include one or more physical or logical blocks of computer instructions, for example, it can be constructed as an object, process or function. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different positions, and when these instructions are logically combined together, it constitutes a module and realizes the specified purpose of the module.
[0150] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed among different programs, and distributed across a plurality of memory devices. Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form. The operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.
[0151] When a module can be implemented by software, considering the level of existing hardware technology, a person skilled in the art can build a corresponding hardware circuit to implement the corresponding function of the module that can be implemented by software without considering the cost. The hardware circuit includes a conventional very large scale integration (VLSI) circuit or gate array and existing semiconductors such as logic chips, transistors, or other discrete components. The module can also be implemented by a programmable hardware device, such as a field programmable gate array, a programmable array logic, a programmable logic device, etc.
[0152] The above exemplary embodiments are described with reference to the accompanying drawings, and many different forms and embodiments are feasible without departing from the spirit and teachings of the present invention. Therefore, the present invention should not be constructed as a limitation of the exemplary embodiments proposed herein. More specifically, these exemplary embodiments are provided so that the present invention will be perfect and complete, and the scope of the present invention will be conveyed to those who are familiar with the technology. In these figures, the component sizes and relative sizes may be exaggerated for clarity. The terms used here are only based on the purpose of describing specific exemplary embodiments and are not intended to be limiting. As used herein, unless the text clearly indicates otherwise, the singular forms "one", "an" and "the" are intended to include these multiple forms. It will be further understood that the terms "including" and / or "comprising" when used in this specification indicate the presence of the features, integers, steps, operations, components and / or components, but do not exclude the presence or increase of one or more other features, integers, steps, operations, components, components and / or their groups. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of that range and any subranges therebetween.
[0153] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for authenticating an IoT device to be authenticated, characterized in that: include: According to the historical log information of the device to be authenticated, the historical login information corresponding to the device to be authenticated is obtained, wherein the historical login information includes the historical online time and offline time of the device to be authenticated; Determine the first moment of preloading the authentication information for the next login of the device to be authenticated and the validity period of the authentication information based on the historical login information; wherein, determine the method for obtaining the validity period of the authentication information preloaded for the next login of the device to be authenticated based on the historical login information, including: determine the number of historical device logins of the device to be authenticated within the same time according to the historical login information; determine the validity period of the authentication information preloaded for the next login of the device to be authenticated based on the number of historical device logins within the same time; wherein, set the length of the validity period of the authentication information preloaded for the next login of the device to be authenticated based on the number of terminal devices logged in within the same time of the device to be authenticated, and the more devices logged in at the same time, the longer the validity period of the authentication information preloaded for the next login of the device to be authenticated; Within the validity period of the authentication information, if a login request of the device to be authenticated is received, authentication of the login validity is performed according to the preloaded authentication information; Among them, a scheduled task is created with the predicted login time of the next login of the device to be authenticated, the first moment of preloading the authentication information of the next login of the device to be authenticated, and the validity period of the authentication information, the scheduled task is executed at the first moment, the authentication information of the device to be authenticated is pre-pulled from the persistent database and stored in the cache, and after the validity period of the authentication information, the authentication information is determined to be expired; the scheduled task exists in the scheduled task queue: according to the user ID, product ID, device ID, the login time of the next login, the first moment of preloading the authentication information of the next login of the device to be authenticated, and the validity period of the authentication information, a scheduled task is created and added to the scheduled task queue, when the time meets the conditions, the authentication information of the device to be authenticated is pre-pulled from the persistent database and stored in the cache, and according to the cache expiration time, the service local cache expiration time and the validity period of the authentication information in the cache database are set.
2. The method according to claim 1, characterized in that The validity period includes: the validity period of the local cache authentication information, Within the validity period of the authentication information, if a login request of the device to be authenticated is received, authentication of the login validity is performed according to the preloaded authentication information, including: Within the validity period of the locally cached authentication information, if a login request from the device to be authenticated is received, the login validity is authenticated according to the preloaded authentication information.
3. The method according to claim 2, characterized in that The validity period also includes: the validity period of the cache database, Within the validity period of the authentication information, if a login request of the device to be authenticated is received, authentication of the login validity is performed according to the preloaded authentication information, further comprising: When the local cache authentication information is not within the validity period, but within the validity period of the cache database, if a login request of the device to be authenticated is received, the login validity is authenticated according to the authentication information in the cache database.
4. The method according to claim 3, characterized in that Within the validity period of the authentication information, if a login request of the device to be authenticated is received, authentication of the login validity is performed according to the preloaded authentication information, further comprising: When the validity period of the cache database is not reached, if a login request of the device to be authenticated is received, the login validity is authenticated according to the authentication information in the persistent database.
5. The method according to claim 1, characterized in that Determining, according to the historical login information, a first moment for preloading authentication information for the next login of the device to be authenticated, comprises: Selecting N login information from the historical login information, where N is determined by the accuracy and efficiency value of each login information obtained by parsing the historical login information; Predicting the next login time of the device to be authenticated based on the N login information; According to the login time of the next login, a first time for preloading authentication information for the next login of the device to be authenticated is determined.
6. The method according to claim 1, characterized in that Before acquiring the historical login information corresponding to the device to be authenticated according to the historical log information of the device to be authenticated, the method includes: Receiving a registration request sent by the device to be authenticated, the registration request including user information, product information, and device information sent by the device to be authenticated; The user information, product information and device information corresponding to the device to be authenticated are stored in a persistent database.
7. The method according to claim 1, characterized in that The historical log information at least includes: User information, product information, device information, address information when the device is logged in, and device login information.
8. An authentication device for an IoT device to be authenticated, characterized in that: include: An acquisition module, configured to acquire historical login information corresponding to the device to be authenticated according to historical log information of the device to be authenticated, wherein the historical login information includes historical online time and offline time of the device to be authenticated; The acquisition module includes: a fifth determination unit, which is used to determine the number of historical device logins of the device to be authenticated within the same time according to the historical login information; a sixth determination unit, which is used to determine the validity period of the authentication information preloaded for the next login of the device to be authenticated according to the number of historical device logins within the same time; wherein, according to the number of terminal devices logged in within the same time of the device to be authenticated, the validity period of the authentication information preloaded for the next login of the device to be authenticated is set, and the more devices logged in at the same time, the longer the validity period of the authentication information preloaded for the next login of the device to be authenticated; A first determination module, configured to determine, based on the historical login information, a first time to preload the authentication information for the next login of the device to be authenticated and a validity period of the authentication information; A second determination module is used to authenticate the login validity according to the preloaded authentication information if a login request of the device to be authenticated is received within the validity period of the authentication information; Among them, a scheduled task is created with the predicted login time of the next login of the device to be authenticated, the first moment of preloading the authentication information of the next login of the device to be authenticated, and the validity period of the authentication information, the scheduled task is executed at the first moment, the authentication information of the device to be authenticated is pre-pulled from the persistent database and stored in the cache, and after the validity period of the authentication information, the authentication information is determined to be expired; the scheduled task exists in the scheduled task queue: according to the user ID, product ID, device ID, the login time of the next login, the first moment of preloading the authentication information of the next login of the device to be authenticated, and the validity period of the authentication information, a scheduled task is created and added to the scheduled task queue, when the time meets the conditions, the authentication information of the device to be authenticated is pre-pulled from the persistent database and stored in the cache, and according to the cache expiration time, the service local cache expiration time and the validity period of the authentication information in the cache database are set.
9. A network device comprising: A transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; characterized in that when the processor executes the program or instruction, the authentication device for an IoT device to be authenticated is implemented as described in any one of claims 1 to 7.
10. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the authentication device for an IoT device to be authenticated is implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Information processing method and electronic equipment
CN104239772A
User information loading method and device as well as server
CN106156261A
Identity authentication method and device
CN111901290A