Internet of things equipment access method and system

文档序号:1819840 发布日期:2021-11-09 浏览:4次 中文

阅读说明:本技术 一种物联网设备接入方法及系统 (Internet of things equipment access method and system ) 是由 刘源 姜仁杰 张彬 张海涛 郭沛 吴今 于 2020-05-07 设计创作,主要内容包括:本发明提供了一种物联网设备接入方法及系统,该方法包括:获取目标信息;将目标信息中的至少部分保存至远程字典服务Redis数据库中。本发明实施例通过将物联网设备与分布式节点的连接信息、物联网设备的订阅信息、分布式节点之间的路由信息、连接信息的过期时间、订阅信息的过期时间、物联网设备的业务数据、以及物联网设备的状态中的至少一项目标信息保存至Redis数据库的方式,内部实现集群模式不依赖第三方组件维护,使用简便、维护成本第,在分布式集群模式下,各个分布式节点间的信息同步速率较高,且能够保证数据的一致性,消息流转速度快。(The invention provides an Internet of things equipment access method and system, wherein the method comprises the following steps: acquiring target information; saving at least part of the target information to a remote dictionary service Redis database. According to the embodiment of the invention, at least one item of target information of the connection information between the Internet of things equipment and the distributed nodes, the subscription information of the Internet of things equipment, the routing information between the distributed nodes, the expiration time of the connection information, the expiration time of the subscription information, the service data of the Internet of things equipment and the state of the Internet of things equipment is stored in the Redis database, the cluster mode is internally realized without depending on the maintenance of a third-party component, the use is simple and convenient, the maintenance cost is low, the information synchronization rate between the distributed nodes is high in the distributed cluster mode, the data consistency can be ensured, and the message flow speed is high.)

1. An Internet of things equipment access method is characterized by comprising the following steps:

acquiring target information; wherein the target information includes: at least one of connection information of the internet of things equipment and distributed nodes, subscription information of the internet of things equipment, routing information between the distributed nodes, expiration time of the connection information, expiration time of the subscription information, service data of the internet of things equipment, and states of the internet of things equipment;

saving at least part of the target information to a remote dictionary service Redis database.

2. The internet of things device access method of claim 1, wherein after the step of saving the target information to a remote dictionary service (Redis) database, further comprising:

reading corresponding information from the Redis database upon at least one of:

a write node in the distributed nodes is abnormal;

the node cluster formed by the distributed nodes is abnormal;

when the Internet of things equipment is reconnected.

3. The internet of things equipment access method according to claim 1, wherein before the step of obtaining the target information, the method further comprises:

acquiring an access request of the Internet of things equipment; wherein the access request comprises: at least one of a client ID, a username and password, and a topic access control;

authenticating the Internet of things equipment according to the access request;

and if the authentication is passed, acquiring the connection information of the Internet of things equipment and the distributed nodes.

4. The internet of things equipment access method according to claim 1, wherein after the step of obtaining the target information, the method further comprises:

and monitoring the state of the equipment of the Internet of things and the service data of the equipment of the Internet of things.

5. The internet of things equipment access method according to claim 1, wherein after the step of obtaining the target information, the method further comprises:

and synchronizing the state and the timestamp of the Internet of things equipment to an equipment shadow module.

6. The Internet of things equipment access method of claim 5, further comprising:

reading a status of the Internet of things device from the device shadow module when at least one of:

the state of the Internet of things equipment is an off-line state;

the multiple programs simultaneously request the state of the Internet of things equipment;

and the Internet of things equipment is on line again after being disconnected.

7. The internet of things equipment access method of claim 1, further comprising:

caching subscription information and states of the Internet of things equipment and message flow data among the equipment; and/or the presence of a gas in the gas,

and storing the service data of the Internet of things equipment.

8. The internet of things device access method of claim 1, wherein the subscription information comprises: and (3) a mapping relation between the theme and the distributed nodes, wherein the theme comprises wildcard characters +, #and.

9. The internet of things device access method of claim 1, wherein saving at least part of the target information to a remote dictionary service (Redis) database comprises:

and storing the part of the target information, of which the service quality Qos is a first value, into a Redis database.

10. An internet of things device access system, comprising: the system comprises the Internet of things equipment, a gateway connected with the Internet of things equipment and an access core module connected with the gateway; wherein the access core module comprises:

a first acquisition unit configured to acquire target information; wherein the target information includes: at least one of connection information of the internet of things equipment and distributed nodes, subscription information of the internet of things equipment, routing information between the distributed nodes, expiration time of the connection information, expiration time of the subscription information, service data of the internet of things equipment, and states of the internet of things equipment;

and the storage unit is used for storing at least part of the target information into a remote dictionary service Redis database.

11. The internet of things device access system of claim 10, wherein the access core module further comprises:

a first reading unit, configured to read corresponding information from the Redis database when at least one of the following occurs:

a write node in the distributed nodes is abnormal;

the node cluster formed by the distributed nodes is abnormal;

when the Internet of things equipment is reconnected.

12. The internet of things device access system of claim 10, wherein the access core module further comprises:

the second obtaining unit is used for obtaining an access request of the Internet of things equipment; wherein the access request comprises: at least one of a client ID, a username and password, and a topic access control;

authenticating the Internet of things equipment according to the access request;

and if the authentication is passed, acquiring the connection information of the Internet of things equipment and the distributed nodes.

13. The internet of things device access system of claim 10, further comprising:

and the data monitoring module is used for monitoring the state of the Internet of things equipment and the service data of the Internet of things equipment.

14. The internet of things device access system of claim 1, further comprising:

and the access core module synchronizes the state of the Internet of things equipment and the timestamp to the equipment shadow module.

15. The internet of things device access system of claim 14, wherein the access core module and the device shadow module are connected by a kafka.

16. The internet of things device access system of claim 14, wherein the access core module further comprises:

a second reading unit, configured to read, from the device shadow module, a status of the internet of things device when at least one of the following occurs:

the state of the Internet of things equipment is an off-line state;

the multiple programs simultaneously request the state of the Internet of things equipment;

and the Internet of things equipment is on line again after being disconnected.

17. The internet of things device access system of claim 10, further comprising:

the cache module is used for caching subscription information and states of the Internet of things equipment and message flow data among the equipment; and/or the presence of a gas in the gas,

and the database is used for storing the service data of the Internet of things equipment.

18. The internet of things device access system of claim 10, wherein the subscription information comprises: and (3) a mapping relation between the theme and the distributed nodes, wherein the theme comprises wildcard characters +, #and.

19. The internet of things device access system of claim 10, wherein the storage unit is specifically configured to: and storing the part of the target information, of which the service quality Qos is a first value, into a Redis database.

Technical Field

The invention relates to the technical field of communication, in particular to an Internet of things equipment access method and system.

Background

The Telemetry Transport (MQTT) belongs to a Transport protocol of the Internet of things (IoT), mainly provides a subscription and publishing mode, has an open design concept, is simple, lightweight and easy to implement, and can be used even in a limited environment (such as low bandwidth, high network delay, unstable network communication, and the like).

Due to the characteristics of hardware and bandwidth limitation of the internet of things equipment, the existing scheme for realizing equipment access of the internet of things platform mostly adopts an MQTT protocol. Currently, the MOTT protocol defines two entity types in the network: one is a message broker and one is a client. Wherein the proxy can act as a server to listen for all messages from the client and then route them to the relevant target client. A client may be anything that sends and receives messages by interacting with an agent. For example, the client may be an IoT sensor in the field, or an application within a data center that processes IoT data, and the like.

At present, the method for realizing device access based on the publish-subscribe mechanism of the MQTT protocol has the problem of poor real-time performance.

Disclosure of Invention

The invention provides an Internet of things equipment access method and system, and solves the problem of poor real-time performance in the existing Internet of things equipment access method.

The embodiment of the invention provides an access method of Internet of things equipment, which comprises the following steps:

acquiring target information; wherein the target information includes: at least one of connection information of the internet of things equipment and the distributed nodes, subscription information of the internet of things equipment, routing information between the distributed nodes, expiration time of the connection information, expiration time of the subscription information, service data of the internet of things equipment, and states of the internet of things equipment;

saving at least a portion of the target information to a Remote Dictionary service (Redis) database.

Optionally, after the step of saving the target information in a remote dictionary service Redis database, the method further includes:

reading corresponding information from the Redis database upon at least one of the following occurrences:

a write node in the distributed node is abnormal;

a node cluster formed by distributed nodes is abnormal;

when the internet of things equipment is reconnected.

Optionally, before the step of obtaining the target information, the method further includes:

acquiring an access request of the Internet of things equipment; wherein, the access request includes: at least one of a client (Clien) ID, username and password, topic access control;

authenticating the Internet of things equipment according to the access request;

and if the authentication is passed, acquiring the connection information of the Internet of things equipment and the distributed nodes.

Optionally, after the step of obtaining the target information, the method further includes:

and monitoring the state of the equipment of the Internet of things and the service data of the equipment of the Internet of things.

Optionally, after the step of obtaining the target information, the method further includes:

and synchronizing the state of the Internet of things equipment and the timestamp to the equipment shadow module.

Optionally, the internet of things device access method according to the embodiment of the present invention further includes:

reading a state of the Internet of things device from the device shadow module when at least one of the following occurs:

the state of the Internet of things equipment is an offline state;

the multiple programs simultaneously request the state of the equipment of the Internet of things;

and the Internet of things equipment is on line again after being disconnected.

Optionally, the internet of things device access method according to the embodiment of the present invention further includes:

caching subscription information and states of the Internet of things equipment and message flow data among the equipment;

and/or the presence of a gas in the gas,

and storing the service data of the equipment of the Internet of things.

Optionally, the subscription information includes: and (3) a mapping relation between the theme and the distributed nodes, wherein the theme comprises wildcard characters +, #and.

Optionally, saving at least part of the target information to a remote dictionary service Redis database comprises:

and storing a part of the target information, of which the Quality of Service (Qos) is a first value, into a Redis database.

The embodiment of the invention also provides an access system of the internet of things equipment, which comprises the following components: the system comprises the Internet of things equipment, a gateway connected with the Internet of things equipment and an access core module connected with the gateway; wherein, the access core module includes:

a first acquisition unit configured to acquire target information; wherein the target information includes: at least one of connection information of the internet of things equipment and the distributed nodes, subscription information of the internet of things equipment, routing information between the distributed nodes, expiration time of the connection information, expiration time of the subscription information, service data of the internet of things equipment, and states of the internet of things equipment;

and the storage unit is used for storing at least part of the target information into a remote dictionary service Redis database.

Optionally, the access core module further comprises:

a first reading unit, configured to read corresponding information from the Redis database when at least one of the following occurs:

a write node in the distributed node is abnormal;

a node cluster formed by distributed nodes is abnormal;

when the internet of things equipment is reconnected.

Optionally, the access core module further comprises:

the second obtaining unit is used for obtaining an access request of the Internet of things equipment; wherein, the access request includes: at least one of a client ID, a username and password, and a topic access control;

authenticating the Internet of things equipment according to the access request;

and if the authentication is passed, acquiring the connection information of the Internet of things equipment and the distributed nodes.

Optionally, the internet of things device access system of the embodiment of the present invention further includes:

and the data monitoring module is used for monitoring the state of the Internet of things equipment and the service data of the Internet of things equipment.

Optionally, the internet of things device access system of the embodiment of the present invention further includes:

and the equipment shadow module is accessed into the core module to synchronize the state and the timestamp of the equipment of the Internet of things to the equipment shadow module.

Optionally, the access core module and the device shadow module are connected through kafka.

Optionally, the access core module further comprises:

a second reading unit, configured to read, from the device shadow module, a state of the internet of things device when at least one of the following occurs:

the state of the Internet of things equipment is an offline state;

the multiple programs simultaneously request the state of the equipment of the Internet of things;

and the Internet of things equipment is on line again after being disconnected.

Optionally, the internet of things device access system further includes:

the cache module is used for caching subscription information and states of the Internet of things equipment and message flow data among the equipment;

and/or the presence of a gas in the gas,

and the database is used for storing the service data of the equipment of the Internet of things.

Optionally, the subscription information includes: and (3) a mapping relation between the theme and the distributed nodes, wherein the theme comprises wildcard characters +, #and.

Optionally, the saving unit is specifically configured to: and saving the part of the target information, of which the service quality Qos is a first value, into a Redis database.

The technical scheme of the invention has the beneficial effects that: by storing at least one item of target information in the connection information of the Internet of things equipment and the distributed nodes, the subscription information of the Internet of things equipment, the routing information between the distributed nodes, the expiration time of the connection information, the expiration time of the subscription information, the service data of the Internet of things equipment and the state of the Internet of things equipment into a Redis database, the internal implementation cluster mode is independent of the maintenance of a third party component, the use is simple and convenient, the maintenance cost is low, in the distributed cluster mode, the information synchronization rate between the distributed nodes is high, the data consistency can be guaranteed, and the message circulation speed is high.

Drawings

Fig. 1 is a schematic flow chart of an access method of an internet of things device according to an embodiment of the present invention;

fig. 2 is a block diagram of an internet of things device access system according to an embodiment of the present invention;

fig. 3 is a schematic structural diagram of a unit of an access core module according to an embodiment of the present invention.

Detailed Description

In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help the full understanding of the embodiments of the present invention. Thus, it will be apparent to those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the invention. In addition, descriptions of well-known functions and constructions are omitted for clarity and conciseness.

It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

In addition, the terms "system" and "network" are often used interchangeably herein.

In the embodiments provided herein, it should be understood that "B corresponding to a" means that B is associated with a from which B can be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may be determined from a and/or other information.

As shown in fig. 1, an embodiment of the present invention provides an access method for an internet of things device, which specifically includes the following steps:

step 11: and acquiring target information.

Wherein the target information includes: at least one of connection information of the internet of things equipment and the distributed nodes, subscription information of the internet of things equipment, routing information between the distributed nodes, expiration time of the connection information, expiration time of the subscription information, service data of the internet of things equipment, and states of the internet of things equipment.

Step 12: saving at least part of the target information to a remote dictionary service Redis database.

Optionally, after the step of saving the target information in a remote dictionary service Redis database, the method further includes:

reading corresponding information from the Redis database upon at least one of the following occurrences:

a write node in the distributed node is abnormal;

a node cluster formed by distributed nodes is abnormal;

when the internet of things equipment is reconnected.

Optionally, before the step of obtaining the target information, the method further includes:

acquiring an access request of the Internet of things equipment; wherein, the access request includes: at least one of a client ID, a username and password, and a topic access control;

authenticating the Internet of things equipment according to the access request;

and if the authentication is passed, acquiring the connection information of the Internet of things equipment and the distributed nodes.

Optionally, after the step of obtaining the target information, the method further includes:

and monitoring the state of the equipment of the Internet of things and the service data of the equipment of the Internet of things.

Optionally, after the step of obtaining the target information, the method further includes:

and synchronizing the state of the Internet of things equipment and the timestamp to the equipment shadow module.

Optionally, the internet of things device access method according to the embodiment of the present invention further includes:

reading a state of the Internet of things device from the device shadow module when at least one of the following occurs:

the state of the Internet of things equipment is an offline state;

the multiple programs simultaneously request the state of the equipment of the Internet of things;

and the Internet of things equipment is on line again after being disconnected.

Optionally, the internet of things device access method according to the embodiment of the present invention further includes:

caching subscription information and states of the Internet of things equipment and message flow data among the equipment;

and/or the presence of a gas in the gas,

and storing the service data of the equipment of the Internet of things.

Optionally, the subscription information includes: and (3) a mapping relation between the theme and the distributed nodes, wherein the theme comprises wildcard characters +, #and.

Optionally, saving at least part of the target information to a remote dictionary service Redis database comprises:

and saving the part of the target information, of which the service quality Qos is a first value, into a Redis database. Where the value of Qos represents a Qos level, for example the value of Qos may include 0 or 1. The method comprises the steps of taking service data of the Internet of things equipment as an example, storing messages with Qos >1 in Redis, using an expiration mechanism of the Redis to achieve custom storage measurement of the messages, achieving message retransmission through custom configuration when the Internet of things equipment is reconnected, and deleting corresponding messages after the Internet of things equipment is confirmed.

By storing at least one item of target information in the connection information of the Internet of things equipment and the distributed nodes, the subscription information of the Internet of things equipment, the routing information between the distributed nodes, the expiration time of the connection information, the expiration time of the subscription information, the service data of the Internet of things equipment and the state of the Internet of things equipment into a Redis database, the internal implementation cluster mode is independent of the maintenance of a third party component, the use is simple and convenient, the maintenance cost is low, in the distributed cluster mode, the information synchronization rate between the distributed nodes is high, the data consistency can be guaranteed, and the message circulation speed is high.

The foregoing embodiments are respectively introduced to the method for accessing an internet of things device, and the following embodiments will further describe a system corresponding to the method with reference to the accompanying drawings.

Specifically, as shown in fig. 2, the internet of things device access system according to the embodiment of the present invention includes: the system comprises an internet of things device 21 (or MQTT device), a gateway 22 connected with the internet of things device 21, and an access core module 23 (or MQTT cracker BROKER) connected with the gateway 22; the gateway 22 is used for load balancing of the internet of things device 21. The access core module has the core functions: 1. access and authentication of internet of things devices 21 (such as MQTT devices), topic subscription and publication, circulation of messages (such as service data), and the like. In addition, the access core module can also support mqtt v3.3.1 protocol specification, Transport Layer Security (TLS)/secure socket protocol (SSL) and internal encryption communication. The access core module 23 includes a plurality of distributed nodes, and the core access module 23 can operate in a distributed cluster mode, and can implement the distributed cluster mode without depending on a third-party management tool, and automatically synchronize subscription information among the nodes. In addition, the access core module 23 may also customize a message storage policy, support a message retransmission mechanism, a multidimensional current limiting policy, an automatic fusing mechanism exceeding a threshold, and the like. The following is a further description thereof with reference to the accompanying drawings.

As shown in fig. 3, the access core module 23 of the embodiment of the present invention includes:

a first acquisition unit 31 for acquiring target information; wherein the target information includes: at least one of connection information of the internet of things equipment and the distributed nodes, subscription information of the internet of things equipment, routing information between the distributed nodes, expiration time of the connection information, expiration time of the subscription information, service data of the internet of things equipment, and states of the internet of things equipment;

a saving unit 32, configured to save at least part of the target information to a remote dictionary service Redis database.

The core functions of the access core module 23 are: under the distributed cluster mode, the data consistency and the synchronization efficiency among all nodes are high. The data that the access core module 23 of the embodiment of the present invention can synchronize and store in real time includes but is not limited to: the method includes the steps of determining which devices are connected to a node, subscription information of the connected devices to the node, storing of messages, and routing information of the messages from source addresses to destination addresses.

In consideration of the timeliness and resource consumption of data synchronization, the embodiment of the invention can adopt a scheme of theme tree + local cache + Redis. Optionally, the access core module 23 further includes:

a first reading unit, configured to read corresponding information from the Redis database when at least one of the following occurs:

a write node in the distributed node is abnormal;

a node cluster formed by distributed nodes is abnormal;

when the internet of things equipment is reconnected.

Taking the state of the internet of things equipment and the like as examples, storing connection information of the internet of things equipment connected to a certain distributed node in a local cache, simulating a distributed lock by utilizing an SETNX command provided by a redis database, writing the state of the internet of things equipment into the redis database and setting expiration time, so that if the written node is abnormal, the state of the internet of things equipment can be synchronized with real equipment within the shortest time, and the state of the internet of things equipment in the whole cluster node is guaranteed to be correct.

For example, when subscribing/unsubscribing a topic, the internet of things device subscribes/unsubscribes a topic, and first stores/cancels the subscription relationship between the internet of things device and the topic in the topic tree of the current node, and also needs to store the relationship in the Redis database, and when the cluster node recovers from an abnormality, the data can be read from the Redis database and recovered.

Optionally, the access core module 23 further supports broadcasting the mapping relationship between the topic and the distributed node to other nodes through a private communication protocol between the distributed nodes. And other nodes receive the data and store the data in the local node cache.

Optionally, the saving unit 32 is specifically configured to: and saving the part of the target information, of which the service quality Qos is a first value, into a Redis database. The Qos value is used to indicate a Qos level, and the first value may be a value greater than 0, for example, all messages with Qos >0 are stored in a Redis database, and a self-defined storage policy of the platform on the messages is implemented by using an expiration mechanism of the Redis database. When the internet of things equipment is reconnected, message retransmission can be realized through custom configuration, and the corresponding message is deleted after the internet of things equipment is confirmed so as to release the memory. Optionally, the access core module 23 of the embodiment of the present invention supports QOS levels of 0 and 1.

In the embodiment of the present invention, when the access core module 23 works in the cluster mode, when a message of a certain piece of internet-of-things equipment reaches a node, a target equipment is first searched from the theme tree of the current node, and if the target equipment is found, the message is directly sent, otherwise, the message is routed to the corresponding node through the mapping relationship between the theme and the node, and then the target equipment is found from the theme tree of the target node.

That is to say, the access core module 23 of the embodiment of the present invention supports the following functions: the support function of Connect, Disconnect, Subscribe, Publish, Unscubscribe, Ping, Keepalive, Retain, wild, clear Session, etc.

Optionally, the functions supported by the access core module 23 further support ClienID, username and password authentication, and topic access control, and specifically, the access core module 23 further includes:

the second obtaining unit is used for obtaining an access request of the Internet of things equipment; wherein, the access request includes: at least one of a ClienID, a username and password, and a topic access control;

authenticating the Internet of things equipment according to the access request;

and if the authentication is passed, acquiring the connection information of the Internet of things equipment and the distributed nodes.

Optionally, the internet of things device access system of the embodiment of the present invention further includes:

and the data monitoring module is used for monitoring the state of the Internet of things equipment and the service data of the Internet of things equipment. Optionally, the data monitoring module may provide an api interface to monitor the state and service data of the internet of things device.

Optionally, the internet of things device access system of the embodiment of the present invention further includes:

and the equipment shadow module 24 is accessed to the core module to synchronize the state and the timestamp of the equipment of the internet of things to the equipment shadow module.

The Internet of things access system of the embodiment of the invention provides a device shadow function for caching the state of the device. When the equipment is on line, a cloud instruction can be directly obtained; when the device is offline, the cloud instruction can be actively pulled after the device is online.

Optionally, the access core module 23 and the device shadow module 24 are connected by kafka 25. kafka25 is used as a communication middleware of the device core module 23 and the device shadow module 24, and can decouple service logic between the modules to realize an asynchronous data transmission function.

Optionally, the access core module 23 further includes:

a second reading unit, configured to read, from the device shadow module, a state of the internet of things device when at least one of the following occurs:

the state of the Internet of things equipment is an offline state;

the multiple programs simultaneously request the state of the equipment of the Internet of things;

and the Internet of things equipment is on line again after being disconnected.

That is, the device shadow applies to the following scenario:

firstly, the network is unstable, and the device is frequently on and off.

The device shadow mechanism is used to store the latest state of the device, and once the state of the internet of things device changes, the internet of things device synchronizes the state to the device shadow module 24. When the application program requests the current state of the device, it only needs to acquire the state in the device shadow module 24, and does not need to care whether the device is online.

And secondly, simultaneously requesting to acquire the equipment state by multiple programs.

The internet of things equipment only needs to actively synchronize the state to the equipment shadow module 24 once, and the latest state of the equipment can be obtained by a plurality of application programs requesting the equipment shadow module 24 to obtain the equipment state, so that decoupling of the application programs and the internet of things equipment is realized.

And thirdly, the Internet of things equipment is disconnected.

The internet of things equipment is truly disconnected, and the instruction sending fails. When the internet of things device comes online again, the device shadow module 24 may ensure that the internet of things device will not execute expired instructions in an instruction-timestamping mode.

Optionally, the internet of things device access system further includes:

the caching module 26 is configured to cache subscription information and status of the internet of things devices and message flow data between the devices.

The cache module 26 (e.g., a Redis database) is mainly used for storing hot spots and non-persistent data, accelerating the response performance of the whole system, relieving the request pressure of the database module, and mainly storing the following types of information: device subscription information, device presence status, message flow data between devices, etc.

And/or the presence of a gas in the gas,

the Internet of things equipment access system further comprises: and the database 27 is used for storing service data of the internet of things equipment, for example, storing service basic information and serving as a persistence and bottom-binding strategy of data storage, so that the safety of the data is kept to the maximum extent.

Optionally, the access core module supports subscription to certain topics containing special wildcards, e.g. the topics supporting subscription contain wildcards +, #, etc. Accordingly, the subscription information includes: and (3) a mapping relation between the theme and the distributed nodes, wherein the theme comprises wildcard characters +, #and.

According to the Internet of things equipment access system provided by the embodiment of the invention, the decoupling of the service and the state is realized through the equipment shadow module 25, the service function can be independent of the real-time state of the equipment, and the response timeliness of the system and the use experience of a user are improved.

In addition, the access system of the internet of things equipment of the embodiment of the invention completely realizes the MQTT protocol specification, has wider coverage, more comprehensively supports a plurality of unusual equipment use scenes, supports the MQTT encryption function of the whole connection life cycle of the internet of things equipment, and effectively ensures the data security.

The cluster mode realized in the Internet of things equipment access system provided by the embodiment of the invention does not depend on the maintenance of a third-party component, the use is simple and convenient, the maintenance cost is lower, and the own internal message communication protocol is easy to customize to avoid invalid data. In the distributed cluster mode, the information synchronization rate among all the nodes is high, the data consistency can be better ensured, the message circulation speed is high, the message storage strategy can be customized, the message retransmission is supported, and the possibility of data loss is reduced. According to the self capacity of the cluster, the current limiting strategies of all dimensions are dynamically implemented, even if an accident occurs, an automatic fusing mechanism of the system can be triggered, and the normal function operation of the platform is effectively protected.

The system embodiment of the invention is corresponding to the embodiment of the method, all the implementation means in the method embodiment are applicable to the embodiment of the system, and the same technical effect can be achieved. According to the system, a mode that at least one item of target information in connection information of the Internet of things equipment and distributed nodes, subscription information of the Internet of things equipment, routing information between the distributed nodes, expiration time of the connection information, expiration time of the subscription information, service data of the Internet of things equipment and states of the Internet of things equipment is stored in a Redis database is adopted, an internal cluster mode is not dependent on maintenance of a third party component, the use is simple and convenient, the maintenance cost is low, under the distributed cluster mode, the information synchronization rate between the distributed nodes is high, the data consistency can be guaranteed, and the message circulation speed is high.

Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be performed by hardware, or may be instructed to be performed by associated hardware by a computer program that includes instructions for performing some or all of the steps of the above methods; and the computer program may be stored in a readable storage medium, which may be any form of storage medium.

The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the internet of things device access method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.

Furthermore, it is to be noted that in the device and method of the invention, it is obvious that the individual components or steps can be decomposed and/or recombined. These decompositions and/or recombinations are to be regarded as equivalents of the present invention. Also, the steps of performing the series of processes described above may naturally be performed chronologically in the order described, but need not necessarily be performed chronologically, and some steps may be performed in parallel or independently of each other. It will be understood by those skilled in the art that all or any of the steps or elements of the method and apparatus of the present invention may be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or any combination thereof, which can be implemented by those skilled in the art using their basic programming skills after reading the description of the present invention.

Thus, the objects of the invention may also be achieved by running a program or a set of programs on any computing device. The computing device may be a general purpose device as is well known. The object of the invention is thus also achieved solely by providing a program product comprising program code for implementing the method or the apparatus. That is, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. It is to be understood that the storage medium may be any known storage medium or any storage medium developed in the future. It is further noted that in the apparatus and method of the present invention, it is apparent that each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be regarded as equivalents of the present invention. Also, the steps of executing the series of processes described above may naturally be executed chronologically in the order described, but need not necessarily be executed chronologically. Some steps may be performed in parallel or independently of each other.

While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种匿名流量的识别方法、装置及电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类