CN108924773A - Message treatment method and device - Google Patents

Message treatment method and device Download PDF

Info

Publication number
CN108924773A
CN108924773A CN201810563323.XA CN201810563323A CN108924773A CN 108924773 A CN108924773 A CN 108924773A CN 201810563323 A CN201810563323 A CN 201810563323A CN 108924773 A CN108924773 A CN 108924773A
Authority
CN
China
Prior art keywords
message
coap
client
coap client
source
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.)
Granted
Application number
CN201810563323.XA
Other languages
Chinese (zh)
Other versions
CN108924773B (en
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.)
Beijing Hundred Enlightenment Technology Co Ltd
Original Assignee
Beijing Hundred Enlightenment 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 Beijing Hundred Enlightenment Technology Co Ltd filed Critical Beijing Hundred Enlightenment Technology Co Ltd
Priority to CN201810563323.XA priority Critical patent/CN108924773B/en
Publication of CN108924773A publication Critical patent/CN108924773A/en
Application granted granted Critical
Publication of CN108924773B publication Critical patent/CN108924773B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/18Information format or content conversion, e.g. adaptation by the network of the transmitted or received information for the purpose of wireless delivery to users or terminals
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the present invention provides a kind of message treatment method and device.The method is applied to restricted application protocol COAP server, and the COAP server is WWW WEB server, the method includes:Determine the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things NB equipment;The source message is converted to the target message of byte BYTE format, and the target message is sent to the COAP client.The embodiment of the present invention is realized and is directly communicated between COAP server and COAP client, does not need to forward message by middleware, is avoided message source waste, is improved the high availability of WEB server Yu NB communication between devices.And since COAP protocol package is smaller, be conducive to the communication capacity for promoting WEB server and NB communication between devices.

Description

Message treatment method and device
Technical field
The present embodiments relate to internet of things field more particularly to a kind of message treatment methods and device.
Background technique
In the internet of things era, data communication technology development is very fast, and all things on earth interconnection becomes the direction of future development.Narrowband Internet of Things Net (Narrow Band Internet Of Things, NB-IOT) is new as the standard that 3GPP International Standards Organization R13 is issued Type technology has obtained certain approval, and the new technique as internet of things field, and the core in the 5G standard that will be appeared on the market One of heart technology.
NB-IOT belongs to narrowband lower rate transmissions technology, has low-frequency range, low-power consumption, low cost and high covering etc. excellent Point.NB-IOT technology mainly solves the series of problems of low-power consumption wide area network, after in September, 2016 starts formulation standard, Some operators, device fabrication manufacturer accelerate to push it commercial in actively layout market, therefore, a large amount of NB-IOT equipment (hereinafter NB equipment) constantly occurs.In artificial intelligence epoch of the current internet in conjunction with big data, NB equipment is also needed It is the same as personal computer (Personal Computer, PC) or smart phone, pass through some communication protocols and global wide area Net or WWW (World Wide Web, WEB) are that server carries out data communication.
Although currently, the formal commercialization not yet of 5G technology, core technology of the NB-IOT as 5G technology in narrowband field It gradually rises, the communication means between many WEB servers and NB equipment correspondingly also occurs.And in the prior art, WEB server communicates the middleware for needing to forward as information by device controller, device controller with NB equipment, is communicating In the process, NB equipment first issues connection request to device controller, and device controller, which confirms, permits connection after the NB equipment is legal Network;Device controller sends instructions to the operating system where itself, is again forwarded to connection request after operating system decoding In WEB server, eventually by hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) or hypertext Transmit the side of security protocol (Hyper Text Transfer Protocol over Secure Socket Layer, HTTPS) The communication of formula realization WEB server and NB equipment.
However, when NB number of devices is more, being easy drop in such a way that device controller is communicated with WEB server The high availability of low WEB server and NB communication between devices;And equipment cost, the maintenance cost of device controller also will increase Communications cost.
Summary of the invention
The embodiment of the present invention provides a kind of message treatment method and device, and to solve in the prior art, WEB server is logical Cross the problem of device controller communicates with NB equipment, is easily reduced the high availability of communication process.
On the one hand, the embodiment of the present invention provides a kind of message treatment method, is applied to restricted application protocol COAP and takes Business device, the COAP server are WWW WEB server, the method includes:
Determine the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things NB equipment;
The source message is converted to the target message of byte BYTE format, and the target message is sent to described COAP client.
On the other hand, the embodiment of the present invention provides a kind of message processing apparatus, is applied to restricted application protocol COAP Server, the COAP server are WWW WEB server, and described device includes:
Determining module, for determining the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things NB equipment;
Sending module disappears for the source message to be converted to the target message of byte BYTE format, and by the target Breath is sent to the COAP client.
On the other hand, the embodiment of the invention also provides a kind of electronic equipment, including memory, processor, bus and The computer program that can be run on a memory and on a processor is stored, the processor is realized above-mentioned when executing described program Step in message treatment method.
In another aspect, being stored thereon with the embodiment of the invention also provides a kind of non-transient computer readable storage medium Computer program realizes the step in above-mentioned message treatment method when described program is executed by processor.
Message treatment method and device provided in an embodiment of the present invention, by determining that the source for being handed down to COAP client disappears The source message is converted to the target message of byte BYTE format, and the target message is sent to the COAP visitor by breath Source message is converted to the target message of byte BYTE format by family end, so that COAP client can directly read target message, it is real Show and directly communicated between COAP server and COAP client, has not needed to forward message by middleware, avoid Message source waste, improves the high availability of WEB server Yu NB communication between devices.And since COAP protocol package is smaller, Be conducive to be promoted the communication capacity of WEB server and NB communication between devices.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root Other attached drawings are obtained according to these attached drawings.
Fig. 1 is one of the flow diagram of message treatment method provided in an embodiment of the present invention;
Fig. 2 is the two of the flow diagram of message treatment method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of the specific example of the embodiment of the present invention;
Fig. 4 is the block diagram of message processing apparatus provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 shows a kind of flow diagram of message treatment method provided in an embodiment of the present invention.
As shown in Figure 1, message treatment method provided in an embodiment of the present invention, the method is assisted applied to restricted application COAP server is discussed, the COAP server is WWW WEB server, the method includes:
Step 101, the source message for being handed down to COAP client is determined;The COAP client is that Internet of Things NB in narrowband is set It is standby.
Wherein, restricted application protocol (Constrained Application Protocol, COAP) is a kind of base A kind of network communication protocol in REST framework and in the environment of operating in limited CPU and memory, it is each by defining binary system Position section function describes protocol package content, and relative to communication protocols such as HTTP, COAP protocol package is smaller, more compact, for example, COAP The smallest protocol package only has 4B in agreement.
In this step, the source message is response of the COAP server for the request message of the COAP client The instruction information that message or the COAP server are issued to the COAP client.
Step 102, the source message is converted to the target message of byte BYTE format, and the target message is sent To the COAP client.
Wherein, since COAP server is WEB server, the format for the source message that WEB server is issued is JS object Numbered musical notation (JavaScript Object Notation, JSON) format, and due to the limitation of CPU and memory, parsing in NB equipment JSON power consumption is too high, and therefore, in the embodiment of the present invention, COAP server disappears the target that source message is converted to byte BYTE format Breath, BYTE format can be directly read by NB equipment by COAP agreement, and power consumption is lower when parsing BYTE.
For example, the COAP server described in the source message issued to the COAP client instruction information when, COAP Sent instructions under server to COAP client, COAP client can parse instruction information by firmware program, if deposit with it is described Indicate the corresponding valid instruction of information, COAP client will execute the instruction information.
Due to directly being communicated between COAP server and COAP client, do not need to improve WEB by middleware The high availability serviced between server and NB equipment, wherein high availability, that is, high degree of availability.
In the above embodiment of the present invention, it is handed down to the source message of COAP client by determining, the source message is turned It is changed to the target message of byte BYTE format, and the target message is sent to the COAP client, source message is converted For the target message of byte BYTE format so that COAP client can directly read target message, realize COAP server with It is directly communicated between COAP client, does not need to forward message by middleware, avoided message source waste, improve The high availability of WEB server and NB communication between devices.And since COAP protocol package is smaller, be conducive to promote WEB service The communication capacity of device and NB communication between devices.The present invention solves in the prior art, WEB server by device controller with The problem of NB equipment communicates, and is easily reduced high availability of the WEB server with NB communication between devices.
Further, as shown in Fig. 2, message treatment method provided in an embodiment of the present invention, the method are applied to COAP Server, the COAP server are WEB server, the method includes:
Step 201, the request message of COAP client is received, the COAP client is NB equipment.
Wherein, the request message of COAP client can be registration request or subscription request etc..
It include a uniform resource locator (Uniform in NB equipment since COAP client is NB equipment Resource Locator, URL) be " t/d " resource (alternatively referred to as route), which supports the GET method of similar HTTP The resource of server is accessed with POST method.If than one NB equipment has the sensor of temperature measurement, then temperature When value is transmitted to COAP server, its address URL can be:
COAP://NBmachine.address:5666/sensors/temperature;
Wherein, " 5566 " are the address of the NB equipment.
COAP server can directly obtain the temperature value of the equipment by this URL, since COAP agreement is based on use The upper-layer protocol of user data datagram protocol (User Datagram Protocol, UDP) does not need long connection, saves power consumption.
Step 202, the request message is converted to the destination request message of JS object numbered musical notation JSON format.
Wherein, since COAP server is WEB server, the format for the source message that WEB server is issued is JSON lattice Formula, and the limitation parsing JSON power consumption in NB equipment due to CPU and memory is too high, in the embodiment of the present invention, NB equipment Request message uses BYTE format, and after COAP server receives request message, the request message of BYTE format is converted to The destination request message of JSON format parses convenient for COAP server.
Step 203, the source message for being directed to the destination request message is generated.
Wherein, COAP server is directed to the destination request message, determines response contents, generates and is directed to the destination request The source message of message;Source message is to be used to respond the message of the destination request message, for example, when destination request message is registration When request, source message is registering result.
Step 204, the source message is converted to the target message of byte BYTE format, and the target message is sent To the COAP client.
Wherein, source message is converted to the target message of byte BYTE format by COAP server, and BYTE format can be by NB Equipment is directly read by COAP agreement, realizes that WEB server is communicated with NB equipment.
Optionally, in the above embodiment of the present invention, when the request message is login request message,
After the step of destination request message that the request message is converted to JS object numbered musical notation JSON format, institute The method of stating further includes:
Obtain the unique identifier of the COAP client carried in the login request message;
Establish account corresponding with the unique identifier.
Specifically, the function of equipment management may be implemented in WEB server end.By being established not to different COAP clients With account realize.When receiving the registration request of COAP client, carried in acquisition login request message described The unique identifier of COAP client, and establish and the one-to-one account of unique identifier.For example, the world of equipment can be used Mobile device identification code IMEI (International Mobile Equipment Identity, IMEI) is as unique mark Know symbol, the NB equipment can be found by carrier network in this way.
Optionally, in the above embodiment of the present invention, the step of foundation account corresponding with the unique identifier Later, the method also includes:
Creation is directed to the first data queue and the second data queue of the account;Wherein, first data queue For storing the equipment connection request for being directed to the account, the COAP client is handed down to for storing in second data queue The instruction message at end.
Wherein, after the account for creating COAP client, COAP server is likely to be received the equipment that numerous accounts are sent and connects It connects request or COAP server needs to send instruction message to New Account.It is each COAP client in the embodiment of the present invention Liang Ge data queue, the first data queue and the second data queue are opened in COAP server in end.
Specifically, the obstruction queue (Blocking Queue) in JAVA, Blocking can be used in the embodiment of the present invention Queue queue is with traditional queue difference, executes insertion data again when queue full to when queue, which can quilt Obstruction, until there is other threads to consume the data in the queue.
Optionally, in the above embodiment of the present invention, the creation is for the first data queue of the account and the After the step of two data queues, the method includes:
The equipment connection request for being directed to the account is received, the equipment connection request is stored in first data team In column.
For storing the equipment connection request sent from other NB equipment, the write method of the queue is main for first data queue Realize the data in consumption queue, i.e., the equipment connection request that other NB equipment in queue are sent is saved in database, In agent object in memory or in user-defined file.
Optionally, in the above embodiment of the present invention, the step of determination is handed down to the source message of COAP client it Afterwards, the method also includes:
The source message is stored in the default queue for being used for storing the instruction message for being handed down to the COAP client.
Wherein, for storing default queue i.e. the second data queue for the instruction message for being handed down to the COAP client, Second data queue is used to the instruction message that COAP server issues returning to COAP client, and concrete methods of realizing is as follows: The determination of COAP server is handed down to after the source message of COAP client, for example is received NB device manufacturer and logged in COAP server When being sent to the instruction message of NB equipment, all instruction messages are written in the reading method of the second data queue first, in this way When avoiding concurrent high, COAP server load is overweight to lead to loss of data, therefore, instruction message is first saved in the second data In queue, it is then then turned on the data that one or more thread is gone in the second data queue of consumption.
In this way, the first data queue, which realizes from COAP client, sends data to COAP server transport data, second Data queue realizes from COAP server and sends data to COAP client transmissions data, is communicated in an asynchronous manner, and The data of communication are subjected to real-time storage and processing, it can be achieved that under high concurrent scene, are communicated between NB equipment and WEB server High Availabitity, the very high performance of WEB server.
In the above embodiment of the present invention, it is handed down to the source message of COAP client by determining, the source message is turned It is changed to the target message of byte BYTE format, and the target message is sent to the COAP client, source message is converted For the target message of byte BYTE format so that COAP client can directly read target message, realize COAP server with It is directly communicated between COAP client, does not need to forward message by middleware, avoided message source waste, improve The high availability of WEB server and NB communication between devices.And since COAP protocol package is smaller, be conducive to promote WEB service The communication capacity of device and NB communication between devices.COAP server is that the first data queue and the is respectively created in COAP client Two data queues, are communicated in an asynchronous manner, and the data of communication are carried out real-time storage and processing, it can be achieved that in high concurrent Under scene, the High Availabitity communicated between NB equipment and WEB server, the very high performance of WEB server.
As a specific example, referring to Fig. 3, in Fig. 3, COAP client and COAP server communication, COAP server side are set It is equipped with a conversion plug-in unit and message processing module, is converted mutually for realizing BYTE format and JSON format, communication process master Include the following steps:
1, COAP client sends login request message to COAP server.
Wherein, conversion plug-in unit is firstly received login request message.
And using the IMEI number of NB equipment as the unique identifier of NB equipment.
2, plug-in unit, which is converted, by login request message is converted to JSON format.
3, plug-in unit, which is converted, by the login request message of JSON format is sent to message processing module.
4, message processing module is that COAP client establishes account, and creates the first data queue and the second data queue.
Later, if COAP server receives the connection request for COAP client, which is stored in In first data queue.
5, COAP servers send instruction message to COAP client, at this time since instruction message is JSON format, Instruction message is first sent to conversion plug-in unit by message processing module.Message processing module determines that the source for being handed down to COAP client disappears It after breath, for example receives NB device manufacturer and logs in COAP server when being sent to the instruction message of NB equipment, will own first Instruction message is written in the reading method of the second data queue, this avoid it is concurrent high when, COAP server load is overweight to be led Loss of data is caused, therefore, first instruction message is saved in the second data queue, one or more thread is then then turned on and goes Consume the data in the second data queue.
6, plug-in unit, which is converted, by the instruction message of JSON format is converted to BYTE format.
7, plug-in unit, which is converted, by the instruction message after conversion is sent to COAP client.
In above-mentioned example, realizes and directly communicated between COAP server and COAP client, do not needed in Between part forward message, avoid message source waste, improve the high availability of WEB server Yu NB communication between devices. And since COAP protocol package is smaller, be conducive to the communication capacity for promoting WEB server and NB communication between devices.COAP server 302 are respectively created the first data queue and the second data queue for COAP client 301, are communicated in an asynchronous manner, and The data of communication are subjected to real-time storage and processing, it can be achieved that under high concurrent scene, are communicated between NB equipment and WEB server High Availabitity, the very high performance of WEB server.
Referring to fig. 4, the embodiment of the present invention provides a kind of message processing apparatus, is applied to restricted application protocol COAP and takes Business device, the COAP server are WWW WEB server, and described device includes:
Determining module 401, for determining the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things Net NB equipment.
Wherein, COAP is a kind of based on REST framework and to operate in a kind of network in the environment of limited CPU and memory Communication protocol describes protocol package content by defining the every section function of binary system, relative to the communication protocols such as HTTP, COAP association Bao Geng little, more compact is discussed, for example, the smallest protocol package only has 4B in COAP agreement.
The source message is response message or institute of the COAP server for the request message of the COAP client State the instruction information that COAP server is issued to the COAP client.
Sending module 402, for the source message to be converted to the target message of byte BYTE format, and by the target Message is sent to the COAP client.
Wherein, since COAP server is WEB server, the format for the source message that WEB server is issued is JS object Numbered musical notation (JavaScript Object Notation, JSON) format, and the limitation in NB equipment due to CPU and memory parses JSON power consumption is too high, and therefore, in the embodiment of the present invention, COAP server disappears the target that source message is converted to byte BYTE format Breath, BYTE format can be directly read by NB equipment by COAP agreement, realize that WEB server is communicated with NB equipment.
Optionally, in the embodiment of the present invention, described device includes:
Receiving module, for receiving the request message of COAP client;
First conversion module, the destination request for the request message to be converted to JS object numbered musical notation JSON format disappear Breath;
Module is produced, for generating the source message for being directed to the destination request message.
Optionally, in the embodiment of the present invention, when the request message is login request message, described device further includes:
Identifier obtains module, for obtaining unique mark of the COAP client carried in the login request message Know symbol;
Account establishes module, for establishing account corresponding with the unique identifier.
Optionally, in the embodiment of the present invention, described device further includes:
Queue creation module, for creating the first data queue and the second data queue that are directed to the account;Wherein, First data queue is used to store the equipment connection request for the account, under second data queue is for storing Issue the instruction message of the COAP client.
Optionally, in the embodiment of the present invention, described device includes:
First memory module deposits the equipment connection request for receiving the equipment connection request for being directed to the account Storage is in first data queue.
Optionally, in the embodiment of the present invention, described device further includes:
Second memory module is used to store the instruction for being handed down to the COAP client for the source message to be stored in In the default queue of message.
In the above embodiment of the present invention, the source message for being handed down to COAP client is determined by determining module 401, is sent The source message is converted to the target message of byte BYTE format by module 402, and the target message is sent to described Source message is converted to the target message of byte BYTE format by COAP client, so that COAP client can directly read target Message is realized and is directly communicated between COAP server and COAP client, is not needed to forward message by middleware, be kept away Exempt from that message source is caused to waste, improves the high availability of WEB server Yu NB communication between devices.And due to COAP protocol package It is smaller, be conducive to the communication capacity for promoting WEB server and NB communication between devices.The present invention solves in the prior art, WEB Server is communicated by device controller with NB equipment, and the high availability of WEB server Yu NB communication between devices is easily reduced The problem of.
Fig. 5 shows the structural schematic diagram of a kind of electronic equipment of further embodiment of this invention offer.
Referring to Fig. 5, electronic equipment provided in an embodiment of the present invention, the electronic equipment include memory (memory) 51, Processor (processor) 52, bus 53 and it is stored in the computer program that can be run on memory 51 and on a processor. Wherein, the memory 51, processor 52 complete mutual communication by the bus 53.
The processor 52 is used to call the program instruction in the memory 51, realizes when executing described program as schemed 1 method.
In another embodiment, following method is realized when the processor executes described program:
Determine the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things NB equipment;
The source message is converted to the target message of byte BYTE format, and the target message is sent to described COAP client.
Electronic equipment provided in an embodiment of the present invention can be used for executing the corresponding program of method of above method embodiment, This implementation repeats no more.
Electronic equipment provided in an embodiment of the present invention is handed down to the source message of COAP client by determining, by the source Message is converted to the target message of byte BYTE format, and the target message is sent to the COAP client, and source is disappeared Breath is converted to the target message of byte BYTE format, so that COAP client can directly read target message, realizes COAP clothes It is directly communicated between business device and COAP client, does not need to forward message by middleware, avoid message source wave Take, improves the high availability of WEB server Yu NB communication between devices.And since COAP protocol package is smaller, be conducive to be promoted The communication capacity of WEB server and NB communication between devices.
A kind of non-transient computer readable storage medium that further embodiment of this invention provides, the non-transient computer can It reads to be stored with computer program on storage medium, realize when described program is executed by processor such as the step of Fig. 1.
In another embodiment, following method is realized when described program is executed by processor:
Determine the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things NB equipment;
The source message is converted to the target message of byte BYTE format, and the target message is sent to described COAP client.
Non-transient computer readable storage medium provided in an embodiment of the present invention, realization when described program is executed by processor The method of above method embodiment, this implementation repeat no more.
Non-transient computer readable storage medium provided in an embodiment of the present invention is handed down to COAP client by determination The source message, is converted to the target message of byte BYTE format by source message, and the target message is sent to described Source message is converted to the target message of byte BYTE format by COAP client, so that COAP client can directly read target Message is realized and is directly communicated between COAP server and COAP client, is not needed to forward message by middleware, be kept away Exempt from that message source is caused to waste, improves the high availability of WEB server Yu NB communication between devices.And due to COAP protocol package It is smaller, be conducive to the communication capacity for promoting WEB server and NB communication between devices.
Further embodiment of this invention discloses a kind of computer program product, and the computer program product is non-including being stored in Computer program in transitory computer readable storage medium, the computer program include program instruction, when described program refers to When order is computer-executed, computer is able to carry out method provided by above-mentioned each method embodiment, for example including:
Determine the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things NB equipment;
The source message is converted to the target message of byte BYTE format, and the target message is sent to described COAP client.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member It is physically separated with being or may not be, component shown as a unit may or may not be physics list Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness Labour in the case where, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation Method described in certain parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that:It still may be used To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features; And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and Range.

Claims (14)

1. a kind of message treatment method is applied to restricted application protocol COAP server, which is characterized in that the COAP clothes Business device is WWW WEB server, the method includes:
Determine the source message for being handed down to COAP client;The COAP client is narrowband Internet of Things NB equipment;
The source message is converted to the target message of byte BYTE format, and the target message is sent to the COAP visitor Family end.
2. the method according to claim 1, wherein the source message is the request for the COAP client When the response message of message, the step of the target message that the source message is converted to byte BYTE format before, it is described Method includes:
Receive the request message of COAP client;
The request message is converted to the destination request message of JS object numbered musical notation JSON format;
Generate the source message for being directed to the destination request message.
3. according to the method described in claim 2, it is characterized in that, when the request message be login request message when,
After the step of destination request message that the request message is converted to JS object numbered musical notation JSON format, the side Method further includes:
Obtain the unique identifier of the COAP client carried in the login request message;
Establish account corresponding with the unique identifier.
4. according to the method described in claim 3, it is characterized in that, described establish corresponding with unique identifier account After step, the method also includes:
Creation is directed to the first data queue and the second data queue of the account;Wherein, first data queue is used for Storage is directed to the equipment connection request of the account, and the COAP client is handed down to for storing in second data queue Instruction message.
5. according to the method described in claim 4, it is characterized in that, it is described creation for the account the first data queue with And after the step of the second data queue, the method includes:
The equipment connection request for being directed to the account is received, the equipment connection request is stored in first data queue In.
6. the method according to claim 1, wherein the determination is handed down to the step of the source message of COAP client After rapid, the method also includes:
The source message is stored in the default queue for being used for storing the instruction message for being handed down to the COAP client.
7. a kind of message processing apparatus is applied to restricted application protocol COAP server, which is characterized in that the COAP clothes Business device is WWW WEB server, and described device includes:
Determining module, for determining the source message for being handed down to COAP client;The COAP client is that Internet of Things NB in narrowband is set It is standby;
Sending module is sent out for the source message to be converted to the target message of byte BYTE format, and by the target message Give the COAP client.
8. device according to claim 7, which is characterized in that described device includes:
Receiving module, for receiving the request message of COAP client;
First conversion module, for the request message to be converted to the destination request message of JS object numbered musical notation JSON format;
Module is produced, for generating the source message for being directed to the destination request message.
9. device according to claim 8, which is characterized in that described when the request message is login request message Device further includes:
Identifier obtains module, for obtaining the unique identification of the COAP client carried in the login request message Symbol;
Account establishes module, for establishing account corresponding with the unique identifier.
10. device according to claim 9, which is characterized in that described device further includes:
Queue creation module, for creating the first data queue and the second data queue that are directed to the account;Wherein, described First data queue is used to store the equipment connection request for the account, and second data queue is handed down to for storing The instruction message of the COAP client.
11. device according to claim 10, which is characterized in that described device further includes:
The equipment connection request is stored in by the first memory module for receiving the equipment connection request for being directed to the account In first data queue.
12. device according to claim 7, which is characterized in that described device further includes:
Second memory module is used to store the instruction message for being handed down to the COAP client for the source message to be stored in Default queue in.
13. a kind of electronic equipment, which is characterized in that on a memory and can be including memory, processor, bus and storage The computer program run on processor, the processor are realized when executing described program such as any one of claim 1-6 institute The step in message treatment method stated.
14. a kind of non-transient computer readable storage medium, is stored thereon with computer program, it is characterised in that:Described program It realizes when being executed by processor such as the step in message treatment method of any of claims 1-6.
CN201810563323.XA 2018-06-04 2018-06-04 Message processing method and device Active CN108924773B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810563323.XA CN108924773B (en) 2018-06-04 2018-06-04 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810563323.XA CN108924773B (en) 2018-06-04 2018-06-04 Message processing method and device

Publications (2)

Publication Number Publication Date
CN108924773A true CN108924773A (en) 2018-11-30
CN108924773B CN108924773B (en) 2021-04-13

Family

ID=64410800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810563323.XA Active CN108924773B (en) 2018-06-04 2018-06-04 Message processing method and device

Country Status (1)

Country Link
CN (1) CN108924773B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365802A (en) * 2019-08-26 2019-10-22 北京奇艺世纪科技有限公司 A kind of method for message transmission, message forwarding device and storage medium
CN113518087A (en) * 2021-07-12 2021-10-19 广州乐摇摇信息科技有限公司 IOT protocol reverse docking method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102148863A (en) * 2011-01-27 2011-08-10 华为技术有限公司 Method and device for delivering M2M (machine to machine) service messages
CN102438015A (en) * 2011-12-13 2012-05-02 清华大学 System and method for node access of internet of things
CN105159256A (en) * 2015-08-24 2015-12-16 东华大学 Web service-based intelligent household control system
US20160269368A1 (en) * 2015-03-13 2016-09-15 Electronics And Telecommunications Research Institute Method of selectively applying data encryption function

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102148863A (en) * 2011-01-27 2011-08-10 华为技术有限公司 Method and device for delivering M2M (machine to machine) service messages
CN102438015A (en) * 2011-12-13 2012-05-02 清华大学 System and method for node access of internet of things
US20160269368A1 (en) * 2015-03-13 2016-09-15 Electronics And Telecommunications Research Institute Method of selectively applying data encryption function
CN105159256A (en) * 2015-08-24 2015-12-16 东华大学 Web service-based intelligent household control system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Z. SHELBY等: "The Constrained Application Protocol (CoAP)", 《HTTP://WWW.RFC-EDITOR.ORG/INFO/RFC7252》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365802A (en) * 2019-08-26 2019-10-22 北京奇艺世纪科技有限公司 A kind of method for message transmission, message forwarding device and storage medium
CN110365802B (en) * 2019-08-26 2022-11-15 北京奇艺世纪科技有限公司 Message transmission method, message forwarding equipment and storage medium
CN113518087A (en) * 2021-07-12 2021-10-19 广州乐摇摇信息科技有限公司 IOT protocol reverse docking method and device

Also Published As

Publication number Publication date
CN108924773B (en) 2021-04-13

Similar Documents

Publication Publication Date Title
Glaroudis et al. Survey, comparison and research challenges of IoT application protocols for smart farming
KR101973298B1 (en) Publication and discovery of m2m-iot services
US10932110B2 (en) Method, apparatus and system for use in a web service
CN105408865B (en) Method and apparatus for data annotation as a service for IoT systems
CN107948324B (en) Request Transmission system, method, apparatus and storage medium
CN108200165B (en) Request Transmission system, method, apparatus and storage medium
CN102655481B (en) A kind of instant messaging chat content inspection method based on webpage and system
CN103634382B (en) A kind of system and method for realizing real-time, interactive on webpage
CN108712485A (en) A kind of resource subscription method and apparatus of internet of things equipment
CN109905409A (en) Things-internet gateway real time bidirectional communication system based on Socket.IO
CN110324405B (en) Message sending method, device, system and computer readable storage medium
US11283668B2 (en) Method and apparatus in a web service system
CN110086759B (en) Method and device for realizing message transmission between heterogeneous systems
CN114567650B (en) Data processing method and Internet of things platform system
JP2018537777A (en) Internet of things information system
Mangas et al. WOTPY: A framework for web of things applications
Luoto et al. Fighting network restrictions of request‐response pattern with MQTT
CN108924773A (en) Message treatment method and device
CN110247926A (en) A kind of exchange method and system
CN114679436B (en) Session management method, server and computer readable storage medium
Garg et al. A review on Internet of Things: communication protocols, wireless technologies, and applications
CN113992641A (en) Data processing method, device, equipment and storage medium
CN101917476A (en) Hyper text transmission protocol (HTTP) message processing method and client system thereof
CN106899652A (en) A kind of method and device of transmission service result
Zhang et al. The design of an efficient proxy-based framework for mobile cloud computing

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
GR01 Patent grant
GR01 Patent grant