CN113630366A - Internet of things equipment access method and system - Google Patents

Internet of things equipment access method and system Download PDF

Info

Publication number
CN113630366A
CN113630366A CN202010376821.0A CN202010376821A CN113630366A CN 113630366 A CN113630366 A CN 113630366A CN 202010376821 A CN202010376821 A CN 202010376821A CN 113630366 A CN113630366 A CN 113630366A
Authority
CN
China
Prior art keywords
internet
things equipment
things
equipment
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010376821.0A
Other languages
Chinese (zh)
Inventor
刘源
姜仁杰
张彬
张海涛
郭沛
吴今
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile IoT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010376821.0A priority Critical patent/CN113630366A/en
Publication of CN113630366A publication Critical patent/CN113630366A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Abstract

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.

Description

Internet of things equipment access method and system
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.

Claims (19)

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.
CN202010376821.0A 2020-05-07 2020-05-07 Internet of things equipment access method and system Pending CN113630366A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010376821.0A CN113630366A (en) 2020-05-07 2020-05-07 Internet of things equipment access method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010376821.0A CN113630366A (en) 2020-05-07 2020-05-07 Internet of things equipment access method and system

Publications (1)

Publication Number Publication Date
CN113630366A true CN113630366A (en) 2021-11-09

Family

ID=78376851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010376821.0A Pending CN113630366A (en) 2020-05-07 2020-05-07 Internet of things equipment access method and system

Country Status (1)

Country Link
CN (1) CN113630366A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022392A (en) * 2022-06-24 2022-09-06 浪潮软件集团有限公司 IOT-oriented distributed publishing and subscribing service method and system
CN115102800A (en) * 2022-06-16 2022-09-23 珠海格力电器股份有限公司 Access system and access method of Internet of things equipment
CN115022392B (en) * 2022-06-24 2024-04-30 浪潮软件集团有限公司 IOT-oriented distributed publishing and subscribing service method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101178A (en) * 2016-05-30 2016-11-09 海尔优家智能科技(北京)有限公司 A kind of subscription message distribution, method of reseptance, device and related system
CN109587228A (en) * 2018-11-23 2019-04-05 济南浪潮高新科技投资发展有限公司 A kind of publicly-owned agreement platform of internet of things and equipment cut-in method
CN110557423A (en) * 2018-06-04 2019-12-10 珠海全志科技股份有限公司 message pushing method and system
US10555202B1 (en) * 2019-02-20 2020-02-04 Oracle International Corporation Methods, systems, and computer readable media for monitoring internet of things (IoT) device state through service capability exposure function (SCEF)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101178A (en) * 2016-05-30 2016-11-09 海尔优家智能科技(北京)有限公司 A kind of subscription message distribution, method of reseptance, device and related system
CN110557423A (en) * 2018-06-04 2019-12-10 珠海全志科技股份有限公司 message pushing method and system
CN109587228A (en) * 2018-11-23 2019-04-05 济南浪潮高新科技投资发展有限公司 A kind of publicly-owned agreement platform of internet of things and equipment cut-in method
US10555202B1 (en) * 2019-02-20 2020-02-04 Oracle International Corporation Methods, systems, and computer readable media for monitoring internet of things (IoT) device state through service capability exposure function (SCEF)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115102800A (en) * 2022-06-16 2022-09-23 珠海格力电器股份有限公司 Access system and access method of Internet of things equipment
CN115022392A (en) * 2022-06-24 2022-09-06 浪潮软件集团有限公司 IOT-oriented distributed publishing and subscribing service method and system
CN115022392B (en) * 2022-06-24 2024-04-30 浪潮软件集团有限公司 IOT-oriented distributed publishing and subscribing service method and system

Similar Documents

Publication Publication Date Title
CN106453288B (en) A kind of distributed micro services frame system that supporting asynchronous mode and its implementation
US10439916B2 (en) Client-side fault tolerance in a publish-subscribe system
EP3490224B1 (en) Data synchronization method and system
CN108768826B (en) Message routing method based on MQTT and Kafka high concurrency scene
US9578081B2 (en) System and method for providing an actively invalidated client-side network resource cache
CN102045270B (en) Chat server system, method for constructing chat server system and chat system
US20080098093A1 (en) Offline automated proxy cache for web applications
US9866455B2 (en) Using status inquiry and status response messages to exchange management information
CN107528891B (en) Websocket-based automatic clustering method and system
US20180115616A1 (en) Method for bridging publish/subscribe brokers for guaranteed low-latency delivery
CN113157449A (en) Real-time stream data analysis processing method based on MQTT
CN112583895B (en) TCP communication method, system and device
CN108540367B (en) Message processing method and system
CN102118325B (en) Method and device for configuring chat client terminal, as well as chat client terminal
CN112671554A (en) Node fault processing method and related device
US10958712B2 (en) Enhanced reliability for information services
CN113630366A (en) Internet of things equipment access method and system
CN114500527A (en) Out-of-band management system and method for edge device
EP2944073A2 (en) Method and system for the handling of redundant long poll
CN108076111B (en) System and method for distributing data in big data platform
CN114025005B (en) Data communication method, system, electronic equipment and storage medium
CN101902449A (en) Emulation for persistent HTTP connection between network devices
CN110519397B (en) SIP terminal access load balancing system and method based on NGINX
CN114785695A (en) High-performance network communication library realized based on zeroC ICE
CN108055305B (en) Storage expansion method and storage expansion device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211109