CN108924773B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN108924773B
CN108924773B CN201810563323.XA CN201810563323A CN108924773B CN 108924773 B CN108924773 B CN 108924773B CN 201810563323 A CN201810563323 A CN 201810563323A CN 108924773 B CN108924773 B CN 108924773B
Authority
CN
China
Prior art keywords
message
coap
server
client
coap client
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.)
Active
Application number
CN201810563323.XA
Other languages
Chinese (zh)
Other versions
CN108924773A (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 Baiwu Tech Co ltd
Original Assignee
Beijing Baiwu Tech 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 Baiwu Tech Co ltd filed Critical Beijing Baiwu Tech 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

Images

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]

Abstract

The embodiment of the invention provides a message processing method and device. The method is applied to a restricted application protocol (COAP) server, wherein the COAP server is a World Wide WEB (WWW) server, and the method comprises the following steps: determining a source message issued to a COAP client; the COAP client is narrow-band Internet of things NB equipment; and converting the source message into a target message in a BYTE BYTE format, and sending the target message to the COAP client. The embodiment of the invention realizes the direct communication between the COAP server and the COAP client, does not need to forward the message by means of middleware, avoids the waste of message resources and improves the high availability of the communication between the WEB server and the NB equipment. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved.

Description

Message processing method and device
Technical Field
The embodiment of the invention relates to the technical field of Internet of things, in particular to a message processing method and device.
Background
In the era of the internet of things, the development of data communication technology is fast, and the interconnection of everything becomes a future development direction. The Narrow-Band Internet Of Things (Narrow Band Internet Of Things, NB-IOT) has gained certain acceptance as a novel standard technology issued by the 3GPP International standards organization R13, and is also one Of the core technologies in the 5G standard about to come into the market as a novel technology in the field Of Internet Of Things.
The NB-IOT belongs to a narrow-band low-rate transmission technology and has the advantages of low frequency band, low power consumption, low cost, high coverage and the like. The NB-IOT technology mainly solves the series of problems of the low-power-consumption wide-area Internet of things, and after the standard is established in 2016 (9 months), some operators and equipment manufacturers actively lay out the market to accelerate the promotion of the commercialization of the NB-IOT technology, so that a large number of NB-IOT equipment (hereinafter referred to as NB equipment) continuously appear. In the current era of artificial intelligence where the internet is combined with big data, NB devices also need to communicate data with a global Wide area network (World Wide Web, Web) as a server through some communication protocols like a Personal Computer (PC) or a smart phone.
At present, although the 5G technology is not yet officially commercialized, NB-IOT has been gradually emerging as a core technology of the 5G technology in the narrowband field, and accordingly, many communication methods between the WEB server and the NB device are also emerging. In the prior art, the WEB server and the NB equipment need to communicate by virtue of an equipment controller, the equipment controller is used as a middleware for information forwarding, in the communication process, the NB equipment firstly sends a connection request to the equipment controller, and the equipment controller permits to connect a network after confirming that the NB equipment is legal; the device controller sends an instruction to an operating system where the device controller is located, the operating system decodes the instruction and then forwards a connection request to the WEB server, and finally communication between the WEB server and the NB device is achieved in a hypertext Transfer Protocol (HTTP) or hypertext Transfer Protocol over Secure Socket Layer (HTTPS) mode.
However, in the mode of communicating with the WEB server through the device controller, when the number of NB devices is large, high availability of communication between the WEB server and the NB devices is easily reduced; and the equipment cost, maintenance cost of the equipment controller also increases the communication cost.
Disclosure of Invention
Embodiments of the present invention provide a message processing method and apparatus, so as to solve the problem in the prior art that a WEB server communicates with an NB device through a device controller, which is easy to reduce high availability in a communication process.
In one aspect, an embodiment of the present invention provides a message processing method, which is applied to a restricted application protocol COAP server, where the COAP server is a world wide WEB (www) WEB server, and the method includes:
determining a source message issued to a COAP client; the COAP client is narrow-band Internet of things NB equipment;
and converting the source message into a target message in a BYTE BYTE format, and sending the target message to the COAP client.
On the other hand, an embodiment of the present invention provides a message processing apparatus, which is applied to a restricted application protocol COAP server, where the COAP server is a world wide WEB (www) server, and the apparatus includes:
the determining module is used for determining a source message issued to the COAP client; the COAP client is narrow-band Internet of things NB equipment;
and the sending module is used for converting the source message into a target message in a BYTE BYTE format and sending the target message to the COAP client.
On the other hand, the embodiment of the present invention further provides an electronic device, which includes a memory, a processor, a bus, and a computer program stored on the memory and executable on the processor, where the processor implements the steps in the message processing method when executing the program.
In still another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the message processing method.
According to the message processing method and device provided by the embodiment of the invention, the source message sent to the COAP client is determined, the source message is converted into the target message in the BYTE BYTE format, the target message is sent to the COAP client, and the source message is converted into the target message in the BYTE BYTE format, so that the COAP client can directly read the target message, direct communication between the COAP server and the COAP client is realized, the message is forwarded without the aid of a middleware, the waste of message resources is avoided, and the high availability of communication between the WEB server and NB equipment is improved. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a message processing method according to an embodiment of the present invention;
fig. 2 is a second schematic flowchart of a message processing method according to an embodiment of the present invention;
FIG. 3 is a flow diagram of a specific example of an embodiment of the present invention;
fig. 4 is a block diagram of a message processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a message processing method according to an embodiment of the present invention.
As shown in fig. 1, a message processing method provided in an embodiment of the present invention is applied to a restricted application protocol COAP server, where the COAP server is a world wide WEB (www) WEB server, and the method includes:
step 101, determining a source message issued to a COAP client; the COAP client is narrow-band Internet of things NB equipment.
The restricted Application Protocol (COAP) is a network communication Protocol based on REST architecture and operating in a limited environment of CPU and memory, and describes contents of a Protocol packet by defining functions of each bit segment of a binary system, and the COAP Protocol packet is smaller and more compact compared with communication protocols such as HTTP, for example, the smallest Protocol packet in the COAP Protocol is only 4B.
In this step, the source message is a response message of the COAP server for the request message of the COAP client, or indication information issued by the COAP server to the COAP client.
And step 102, converting the source message into a target message in a BYTE format, and sending the target message to the COAP client.
In the embodiment of the present invention, the COAP server converts the source message into the target message in the BYTE format, the BYTE format can be directly read by the NB device through the COAP protocol, and the power consumption is low when the BYTE is analyzed.
For example, when the source message is the indication information sent by the COAP server to the COAP client, the COAP server sends an instruction to the COAP client, the COAP client can analyze the indication information through a firmware program, and if a legal instruction corresponding to the indication information exists, the COAP client executes the indication information.
Because the COAP server is directly communicated with the COAP client, the high availability of the service between the WEB server and the NB equipment is improved without the aid of middleware, wherein the high availability is high availability.
In the above embodiment of the present invention, by determining the source message sent to the COAP client, converting the source message into the target message in the BYTE format, sending the target message to the COAP client, and converting the source message into the target message in the BYTE format, the COAP client can directly read the target message, so as to implement direct communication between the COAP server and the COAP client, and forward the message without using middleware, thereby avoiding waste of message resources, and improving high availability of communication between the WEB server and the NB device. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved. The invention solves the problem that in the prior art, the WEB server is communicated with NB equipment through the equipment controller, and the high availability of communication between the WEB server and the NB equipment is easy to reduce.
Further, as shown in fig. 2, the message processing method provided in the embodiment of the present invention is applied to a COAP server, where the COAP server is a WEB server, and the method includes:
step 201, receiving a request message of a COAP client, where the COAP client is an NB device.
The request message of the COAP client may be a registration request or a subscription request, etc.
Since the COAP client is an NB device, the NB device includes a Resource (also referred to as a route) with a Uniform Resource Locator (URL) of "t/d", and the Resource supports a GET method and a POST method similar to HTTP to access the Resource of the server. For example, if an NB device has a sensor for temperature measurement, when transmitting the temperature value to the COAP server, its URL address may be:
COAP://NBmachine.address:5666/sensors/temperature;
where "5566" is the address of the NB device.
The COAP server can directly obtain the temperature value of the equipment through the URL, and because the COAP Protocol is an upper layer Protocol based on a User Datagram Protocol (UDP), long connection is not needed, and power consumption is saved.
And step 202, converting the request message into a target request message in the JS object numbered notation JSON format.
In the embodiment of the invention, the request message of the NB device adopts a BYTE format, and the COAP server converts the request message of the BYTE format into the target request message of the JSON format after receiving the request message, so that the analysis of the COAP server is facilitated.
Step 203, generating a source message aiming at the target request message.
The COAP server determines response content aiming at the target request message and generates a source message aiming at the target request message; the source message is a message for responding to the target request message, for example, when the target request message is a registration request, the source message is a registration result.
Step 204, converting the source message into a target message in BYTE format, and sending the target message to the COAP client.
The COAP server converts the source message into a target message in a BYTE BYTE format, the BYTE format can be directly read by NB equipment through a COAP protocol, and communication between the WEB server and the NB equipment is achieved.
Alternatively, in the above embodiments of the present invention, when the request message is a registration request message,
after the step of converting the request message into the target request message in the JSON format of the JS object notation, the method further includes:
acquiring the unique identifier of the COAP client carried in the registration request message;
an account corresponding to the unique identifier is established.
Specifically, the WEB server side may implement a function of device management. This is achieved by establishing different accounts for different COAP clients. When a registration request of a COAP client is received, the unique identifier of the COAP client carried in the registration request message is obtained, and an account corresponding to the unique identifier one to one is established. For example, the International Mobile Equipment Identity (IMEI) of the device may be used as the unique identifier, so that the NB device can be found through the operator network.
Optionally, in the above embodiment of the present invention, after the step of establishing the account corresponding to the unique identifier, the method further includes:
creating a first data queue and a second data queue for the account; the first data queue is used for storing a device connection request for the account, and the second data queue is used for storing an indication message issued to the COAP client.
After the account of the COAP client is newly created, the COAP server may receive device connection requests sent from a plurality of accounts, or the COAP server needs to send an indication message to the newly created account. In the embodiment of the invention, two data queues, namely a first data queue and a second data queue, are started in a program of a COAP server terminal for each COAP client terminal.
Specifically, a Blocking Queue (Blocking Queue) in JAVA may be used in the embodiment of the present invention, and the Blocking Queue differs from a conventional Queue in that when the Queue is full and data is inserted into the Queue, the operation is blocked until other threads consume the data in the Queue.
Optionally, in the above embodiment of the present invention, after the step of creating the first data queue and the second data queue for the account, the method includes:
receiving a device connection request for the account, storing the device connection request in the first data queue.
The first data queue is used for storing device connection requests sent from other NB devices, and the writing method of the queue mainly achieves consuming data in the queue, that is, storing device connection requests sent from other NB devices in the queue into a database, a proxy object in a memory, or a custom file.
Optionally, in the foregoing embodiment of the present invention, after the step of determining the source message sent to the COAP client, the method further includes:
and storing the source message in a preset queue for storing an indication message sent to the COAP client.
The present invention provides a method for implementing a COAP server, which includes the steps of, storing a preset queue of an indication message issued to the COAP client, namely, a second data queue, where the second data queue is used to transmit the indication message issued by the COAP server back to the COAP client, and the method includes: after determining the source message sent to the COAP client, for example, when receiving an indication message sent to the NB device by an NB device manufacturer logging in the COAP server, the COAP server writes all the indication messages into the reading method of the second data queue, so that data loss caused by overload of the COAP server is avoided when concurrency is high, and therefore the indication message is stored into the second data queue first, and then one or more threads are started to consume the data in the second data queue.
Therefore, the first data queue realizes the data transmission from the COAP client to the COAP server, the second data queue realizes the data transmission from the COAP server to the COAP client, the data are communicated in an asynchronous mode, the communicated data are stored and processed in real time, the high availability of communication between the NB equipment and the WEB server can be realized in a high concurrency scene, and the performance of the WEB server is enhanced.
In the above embodiment of the present invention, by determining the source message sent to the COAP client, converting the source message into the target message in the BYTE format, sending the target message to the COAP client, and converting the source message into the target message in the BYTE format, the COAP client can directly read the target message, so as to implement direct communication between the COAP server and the COAP client, and forward the message without using middleware, thereby avoiding waste of message resources, and improving high availability of communication between the WEB server and the NB device. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved. The COAP server respectively creates a first data queue and a second data queue for the COAP client, the first data queue and the second data queue are communicated in an asynchronous mode, and the communicated data are stored and processed in real time, so that the high availability of communication between the NB equipment and the WEB server can be realized in a high concurrency scene, and the performance of the WEB server is enhanced.
As a specific example, referring to fig. 3, in fig. 3, the COAP client communicates with the COAP server, the COAP server side is provided with a conversion plug-in and a message processing module, which are used to implement mutual conversion between the BYTE format and the JSON format, and the communication process mainly includes the following steps:
1, the COAP client sends a registration request message to the COAP server.
Wherein the conversion plug-in first receives the registration request message.
And the IMEI number of the NB device is taken as the unique identifier of the NB device.
And 2, converting the registration request message into a JSON format by the conversion plug-in.
And 3, the conversion plug-in sends the registration request message in the JSON format to the message processing module.
And 4, the message processing module establishes an account for the COAP client and establishes a first data queue and a second data queue.
After that, if the connection request for the COAP client is received by the COAP server, the connection request is stored in the first data queue.
And 5, the COAP server sends an indication message to the COAP client, and at the moment, the indication message is in a JSON format, so that the message processing module firstly sends the indication message to the conversion plug-in. After determining the source message sent to the COAP client, for example, when receiving an indication message sent to the NB device by an NB device manufacturer logging in the COAP server, the message processing module writes all the indication messages into the reading method of the second data queue, so that data loss caused by overload of the COAP server is avoided when concurrency is high, and therefore the indication message is stored into the second data queue first, and then one or more threads are started to consume the data in the second data queue.
And 6, converting the JSON format indication message into a BYTE format by the conversion plug-in.
And 7, the conversion plug-in sends the converted indication message to the COAP client.
In the above example, direct communication between the COAP server and the COAP client is realized, and the message does not need to be forwarded by means of middleware, thereby avoiding message resource waste and improving high availability of communication between the WEB server and the NB device. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved. The COAP server 302 creates a first data queue and a second data queue for the COAP client 301, performs communication in an asynchronous manner, and stores and processes the communicated data in real time, so that high availability of communication between the NB device and the WEB server can be realized in a high concurrency scenario, and the performance of the WEB server is enhanced.
Referring to fig. 4, an embodiment of the present invention provides a message processing apparatus, which is applied to a COAP server of a restricted application protocol, where the COAP server is a world wide WEB (www) server, and the apparatus includes:
a determining module 401, configured to determine a source message sent to the COAP client; the COAP client is narrow-band Internet of things NB equipment.
The COAP is a network communication protocol based on the REST architecture and operating in the environment of limited CPU and memory, and describes the contents of a protocol packet by defining binary bit segment functions, and compared with communication protocols such as HTTP, the COAP protocol packet is smaller and more compact, for example, the smallest protocol packet in the COAP protocol is only 4B.
The source message is a response message of the COAP server for the request message of the COAP client, or indication information issued by the COAP server to the COAP client.
A sending module 402, configured to convert the source message into a target message in a BYTE format, and send the target message to the COAP client.
In the embodiment of the present invention, the COAP server converts the source message into the target message in the BYTE format, and the BYTE format can be directly read by the NB device through the COAP protocol, so that the communication between the WEB server and the NB device is realized.
Optionally, in an embodiment of the present invention, the apparatus includes:
a receiving module, configured to receive a request message of a COAP client;
the first conversion module is used for converting the request message into a target request message in a JS object numbered notation (JSON) format;
a production module to generate a source message for the target request message.
Optionally, in this embodiment of the present invention, when the request message is a registration request message, the apparatus further includes:
an identifier obtaining module, configured to obtain the unique identifier of the COAP client carried in the registration request message;
and the account establishing module is used for establishing an account corresponding to the unique identifier.
Optionally, in an embodiment of the present invention, the apparatus further includes:
a queue creation module to create a first data queue and a second data queue for the account; the first data queue is used for storing a device connection request for the account, and the second data queue is used for storing an indication message issued to the COAP client.
Optionally, in an embodiment of the present invention, the apparatus includes:
a first storage module, configured to receive a device connection request for the account, and store the device connection request in the first data queue.
Optionally, in an embodiment of the present invention, the apparatus further includes:
and the second storage module is used for storing the source message in a preset queue for storing the indication message issued to the COAP client.
In the above embodiment of the present invention, the determining module 401 determines the source message to be sent to the COAP client, the sending module 402 converts the source message into the target message in the BYTE format, sends the target message to the COAP client, and converts the source message into the target message in the BYTE format, so that the COAP client can directly read the target message, thereby achieving direct communication between the COAP server and the COAP client, and avoiding message resource waste without using middleware to forward the message, and improving high availability of communication between the WEB server and the NB device. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved. The invention solves the problem that in the prior art, the WEB server is communicated with NB equipment through the equipment controller, and the high availability of communication between the WEB server and the NB equipment is easy to reduce.
Fig. 5 is a schematic structural diagram of an electronic device according to yet another embodiment of the present invention.
Referring to fig. 5, an embodiment of the present invention provides an electronic device, which includes a memory (memory)51, a processor (processor)52, a bus 53, and a computer program stored in the memory 51 and running on the processor. The memory 51 and the processor 52 complete communication with each other through the bus 53.
The processor 52 is used for calling the program instructions in the memory 51 to implement the method of fig. 1 when executing the program.
In another embodiment, the processor, when executing the program, implements the method of:
determining a source message issued to a COAP client; the COAP client is narrow-band Internet of things NB equipment;
and converting the source message into a target message in a BYTE BYTE format, and sending the target message to the COAP client.
The electronic device provided in the embodiment of the present invention may be configured to execute a program corresponding to the method in the foregoing method embodiment, and details of this implementation are not described again.
According to the electronic device provided by the embodiment of the invention, the source message issued to the COAP client is determined, the source message is converted into the target message in the BYTE BYTE format, the target message is sent to the COAP client, and the source message is converted into the target message in the BYTE BYTE format, so that the COAP client can directly read the target message, direct communication between the COAP server and the COAP client is realized, the message is not required to be forwarded by means of a middleware, the waste of message resources is avoided, and the high availability of communication between the WEB server and the NB device is improved. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved.
A non-transitory computer readable storage medium is provided according to a further embodiment of the present invention, having a computer program stored thereon, which when executed by a processor implements the steps of fig. 1.
In another embodiment, the program when executed by a processor implements a method comprising:
determining a source message issued to a COAP client; the COAP client is narrow-band Internet of things NB equipment;
and converting the source message into a target message in a BYTE BYTE format, and sending the target message to the COAP client.
In the non-transitory computer-readable storage medium provided in the embodiment of the present invention, when the program is executed by the processor, the method in the above-described method embodiment is implemented, and details of this implementation are not described again.
The non-transitory computer readable storage medium provided in the embodiment of the present invention determines a source message to be sent to a COAP client, converts the source message into a target message in a BYTE format, sends the target message to the COAP client, and converts the source message into the target message in the BYTE format, so that the COAP client can directly read the target message, thereby achieving direct communication between the COAP server and the COAP client, and avoiding message resource waste without using middleware to forward the message, and improving high availability of communication between a WEB server and NB devices. And because the COAP protocol packet is smaller, the communication capability of communication between the WEB server and the NB equipment is favorably improved.
Yet another embodiment of the present invention discloses a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-mentioned method embodiments, for example, comprising:
determining a source message issued to a COAP client; the COAP client is narrow-band Internet of things NB equipment;
and converting the source message into a target message in a BYTE BYTE format, and sending the target message to the COAP client.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (14)

1. A message processing method applied to a restricted application protocol (COAP) server, wherein the COAP server is a World Wide WEB (WWW) server, the method comprises the following steps:
determining a source message issued to a COAP client; the COAP client is narrow-band Internet of things NB equipment;
converting the source message into a target message in a BYTE BYTE format, and sending the target message to the COAP client;
the indication information is sent to the COAP client by the COAP server;
when the source message is indication information sent to the COAP client by the COAP server, the COAP server sends an instruction to the COAP client, the COAP client analyzes the indication information through a firmware program, and if a legal instruction corresponding to the indication information exists, the COAP client executes the indication information.
2. The method as claimed in claim 1, wherein when the source message is a response message of a request message for the COAP client, the step of converting the source message into a target message in BYTE format is preceded by the step of:
receiving a request message of a COAP client;
converting the request message into a target request message in a JS object numbered notation (JSON) format;
and generating a source message aiming at the target request message.
3. The method of claim 2, wherein when the request message is a registration request message,
after the step of converting the request message into the target request message in the JSON format of the JS object notation, the method further includes:
acquiring the unique identifier of the COAP client carried in the registration request message;
an account corresponding to the unique identifier is established.
4. The method of claim 3, wherein after the step of establishing an account corresponding to the unique identifier, the method further comprises:
creating a first data queue and a second data queue for the account; the first data queue is used for storing a device connection request for the account, and the second data queue is used for storing an indication message issued to the COAP client.
5. The method of claim 4, wherein after the step of creating a first data queue and a second data queue for the account, the method comprises:
receiving a device connection request for the account, storing the device connection request in the first data queue.
6. The method of claim 1, wherein after the step of determining the source message to be sent to the COAP client, the method further comprises:
and storing the source message in a preset queue for storing an indication message sent to the COAP client.
7. A message processing apparatus for a restricted application protocol COAP server, wherein the COAP server is a WEB server, the apparatus comprising:
the determining module is used for determining a source message issued to the COAP client; the COAP client is narrow-band Internet of things NB equipment;
a sending module, configured to convert the source message into a target message in a BYTE format, and send the target message to the COAP client;
the indication information is sent to the COAP client by the COAP server;
when the source message is the indication information sent by the COAP server to the COAP client, the COAP server sends an instruction to the COAP client, the COAP client analyzes the indication information through a firmware program, and if a legal instruction corresponding to the indication information exists, the COAP client executes the indication information.
8. The apparatus of claim 7, wherein the apparatus comprises:
a receiving module, configured to receive a request message of a COAP client;
the first conversion module is used for converting the request message into a target request message in a JS object numbered notation (JSON) format;
a production module to generate a source message for the target request message.
9. The apparatus of claim 8, wherein when the request message is a registration request message, the apparatus further comprises:
an identifier obtaining module, configured to obtain the unique identifier of the COAP client carried in the registration request message;
and the account establishing module is used for establishing an account corresponding to the unique identifier.
10. The apparatus of claim 9, further comprising:
a queue creation module to create a first data queue and a second data queue for the account; the first data queue is used for storing a device connection request for the account, and the second data queue is used for storing an indication message issued to the COAP client.
11. The apparatus of claim 10, further comprising:
a first storage module, configured to receive a device connection request for the account, and store the device connection request in the first data queue.
12. The apparatus of claim 7, further comprising:
and the second storage module is used for storing the source message in a preset queue for storing the indication message issued to the COAP client.
13. An electronic device, comprising a memory, a processor, a bus, and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the message processing method according to any one of claims 1-6 when executing the program.
14. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that: the program, when executed by a processor, implements the steps in the message processing 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 CN108924773A (en) 2018-11-30
CN108924773B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (3)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101611944B1 (en) * 2015-03-13 2016-04-12 한국전자통신연구원 Method for selectively applying data encryption

Patent Citations (3)

* 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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
The Constrained Application Protocol (CoAP);Z. Shelby等;《http://www.rfc-editor.org/info/rfc7252》;20140630;全文 *

Also Published As

Publication number Publication date
CN108924773A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN110300050B (en) Message pushing method and device, computer equipment and storage medium
EP3275162B1 (en) Systems and techniques for web communication
CN107566786B (en) Method and device for acquiring monitoring video and terminal equipment
CN102546794B (en) Method for directly communicating browser client with back-end server as well as gateway and communication system
CN110022289B (en) Data transmission method, device and system
CN107395572B (en) Data processing method and Internet of things gateway
EP3054650A1 (en) Method, device and system for redirecting data service proxy
US20180278692A1 (en) Communication device, communication system, and communication method
CN108769017B (en) Data communication method and device
CN108924773B (en) Message processing method and device
CN115002016B (en) Message processing system, method, device and storage medium
CN107368334B (en) Business plug-in interaction system and method
US20150067066A1 (en) Provisioning Communication Services using Proxy Server in a Cloud
US20070130312A1 (en) Web service provision apparatus and method and web service request apparatus and method
KR101554760B1 (en) Network message transformation device and methods thereof
CN110417875B (en) Method, system, equipment and storage medium for docking between cloud servers
CN109005250B (en) Method and device for accessing server
CN114679436B (en) Session management method, server and computer readable storage medium
CN108289165B (en) Method and device for realizing camera control based on mobile phone and terminal equipment
CN113746851B (en) Proxy system and method supporting real-time analysis of GRPC request
CN115473947A (en) Data acquisition method and device based on cloud edge cooperation and server
CN113079055B (en) AGV operation data dynamic acquisition method and device
CN114050986A (en) Signaling tracking method, device, equipment and storage medium
CN109995589B (en) Log collection method and system
CN113992641A (en) Data processing method, device, equipment and storage medium

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