CN110365782A - A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty - Google Patents

A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty Download PDF

Info

Publication number
CN110365782A
CN110365782A CN201910651604.5A CN201910651604A CN110365782A CN 110365782 A CN110365782 A CN 110365782A CN 201910651604 A CN201910651604 A CN 201910651604A CN 110365782 A CN110365782 A CN 110365782A
Authority
CN
China
Prior art keywords
hardware terminal
data
netty
internet
channel
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
CN201910651604.5A
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.)
Jiangsu Degao Wulian Technology Co Ltd
Original Assignee
Jiangsu Degao Wulian Technology 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 Jiangsu Degao Wulian Technology Co Ltd filed Critical Jiangsu Degao Wulian Technology Co Ltd
Priority to CN201910651604.5A priority Critical patent/CN110365782A/en
Publication of CN110365782A publication Critical patent/CN110365782A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/53Network services using third party service providers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Telephonic Communication Services (AREA)

Abstract

This application discloses a kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty, the method includes receiving the reported data of hardware terminal;Acquisition decoding data is decoded to the reported data using fixed length decoder;The decoding data is parsed to obtain parsing data, the parsing data include hardware terminal identity;Hardware terminal identity example, the mapping relations of hardware terminal identity example characterization the hardware terminal identity and the channel Netty are constructed according to the hardware terminal identity;The hardware terminal identity example is stored to static cache;The parsing data are stored to database, hardware terminal is solved and server software communication lacks reasonable control, the problem of data are difficult to dynamic and are distributed to different third party systems, IO flow blocked.

Description

A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty
Technical field
This application involves Internet of Things communication field more particularly to a kind of Internet of Things means of communication based on Netty, equipment, hardware Terminal and server.
Background technique
Internet of Things is the important component of generation information technology.Information Technology Development is to today, from person to person originally Communication requirement have turned to interconnecting between people and object and object and object, it is final to realize all things on earth interconnection.Sensor technology, Embedded system technology and mechanics of communication are three important components of Internet of Things.Wherein mechanics of communication is internet constituent parts Between carry out information transmission and the material base exchanged, without mechanics of communication, Internet of Things " cannot join ", cannot also constitute " net ".
As the equipment for being connected to Internet of Things in recent years Exponential growth occurs in diversity and quantitative aspects, Internet of Things is Become a kind of mainstream technology, there are great potentiality in terms of pushing the life style of society now.In the skill of Internet of Things In art and engineering, still there is specific boundary at present between hardware and software platform, wherein energy is placed on by most of supply commercial cities Hardware aspect, hardware and software is only communicated by transmission control protocol mode using socket socket in the prior art, is existed IO flow blocked problem, and the communication of hardware terminal and server-side lacks reasonable control.
Summary of the invention
In order to overcome shortcoming and deficiency of the existing technology, the application discloses a kind of Internet of Things communication side based on Netty Method, equipment, hardware terminal and server, the communication for being able to solve hardware terminal and server-side lack reasonable control, and data are difficult to The problem of dynamic is distributed to different third party systems and IO flow blocked.
In order to achieve the purpose that above-mentioned application, this application provides a kind of the Internet of Things means of communication based on Netty, this method Include:
Receive the reported data of hardware terminal;
Acquisition decoding data is decoded to the reported data using fixed length decoder;
The decoding data is parsed to obtain parsing data, the parsing data include hardware terminal identity;
Hardware terminal identity example, the hardware terminal identity example are constructed according to hardware terminal identity Characterize the mapping relations of hardware terminal identity and the channel Netty;
The hardware terminal identity example is stored to static cache;
The parsing data are stored to database.
Specifically, the method also includes:
Judge whether the channel heartbeat between hardware terminal and Netty is overtime;
If the channel heartbeat timeout between the hardware terminal and Netty, the channel of hardware terminal and Netty is closed.
Further, if the channel heartbeat between the hardware terminal and Netty is not overtime, the method also includes:
Judge whether the heartbeat of hardware terminal active reporting is overtime or judges that the channel is corresponding in the static cache Whether hardware terminal identity is empty;
If channel described in the channel heartbeat timeout or the static cache between the hardware terminal and Netty is corresponding Hardware device identity be sky, close hardware terminal and Netty channel.
Specifically, after the reported data for receiving hardware terminal, the method also includes:
The beginning flag of the reported data is verified;
If the result of verifying is wrong, the instruction of reported data is issued again to hardware terminal.
Specifically, described store the parsing data to before database, the method also includes:
Judge the parsing data whether are stored in database;
If the parsing data are not present in database, the parsing data are stored into database.
Specifically, the method also includes:
Receive the subscription request that third party system is sent;
Determine that requested parsing data are requested in the subscription from the parsing data;
Requested parsing data are requested to be packaged to obtain encapsulation of data the subscription;
The encapsulation of data is distributed to third party system by hypertext transfer protocol, the third party system includes extremely A few third party system.
Specifically, the method also includes:
The fixed length decoder, the communications protocol call format is arranged in communications protocol call format based on hardware terminal Beginning flag, frame length, frame type, identity number, data field, verification and and end mark including the reported data.
On the other hand the application also provides a kind of Internet of Things communication apparatus based on Netty, the equipment includes:
Receiving module, for receiving the reported data of hardware terminal;
Decoder module, for being decoded acquisition decoding data to the reported data using fixed length decoder;
Parsing module obtains parsing data for being parsed to the decoding data, and the parsing data include hardware Terminal identity mark;
Example constructs module, described hard for constructing hardware terminal identity example according to hardware terminal identity Part terminal identity identifies the mapping relations of example characterization hardware terminal identity and the channel Netty;
First memory module, for storing the hardware terminal identity example to static cache;
Second memory module, for storing the parsing data to database.
On the other hand the application also provides a kind of Internet of Things communication hardware terminal based on Netty, the hardware terminal includes Processor and memory are stored at least one instruction, at least a Duan Chengxu, code set or instruction set, institute in the memory At least one instruction, an at least Duan Chengxu, the code set or instruction set is stated to be loaded by the processor and executed with reality The now Internet of Things means of communication as described in claim 1 to 7 is any.
On the other hand the application also provides a kind of Internet of Things communication server based on Netty, the server includes processing Device and memory, are stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the memory, it is described extremely A few instruction, an at least Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize such as Any Internet of Things means of communication of claim 1 to 7.
Implement the application, has the following beneficial effects:
The reported data that the application passes through reception hardware terminal;The reported data is decoded using fixed length decoder Obtain decoding data;The decoding data is parsed to obtain parsing data, the parsing data include hardware terminal identity Mark;Hardware terminal identity example is constructed according to the hardware terminal identity, the hardware terminal identity is real The mapping relations of example characterization hardware terminal identity and the channel Netty;By the hardware terminal identity example store to Static cache;The parsing data are stored to database, hardware terminal is solved and server software communication lacks reasonable pipe The problem of control, data are difficult to dynamically be distributed to different third party systems, IO flow blocked.
Detailed description of the invention
In order to illustrate more clearly of a kind of Internet of Things means of communication, device, system and end based on Netty of the present invention End, below will be briefly described attached drawing required for embodiment, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of flow diagram of the Internet of Things means of communication based on Netty provided by the embodiments of the present application;
Fig. 2 is the stream for judging whether closing passage in a kind of Internet of Things communication based on Netty provided by the embodiments of the present application Journey schematic diagram;
Fig. 3 is the stream for judging whether closing passage in a kind of Internet of Things communication based on Netty provided by the embodiments of the present application Journey schematic diagram;
Fig. 4 is a kind of flow diagram of the Internet of Things means of communication based on Netty provided by the embodiments of the present application;
Fig. 5 is a kind of Internet of Things communication apparatus schematic diagram based on Netty provided by the embodiments of the present application.
Fig. 6 is a kind of structural schematic diagram of server provided by the embodiments of the present application.
Wherein, appended drawing reference is corresponding in Fig. 5 are as follows: 1- receiving module, 2- decoder module, 3- parsing module, the building of 4- example Module, the first memory module of 5-, the second memory module of 6-.
Specific embodiment
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality The attached drawing in example is applied, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described implementation Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common The application protection all should belong in technical staff's every other embodiment obtained without creative efforts Range.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, containing the process, method of a series of steps or units, system, product or server need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
In order to realize the technical solution of the application, more engineering technology workers is allowed to be readily understood by and apply the application, Will in conjunction with specific embodiments, the working principle of the application is further described.
This application can be applied to Internet of Things communication fields, including electrical network field, such as smart electronics water meter;Health care neck Domain, such as intelligent medical monitor;Agriculture field, such as intelligent environment monitor;Field of traffic, such as automatic driving vehicle, intelligence pool Vehicle monitor etc..
In this specification, Netty is a kind of Java Open Framework, the programming of client and server-side based on the non-obstruction of NIO Frame, design aspect have the characteristics of non-obstruction, possess simple powerful threading model, support connectionless data packet socket, It links logic and supports multiplexing.Related application scenarios, which are communicated, with the Internet of Things based on Netty refers to hardware terminal and server-side The application scenarios to send instructions under reporting message when communication.In the case where various and Internet of Things based on Netty communicate related application scenarios, A kind of embodiment of the Internet of Things means of communication based on Netty of the application is introduced first, and the use of this method is based on the non-obstruction mould of NIO The Netty frame of formula encapsulation, the connection of hardware terminal and server-side, such as Fig. 1 are established by transparent transmission mode, this method comprises:
S101: hardware terminal sends reported data to server-side.
Hardware terminal sends reported data to server-side, may include the hair first sent to hardware terminal in response to server-side Reported data is sent to request, the reported data sent by trend server-side also may include that hardware terminal is actively sent to server-side Reported data, after hardware terminal actively may include the trigger actions such as the upper offline, reconnection that goes offline to server-side transmission reported data Reported data is sent to server-side, also may include periodically sending reported data to server-side.
S103: server-side is received the reported data of hardware terminal and is decoded using fixed length decoder to reported data and obtained Take decoding data.
The reported data of hardware terminal may include the registration packet of hardware terminal, heartbeat packet, order issue response data packet, Time synchronization packet and active reporting data packet, the registration packet of hardware terminal is for confirming that hardware terminal and Netty establish connection hair Send to the data packet of server-side, the heartbeat packet of hardware terminal is the heartbeat data that each cycle is sent to Netty, hardware terminal when Between synchronous package for confirming that the time of hardware terminal is consistent with the time of server-side, order issues response data packet for hardware Terminal requests the corresponding attribute data or status data reported to server-side back services end, and active reporting data packet is for hard Attribute data or status data of the part terminal to server-side active reporting hardware terminal.
Specifically, can also be tested the beginning flag of reported data after the reported data for receiving hardware terminal Card, if verification result is wrong, the instruction of reported data is issued again to hardware terminal.The verifying of reported data beginning flag, energy Enough data for effectively avoiding continuing misquotation when the reported data error of transmission of hardware terminal.
Specifically, fixed length decoder, communications protocol call format is arranged in the communications protocol call format based on hardware terminal Beginning flag, frame length, frame type, identity number, data field, verification and and end mark including reported data.Service When end receives the reporting message of hardware terminal, using fixed length decoder, frame length can be configured and according to the setting Frame length carries out automatic decoding to reporting message, in contrast to transmission control protocol, without the concern for packet splicing/problem of unpacking.If The reporting message for the hardware terminal that server-side receives is half packet message, and fixed length decoder can cache half packet message and wait next packet Packaging is carried out after reaching, it is known that the message package for reading a completion carries out automatic decoding again.
S105: decoding data is parsed to obtain parsing data, parsing data include hardware terminal identity.
Specifically, this method can also include:
S106: server-side sends instructions under replying to hardware terminal.
Reported data is sent to server-side corresponding to hardware terminal, server-side has issued confirmation command to hardware terminal reply Receive the data reported.
S107: hardware terminal identity example, the hardware terminal identity mark are constructed according to hardware terminal identity Know the mapping relations of example characterization hardware terminal identity and the channel Netty.
Hardware terminal identity example be hardware terminal identify at one's side with the one-to-one corresponding relationship in the channel Netty, API (Application Programming Interface, application programming interfaces) can pass through the identity of hardware terminal Query By Example establishes the communication with the hardware terminal to the hardware terminal called and the channel of Netty, with this.
S109: hardware terminal identity example is stored to static cache.
Static cache is used to store static data, static state map look-up table can be preferably used, for storing key assignments Right, key can regard the index of value as, and the object as key is not reproducible in set.Hardware terminal in S107 step with Channel, that is, corresponding keys of Netty, identity, that is, respective value of hardware terminal, by the channel and hardware of hardware terminal and Netty The key-value pair of the identity composition of terminal is stored into static map.When API needs to be called hardware terminal, send It orders the order of server-side to issue interface, hardware end is belonged to according to the identity of hardware terminal lookup from static map The example for holding identity, after finding the example, according to corresponding channel, API establishes the communication to hardware terminal, thus Transmitting order to lower levels is to hardware terminal.Example is stored to static cache, after static cache is restarted, static cache occupancy can be discharged Resource can reacquire the identity of hardware terminal when offline on hardware terminal, and rebuild hardware terminal Identity example.
S111: parsing data are stored to database.
The step in, database may include redis database, and redis database is as non-relational database area Not in other relevant databases, advantage with high performance.
Specifically, storing parsing data to before database, it can first judge whether be stored with wait store in database Parsing data.If parsing data to be stored are not present in database, then parsing data are stored to database.This operation The repeatability of data can be reduced.
By taking hardware terminal is electronic water meter as an example, electronic water meter needs that data is periodically reported to server-side, Reported data may include the registration packet of electronic water meter, and heartbeat packet requires the data packet reported in response to server-side, with server-side The time synchronization packet and active reporting data packet of time synchronization, wherein the data packet and active reported is required in response to server-side Reported data packet may include the upper offline record of electronic water meter, the related data of user's water.Server-side receives count off Acquisition decoding data is decoded to reported data using fixed length decoder according to rear, then decoding data parsed Data, parsing data include the equipment Serial Number of electronic water meter, are constructed by the identity of electronic water meter of the equipment Serial Number Identity example, every electronic water meter just correspond to a Netty channel, by the identity example of electronic water meter store to Static map table can directly utilize corresponding channel transmitting order to lower levels when API need to be called the electronic water meter.Number will be parsed According to storing to database, in case third party system uses.
In the embodiment above, hardware terminal sends reported data to server-side, and server-side receives reporting for hardware terminal Data are simultaneously decoded acquisition decoding data to reported data using fixed length decoder, after obtaining decoding data, to solution yardage According to being parsed, hardware terminal identity example is constructed according to the hardware terminal identity in parsing data, it finally will be hard Part terminal identity mark example store to static cache, and by parsing data store into database, solve hardware terminal with The problem of service terminal software communication lacks reasonable control, and data are not easy packed utilization and IO flow blocked.
In a further embodiment, such as Fig. 2, this method can also include:
S201: judge whether the channel heartbeat between hardware terminal and Netty is overtime.
Hardware terminal will create thread during establishing connection with server-side, wherein per thread may include more A channel, the connection between each channel characterization hardware terminal and Netty, the heartbeat in channel characterize the liveness of the connection.
If the channel heartbeat timeout between hardware terminal and Netty, S203 is carried out: closing hardware terminal and Netty Channel.
Specifically, such as Fig. 3, the embodiment based on Fig. 2, this method can also include:
S202: if the channel heartbeat between hardware terminal and Netty is not overtime, judge the heartbeat of hardware terminal active reporting Whether time-out or judge in static cache whether the corresponding hardware terminal identity in the channel is sky.
Wherein, the heartbeat packet in the heartbeat hardware terminal reported data of hardware terminal active reporting, is the hardware terminal period Property to server-side send heartbeat data, to show the connection status of hardware terminal and server-side.
If the channel heartbeat between hardware terminal and Netty is not overtime, and the heartbeat timeout of hardware terminal active reporting or The corresponding hardware terminal identity in the channel is sky in person's static cache, then carries out S203: closing hardware terminal and Netty Channel.
The heartbeat timeout of hardware terminal active reporting refers to that in preset time threshold, server-side does not receive hardware The heartbeat data that terminal reports, at this time close hardware terminal and Netty channel, can discharge beyond preset time threshold not on The cache resources for reporting the hardware terminal of heartbeat to occupy.Channel heartbeat between hardware terminal and Netty is not overtime, hardware terminal In the case where the heartbeat timeout of active reporting, the channel of hardware terminal and Netty is closed, for example, predetermined hardware terminal and Netty The time threshold of channel heartbeat timeout be 150 seconds, the time threshold of the heartbeat timeout of hardware terminal active reporting is 120 seconds, When the time was beyond 120 seconds and did not reached 150 seconds, then hardware terminal and the channel of Netty are closed.Or it should in static cache The corresponding hardware terminal identity in channel is sky, the hardware terminal and the channel of Netty is closed, for example, there are first terminal roots It is connected to server-side according to the address ip (Internet Protocol Address, Internet protocol address) and port, but is not met The connection protocol of server-side cannot construct example storage into static cache, logical between hardware terminal and Netty determining In the case that road heartbeat is not overtime, the corresponding hardware terminal identity in the channel in static cache is checked as sky, is closed hard The channel of part terminal and Netty.The channel this operation for closing hardware terminal and Netty is by active channel but not set up example Hardware terminal released from Netty, reduce occupying for resource.
In another embodiment, such as Fig. 4, the Internet of Things means of communication based on Netty are somebody's turn to do, further includes:
S401: third party system sends to server-side and subscribes to request.
S403: server-side receives the subscription that third party system is sent and requests and determine that requested parsing number is requested in the subscription According to.
S405: requested parsing data are requested to be packaged to obtain encapsulation of data the subscription.
S407: being distributed to third party system for encapsulation of data by hypertext transfer protocol, which includes one A or multiple third party systems.
For example, third party system can be the data monitoring system of operation electronic water meter side in the application examples of electronic water meter System, the content that data monitoring system pulls subscription includes the heart of electronic water meter sequence number, time, upper down status, electronic water meter Jump time etc..
Third party system sends to server-side and subscribes to request, and server-side is by corresponding to the parsing data in database It is sent to third party system in the data encapsulation for subscribing to request, then by encapsulation of data, realizes and data is sealed for subscription request The Dynamic Customization of dress.
On the other hand the application also provides a kind of Internet of Things communication apparatus based on Netty, such as Fig. 5, which includes:
Receiving module 1, for receiving the reported data of hardware terminal;
Decoder module 2, for being decoded acquisition decoding data to the reported data using fixed length decoder;
Parsing module 3 obtains parsing data for being parsed to the decoding data, and the parsing data include hardware Terminal identity mark;
Example constructs module 4, for constructing hardware terminal identity example, institute according to the hardware terminal identity State the mapping relations of hardware terminal identity example characterization hardware terminal identity and the channel Netty;
First memory module 5, for storing the hardware terminal identity example to static cache;
Second memory module 6, for storing the parsing data to database.
Specifically, the equipment can also include first passage closing unit, for determining hardware terminal active reporting Heartbeat timeout when, close hardware terminal and Netty channel;
Second channel closing unit, it is not overtime for the heartbeat in hardware terminal active reporting, hardware terminal and Netty it Between channel heartbeat timeout in the case where, when to determine the corresponding hardware device identity in channel in static cache be empty, close Close hardware terminal and the channel of Netty.
On the other hand the application also provides a kind of Internet of Things communication hardware terminal based on Netty, which includes place Device and memory are managed, is stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the memory, it is described At least one instruction, an at least Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize Above Internet of Things means of communication based on Netty.
On the other hand the application also provides a kind of Internet of Things communication server based on Netty, which includes processor And memory, be stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the memory, it is described at least One instruction, an at least Duan Chengxu, the code set or instruction set are loaded by the processor and are executed more than to realize The Internet of Things means of communication based on Netty.
Embodiment of the method provided by the embodiments of the present application can be in hardware terminal, server or similar arithmetic unit It executes.For running on the server, Fig. 6 is a kind of Internet of Things means of communication based on Netty provided by the embodiments of the present application Server hardware block diagram.As shown in fig. 6, the server 600 can because configuration or performance are different generate it is bigger Difference may include one or more central processing unit (Central Processing Units, CPU) 610 (processors 610 can include but is not limited to the processing unit of Micro-processor MCV or programmable logic device FPGA etc.), for storing data Memory 630, storage medium 620 (such as one or one of one or more storage application programs 623 or data 622 A above mass memory unit).Wherein, memory 630 and storage medium 620 can be of short duration storage or persistent storage.Storage It may include one or more modules in the program of storage medium 620, each module may include to one in server Series of instructions operation.Further, central processing unit 610 can be set to communicate with storage medium 620, in server 600 The upper series of instructions operation executed in storage medium 620.Server 600 can also include one or more power supplys 660, One or more wired or wireless network interfaces 650, one or more input/output interfaces 640, and/or, one Or more than one operating system 621, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
By a kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty of above the application, the side Method includes receiving the reported data of hardware terminal;Acquisition solution yardage is decoded to the reported data using fixed length decoder According to;The decoding data is parsed to obtain parsing data, the parsing data include hardware terminal identity;According to institute Hardware terminal identity building hardware terminal identity example is stated, the hardware terminal identity example characterization hardware is whole Hold the mapping relations of identity and the channel Netty;The hardware terminal identity example is stored to static cache;By institute It states parsing data to store to database, solves hardware terminal and server software communication lacks reasonable control, data are difficult to move The problem of state is distributed to different third party systems, IO flow blocked.
Above description sufficiently discloses the specific embodiment of the application.It should be pointed out that being familiar with the field Range of any change that technical staff does the specific embodiment of the application all without departing from following claims. Correspondingly, the range of claims hereof is also not limited only to previous embodiment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For terminal and server embodiment, since it is substantially similar to the method embodiment, so being described relatively simple, related place Illustrate referring to the part of embodiment of the method.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of Internet of Things means of communication based on Netty, which is characterized in that this method comprises:
Receive the reported data of hardware terminal;
Acquisition decoding data is decoded to the reported data using fixed length decoder;
The decoding data is parsed to obtain parsing data, the parsing data include hardware terminal identity;
Hardware terminal identity example, the hardware terminal identity example are constructed according to the hardware terminal identity Characterize the mapping relations of hardware terminal identity and the channel Netty;
The hardware terminal identity example is stored to static cache;
The parsing data are stored to database.
2. the Internet of Things means of communication according to claim 1 based on Netty, which is characterized in that the method also includes:
Judge whether the channel heartbeat between hardware terminal and Netty is overtime;
If the channel heartbeat timeout between the hardware terminal and Netty, the channel of hardware terminal and Netty is closed.
3. the Internet of Things means of communication according to claim 2 based on Netty, which is characterized in that if the hardware terminal with Channel heartbeat between Netty is not overtime, the method also includes:
Judge whether the heartbeat of hardware terminal active reporting is overtime or judges the corresponding hardware in the channel in the static cache Terminal identity identifies whether as sky;
If channel described in the channel heartbeat timeout or the static cache between the hardware terminal and Netty is corresponding hard Part equipment identities are identified as sky, close the channel of hardware terminal and Netty.
4. the Internet of Things means of communication according to claim 1 based on Netty, which is characterized in that the reception hardware terminal Reported data after, the method also includes:
The beginning flag of the reported data is verified;
If the result of verifying is wrong, the instruction of reported data is issued again to hardware terminal.
5. the Internet of Things means of communication according to claim 1 based on Netty, which is characterized in that described by the parsing number According to storing to before database, the method also includes:
Judge the parsing data whether are stored in database;
If the parsing data are not present in database, the parsing data are stored into database.
6. the Internet of Things means of communication according to claim 1 based on Netty, which is characterized in that the method also includes:
Receive the subscription request that third party system is sent;
Determine that requested parsing data are requested in the subscription from the parsing data;
Requested parsing data are requested to be packaged to obtain encapsulation of data the subscription;
The encapsulation of data is distributed to third party system by hypertext transfer protocol, the third party system includes at least one A third party system.
7. the Internet of Things means of communication according to claim 1 based on Netty, which is characterized in that the method also includes:
The fixed length decoder is arranged in communications protocol call format based on hardware terminal, and the communications protocol call format includes Beginning flag, frame length, frame type, identity number, data field, verification and and the end mark of the reported data.
8. a kind of Internet of Things communication apparatus based on Netty, which is characterized in that the equipment includes:
Receiving module, for receiving the reported data of hardware terminal;
Decoder module, for being decoded acquisition decoding data to the reported data using fixed length decoder;
Parsing module obtains parsing data for being parsed to the decoding data, and the parsing data include hardware terminal Identity;
Example constructs module, described hard for constructing hardware terminal identity example according to the hardware terminal identity Part terminal identity identifies the mapping relations of example characterization hardware terminal identity and the channel Netty;
First memory module, for storing the hardware terminal identity example to static cache;
Second memory module, for storing the parsing data to database.
9. a kind of Internet of Things communication hardware terminal based on Netty, which is characterized in that the hardware terminal includes processor and storage Device is stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the memory, and described at least one refers to It enables, an at least Duan Chengxu, the code set or instruction set are loaded by the processor and executed to realize such as claim 1 To 7 any Internet of Things means of communication.
10. a kind of Internet of Things communication server based on Netty, which is characterized in that the server includes processor and memory, It is stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the memory, at least one instruction, An at least Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize such as claim 1 to 7 Any Internet of Things means of communication.
CN201910651604.5A 2019-07-18 2019-07-18 A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty Pending CN110365782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910651604.5A CN110365782A (en) 2019-07-18 2019-07-18 A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910651604.5A CN110365782A (en) 2019-07-18 2019-07-18 A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty

Publications (1)

Publication Number Publication Date
CN110365782A true CN110365782A (en) 2019-10-22

Family

ID=68220759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910651604.5A Pending CN110365782A (en) 2019-07-18 2019-07-18 A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty

Country Status (1)

Country Link
CN (1) CN110365782A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112714162A (en) * 2020-12-22 2021-04-27 上海上实龙创智能科技股份有限公司 Netty-based Internet of things communication system and method
CN114301992A (en) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) Data transmission method and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790347A (en) * 2016-11-11 2017-05-31 南通大学 A kind of large-scale concurrent data forwarding method based on netty
US20180218069A1 (en) * 2017-01-31 2018-08-02 Experian Information Solutions, Inc. Massive scale heterogeneous data ingestion and user resolution
CN108616606A (en) * 2018-08-01 2018-10-02 湖南恒茂高科股份有限公司 A kind of Internet of Things communication means and device
CN109309599A (en) * 2018-09-06 2019-02-05 华南理工大学 A method of the communication of internet of things equipment high concurrent is realized based on street lamp hardware platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790347A (en) * 2016-11-11 2017-05-31 南通大学 A kind of large-scale concurrent data forwarding method based on netty
US20180218069A1 (en) * 2017-01-31 2018-08-02 Experian Information Solutions, Inc. Massive scale heterogeneous data ingestion and user resolution
CN108616606A (en) * 2018-08-01 2018-10-02 湖南恒茂高科股份有限公司 A kind of Internet of Things communication means and device
CN109309599A (en) * 2018-09-06 2019-02-05 华南理工大学 A method of the communication of internet of things equipment high concurrent is realized based on street lamp hardware platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112714162A (en) * 2020-12-22 2021-04-27 上海上实龙创智能科技股份有限公司 Netty-based Internet of things communication system and method
CN114301992A (en) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) Data transmission method and storage medium

Similar Documents

Publication Publication Date Title
US11770317B2 (en) Internet of Things event management systems and methods
Tolle et al. Design of an application-cooperative management system for wireless sensor networks
CN104601665B (en) A kind of system and method that high in the clouds real-time simulation is carried out to Internet of Things awareness apparatus
US11172399B2 (en) Default quality of service (QoS) control method and device
Venticinque et al. Agents based cloud computing interface for resource provisioning and management
Saadallah et al. CCNx for Contiki: implementation details
CN105704252B (en) Bluetooth low energy device data transmission method and device
CN108712485A (en) A kind of resource subscription method and apparatus of internet of things equipment
CN110365782A (en) A kind of Internet of Things means of communication, equipment, hardware terminal and server based on Netty
CN110213058A (en) A kind of block chain all-in-one machine for realizing data cochain
WO2015138588A1 (en) Cross-layer context management
CN109309599A (en) A method of the communication of internet of things equipment high concurrent is realized based on street lamp hardware platform
CN111400127B (en) Service log monitoring method and device, storage medium and computer equipment
CN107448779A (en) Pipe leakage signal monitoring system and method based on wireless sensor network
CN108632309A (en) A kind of method and device of upgrading narrowband internet-of-things terminal
CN111181800A (en) Test data processing method and device, electronic equipment and storage medium
CN114205866A (en) Deterministic information reporting and issuing method and device, storage medium and electronic equipment
CN113965904B (en) Device registration method, device and storage medium
CN105530673B (en) A kind of method for connecting network and user equipment
CN117176802B (en) Full-link monitoring method and device for service request, electronic equipment and medium
CN106850770A (en) High-efficiency transmission method and device based on cloud computing service
CN109450719A (en) A kind of node upgrade method and system based on lorawan agreement
CN110062016A (en) Method and device for trusted service management
US8402312B2 (en) Method and system for testing an application
CN111164951B (en) Service Registration Based on Service Capability Requirements and Preferences

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: 20191022