CN109788014A - The message treatment method and device of a kind of Message Processing, Internet of things system - Google Patents

The message treatment method and device of a kind of Message Processing, Internet of things system Download PDF

Info

Publication number
CN109788014A
CN109788014A CN201711123895.8A CN201711123895A CN109788014A CN 109788014 A CN109788014 A CN 109788014A CN 201711123895 A CN201711123895 A CN 201711123895A CN 109788014 A CN109788014 A CN 109788014A
Authority
CN
China
Prior art keywords
message
segment information
template
distribution apparatus
resource address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711123895.8A
Other languages
Chinese (zh)
Inventor
吕建文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201711123895.8A priority Critical patent/CN109788014A/en
Publication of CN109788014A publication Critical patent/CN109788014A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the present application provides the message treatment method and device of a kind of Message Processing, Internet of things system, and the message treatment method includes: the destination Uniform Resource identifier for obtaining the targeted target resource address of message that distribution apparatus is sent;Corresponding default template is searched according to the destination Uniform Resource identifier;Determine that the distribution apparatus has the authorization uniform resource identifier of the resource address of authorization according to the default template;According to the destination Uniform Resource identifier and the authorization uniform resource identifier, judge whether the distribution apparatus has the authorization that message is sent to the target resource address;If the distribution apparatus has the authorization for sending message to the target resource address, send the message in target resource address.Compared with existing authority checking method, the authority checking of the embodiment of the present application is more unified efficient, reduces the storage overhead of authority record, and deployable in different agreement.

Description

The message treatment method and device of a kind of Message Processing, Internet of things system
Technical field
This application involves fields of communication technology, more particularly to a kind of message treatment method, a kind of message processing apparatus, one The message treatment method and a kind of message processing apparatus of Internet of things system of kind Internet of things system.
Background technique
Since various device end abilities are different in internet of things field, communication protocol is also various.Traditional HTTP (HyperText Transfer Protocol, hypertext transfer protocol) agreement and not applicable Internet of Things, therefore propose special For Internet of Things MQTT (Message Queuing Telemetry Transport, message queue telemetering transmission) agreement, COAP (Constrained Application Protocol, restricted application protocol) agreement makes up Internet of Things communication protocols Deficiency in view.
But due to difference in agreement and the difference on communication pattern, there are various message systems, such as The message system of HTTP mode, for the Message Queuing system of MQTT agreement, for message system of COAP agreement etc., these are System directly how to interconnect and the authority record of the equipment of magnanimity and magnanimity how efficient storage become it is urgently to be resolved The problem of.
Summary of the invention
In view of the above problems, it proposes the embodiment of the present application and overcomes the above problem or at least partly in order to provide one kind A kind of message treatment method, a kind of message processing apparatus, a kind of message treatment method of Internet of things system to solve the above problems With a kind of message processing apparatus of Internet of things system.
To solve the above-mentioned problems, the embodiment of the present application discloses a kind of message treatment method, comprising:
The destination Uniform Resource identifier of the targeted target resource address of the message that acquisition distribution apparatus is sent;
Corresponding default template is searched according to the destination Uniform Resource identifier;
Determine that the distribution apparatus has the authorization uniform resource identifier of the resource address of authorization according to the default template Symbol;
According to the destination Uniform Resource identifier and the authorization uniform resource identifier, the distribution apparatus is judged Whether there is the authorization that message is sent to the target resource address;
If the distribution apparatus has the authorization for sending message to the target resource address, send the message to In target resource address.
Preferably, further includes:
If the distribution apparatus has the authorization for sending message to the target resource address, described receiving again When the message that distribution apparatus is sent to the target resource address, directly send the message in target resource address.
Preferably, the default template successively specifies multiple variable names or constant value for indicating template segment information, institute Multiple template segment information is stated for indicating the authorization uniform resource identifier;It is described determined according to the default template described in Distribution apparatus have authorization resource address authorization uniform resource identifier the step of include:
Obtain the context of the distribution apparatus;
The corresponding variate-value of variable name for indicating the template segment information is searched from the context of the distribution apparatus, Using the variate-value as corresponding template segment information;
The constant value for the expression template segment information that the default template is specified, as template segment information.
Preferably, the multiple template segment information includes: the first template segment information at interval, the second template segmentation letter Breath and third template segment information;The default template successively specifies the first variable for indicating the first template segment information Name or the first constant value, the second variable name or the second constant value that indicate the second template segment information, and indicate third template The third constant value of segment information;
It is described that the corresponding change of variable name for indicating the template segment information is searched from the context of the distribution apparatus Magnitude includes: using the variate-value as the step of corresponding template segment information
Corresponding first variate-value of first variable name is searched from the context of the distribution apparatus, by described first Variate-value is as the first template segment information;
And/or
Corresponding second variate-value of second variable name is searched from the context of the distribution apparatus, by described second Variate-value is as the second template segment information.
Preferably, the constant value of the expression template segment information that the default template is specified, is segmented as template The step of information includes:
First constant value that the default template is specified, as the first template segment information;
And/or
Second constant value that the default template is specified, as the second template segment information;
And/or
The third constant value that the default template is specified, as third template segment information.
Preferably, the destination Uniform Resource identifier includes the first object segment information at interval, the second target segment Information and third target segment information;It is described according to the destination Uniform Resource identifier and the authorization unified resource mark Know symbol, judging whether the distribution apparatus had to the step of authorization of target resource address transmission message includes:
Compare the first object segment information and whether the first template segment information is identical, second mesh It marks segment information and whether the second template segment information is identical, the third target segment information and the third mould Whether plate segment information is identical;
If the corresponding segment information of each intervening sequences is all identical, it is determined that the distribution apparatus, which has to the target, to be provided The authorization of source address transmission message.
Preferably, described the step of searching corresponding default template according to the destination Uniform Resource identifier, includes:
Determine that each default template is directed to the corresponding variate-value of the first variable name or the first constant value of the distribution apparatus;
By the corresponding variate-value of first variable name or the first constant value, with the destination Uniform Resource identifier The identical default template of one target segment information, as default template corresponding with the destination Uniform Resource identifier.
Preferably, the step sent the message in target resource address includes:
It is preset format by the Format adjusting of the message, and the message after adjustment format is sent to target resource address In.
Preferably, described when receiving the message that the distribution apparatus is sent to the target resource address again, directly Connecing the step sent the message in target resource address includes:
When receiving the message that the distribution apparatus is sent to the target resource address again, directly by the message It is adjusted to preset format, and the message after adjustment format is sent in target resource address.
The embodiment of the present application also discloses a kind of message treatment method, comprising:
Obtain the message in the resource address of server;
Determine the protocol format of receiving device;
The format of the message is converted to the protocol format for being adapted to the receiving device;
Message after after format is turned is sent to corresponding receiving device.
Preferably, the resource address is the theme;The step of protocol format of the determining receiving device includes:
Determine the protocol format for subscribing to the receiving device of the theme.
The embodiment of the present application also discloses a kind of message treatment method of Internet of things system, and the Internet of things system includes hair Cloth equipment, the message-oriented middleware communicated with the distribution apparatus, and, the application server communicated with the message-oriented middleware, The method includes:
The message-oriented middleware receives the message that the distribution apparatus is sent;
The target of the targeted target resource address of the message that the message-oriented middleware acquisition distribution apparatus is sent is unified to be provided Source identifier;
The message-oriented middleware searches corresponding default template according to the destination Uniform Resource identifier;
The message-oriented middleware determines that the distribution apparatus has awarding for the resource address of authorization according to the default template Weigh uniform resource identifier;
The message-oriented middleware is sentenced according to the destination Uniform Resource identifier and the authorization uniform resource identifier Whether the distribution apparatus that breaks has the authorization that message is sent to the target resource address;
If the distribution apparatus has the authorization for sending message to the target resource address, the message-oriented middleware will The message is sent in the target resource address of the application server.
Preferably, further includes:
If the distribution apparatus has the authorization for sending message to the target resource address, in the message-oriented middleware When receiving the message that the distribution apparatus is sent to the target resource address again, the message-oriented middleware directly will be described Message is sent in target resource address.
Preferably, the default template successively specifies multiple variable names or constant value for indicating template segment information, institute Multiple template segment information is stated for indicating the authorization uniform resource identifier;The message-oriented middleware is according to the default mould Plate determines that the step of distribution apparatus has the authorization uniform resource identifier of the resource address of authorization includes:
The message-oriented middleware obtains the context of the distribution apparatus;
The message-oriented middleware searches the variable for indicating the template segment information from the context of the distribution apparatus The corresponding variate-value of name, using the variate-value as corresponding template segment information;
The constant value for the expression template segment information that the message-oriented middleware specifies the default template, as template point Segment information.
Preferably, the multiple template segment information includes: the first template segment information at interval, the second template segmentation letter Breath and third template segment information;The default template successively specifies the first variable for indicating the first template segment information Name or the first constant value, the second variable name or the second constant value that indicate the second template segment information, and indicate third template The third constant value of segment information;
The message-oriented middleware searches the variable for indicating the template segment information from the context of the distribution apparatus The corresponding variate-value of name includes: using the variate-value as the step of corresponding template segment information
The message-oriented middleware is searched first variable name corresponding first from the context of the distribution apparatus and is become Magnitude, using first variate-value as the first template segment information;
And/or
The message-oriented middleware is searched second variable name corresponding second from the context of the distribution apparatus and is become Magnitude, using second variate-value as the second template segment information.
Preferably, the constant value for the expression template segment information that the message-oriented middleware specifies the default template, makees Include: for the step of template segment information
First constant value that the message-oriented middleware specifies the default template is segmented as the first template and believes Breath;
And/or
Second constant value that the message-oriented middleware specifies the default template is segmented as the second template and believes Breath;
And/or
The third constant value that the message-oriented middleware specifies the default template is segmented as third template and believes Breath.
Preferably, the destination Uniform Resource identifier includes the first object segment information at interval, the second target segment Information and third target segment information;
The message-oriented middleware is sentenced according to the destination Uniform Resource identifier and the authorization uniform resource identifier Whether the distribution apparatus that breaks had to the step of authorization of target resource address transmission message
Whether the message-oriented middleware first object segment information and the first template segment information are identical, Compare the second target segment information and whether the second template segment information is identical, the third target segment letter It ceases whether identical as the third template segment information;
If the corresponding segment information of each intervening sequences is all identical, the message-oriented middleware determines the distribution apparatus tool The oriented target resource address sends the authorization of message.
Preferably, the message-oriented middleware searches the step of corresponding default template according to the destination Uniform Resource identifier Suddenly include:
The message-oriented middleware determines that each default template is directed to the corresponding variable of the first variable name of the distribution apparatus Value or the first constant value;
The message-oriented middleware is by the corresponding variate-value of first variable name or the first constant value, with target unification The identical default template of the first object segment information of resource identifier, as corresponding with the destination Uniform Resource identifier Default template.
Preferably, the message-oriented middleware is sent the message in the target resource address of the application server Step includes:
The Format adjusting of the message is preset format by the message-oriented middleware, and the message after adjustment format is sent Into the target resource address of the application server.
Preferably, described to receive the distribution apparatus again in the message-oriented middleware and sent out to the target resource address When the message sent, the step that the message-oriented middleware is directly sent the message in target resource address includes:
When the message-oriented middleware receives the message that the distribution apparatus is sent to the target resource address again, The message is directly adjusted to preset format by the message-oriented middleware, and the message after adjustment format is sent to target resource In address.
The embodiment of the present application also discloses a kind of message treatment method of Internet of things system, and the Internet of things system includes ordering Equipment is read, the message-oriented middleware communicated with the subscription equipment, and, the application server communicated with the message-oriented middleware, The method includes:
The message-oriented middleware obtains the message in the resource address of the application server;
The message-oriented middleware determines the protocol format for subscribing to equipment;
The message-oriented middleware, which is converted to the format of the message, is adapted to the protocol format for subscribing to equipment;
Message after format is turned rear by the message-oriented middleware is sent to corresponding subscription equipment.
Preferably, the resource address is the theme;The message-oriented middleware determines the step of protocol format for subscribing to equipment Include:
The message-oriented middleware determines the protocol format for having subscribed the subscription equipment of the theme.
The embodiment of the present application also discloses a kind of message processing apparatus, comprising:
Destination Uniform Resource identifier obtains module, the targeted target resource of the message for obtaining distribution apparatus transmission The destination Uniform Resource identifier of address;
Template searching module, for searching corresponding default template according to the destination Uniform Resource identifier;
Uniform resource identifier determining module is authorized, is awarded for determining that the distribution apparatus has according to the default template The authorization uniform resource identifier of the resource address of power;
Judgment module is authorized, for according to the destination Uniform Resource identifier and the authorization uniform resource identifier Symbol, judges whether the distribution apparatus has the authorization that message is sent to the target resource address;
First message sending module sends awarding for message if having for the distribution apparatus to the target resource address Power, then send the message in target resource address.
Preferably, further includes:
Second message sending module sends awarding for message if having for the distribution apparatus to the target resource address Power, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly send out the message It send into target resource address.
Preferably, the default template successively specifies multiple variable names or constant value for indicating template segment information, institute Multiple template segment information is stated for indicating the authorization uniform resource identifier;The authorization uniform resource identifier determines mould Block includes:
Context acquisition submodule, for obtaining the context of the distribution apparatus;
First template segment information determines submodule, indicates the mould for searching from the context of the distribution apparatus The corresponding variate-value of the variable name of plate segment information, using the variate-value as corresponding template segment information;
Second template segment information determines submodule, the expression template segment information for specifying the default template Constant value, as template segment information.
Preferably, the multiple template segment information includes: the first template segment information at interval, the second template segmentation letter Breath and third template segment information;The default template successively specifies the first variable for indicating the first template segment information Name or the first constant value, the second variable name or the second constant value that indicate the second template segment information, and indicate third template The third constant value of segment information;
The first template segment information determines that submodule includes:
First template segment information determination unit, for searching first variable from the context of the distribution apparatus Corresponding first variate-value of name, using first variate-value as the first template segment information;
And/or
Second template segment information determination unit, for searching second variable from the context of the distribution apparatus Corresponding second variate-value of name, using second variate-value as the second template segment information.
Preferably, the second template segment information determines that submodule includes:
Third template segment information determination unit, first constant value for specifying the default template, as First template segment information;
And/or
4th template segment information determination unit, second constant value for specifying the default template, as Second template segment information;
And/or
5th template segment information determination unit, the third constant value for specifying the default template, as Third template segment information.
Preferably, the destination Uniform Resource identifier includes the first object segment information at interval, the second target segment Information and third target segment information;The authorization judgment module includes:
Comparative sub-module, for the first object segment information and the first template segment information whether phase Together, whether the second target segment information and the second template segment information are identical, the third target point Whether segment information and the third template segment information are identical;
It authorizes and determines submodule, if all identical for the corresponding segment information of each intervening sequences, it is determined that the publication Equipment has the authorization that message is sent to the target resource address.
Preferably, the template searching module includes:
Template Information determines submodule, for determining that each default template is directed to the first variable name pair of the distribution apparatus The variate-value or the first constant value answered;
Target template determines submodule, is used for by the corresponding variate-value of first variable name or the first constant value, with institute The identical default template of first object segment information for stating destination Uniform Resource identifier, as with the destination Uniform Resource mark Know and accords with corresponding default template.
Preferably, the first message sending module includes:
First message sending submodule sends message if having for the distribution apparatus to the target resource address The Format adjusting of the message is then preset format, and the message after adjustment format is sent to target resource address by authorization In.
Preferably, the second message sending module includes:
Second message sending submodule sends message if having for the distribution apparatus to the target resource address Authorization, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly by the message It is adjusted to preset format, and the message after adjustment format is sent in target resource address.
The embodiment of the present application also discloses a kind of message processing apparatus, comprising:
Message capturing module, the message in resource address for obtaining server;
Protocol format determining module, for determining the protocol format of receiving device;
Protocol format conversion module, for the format of the message to be converted to the agreement lattice for being adapted to the receiving device Formula;
Message transmission module is sent to corresponding receiving device for the message after after turning format.
Preferably, the resource address is the theme;The protocol format determining module includes:
It subscribes to device protocol format and determines submodule, for determining the protocol format for subscribing to the receiving device of the theme.
The embodiment of the present application also discloses a kind of message processing apparatus of Internet of things system, and the Internet of things system includes hair Cloth equipment, the message-oriented middleware communicated with the distribution apparatus, and, the application server communicated with the message-oriented middleware, The device includes:
Positioned at the message reception module of the message-oriented middleware, for receiving the message of the distribution apparatus transmission;
Destination Uniform Resource identifier positioned at the message-oriented middleware obtains module, for obtaining distribution apparatus transmission The destination Uniform Resource identifier of the targeted target resource address of message;
Positioned at the template searching module of the message-oriented middleware, for according to destination Uniform Resource identifier lookup pair The default template answered;
Positioned at the authorization uniform resource identifier determining module of the message-oriented middleware, for true according to the default template The fixed distribution apparatus has the authorization uniform resource identifier of the resource address of authorization;
Positioned at the authorization judgment module of the message-oriented middleware, for according to the destination Uniform Resource identifier and institute Authorization uniform resource identifier is stated, judges whether the distribution apparatus has to the target resource address and sends awarding for message Power;
Positioned at the first message sending module of the message-oriented middleware, if having for the distribution apparatus to the target Resource address sends the authorization of message, then sends the message in the target resource address of the application server.
Preferably, further includes:
Positioned at the second message sending module of the message-oriented middleware, if having for the distribution apparatus to the target Resource address sends the authorization of message, then receives the distribution apparatus again to the target resource in the message-oriented middleware When the message that address is sent, directly send the message in target resource address.
Preferably, the default template successively specifies multiple variable names or constant value for indicating template segment information, institute Multiple template segment information is stated for indicating the authorization uniform resource identifier;The authorization uniform resource identifier determines mould Block includes:
Context acquisition submodule, for obtaining the context of the distribution apparatus;
First template segment information determines submodule, indicates the mould for searching from the context of the distribution apparatus The corresponding variate-value of the variable name of plate segment information, using the variate-value as corresponding template segment information;
Second template segment information determines submodule, the expression template segment information for specifying the default template Constant value, as template segment information.
Preferably, the multiple template segment information includes: the first template segment information at interval, the second template segmentation letter Breath and third template segment information;The default template successively specifies the first variable for indicating the first template segment information Name or the first constant value, the second variable name or the second constant value that indicate the second template segment information, and indicate third template The third constant value of segment information;
The first template segment information determines that submodule includes:
First template segment information determination unit, for searching first variable from the context of the distribution apparatus Corresponding first variate-value of name, using first variate-value as the first template segment information;
And/or
Second template segment information determination unit, for searching second variable from the context of the distribution apparatus Corresponding second variate-value of name, using second variate-value as the second template segment information.
Preferably, the second template segment information determines that submodule includes:
Third template segment information determination unit, first constant value for specifying the default template, as First template segment information;
And/or
4th template segment information determination unit, second constant value for specifying the default template, as Second template segment information;
And/or
5th template segment information determination unit, the third constant value for specifying the default template, as Third template segment information.
Preferably, the destination Uniform Resource identifier includes the first object segment information at interval, the second target segment Information and third target segment information;
The authorization judgment module includes:
Comparative sub-module, for the first object segment information and the first template segment information whether phase Together, whether the second target segment information and the second template segment information are identical, the third target point Whether segment information and the third template segment information are identical;
It authorizes and determines submodule, if all identical for the corresponding segment information of each intervening sequences, it is determined that the publication Equipment has the authorization that message is sent to the target resource address.
Preferably, the template searching module includes:
Template Information determines submodule, for determining that each default template is directed to the first variable name pair of the distribution apparatus The variate-value or the first constant value answered;
Target template determines submodule, is used for by the corresponding variate-value of first variable name or the first constant value, with institute The identical default template of first object segment information for stating destination Uniform Resource identifier, as with the destination Uniform Resource mark Know and accords with corresponding default template.
Preferably, the first message sending module includes:
First message sending submodule sends message if having for the distribution apparatus to the target resource address The Format adjusting of the message is then preset format, and the message after adjustment format is sent to target resource address by authorization In.
Preferably, the second message sending module includes:
Second message sending submodule sends message if having for the distribution apparatus to the target resource address Authorization, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly by the message It is adjusted to preset format, and the message after adjustment format is sent in target resource address.
The embodiment of the present application also discloses a kind of message processing apparatus of Internet of things system, and the Internet of things system includes ordering Equipment is read, the message-oriented middleware communicated with the subscription equipment, and, the application server communicated with the message-oriented middleware, The device includes:
Positioned at the message capturing module of the message-oriented middleware, in the resource address for obtaining the application server Message;
Positioned at the protocol format determining module of the message-oriented middleware, for determining the protocol format for subscribing to equipment;
Positioned at the protocol format conversion module of the message-oriented middleware, for the format of the message to be converted to adaptation institute State the protocol format for subscribing to equipment;
Positioned at the message transmission module of the message-oriented middleware, it is sent to accordingly for the message after after turning format Subscribe to equipment.
Preferably, the resource address is the theme;The protocol format determining module includes:
It subscribes to device protocol format and determines submodule, for determining the agreement lattice for having subscribed the subscription equipment of the theme Formula.
The embodiment of the present application also discloses a kind of device, comprising:
One or more processors;With
One or more machine readable medias of instruction are stored thereon with, are executed when by one or more of processors When, so that described device executes one or more method as described above.
The embodiment of the present application also discloses one or more machine readable medias, is stored thereon with instruction, when by one or When multiple processors execute, so that device executes one or more method as described above.
The embodiment of the present application includes the following advantages:
In the embodiment of the present application, to theme TOPIC or the URL (UniformResource in cloud server Locator, uniform resource locator) etc. resource address URI (Uniform ResourceIdentifier, unified resource mark Know symbol) unified template is provided, which is used to indicate that equipment to have the URI of the resource address of communication authority.Work as receiving device When to the message sent to target resource address, determine that current device has the resource address of permission according to template.According to having The resource address of permission and target resource address, judge whether current device sends the permission of message to target resource.For each The equipment of kind agreement can go to determine the resource address that the equipment has permission using unified template.With existing authorization Verification method is compared, and the authority checking of the embodiment of the present application is more unified efficient, reduces the storage overhead of authority record, and can It is deployed in different agreement.
After determining that equipment has permission, the message of the equipment of various agreements is uniformly adjusted to adaptation cloud server Message content is transparent to cloud server by message format.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of message treatment method embodiment 1 of the application;
Fig. 2 is a kind of step flow chart of message treatment method embodiment 2 of the application;
Fig. 3 is a kind of step flow chart of the message treatment method embodiment 1 of Internet of things system of the application;
Fig. 4 is a kind of step flow chart of the message treatment method embodiment 2 of Internet of things system of the application;
Fig. 5 is the schematic diagram of Internet of things system in the embodiment of the present application;
Fig. 6 is a kind of structural block diagram of message processing apparatus embodiment 1 of the application;
Fig. 7 is a kind of structural block diagram of message processing apparatus embodiment 2 of the application;
Fig. 8 is a kind of structural block diagram of the message processing apparatus embodiment 1 of Internet of things system of the application;
Fig. 9 is a kind of structural block diagram of the message processing apparatus embodiment 2 of Internet of things system of the application.
Specific embodiment
In order to make the above objects, features, and advantages of the present application more apparent, with reference to the accompanying drawing and it is specific real Applying mode, the present application will be further described in detail.
In existing technology of Internet of things, message-oriented middleware (also referred to as message can be passed through between equipment and cloud server Queue Message Queue) it is communicated.
Message-oriented middleware is the container that message is saved in message transmitting procedure, using producers and consumers' mode, solution When certainly extensive message is transmitted, if there are many producer's message, and if consumer spending is slow, queue can do message product Pressure, issues consumer according to consumers ability.
Message-oriented middleware supports pub/sub (publish/subscribe, publish/subscribe) communication pattern.Pass through the message A piece of news can be sent to multiple message consumers by TRANSFER MODEL, application program.In this transport model, message destination Type is theme TOPIC.Message is distributed in message server in specific theme by distribution apparatus (the message producer) first, Then all subscription equipment (message consumer) for having subscribed to this theme are transferred a message to by message server.
In pub/sub communication pattern, distribution apparatus can only have the theme of publication permission to give out information into topic list. Message-oriented middleware can judge whether publication and equipment have the permission of the theme when distribution apparatus sends message to theme.? In the prior art, it when distribution apparatus sends message to theme every time, requires to carry out authorization judgement.When distribution apparatus is more, Authorization judgement is also required to largely carry out.
If the equipment for realizing various agreements is communicated with cloud server, need to construct the message for being adapted to various agreements Processing system,
Equipment a by http protocol to cloud server send message (if message is sent to http://xxxx/ Device/a/upload), cloud server needs to construct a set of message system A for http protocol, and it also requires judgement Whether equipment a possesses the permission for accessing this URL;
Equipment b sends message to cloud server by MQTT agreement, and cloud server needs to construct a set of for MQTT The message system B of agreement.Since MQTT agreement is theme subscribing mode, equipment b needs the TOPIC to message system B :/ Device/b/upload sends message, and same message system B also needs to judge whether equipment b possesses this TOPIC permission;
Equipment c sends message to cloud by COAP agreement, and cloud server needs to construct a set of for COAP agreement Message system C.Similar HTTP, message system C need to judge whether equipment c possesses the permission of access URL to guarantee safety;
There are following several main problems in existing technology of Internet of things:
Firstly, how to realize interconnecting for the equipment of different agreement;Secondly, for the equipment for being compatible with various agreements, cloud The server is held to need to develop the message system for being adapted to various agreements, significant wastage resource;Finally, if a large amount of equipment, that The URL or TOPIC of these equipment access also have largely, and cloud server needs to judge whether equipment has corresponding access Authorization, then how to solve the storage and expense of a large amount of authority record.
One of the core concepts of the embodiments of the present application is that theme TOPIC or the URL (Uniform in cloud server Resource Locator, uniform resource locator) etc. resource address URI (Uniform Resource Identifier, Uniform resource identifier) unified template is provided, which is used to indicate that equipment to have the URI of the resource address of communication authority. When receiving device is to the message sent to target resource address, determine current device there is the resource of permission according to template Location.According to permission resource address and target resource address, judge whether current device to target resource sends message Permission.For the equipment of various agreements, can go to determine the resource address that the equipment has permission using unified template.With Existing authority checking method is compared, and the authority checking of the embodiment of the present application is more unified efficient, reduces depositing for authority record Expense is stored up, and deployable in different agreement.
After determining that equipment has permission, the message of the equipment of various agreements is uniformly adjusted to adaptation cloud server Message content is transparent to cloud server by message format.The message that cloud server is sent to equipment, being adjusted to adaptation should The message format of the agreement of equipment, to realize interconnecting for message between the equipment of each agreement.
Referring to Fig.1, a kind of step flow chart of message treatment method embodiment 1 of the application is shown, specifically can wrap Include following steps:
Step 101, the destination Uniform Resource mark of the targeted target resource address of the message that acquisition distribution apparatus is sent Symbol;
In the embodiment of the present application, message-oriented middleware supports pub/sub communication pattern.Message-oriented middleware can receive a variety of associations The message that equipment is sent is discussed, message-oriented middleware determines the message is which to be sent to after receiving the message that distribution apparatus is sent A resource address, and determine the uniform resource identifier URI of the resource address.
For example, http protocol devices tohttp://xxxxx.com/productKey/deviceName1/uploadIt sends Message, then the URI of target resource address is /productKey/deviceName1/upload.
If it is MQTT agreement, there is the region TOPIC in the data packet of message, that fill in is the URI of target resource address.
Whether the message that equipment is sent, which can reach target resource address, needs permission to control.
For pub/sub communication pattern, target resource address is exactly the address of the theme in cloud server.
Step 102, corresponding default template is searched according to the destination Uniform Resource identifier;
In the embodiment of the present application, URI includes at least 3 sections of segment informations: the/the first segment information seg1/ second segmentation letter Cease seg2/ third segment information seg3.
In the embodiment of the present application, the destination Uniform Resource identifier includes the first object segment information at interval, the Two target segment information and third target segment information;
Then the URI of target resource address is indicated are as follows:/first object segment information/the second target segment information/third target Segment information
The step 102 may include following sub-step:
Sub-step S11, determine each default template for the distribution apparatus the corresponding variate-value of the first variable name or First constant value;
In the embodiment of the present application, the default template successively specify it is multiple indicate template segment informations variable names or Constant value;The multiple template segment information is for indicating the authorization uniform resource identifier;
There is the URI of authorization to provide unified template equipment in the embodiment of the present application.Template includes the multiple of interval Template segment information.Specific form are as follows: the/the first template segment information/the second template segment information/third template segmentation letter Breath.
For MQTT agreement, according to default die plate equipment there is the target resource address of authorization can indicate are as follows: the/the first mould Plate segment information/the second template segment information/third template segment information.
For COAP agreement, according to default die plate equipment there is the target resource address of authorization can indicate are as follows: coap: // $ { endpoint }/first template segment information/the second template segment information/third template segment information.
For http protocol, according to default die plate equipment there is the target resource address of authorization can indicate are as follows: http: // $ { endpoint }/first template segment information/the second template segment information/third template segment information.
Wherein, the default template successively specifies the first variable name or the first constant for indicating the first template segment information Value, the second variable name or the second constant value for indicating the second template segment information, and indicate the of third template segment information Three constant values;
That is presetting template can be with are as follows: the/the first variable name or the first constant value/second variable name or the second constant Value/third constant value.
For example,
/${productKey}/${deviceName}/get
/shadow/${productKey}/update
/broadcast/${productKey}/+/
Wherein, $ { XX } is meant in the variate-value for taking entitled XX variable in some scope.In the embodiment of the present application In, scope can be the context Context of distribution apparatus.
Context is after equipment logs in, and cloud server is filled into session layer, and storage result is with key-value pair (key Value) form storage to data, such as map structure.Context is stored in cloud server, and each equipment connects Independent sessions can all be had by connecing, and each session can have independent context, and record has facility information, the affiliated product of equipment in context Information etc..
For/{ productKey }/{ deviceName }/get this template, which indicates that equipment possesses/equipment The permission of this resource address of affiliated product K ey/ device name/get.
If key1:productKey, value1:123 in the context of equipment;Key2:deviceName, value2: 456.Then the first template segment information is value of the variable in Context of entitled productKey, i.e., 123;First template point Segment information is value of the variable in Context of entitled deviceName, i.e., 456;This is normal for get for third template segment information Magnitude.
Sub-step S12, by the corresponding variate-value of first variable name or the first constant value, with the destination Uniform Resource The identical default template of the first object segment information of identifier, as corresponding with the destination Uniform Resource identifier default Template.
When message-oriented middleware receives message, the destination Uniform Resource mark of the target resource address targeted from the message Know in symbol, extracts first object segment information.
Then it determines the value of the first template segment information of each default template, that is, determines for indicating the first segment information The corresponding variate-value of the first variable name or the first constant value.
By the corresponding variate-value of the first variable name or the first constant value default template identical with first object segment information, As default template corresponding with the destination Uniform Resource identifier.
For example, the target resource address that equipment sends message is /a/b/c, then mould is searched with first object segment information a Version.
If user when opening product, sets prodcutKey=a, then record has prodcutKey=within a context a。
If being configured with following template :/$ { productKey }/$ { deviceName }/upload, the first of the template Template segment information is expressed as productkey=a.
It so can corresponding template/$ according to the first object segment information a in target resource address/a/b/c {productKey}/${deviceName}/upload。
Step 103, determine that the distribution apparatus has the authorization of the resource address of authorization unified according to the default template Resource identifier;
In the embodiment of the present application, resource address is provided with access authority.The authorization ability that equipment needs to have resource address The resource address can be accessed.
There is equipment the resource address of authorization can be arranged by user when registering the equipment.Such as user can be in resource Select some resource address that there is the resource address of authorization as equipment in address list.
In the embodiment of the present application, the step 103 may include following sub-step:
Sub-step S21 obtains the context of the distribution apparatus;
It is hereafter stored in cloud server, each equipment connection there can be independent sessions, and each session there can be list Only context.
Sub-step S22 searches the variable name pair for indicating the template segment information from the context of the distribution apparatus The variate-value answered, using the variate-value as corresponding template segment information;
In the embodiment of the present application, preset template successively specify indicate the first template segment information the first variable name or First constant value, the second variable name or the second constant value for indicating the second template segment information, and indicate the segmentation of third template The third constant value of information.
For example,/the first variable name or the first constant value/second variable name or the second constant value/third constant value.
The sub-step S22 may further include following sub-step:
Sub-step S221 searches corresponding first variable of first variable name from the context of the distribution apparatus Value, using first variate-value as the first template segment information;
If default template specifies the first template segment information to be indicated with the first variable name, from the context lookup names For corresponding first variate-value of the first variable name.
And/or
Sub-step S222 searches corresponding second variable of second variable name from the context of the distribution apparatus Value, using second variate-value as the second template segment information.
If default template specifies the second template segment information to be indicated with the second variable name, from the context lookup names For corresponding second variate-value of the second variable name.
For example, for template/$ { productKey }/$ { deviceName }/get.
First template segment information indicates with variable productKey, the second template segment information variable deviceName It indicates;
The variate-value that variable productKey is then searched from the context of equipment, searches variable from the context The variate-value of deviceName.
Sub-step S23, the constant value for the expression template segment information that the default template is specified are segmented as template and believe Breath.
In the embodiment of the present application, it is constant value that template, which can specify template segment information,.
The sub-step S23 may further include following sub-step:
Sub-step S231, first constant value that the default template is specified, as the first template segment information;
And/or
Sub-step S232, second constant value that the default template is specified, as the second template segment information;
And/or
Sub-step S233, the third constant value that the default template is specified, as third template segment information.
For example, template/shadow/ $ { productKey }/update.The template specifies the first template segment information Constant shadow, third template segment information are constant update.
Step 104, according to the destination Uniform Resource identifier and the authorization uniform resource identifier, described in judgement Whether distribution apparatus has the authorization that message is sent to the target resource address;
In the embodiment of the present application, the destination Uniform Resource identifier includes the first object segment information at interval, the Two target segment information and third target segment information;
The step 104 may include following sub-step:
Sub-step S31, whether the first object segment information and the first template segment information are identical, compare Whether the second target segment information and the second template segment information identical, the third target segment information with Whether the third template segment information is identical;
In the embodiment of the present application, the URI that equipment sends the target resource address of message can be indicated are as follows:/first object Segment information/the second target segment information/third target segment information.
There is the equipment determined according to default template the URI of the resource address of authorization can indicate are as follows: the segmentation of the first template Information/the second template segment information/third template segment information.
In practice, the comparison of segment information can be carried out by way of constructing MVEL expression formula.
For example, for template/$ { productKey }/$ { deviceName }/abc, the MVEL expression formula of construction are as follows:
First object segment information==context.productKey and
Second target segment information==context.deviceName and
Third target segment information==' abc '
When message-oriented middleware receives the message of equipment transmission, message-oriented middleware according to the target resource address of message and Default template compiles the MVEL expression formula.
For example, if equipment has sent 2 message,
The target resource address of message 1 are as follows:/a/b/abc.
The target resource address of message 2 are as follows:/a/b/123.
ProductKey=a, deviceName=b in the context of the equipment.
The MVEL expression formula that so message 1 is constructed are as follows:
' a '==' a ' and ' b '==' b ' and ' abc '==' abc ', the value of the expression formula is true, the first mesh of expression Mark segment information is identical as the first template segment information, and the second target segment information is identical as the second template segment information, Third target segment information is identical as third template segment information.
The MVEL expression formula that message 2 is constructed are as follows:
' a '==' a ' and ' b '==' b ' and ' 123 '==' abc ', because ' 123 '!=' abc ', the expression formula Value is vacation, indicates that third target segment information and third template segment information be not identical.
Sub-step S32, if the corresponding segment information of each intervening sequences is all identical, it is determined that the distribution apparatus have to The target resource address sends the authorization of message.
If first object segment information is identical as the first template segment information, the second target segment information and described second Template segment information is identical, and third target segment information is identical as third template segment information, indicates that distribution apparatus has to mesh Mark the authorization that resource address sends message.
Step 105, if the distribution apparatus has the authorization for sending message to the target resource address, disappear described Breath is sent in target resource address.
Determine distribution apparatus have to target resource address send message authorization after, message-oriented middleware can directly by Message is sent in the target resource address of cloud server.
In the embodiment of the present application, if the step 105 may include: that the distribution apparatus has to the target resource Address sends the authorization of message, then is preset format by the Format adjusting of the message, and the message after adjustment format is sent Into target resource address.
Specifically, the format of message can be adaptation cloud from the Format adjusting of original device protocol by message-oriented middleware The unified format of server.After Format adjusting, then send a message in the target resource address of cloud server.
In the embodiment of the present application, the method can also include:
If the distribution apparatus has the authorization for sending message to the target resource address, described receiving again When the message that distribution apparatus is sent to the target resource address, directly send the message in target resource address.
Specifically, determining that user has resource address and the target resource address of authorization according to default template if having determined It is identical, then it caches and determines that user has the resource address of authorization according to default template.When distribution apparatus is again to the resource address When sending message, then it directly can determine that distribution apparatus has authorization according to the resource address with authorization of caching, directly will The message is adjusted to preset format, and the message after adjustment format is sent in target resource address.
In the embodiment of the present application, to theme TOPIC or URL (the Uniform Resource in cloud server Locator, uniform resource locator) etc. resource address URI (Uniform Resource Identifier, unified resource mark Know symbol) unified template is provided, which is used to indicate that equipment to have the URI of the resource address of communication authority.Work as receiving device When to the message sent to target resource address, determine that current device has the resource address of permission according to template.According to having The resource address of permission and target resource address, judge whether current device sends the permission of message to target resource.For each The equipment of kind agreement can go to determine the resource address that the equipment has permission using unified template.With existing authorization Verification method is compared, and the authority checking of the embodiment of the present application is more unified efficient, reduces the storage overhead of authority record, and can It is deployed in different agreement.
After determining that equipment has permission, the message of the equipment of various agreements is uniformly adjusted to adaptation cloud server Message content is transparent to cloud server by message format.
Referring to Fig. 2, a kind of step flow chart of message treatment method embodiment 2 of the application is shown, specifically can wrap Include following steps:
Step 201, the message in the resource address of server is obtained;
In the embodiment of the present application, the message of the equipment of various agreements is uniformly adjusted to adaptation cloud clothes by message-oriented middleware The message format of business device, is transparent to cloud server for message content.
Message in the resource address of server can be sent to the permission with the resource address by message-oriented middleware Equipment.
Message-oriented middleware supports that pub/sub communication pattern, resource address can be the theme of cloud server.Equipment can be with Subscribe to theme.The message of some theme can be sent to the equipment for having subscribed the theme by message-oriented middleware.
Step 202, the protocol format of receiving device is determined;
In the embodiment of the present application, the resource address can be the theme, and the step 202 may include: determining subscription The protocol format of the receiving device of the theme.
Step 203, the format of the message is converted to the protocol format for being adapted to the receiving device;
Message is stored in cloud server, is stored with the unified format for being adapted to cloud server.Message-oriented middleware Need to be converted to message from the format of adaptation cloud server the protocol format of adapting appts.
For example, needing to convert the message to be adapted to the format of http protocol for HTTP equipment.
For MQTT equipment, need to convert the message to be adapted to the format of MQTT agreement.
For COAP equipment, need to convert the message to be adapted to the format of COAP agreement.
Step 204, the message after after format being turned is sent to corresponding receiving device.
In the embodiment of the present application, the message that cloud server can be sent to equipment is adjusted to be adapted to the association of the equipment The message format of view is simultaneously sent to equipment, to realize interconnecting for message between the equipment of each agreement.
Referring to Fig. 3, a kind of step process of the message treatment method embodiment 1 of Internet of things system of the application is shown Figure, the Internet of things system includes distribution apparatus, the message-oriented middleware communicated with the distribution apparatus, and, with the message The application server of middleware communication, the method may include: that can specifically include following steps:
Step 301, the message-oriented middleware receives the message that the distribution apparatus is sent;
In the embodiment of the present application, Internet of things system can be intelligent farm system, intelligent plant system, smart home system The systems such as system.
The distribution apparatus can be such as sensor, actuator, embedded device or intelligent appliance terminal.
The a part of message-oriented middleware as Internet of Things external member provides publication and reception for equipment and Internet of Things application program The exit passageway of message.Facilitate the two-way communication between equipment and cloud server.
In the embodiment of the present application, message-oriented middleware can support http protocol, COAP agreement and MQTT agreement;And it props up Hold pub/sub communication pattern.
Step 302, the mesh of the targeted target resource address of the message that the message-oriented middleware acquisition distribution apparatus is sent Mark uniform resource identifier;
Step 303, the message-oriented middleware searches corresponding default template according to the destination Uniform Resource identifier;
In the embodiment of the present application, the destination Uniform Resource identifier includes the first object segment information at interval, the Two target segment information and third target segment information;
The step 303 may include following sub-step:
Sub-step S41, the message-oriented middleware determine that each default template is directed to the first variable name of the distribution apparatus Corresponding variate-value or the first constant value;
Sub-step S42, the message-oriented middleware is by the corresponding variate-value of first variable name or the first constant value, with institute The identical default template of first object segment information for stating destination Uniform Resource identifier, as with the destination Uniform Resource mark Know and accords with corresponding default template.
Step 304, the message-oriented middleware determines that the distribution apparatus has the resource of authorization according to the default template The authorization uniform resource identifier of address;
In the embodiment of the present application, the default template successively specify it is multiple indicate template segment informations variable names or Constant value, the multiple template segment information is for indicating the authorization uniform resource identifier;The step 304 may include Following sub-step:
Sub-step S51, the message-oriented middleware obtain the context of the distribution apparatus;
Sub-step S52, the message-oriented middleware is searched from the context of the distribution apparatus indicates the template segmentation The corresponding variate-value of the variable name of information, using the variate-value as corresponding template segment information;
In the embodiment of the present application, the multiple template segment information includes: the first template segment information at interval, second Template segment information and third template segment information;The default template, which successively specifies, indicates the first template segment information The first variable name or the first constant value, indicate the second template segment information the second variable name or the second constant value, Yi Jibiao Show the third constant value of third template segment information;
In the embodiment of the present application, the sub-step S52 can further following sub-step:
Sub-step S521, the message-oriented middleware search first variable name pair from the context of the distribution apparatus The first variate-value answered, using first variate-value as the first template segment information;
And/or
Sub-step S522, the message-oriented middleware search second variable name pair from the context of the distribution apparatus The second variate-value answered, using second variate-value as the second template segment information.
Sub-step S53, the constant value for the expression template segment information that the message-oriented middleware specifies the default template, As template segment information.
In the embodiment of the present application, the sub-step S53 can further following sub-step:
Sub-step S531, first constant value that the message-oriented middleware specifies the default template, as first Template segment information;
And/or
Sub-step S532, second constant value that the message-oriented middleware specifies the default template, as second Template segment information;
And/or
Sub-step S533, the third constant value that the message-oriented middleware specifies the default template, as third Template segment information.
Step 305, the message-oriented middleware is according to the destination Uniform Resource identifier and the authorization unified resource Identifier, judges whether the distribution apparatus has the authorization that message is sent to the target resource address;
In the embodiment of the present application, the step 305 may include following sub-step:
Sub-step S61, the message-oriented middleware first object segment information and first template segmentation are believed Whether identical cease, whether the second target segment information and the second template segment information are identical, and more described the Whether three target segment information and the third template segment information are identical;
Sub-step S62, if the corresponding segment information of each intervening sequences is all identical, described in the message-oriented middleware determination Distribution apparatus has the authorization that message is sent to the target resource address.
Step 306, if the distribution apparatus has the authorization for sending message to the target resource address, the message Middleware is sent the message in the target resource address of the application server.
In the embodiment of the present application, the step 306 may include:
If the distribution apparatus has the authorization for sending message to the target resource address, the message-oriented middleware will The Format adjusting of the message is preset format, and the target that the message after adjustment format is sent to the application server is provided In source address.
In the embodiment of the present application, the method can also include:
If the distribution apparatus has the authorization for sending message to the target resource address, in the message-oriented middleware When receiving the message that the distribution apparatus is sent to the target resource address again, the message-oriented middleware directly will be described Message is sent in target resource address.
Specifically, disappearing if the distribution apparatus has the authorization for sending message to the target resource address described When breath middleware receives the message that the distribution apparatus is sent to the target resource address again, the message-oriented middleware is straight It connects and the message is adjusted to preset format, and the message after adjustment format is sent in target resource address.
In the embodiment of the present application, message-oriented middleware is to theme TOPIC or the URL (Uniform in cloud server Resource Locator, uniform resource locator) etc. resource address URI (Uniform Resource Identifier, Uniform resource identifier) unified template is provided, which is used to indicate that equipment to have the URI of the resource address of communication authority. When receiving device is to the message sent to target resource address, determine current device there is the resource of permission according to template Location.According to permission resource address and target resource address, judge whether current device to target resource sends message Permission.For the equipment of various agreements, can go to determine the resource address that the equipment has permission using unified template.With Existing authority checking method is compared, and the authority checking of the embodiment of the present application is more unified efficient, reduces depositing for authority record Expense is stored up, and deployable in different agreement.
Message-oriented middleware is uniformly adjusted to adaptation cloud after determining that equipment has permission, by the message of the equipment of various agreements The message format for holding server, is transparent to cloud server for message content.
Referring to Fig. 4, a kind of step process of the message treatment method embodiment 2 of Internet of things system of the application is shown Figure, the Internet of things system includes distribution apparatus, the message-oriented middleware communicated with the distribution apparatus, and, with the message The application server of middleware communication, the method may include: that can specifically include following steps:
Step 401, the message-oriented middleware obtains the message in the resource address of the application server;
In the embodiment of the present application, Internet of things system can be intelligent farm system, intelligent plant system, smart home system The systems such as system.
The distribution apparatus can be such as sensor, actuator, embedded device or intelligent appliance terminal.
The a part of message-oriented middleware as Internet of Things external member provides publication and reception for equipment and Internet of Things application program The exit passageway of message.Facilitate the two-way communication between equipment and cloud server.
In the embodiment of the present application, message-oriented middleware can support http protocol, COAP agreement and MQTT agreement;And it props up Hold pub/sub communication pattern.
In the embodiment of the present application, the message of the equipment of various agreements is uniformly adjusted to adaptation cloud clothes by message-oriented middleware The message format of business device, is transparent to cloud server for message content.
Message in the resource address of server can be sent to the permission with the resource address by message-oriented middleware Equipment.
Resource address can be the theme of cloud server.Equipment can subscribe to theme.Message-oriented middleware can be by some The message of theme is sent to the equipment for having subscribed the theme.
Step 402, the message-oriented middleware determines the protocol format for subscribing to equipment;
In the embodiment of the present application, the resource address is the theme;The step 402 may include: among the message Part determines the protocol format for having subscribed the subscription equipment of the theme.
Step 403, the message-oriented middleware, which is converted to the format of the message, is adapted to the agreement lattice for subscribing to equipment Formula;
Step 404, the message after after the message-oriented middleware turns format is sent to corresponding subscription equipment.
In the embodiment of the present application, the message that message-oriented middleware can send cloud server to equipment is adjusted to be adapted to The message format of the agreement of the equipment is simultaneously sent to equipment, to realize interconnecting for message between the equipment of each agreement.
In order to make those skilled in the art can better understand that the embodiment of the present application, below by an example to this Shen Please embodiment be illustrated:
It is referring to Figure 5 the schematic diagram of Internet of things system in the embodiment of the present application.Wherein, Internet of things system includes: to set The upper-level system of standby, message-oriented middleware and cloud server.
Message-oriented middleware includes: HTTP message server, MQTT message server, COAP message server, other message Server, template authorization module and Message routing module.
HTTP message server is responsible for receiving the message that http protocol equipment is sent, and MQTT message server is responsible for reception The message that MQTT protocol devices are sent, COAP message server are responsible for receiving the message that COAP protocol devices are sent.
The embodiment of the present application increases template authorization module and message routing on the basis of existing various message-oriented middlewares Module.
Template authorization module can provide: template configuration compiling, permission compiling, permission template caching function.
Template configuration compilation facility refers to, provides unified mould to the URI of the resource address such as theme in cloud server Plate, the template are used to indicate that equipment to have the URI of the resource address of communication authority.
Such as/$ { productKey }/$ { deviceName }/upload this template represents equipment and is owned by/equipment institute Belong to permission as product key/ device name/upload.
In the embodiment of the present application // between section call a seg (segment, segmentation).
For example, MQTT:/seg1/seg2/seg3
COAP:coap://${endpoint}/seg1/seg2/seg3
HTTP:http: // $ { endpont }/seg1/seg2/seg3
In the embodiment of the present application, the affiliated product key of equipment may be prescribed as seg1, seg2 may be prescribed as equipment Title, seg3 can voluntarily be configured by user.
Permission compilation facility refers to, when receiving device is to the message sent to target resource address, is determined according to template Current device has the resource address of permission.According to permission resource address and target resource address, judge current device Whether the permission of message is sent to target resource.For the equipment of various agreements, it can go to determine using unified template and be somebody's turn to do Equipment has the resource address of permission.
Permission template caching function refers to, after judging equipment with the permission for sending message to some resource address, builds Found the caching of the resource address.When equipment sends message to the resource address again, it can directly authorize and pass through, no longer need to carry out Permission compiling.
Message routing module can provide: message coding decoding function, device distribution formula interactive function, request routing function.
Message coding decoding function refers to, sends resource address message for various protocol devices and is adjusted to adaptation cloud clothes The unified message format of business device.
For example, { " TOPIC ": " resource address of equipment transmission message ", " content ": byte [] }, wherein resource Location has been unified for/seg1/seg2/seg3 as path.Byte [] is the content of message, and the content of message can be with transparent transmission To resource address.
Message coding decoding function further includes that cloud server is sent to the message of equipment, is done according to the agreement of equipment Message encapsulation, to be adapted to corresponding agreement.
Device distribution formula interactive function refers to, establishes a corresponding session to an equipment connection, contains in session and set It is standby whether the information such as online, equipment ip, equipment connection protocol (MQTT, MOAP, HTTP), equipment link address.
Request routing function refers to, is responsible for message distribution and subscription equipment, such as equipment A is given to send message using http protocol In to/TOPIC, and equipment B has subscribed this message using MQTT agreement, then request routing function can turn message MQTT format Equipment B is distributed to by MQTT server simultaneously, realizes interconnecting for message between the equipment of each agreement, and upper layer industry Business system is not necessarily to awareness apparatus connection protocol.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method It closes, but those skilled in the art should understand that, the embodiment of the present application is not limited by the described action sequence, because according to According to the embodiment of the present application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should Know, the embodiments described in the specification are all preferred embodiments, and related movement not necessarily the application is implemented Necessary to example.
Referring to Fig. 6, a kind of structural block diagram of message processing apparatus embodiment 1 of the application is shown, can specifically include Following module:
Destination Uniform Resource identifier obtains module 601, the targeted target of the message for obtaining distribution apparatus transmission The destination Uniform Resource identifier of resource address;
Template searching module 602, for searching corresponding default template according to the destination Uniform Resource identifier;
Uniform resource identifier determining module 603 is authorized, for determining that the distribution apparatus has according to the default template There is the authorization uniform resource identifier of the resource address of authorization;
Judgment module 604 is authorized, for according to the destination Uniform Resource identifier and the authorization unified resource mark Know symbol, judges whether the distribution apparatus has the authorization for sending message to the target resource address;
First message sending module 605 sends message if having for the distribution apparatus to the target resource address Authorization, then send the message in target resource address.
In the embodiment of the present application, the device can also include:
Second message sending module sends awarding for message if having for the distribution apparatus to the target resource address Power, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly send out the message It send into target resource address.
In the embodiment of the present application, the default template successively specify it is multiple indicate template segment informations variable names or Constant value, the multiple template segment information is for indicating the authorization uniform resource identifier;The authorization unified resource mark Knowing symbol determining module 603 may include:
Context acquisition submodule, for obtaining the context of the distribution apparatus;
First template segment information determines submodule, indicates the mould for searching from the context of the distribution apparatus The corresponding variate-value of the variable name of plate segment information, using the variate-value as corresponding template segment information;
Second template segment information determines submodule, the expression template segment information for specifying the default template Constant value, as template segment information.
In the embodiment of the present application, the multiple template segment information includes: the first template segment information at interval, second Template segment information and third template segment information;The default template, which successively specifies, indicates the first template segment information The first variable name or the first constant value, indicate the second template segment information the second variable name or the second constant value, Yi Jibiao Show the third constant value of third template segment information;
The first template segment information determines that submodule may include:
First template segment information determination unit, for searching first variable from the context of the distribution apparatus Corresponding first variate-value of name, using first variate-value as the first template segment information;
And/or
Second template segment information determination unit, for searching second variable from the context of the distribution apparatus Corresponding second variate-value of name, using second variate-value as the second template segment information.
In the embodiment of the present application, the second template segment information determines that submodule may include:
Third template segment information determination unit, first constant value for specifying the default template, as First template segment information;
And/or
4th template segment information determination unit, second constant value for specifying the default template, as Second template segment information;
And/or
5th template segment information determination unit, the third constant value for specifying the default template, as Third template segment information.
In the embodiment of the present application, the destination Uniform Resource identifier includes the first object segment information at interval, the Two target segment information and third target segment information;The authorization judgment module 604 may include:
Comparative sub-module, for the first object segment information and the first template segment information whether phase Together, whether the second target segment information and the second template segment information are identical, the third target point Whether segment information and the third template segment information are identical;
It authorizes and determines submodule, if all identical for the corresponding segment information of each intervening sequences, it is determined that the publication Equipment has the authorization that message is sent to the target resource address.
In the embodiment of the present application, the template searching module 602 may include:
Template Information determines submodule, for determining that each default template is directed to the first variable name pair of the distribution apparatus The variate-value or the first constant value answered;
Target template determines submodule, is used for by the corresponding variate-value of first variable name or the first constant value, with institute The identical default template of first object segment information for stating destination Uniform Resource identifier, as with the destination Uniform Resource mark Know and accords with corresponding default template.
In the embodiment of the present application, the first message sending module 605 may include:
First message sending submodule sends message if having for the distribution apparatus to the target resource address The Format adjusting of the message is then preset format, and the message after adjustment format is sent to target resource address by authorization In.
In the embodiment of the present application, the second message sending module may include:
Second message sending submodule sends message if having for the distribution apparatus to the target resource address Authorization, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly by the message It is adjusted to preset format, and the message after adjustment format is sent in target resource address.
Referring to Fig. 7, a kind of structural block diagram of message processing apparatus embodiment 2 of the application is shown, can specifically include Following module:
Message capturing module 701, the message in resource address for obtaining server;
Protocol format determining module 702, for determining the protocol format of receiving device;
Protocol format conversion module 703, for the format of the message to be converted to the agreement for being adapted to the receiving device Format;
Message transmission module 704 is sent to corresponding receiving device for the message after after turning format.
In the embodiment of the present application, the resource address is the theme;The protocol format determining module 702 may include:
It subscribes to device protocol format and determines submodule, for determining the protocol format for subscribing to the receiving device of the theme.
Referring to Fig. 8, a kind of structural block diagram of the message processing apparatus embodiment 1 of Internet of things system of the application is shown, The Internet of things system includes distribution apparatus, the message-oriented middleware communicated with the distribution apparatus, and, among the message The application server of part communication, the device can specifically include following module:
Positioned at the message reception module 801 of the message-oriented middleware, for receiving the message of the distribution apparatus transmission;
Destination Uniform Resource identifier positioned at the message-oriented middleware obtains module 802, for obtaining distribution apparatus hair The destination Uniform Resource identifier of the targeted target resource address of the message sent;
Positioned at the template searching module 803 of the message-oriented middleware, for being looked into according to the destination Uniform Resource identifier Look for corresponding default template;
Positioned at the authorization uniform resource identifier determining module 804 of the message-oriented middleware, for according to the default mould Plate determines that the distribution apparatus has the authorization uniform resource identifier of the resource address of authorization;
Positioned at the authorization judgment module 805 of the message-oriented middleware, for according to the destination Uniform Resource identifier with And the authorization uniform resource identifier, judge whether the distribution apparatus has to the target resource address and sends message Authorization;
Positioned at the first message sending module 806 of the message-oriented middleware, if having for the distribution apparatus to described Target resource address sends the authorization of message, then sends the message in the target resource address of the application server.
In the embodiment of the present application, the device can also include:
Positioned at the second message sending module of the message-oriented middleware, if having for the distribution apparatus to the target Resource address sends the authorization of message, then receives the distribution apparatus again to the target resource in the message-oriented middleware When the message that address is sent, directly send the message in target resource address.
In the embodiment of the present application, the default template successively specify it is multiple indicate template segment informations variable names or Constant value, the multiple template segment information is for indicating the authorization uniform resource identifier;The authorization unified resource mark Knowing symbol determining module 804 may include:
Context acquisition submodule, for obtaining the context of the distribution apparatus;
First template segment information determines submodule, indicates the mould for searching from the context of the distribution apparatus The corresponding variate-value of the variable name of plate segment information, using the variate-value as corresponding template segment information;
Second template segment information determines submodule, the expression template segment information for specifying the default template Constant value, as template segment information.
In the embodiment of the present application, the multiple template segment information includes: the first template segment information at interval, second Template segment information and third template segment information;The default template, which successively specifies, indicates the first template segment information The first variable name or the first constant value, indicate the second template segment information the second variable name or the second constant value, Yi Jibiao Show the third constant value of third template segment information;
The first template segment information determines that submodule may include:
First template segment information determination unit, for searching first variable from the context of the distribution apparatus Corresponding first variate-value of name, using first variate-value as the first template segment information;
And/or
Second template segment information determination unit, for searching second variable from the context of the distribution apparatus Corresponding second variate-value of name, using second variate-value as the second template segment information.
In the embodiment of the present application, the second template segment information determines that submodule may include:
Third template segment information determination unit, first constant value for specifying the default template, as First template segment information;
And/or
4th template segment information determination unit, second constant value for specifying the default template, as Second template segment information;
And/or
5th template segment information determination unit, the third constant value for specifying the default template, as Third template segment information.
In the embodiment of the present application, the destination Uniform Resource identifier includes the first object segment information at interval, the Two target segment information and third target segment information;
The authorization judgment module 805 may include:
Comparative sub-module, for the first object segment information and the first template segment information whether phase Together, whether the second target segment information and the second template segment information are identical, the third target point Whether segment information and the third template segment information are identical;
It authorizes and determines submodule, if all identical for the corresponding segment information of each intervening sequences, it is determined that the publication Equipment has the authorization that message is sent to the target resource address.
In the embodiment of the present application, the template searching module 803 may include:
Template Information determines submodule, for determining that each default template is directed to the first variable name pair of the distribution apparatus The variate-value or the first constant value answered;
Target template determines submodule, is used for by the corresponding variate-value of first variable name or the first constant value, with institute The identical default template of first object segment information for stating destination Uniform Resource identifier, as with the destination Uniform Resource mark Know and accords with corresponding default template.
In the embodiment of the present application, the first message sending module 806 may include:
First message sending submodule sends message if having for the distribution apparatus to the target resource address The Format adjusting of the message is then preset format, and the message after adjustment format is sent to target resource address by authorization In.
In the embodiment of the present application, the second message sending module may include:
Second message sending submodule sends message if having for the distribution apparatus to the target resource address Authorization, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly by the message It is adjusted to preset format, and the message after adjustment format is sent in target resource address.
Referring to Fig. 9, a kind of structural block diagram of the message processing apparatus embodiment 2 of Internet of things system of the application is shown, The Internet of things system includes distribution apparatus, the message-oriented middleware communicated with the distribution apparatus, and, among the message The application server of part communication, the device can specifically include following module:
Positioned at the message capturing module 901 of the message-oriented middleware, for obtaining the resource address of the application server In message;
Positioned at the protocol format determining module 902 of the message-oriented middleware, for determining the protocol format for subscribing to equipment;
It is suitable for being converted to the format of the message positioned at the protocol format conversion module 903 of the message-oriented middleware With the protocol format for subscribing to equipment;
Positioned at the message transmission module 904 of the message-oriented middleware, phase is sent to for the message after after turning format The subscription equipment answered.
In the embodiment of the present application, the resource address is the theme;The protocol format determining module 902 may include:
It subscribes to device protocol format and determines submodule, for determining the agreement lattice for having subscribed the subscription equipment of the theme Formula.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
The embodiment of the present application also provides a kind of devices, comprising:
One or more processors;With
One or more machine readable medias of instruction are stored thereon with, are executed when by one or more of processors When, so that described device executes method described in the embodiment of the present application.
The embodiment of the present application also provides one or more machine readable medias, are stored thereon with instruction, when by one or When multiple processors execute, so that device executes method described in the embodiment of the present application.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiments of the present application may be provided as method, apparatus or calculating Machine program product.Therefore, the embodiment of the present application can be used complete hardware embodiment, complete software embodiment or combine software and The form of the embodiment of hardware aspect.Moreover, the embodiment of the present application can be used one or more wherein include computer can With in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code The form of the computer program product of implementation.
The embodiment of the present application is referring to according to the method for the embodiment of the present application, terminal device (system) and computer program The flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructions In each flow and/or block and flowchart and/or the block diagram in process and/or box combination.It can provide these Computer program instructions are set to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminals Standby processor is to generate a machine, so that being held by the processor of computer or other programmable data processing terminal devices Capable instruction generates for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagram The device of specified function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devices In computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packet The manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagram The function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing terminal devices, so that Series of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thus The instruction executed on computer or other programmable terminal equipments is provided for realizing in one or more flows of the flowchart And/or in one or more blocks of the block diagram specify function the step of.
Although preferred embodiments of the embodiments of the present application have been described, once a person skilled in the art knows bases This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as Including preferred embodiment and all change and modification within the scope of the embodiments of the present application.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap Those elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, article Or the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limited Element, it is not excluded that there is also other identical elements in process, method, article or the terminal device for including the element.
Above to a kind of message treatment method provided herein, a kind of message processing apparatus, a kind of Internet of things system Message treatment method and a kind of message processing apparatus of Internet of things system, be described in detail, it is used herein specifically The principle and implementation of this application are described for a example, the application that the above embodiments are only used to help understand Method and its core concept;At the same time, for those skilled in the art is being embodied according to the thought of the application There will be changes in mode and application range, in conclusion the contents of this specification should not be construed as limiting the present application.

Claims (46)

1. a kind of message treatment method characterized by comprising
The destination Uniform Resource identifier of the targeted target resource address of the message that acquisition distribution apparatus is sent;
Corresponding default template is searched according to the destination Uniform Resource identifier;
Determine that the distribution apparatus has the authorization uniform resource identifier of the resource address of authorization according to the default template;
According to the destination Uniform Resource identifier and the authorization uniform resource identifier, whether the distribution apparatus is judged With the authorization for sending message to the target resource address;
If the distribution apparatus has the authorization for sending message to the target resource address, target is sent the message to In resource address.
2. the method according to claim 1, wherein further include:
If the distribution apparatus has the authorization for sending message to the target resource address, the publication is being received again When the message that equipment is sent to the target resource address, directly send the message in target resource address.
3. method according to claim 1 or 2, which is characterized in that the default template successively specifies multiple expression moulds The variable name or constant value of plate segment information, the multiple template segment information is for indicating the authorization uniform resource identifier Symbol;It is described to determine that the distribution apparatus has the authorization uniform resource identifier of the resource address of authorization according to the default template The step of include:
Obtain the context of the distribution apparatus;
The corresponding variate-value of variable name for indicating the template segment information is searched from the context of the distribution apparatus, by institute Variate-value is stated as corresponding template segment information;
The constant value for the expression template segment information that the default template is specified, as template segment information.
4. according to the method described in claim 3, it is characterized in that, the multiple template segment information includes: the first of interval Template segment information, the second template segment information and third template segment information;The default template successively specifies expression The first variable name or the first constant value of first template segment information, the second variable name for indicating the second template segment information or the Two constant values, and indicate the third constant value of third template segment information;
It is described that the corresponding variate-value of variable name for indicating the template segment information is searched from the context of the distribution apparatus, Include: using the variate-value as the step of corresponding template segment information
Corresponding first variate-value of first variable name is searched from the context of the distribution apparatus, by first variable Value is used as the first template segment information;
And/or
Corresponding second variate-value of second variable name is searched from the context of the distribution apparatus, by second variable Value is used as the second template segment information.
5. according to the method described in claim 4, it is characterized in that, the expression template that the default template is specified is segmented The constant value of information includes: as the step of template segment information
First constant value that the default template is specified, as the first template segment information;
And/or
Second constant value that the default template is specified, as the second template segment information;
And/or
The third constant value that the default template is specified, as third template segment information.
6. according to the method described in claim 4, it is characterized in that, the destination Uniform Resource identifier includes the first of interval Target segment information, the second target segment information and third target segment information;It is described according to the destination Uniform Resource mark Know symbol and the authorization uniform resource identifier, judges whether the distribution apparatus has to the target resource address and send The step of authorization of message includes:
Compare the first object segment information and whether the first template segment information is identical, second target point Whether segment information and the second template segment information are identical, the third target segment information and the third template point Whether segment information is identical;
If the corresponding segment information of each intervening sequences is all identical, it is determined that the distribution apparatus has to the target resource The authorization of location transmission message.
7. according to the method described in claim 6, it is characterized in that, described according to destination Uniform Resource identifier lookup pair The step of default template answered includes:
Determine that each default template is directed to the corresponding variate-value of the first variable name or the first constant value of the distribution apparatus;
The first mesh by the corresponding variate-value of first variable name or the first constant value, with the destination Uniform Resource identifier The identical default template of segment information is marked, as default template corresponding with the destination Uniform Resource identifier.
8. the method according to claim 1, wherein described send the message in target resource address Step includes:
It is preset format by the Format adjusting of the message, and the message after adjustment format is sent in target resource address.
9. according to the method described in claim 2, it is characterized in that, described receiving the distribution apparatus to the mesh again When marking the message that resource address is sent, the step directly sent the message in target resource address includes:
When receiving the message that the distribution apparatus is sent to the target resource address again, directly the message is adjusted For preset format, and it is sent to the message after format is adjusted in target resource address.
10. a kind of message treatment method characterized by comprising
Obtain the message in the resource address of server;
Determine the protocol format of receiving device;
The format of the message is converted to the protocol format for being adapted to the receiving device;
Message after after format is turned is sent to corresponding receiving device.
11. according to the method described in claim 10, it is characterized in that, the resource address is the theme;Determining receive sets The step of standby protocol format includes:
Determine the protocol format for subscribing to the receiving device of the theme.
12. a kind of message treatment method of Internet of things system, which is characterized in that the Internet of things system includes distribution apparatus, with The message-oriented middleware of the distribution apparatus communication, and, the application server communicated with the message-oriented middleware, the method Include:
The message-oriented middleware receives the message that the distribution apparatus is sent;
The destination Uniform Resource mark of the targeted target resource address of the message that the message-oriented middleware acquisition distribution apparatus is sent Know symbol;
The message-oriented middleware searches corresponding default template according to the destination Uniform Resource identifier;
The message-oriented middleware determines that there is the distribution apparatus authorization of the resource address of authorization to unite according to the default template One resource identifier;
The message-oriented middleware judges institute according to the destination Uniform Resource identifier and the authorization uniform resource identifier State whether distribution apparatus has the authorization that message is sent to the target resource address;
If the distribution apparatus has the authorization for sending message to the target resource address, the message-oriented middleware will be described Message is sent in the target resource address of the application server.
13. according to the method for claim 12, which is characterized in that further include:
If the distribution apparatus have to the target resource address send message authorization, the message-oriented middleware again When receiving the message that the distribution apparatus is sent to the target resource address, the message-oriented middleware is directly by the message It is sent in target resource address.
14. method according to claim 12 or 13, which is characterized in that the default template successively specifies multiple expressions The variable name or constant value of template segment information, the multiple template segment information is for indicating the authorization uniform resource identifier Symbol;The message-oriented middleware determines that the distribution apparatus has the authorization of the resource address of authorization unified according to the default template The step of resource identifier includes:
The message-oriented middleware obtains the context of the distribution apparatus;
The message-oriented middleware searches the variable name pair for indicating the template segment information from the context of the distribution apparatus The variate-value answered, using the variate-value as corresponding template segment information;
The constant value for the expression template segment information that the message-oriented middleware specifies the default template is segmented as template and believes Breath.
15. according to the method for claim 14, which is characterized in that the multiple template segment information includes: the of interval One template segment information, the second template segment information and third template segment information;The default template successively specifies table Show the first template segment information the first variable name or the first constant value, indicate the second template segment information the second variable name or Second constant value, and indicate the third constant value of third template segment information;
The message-oriented middleware searches the variable name pair for indicating the template segment information from the context of the distribution apparatus The variate-value answered includes: using the variate-value as the step of corresponding template segment information
The message-oriented middleware searches corresponding first variate-value of first variable name from the context of the distribution apparatus, Using first variate-value as the first template segment information;
And/or
The message-oriented middleware searches corresponding second variate-value of second variable name from the context of the distribution apparatus, Using second variate-value as the second template segment information.
16. according to the method for claim 15, which is characterized in that the message-oriented middleware specifies the default template Indicate template segment information constant value, include: as the step of template segment information
First constant value that the message-oriented middleware specifies the default template, as the first template segment information;
And/or
Second constant value that the message-oriented middleware specifies the default template, as the second template segment information;
And/or
The third constant value that the message-oriented middleware specifies the default template, as third template segment information.
17. according to the method for claim 15, which is characterized in that the destination Uniform Resource identifier includes the of interval One target segment information, the second target segment information and third target segment information;
The message-oriented middleware judges institute according to the destination Uniform Resource identifier and the authorization uniform resource identifier State distribution apparatus whether have to the target resource address send message authorization the step of include:
Whether the message-oriented middleware first object segment information and the first template segment information are identical, compare Whether the second target segment information and the second template segment information identical, the third target segment information with Whether the third template segment information is identical;
If the corresponding segment information of each intervening sequences is all identical, the message-oriented middleware determine the distribution apparatus have to The target resource address sends the authorization of message.
18. according to the method for claim 17, which is characterized in that the message-oriented middleware is according to the destination Uniform Resource Identifier search corresponding default template the step of include:
The message-oriented middleware determine each default template for the distribution apparatus the corresponding variate-value of the first variable name or First constant value;
The message-oriented middleware is by the corresponding variate-value of first variable name or the first constant value, with the destination Uniform Resource The identical default template of the first object segment information of identifier, as corresponding with the destination Uniform Resource identifier default Template.
19. according to the method for claim 12, which is characterized in that the message-oriented middleware sends the message to described Step in the target resource address of application server includes:
The Format adjusting of the message is preset format by the message-oriented middleware, and the message after adjustment format is sent to institute It states in the target resource address of application server.
20. according to the method for claim 13, which is characterized in that it is described received again in the message-oriented middleware it is described When the message that distribution apparatus is sent to the target resource address, the message-oriented middleware directly sends the message to target Step in resource address includes:
It is described when the message-oriented middleware receives the message that the distribution apparatus is sent to the target resource address again The message is directly adjusted to preset format by message-oriented middleware, and the message after adjustment format is sent to target resource address In.
21. a kind of message treatment method of Internet of things system, which is characterized in that the Internet of things system includes subscribing to equipment, with The message-oriented middleware for subscribing to equipment communication, and, the application server communicated with the message-oriented middleware, the method Include:
The message-oriented middleware obtains the message in the resource address of the application server;
The message-oriented middleware determines the protocol format for subscribing to equipment;
The message-oriented middleware, which is converted to the format of the message, is adapted to the protocol format for subscribing to equipment;
Message after format is turned rear by the message-oriented middleware is sent to corresponding subscription equipment.
22. according to the method for claim 21, which is characterized in that the resource address is the theme;The message-oriented middleware Determine subscribe to equipment protocol format the step of include:
The message-oriented middleware determines the protocol format for having subscribed the subscription equipment of the theme.
23. a kind of message processing apparatus characterized by comprising
Destination Uniform Resource identifier obtains module, the targeted target resource address of the message for obtaining distribution apparatus transmission Destination Uniform Resource identifier;
Template searching module, for searching corresponding default template according to the destination Uniform Resource identifier;
Uniform resource identifier determining module is authorized, for determining that the distribution apparatus has authorization according to the default template The authorization uniform resource identifier of resource address;
Judgment module is authorized, for sentencing according to the destination Uniform Resource identifier and the authorization uniform resource identifier Whether the distribution apparatus that breaks has the authorization that message is sent to the target resource address;
First message sending module, if having the authorization for sending message to the target resource address for the distribution apparatus, It then sends the message in target resource address.
24. device according to claim 23, which is characterized in that further include:
Second message sending module, if having the authorization for sending message to the target resource address for the distribution apparatus, Then when receiving the message that the distribution apparatus is sent to the target resource address again, directly send the message to In target resource address.
25. the device according to claim 23 or 24, which is characterized in that the default template successively specifies multiple expressions The variable name or constant value of template segment information, the multiple template segment information is for indicating the authorization uniform resource identifier Symbol;The authorization uniform resource identifier determining module includes:
Context acquisition submodule, for obtaining the context of the distribution apparatus;
First template segment information determines submodule, indicates the template point for searching from the context of the distribution apparatus The corresponding variate-value of the variable name of segment information, using the variate-value as corresponding template segment information;
Second template segment information determines submodule, the constant of the expression template segment information for specifying the default template Value, as template segment information.
26. device according to claim 25, which is characterized in that the multiple template segment information includes: the of interval One template segment information, the second template segment information and third template segment information;The default template successively specifies table Show the first template segment information the first variable name or the first constant value, indicate the second template segment information the second variable name or Second constant value, and indicate the third constant value of third template segment information;
The first template segment information determines that submodule includes:
First template segment information determination unit, for searching first variable name pair from the context of the distribution apparatus The first variate-value answered, using first variate-value as the first template segment information;
And/or
Second template segment information determination unit, for searching second variable name pair from the context of the distribution apparatus The second variate-value answered, using second variate-value as the second template segment information.
27. device according to claim 26, which is characterized in that the second template segment information determines submodule packet It includes:
Third template segment information determination unit, first constant value for specifying the default template, as first Template segment information;
And/or
4th template segment information determination unit, second constant value for specifying the default template, as second Template segment information;
And/or
5th template segment information determination unit, the third constant value for specifying the default template, as third Template segment information.
28. device according to claim 26, which is characterized in that the destination Uniform Resource identifier includes the of interval One target segment information, the second target segment information and third target segment information;The authorization judgment module includes:
Comparative sub-module, it is whether identical for the first object segment information and the first template segment information, than Whether the second target segment information and the second template segment information are identical, the third target segment information It is whether identical as the third template segment information;
It authorizes and determines submodule, if all identical for the corresponding segment information of each intervening sequences, it is determined that the distribution apparatus With the authorization for sending message to the target resource address.
29. device according to claim 28, which is characterized in that the template searching module includes:
Template Information determines submodule, for determining that each default template is corresponding for the first variable name of the distribution apparatus Variate-value or the first constant value;
Target template determines submodule, is used for by the corresponding variate-value of first variable name or the first constant value, with the mesh Mark uniform resource identifier the identical default template of first object segment information, as with the destination Uniform Resource identifier Corresponding default template.
30. device according to claim 23, which is characterized in that the first message sending module includes:
First message sending submodule sends awarding for message if having for the distribution apparatus to the target resource address The Format adjusting of the message is then preset format, and the message after adjustment format is sent in target resource address by power.
31. device according to claim 24, which is characterized in that the second message sending module includes:
Second message sending submodule sends awarding for message if having for the distribution apparatus to the target resource address Power, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly by the message tune Whole is preset format, and the message after adjustment format is sent in target resource address.
32. a kind of message processing apparatus characterized by comprising
Message capturing module, the message in resource address for obtaining server;
Protocol format determining module, for determining the protocol format of receiving device;
Protocol format conversion module, for the format of the message to be converted to the protocol format for being adapted to the receiving device;
Message transmission module is sent to corresponding receiving device for the message after after turning format.
33. device according to claim 32, which is characterized in that the resource address is the theme;The protocol format is true Cover half block includes:
It subscribes to device protocol format and determines submodule, for determining the protocol format for subscribing to the receiving device of the theme.
34. a kind of message processing apparatus of Internet of things system, which is characterized in that the Internet of things system includes distribution apparatus, with The message-oriented middleware of the distribution apparatus communication, and, the application server communicated with the message-oriented middleware, the device Include:
Positioned at the message reception module of the message-oriented middleware, for receiving the message of the distribution apparatus transmission;
Destination Uniform Resource identifier positioned at the message-oriented middleware obtains module, for obtaining the message of distribution apparatus transmission The destination Uniform Resource identifier of targeted target resource address;
It is corresponding for being searched according to the destination Uniform Resource identifier positioned at the template searching module of the message-oriented middleware Default template;
Positioned at the authorization uniform resource identifier determining module of the message-oriented middleware, for determining institute according to the default template Stating distribution apparatus has the authorization uniform resource identifier of resource address of authorization;
Positioned at the authorization judgment module of the message-oriented middleware, for according to the destination Uniform Resource identifier and described awarding Uniform resource identifier is weighed, judges whether the distribution apparatus has the authorization for sending message to the target resource address;
Positioned at the first message sending module of the message-oriented middleware, if having for the distribution apparatus to the target resource Address sends the authorization of message, then sends the message in the target resource address of the application server.
35. device according to claim 34, which is characterized in that further include:
Positioned at the second message sending module of the message-oriented middleware, if having for the distribution apparatus to the target resource Address sends the authorization of message, then receives the distribution apparatus again to the target resource address in the message-oriented middleware When the message of transmission, directly send the message in target resource address.
36. the device according to claim 34 or 35, which is characterized in that the default template successively specifies multiple expressions The variable name or constant value of template segment information, the multiple template segment information is for indicating the authorization uniform resource identifier Symbol;The authorization uniform resource identifier determining module includes:
Context acquisition submodule, for obtaining the context of the distribution apparatus;
First template segment information determines submodule, indicates the template point for searching from the context of the distribution apparatus The corresponding variate-value of the variable name of segment information, using the variate-value as corresponding template segment information;
Second template segment information determines submodule, the constant of the expression template segment information for specifying the default template Value, as template segment information.
37. device according to claim 36, which is characterized in that the multiple template segment information includes: the of interval One template segment information, the second template segment information and third template segment information;The default template successively specifies table Show the first template segment information the first variable name or the first constant value, indicate the second template segment information the second variable name or Second constant value, and indicate the third constant value of third template segment information;
The first template segment information determines that submodule includes:
First template segment information determination unit, for searching first variable name pair from the context of the distribution apparatus The first variate-value answered, using first variate-value as the first template segment information;
And/or
Second template segment information determination unit, for searching second variable name pair from the context of the distribution apparatus The second variate-value answered, using second variate-value as the second template segment information.
38. according to the method for claim 37, which is characterized in that the second template segment information determines submodule packet It includes:
Third template segment information determination unit, first constant value for specifying the default template, as first Template segment information;
And/or
4th template segment information determination unit, second constant value for specifying the default template, as second Template segment information;
And/or
5th template segment information determination unit, the third constant value for specifying the default template, as third Template segment information.
39. the device according to claim 37, which is characterized in that the destination Uniform Resource identifier includes the of interval One target segment information, the second target segment information and third target segment information;
The authorization judgment module includes:
Comparative sub-module, it is whether identical for the first object segment information and the first template segment information, than Whether the second target segment information and the second template segment information are identical, the third target segment information It is whether identical as the third template segment information;
It authorizes and determines submodule, if all identical for the corresponding segment information of each intervening sequences, it is determined that the distribution apparatus With the authorization for sending message to the target resource address.
40. device according to claim 39, which is characterized in that the template searching module includes:
Template Information determines submodule, for determining that each default template is corresponding for the first variable name of the distribution apparatus Variate-value or the first constant value;
Target template determines submodule, is used for by the corresponding variate-value of first variable name or the first constant value, with the mesh Mark uniform resource identifier the identical default template of first object segment information, as with the destination Uniform Resource identifier Corresponding default template.
41. device according to claim 34, which is characterized in that the first message sending module includes:
First message sending submodule sends awarding for message if having for the distribution apparatus to the target resource address The Format adjusting of the message is then preset format, and the message after adjustment format is sent in target resource address by power.
42. device according to claim 35, which is characterized in that the second message sending module includes:
Second message sending submodule sends awarding for message if having for the distribution apparatus to the target resource address Power, then when receiving the message that the distribution apparatus is sent to the target resource address again, directly by the message tune Whole is preset format, and the message after adjustment format is sent in target resource address.
43. a kind of message processing apparatus of Internet of things system, which is characterized in that the Internet of things system includes subscribing to equipment, with The message-oriented middleware for subscribing to equipment communication, and, the application server communicated with the message-oriented middleware, the device Include:
Positioned at the message capturing module of the message-oriented middleware, disappearing in the resource address for obtaining the application server Breath;
Positioned at the protocol format determining module of the message-oriented middleware, for determining the protocol format for subscribing to equipment;
Positioned at the protocol format conversion module of the message-oriented middleware, ordered described in adaptation for being converted to the format of the message Read the protocol format of equipment;
Positioned at the message transmission module of the message-oriented middleware, corresponding subscription is sent to for the message after after turning format Equipment.
44. device according to claim 43, which is characterized in that the resource address is the theme;The protocol format is true Cover half block includes:
It subscribes to device protocol format and determines submodule, for determining the protocol format for having subscribed the subscription equipment of the theme.
45. a kind of device characterized by comprising
One or more processors;With
One or more machine readable medias of instruction are stored thereon with, when being executed by one or more of processors, are made The methods for obtaining the one or more that described device is executed as described in claim 1-9 or 10-11 or 12-20 or 21-22.
46. one or more machine readable medias, are stored thereon with instruction, when executed by one or more processors, so that Device executes one or more methods as described in claim 1-9 or 10-11 or 12-20 or 21-22.
CN201711123895.8A 2017-11-14 2017-11-14 The message treatment method and device of a kind of Message Processing, Internet of things system Pending CN109788014A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711123895.8A CN109788014A (en) 2017-11-14 2017-11-14 The message treatment method and device of a kind of Message Processing, Internet of things system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711123895.8A CN109788014A (en) 2017-11-14 2017-11-14 The message treatment method and device of a kind of Message Processing, Internet of things system

Publications (1)

Publication Number Publication Date
CN109788014A true CN109788014A (en) 2019-05-21

Family

ID=66493598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711123895.8A Pending CN109788014A (en) 2017-11-14 2017-11-14 The message treatment method and device of a kind of Message Processing, Internet of things system

Country Status (1)

Country Link
CN (1) CN109788014A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113359A (en) * 2019-05-28 2019-08-09 济南浪潮高新科技投资发展有限公司 A kind of platform of internet of things protocol fitting method
CN110417815A (en) * 2019-08-28 2019-11-05 四川长虹电器股份有限公司 The method of Internet of Things cloud platform Unified Device protocol conversion
CN110430219A (en) * 2019-08-24 2019-11-08 深圳旦倍科技有限公司 Method and system of the various protocols internet of things equipment from adaptation
CN111027298A (en) * 2019-05-31 2020-04-17 珠海随变科技有限公司 Message sending method, system, computer device and storage medium
CN111610765A (en) * 2020-05-25 2020-09-01 珠海格力电器股份有限公司 Distributed message control device and method and building control system
CN111669716A (en) * 2020-04-30 2020-09-15 杭州涂鸦信息技术有限公司 Communication method and communication system of network interphone
CN113448757A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1748201A (en) * 2003-02-06 2006-03-15 国际商业机器公司 Data-driven application integration adapters
CN101690098A (en) * 2007-06-28 2010-03-31 朗讯科技公司 Method and apparatus for providing protocol translation in support of IMS services
CN102282825A (en) * 2010-12-14 2011-12-14 华为技术有限公司 Method and device for streaming media to request address mapping and cache nodes in content delivery network
CN104023021A (en) * 2014-06-13 2014-09-03 珠海市君天电子科技有限公司 File transfer method and file transfer device
CN105122767A (en) * 2013-04-12 2015-12-02 高通股份有限公司 Methods for delivery of flows of objects over broadcast/multicast enabled networks
CN105763426A (en) * 2016-04-12 2016-07-13 北京理工大学 Multiprotocol instant messaging system-based Internet of Things business processing system
US9565271B1 (en) * 2014-10-10 2017-02-07 Go Daddy Operating Company, LLC Methods for website version control using bucket cookies

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1748201A (en) * 2003-02-06 2006-03-15 国际商业机器公司 Data-driven application integration adapters
CN101690098A (en) * 2007-06-28 2010-03-31 朗讯科技公司 Method and apparatus for providing protocol translation in support of IMS services
CN102282825A (en) * 2010-12-14 2011-12-14 华为技术有限公司 Method and device for streaming media to request address mapping and cache nodes in content delivery network
CN105122767A (en) * 2013-04-12 2015-12-02 高通股份有限公司 Methods for delivery of flows of objects over broadcast/multicast enabled networks
CN104023021A (en) * 2014-06-13 2014-09-03 珠海市君天电子科技有限公司 File transfer method and file transfer device
US9565271B1 (en) * 2014-10-10 2017-02-07 Go Daddy Operating Company, LLC Methods for website version control using bucket cookies
CN105763426A (en) * 2016-04-12 2016-07-13 北京理工大学 Multiprotocol instant messaging system-based Internet of Things business processing system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113359A (en) * 2019-05-28 2019-08-09 济南浪潮高新科技投资发展有限公司 A kind of platform of internet of things protocol fitting method
CN111027298A (en) * 2019-05-31 2020-04-17 珠海随变科技有限公司 Message sending method, system, computer device and storage medium
CN110430219A (en) * 2019-08-24 2019-11-08 深圳旦倍科技有限公司 Method and system of the various protocols internet of things equipment from adaptation
CN110417815A (en) * 2019-08-28 2019-11-05 四川长虹电器股份有限公司 The method of Internet of Things cloud platform Unified Device protocol conversion
CN111669716A (en) * 2020-04-30 2020-09-15 杭州涂鸦信息技术有限公司 Communication method and communication system of network interphone
CN111669716B (en) * 2020-04-30 2022-04-12 杭州涂鸦信息技术有限公司 Communication method and communication system of network interphone
CN111610765A (en) * 2020-05-25 2020-09-01 珠海格力电器股份有限公司 Distributed message control device and method and building control system
CN113448757A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system

Similar Documents

Publication Publication Date Title
CN109788014A (en) The message treatment method and device of a kind of Message Processing, Internet of things system
US10492048B2 (en) Service layer resource propagation across domains
CN104956645B (en) URL parameter insertion and addition in self adaptation stream
US10063649B2 (en) Data translation using a proxy service
CN103209223B (en) distributed application session information sharing method, system and application server
CN107733922A (en) Method and apparatus for calling service
US20140244809A1 (en) Service configuration method and apparatus
US8396941B2 (en) Digital living network alliance (DLNA) server that serves contents from IVL services
KR101560185B1 (en) Method for controlling device using URL in distributed network environment and apparatus thereof
CN107113454A (en) Configuration, which is quoted, is used for the inventory file for the infrastructure services provider that adaptive streaming transmits video
CN101405761B (en) For service reception and the method and system processing data
KR20080064835A (en) Network communications in an industrial automation environment
EP2801181A1 (en) Consolidated data services apparatus and method
US8725857B2 (en) Dynamic query services and methods
US10495336B2 (en) Energy operations across domains
CN109218368A (en) Realize method, apparatus, electronic equipment and the readable medium of Http reverse proxy
CN101510881A (en) Method and device for providing web page
US9197501B2 (en) Zero-step auto-customization of mobile applications
KR20160058949A (en) Method for providing a client device with a media asset
US11936749B2 (en) Cross-domain discovery between service layer systems and web of things systems
JP2002196932A (en) Extensible providing mechanism for service gateway
CN115412602A (en) Data parsing and transferring method, device, equipment and medium for digital twin
CN103220297A (en) Method for carrying out multi-screen interaction through social network
CN101889310A (en) Organizing and publishing assets in UPnP networks
CN107948005B (en) Internet of things protocol updating method and device

Legal Events

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

Application publication date: 20190521

RJ01 Rejection of invention patent application after publication