CN107124421B - Communication means, multi-protocol gateway equipment based on multi-protocols and can storage medium - Google Patents
Communication means, multi-protocol gateway equipment based on multi-protocols and can storage medium Download PDFInfo
- Publication number
- CN107124421B CN107124421B CN201710329826.6A CN201710329826A CN107124421B CN 107124421 B CN107124421 B CN 107124421B CN 201710329826 A CN201710329826 A CN 201710329826A CN 107124421 B CN107124421 B CN 107124421B
- Authority
- CN
- China
- Prior art keywords
- data frame
- frame
- json
- data
- protocol
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/18—Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Communication Control (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
The present invention provides a kind of communication means based on multi-protocols, and described method includes following steps: obtaining the source signal that source device is sent, the default data frame of source signal includes one or more communication protocol data frames;The default data frame of source signal is converted into normal data frame;Parsing is carried out to normal data frame and obtains Json data frame;Parsing is carried out to Json data frame and obtains the control parameter of target device, and the control parameter of target device is sent to the target device.The present invention also provides a kind of multi-protocol gateway equipment and can storage medium.Communication means based on multi-protocols of the invention, multi-protocol gateway equipment and can storage medium, solve the problems, such as that different communication mode needs to access multiple gateways, improve the versatility of gateway, conversion between various communications protocols is more convenient, can satisfy the demand of the building managements such as air-conditioning system communication.
Description
Technical field
The present invention relates to fields of communication technology, more particularly to a kind of communication means based on multi-protocols, multi-protocol gateway
Equipment and can storage medium.
Background technique
Generally, the most of conversion for only supporting single communication protocol of gateway, part gateway can be realized multi-communication protocol
Conversion, but above-mentioned multi-protocol gateway only supports Modbus, and the communication protocols such as CAN are unable to satisfy air-conditioning system centralized control
Demand, the versatility of gateway is poor.
Summary of the invention
In view of the problem that the versatility of above-mentioned gateway is poor, it is logical based on multi-protocols that the purpose of the present invention is to provide a kind of
Letter method, multi-protocol gateway equipment and can storage medium, improve the versatility of gateway, can satisfy air-conditioning system etc. concentration
The demand of control.
To achieve the above object, the present invention adopts the following technical scheme:
A kind of communication means based on multi-protocols, described method includes following steps:
The source signal that source device is sent is obtained, the default data frame of the source signal includes one or more communication protocol numbers
According to frame;
The default data frame of the source signal is converted into normal data frame;
Parsing is carried out to the normal data frame and obtains Json data frame;
The control parameter that parsing obtains target device is carried out to the Json data frame, and by the control of the target device
Parameter is sent to the target device.
The step of default data frame of the source signal is converted to normal data frame in one of the embodiments, is into one
Step includes:
The source signal is parsed, the data segment information of the source signal is obtained, includes in the data segment information
The parameter information to be controlled of the target device;
Json data frame is obtained according to the parameter information to be controlled for the target device for including in the data segment information,
In, the Json data frame includes control frame and/or the frame that gets parms;
The Json data frame is converted to the data format of default system, is obtained and the matched mesh of normal data frame
Mark frame data;
The target frame data are written in the valid data section of the normal data frame, obtain the normal data frame.
Before the step of being parsed in one of the embodiments, to the Json data frame further include:
Judge gateway dial-up information that the Json data frame carries and the practical dial-up information of multi-protocol gateway equipment is
It is no consistent;
When the practical dial-up information of gateway dial-up information and the multi-protocol gateway equipment that the Json data frame carries
When consistent, then the Json data frame is received.
The step that parsing obtains the control parameter of target device is carried out to the Json data frame in one of the embodiments,
Suddenly further include:
Judge the frame type of the received Json data frame;
Interface function corresponding with present frame type is called according to the frame type of the Json data frame;
The Json attribute of the Json data frame is obtained according to the corresponding interface function of present frame type;
The Json attribute is matched with preset Json field control table, obtains the control ginseng of the target device
Number.
The communication means supports internet and local area network in one of the embodiments,;
The default data frame of the source signal be TCP/IP data frame, CAN protocol data frame, Modbus protocol data frame and
One of Bacnet protocol data frame is a variety of.
Meanwhile one embodiment of the invention additionally provides a kind of multi-protocol gateway equipment, comprising:
Read module, for obtaining the source signal of source device transmission, the default data frame of the source signal include it is a kind of or
Various communications protocols data frame;
Conversion module, for the default data frame of the source signal to be converted to normal data frame;
Parsing module carries out parsing for the normal data frame and obtains Json data frame, and to the Json data frame
Carry out the control parameter that parsing obtains target device;
Sending module, for the control parameter of the target device to be sent to the target device.
The conversion module is further used for parsing the source signal in one of the embodiments, obtains institute
The data segment information of source signal is stated, includes the parameter information to be controlled of the target device in the data segment information;According to institute
The parameter information to be controlled for stating the target device for including in data segment information obtains Json data frame, wherein the Json data
Frame includes control frame and/or the frame that gets parms;The Json data frame is converted to the data format of default system, acquisition and institute
State the matched target frame data of normal data frame;The target frame data are written to the valid data section of the normal data frame
In, obtain the normal data frame.
The multi-protocol gateway equipment further includes judgment module in one of the embodiments, for judging the Json
Whether the gateway dial-up information that data frame carries is consistent with the practical dial-up information of multi-protocol gateway equipment;When the Json data
When the gateway dial-up information that frame carries is consistent with the practical dial-up information of the multi-protocol gateway equipment, then the Json number is received
According to frame.
The parsing module is further used for obtaining the received Json data frame in one of the embodiments,
Frame type;Interface function corresponding with present frame type is called according to the frame type of the Json data frame;According to present frame class
The corresponding interface function of type obtains the Json attribute of the Json data frame;By the Json attribute and preset Json field control
Tabulation is matched, and the control parameter of the target device is obtained.
The read module includes the first reading unit, the second reading unit, third reading in one of the embodiments,
Unit and the 4th reading unit;
First reading unit is used to obtain the TCP/IP data frame transmitted by ICP/IP protocol;
Second reading unit is used to obtain the CAN protocol data frame transmitted by CAN protocol;
The third reading unit is for obtaining the Modbus protocol data frame transmitted by Modbus agreement;
4th reading unit is for obtaining the Bacnet protocol data frame transmitted by Bacnet agreement.
In addition, another embodiment of the present invention additionally provides a kind of multi-protocol gateway equipment, including processor, memory and
The computer program being stored on the memory specifically executes above-mentioned when the processor executes the computer program
Step in communication means described in one.
In addition, one embodiment of the invention additionally provide one kind can storage medium, it is described to be stored with calculating on storage medium
Machine instruction, when the computer instruction is executed by processor, specifically executes the step in communication means described in any of the above embodiments.
The beneficial effects of the present invention are:
Communication means based on multi-protocols of the invention, multi-protocol gateway equipment and can storage medium, pass through gateway
The one or more different communication protocol data frames received are converted into unified normal data frame, and to above-mentioned standard data
Frame carries out parsing and obtains Json data frame, further carries out the control parameter that parsing obtains target device, solution to Json data frame
Different communication mode of having determined needs the problem of accessing multiple gateways, improves the versatility of gateway, a variety of communication protocols
Conversion between view is more convenient, can satisfy the demand of the building managements such as air-conditioning system communication.
Detailed description of the invention
Fig. 1 is the flow chart of communication means one embodiment of the invention based on multi-protocols;
Fig. 2 is the flow chart of another embodiment of the communication means of the invention based on multi-protocols;
Fig. 3 is the encapsulating structure figure of one embodiment of communication means Plays data frame of the invention;
Fig. 4 is the structural block diagram of one embodiment of multi-protocol gateway equipment of the invention;
Fig. 5 is the application scenarios block diagram of one embodiment of multi-protocol gateway equipment in Fig. 3.
Specific embodiment
In order to keep technical solution of the present invention clearer, below in conjunction with attached drawing, to of the invention logical based on multi-protocols
Letter method, multi-protocol gateway equipment and can storage medium be described in further detail.It should be appreciated that described herein specific
Embodiment is only to explain that the present invention is not intended to limit the present invention.
As shown in Figure 1, one embodiment of the invention provides a kind of communication means based on multi-protocols, which can be with
It realizes the conversion between multiple and different communication protocols, and can satisfy the central controlled demand of air-conditioner set.Specifically, above-mentioned logical
Letter method can be used in multi-protocol gateway equipment, and the above method includes the following steps:
S100, multi-protocol gateway equipment obtain the source signal that source device is sent, and the default data frame of source signal includes one kind
Various communications protocols data frame, i.e. source signal can be sent to multi-protocol gateway equipment by various communications protocols.Specifically, source
Equipment can be host computer, such as client, source device may be controlled device, such as air-conditioner set.Source device hair
The signal that the source signal sent can be sent to the multi-protocol gateway equipment for host computer or air-conditioner set, for example, source signal can be with
It is the control signal that host computer is sent or the feedback signal etc. that source signal is air-conditioner set passback.
Further, which can integrate ICP/IP protocol, CAN protocol (Controller Area
Network, control area network are a kind of serial communication protocol buses applied in real time), Modbus agreement (agreement
Support traditional RS-232, RS-422, RS-485 and ethernet device) and Bacnet agreement (A Data Communication
Protocol for Building Automation and Control Networks, building automation and coutrol network data are logical
Interrogate agreement) etc. a variety of different communication protocols, and realize the conversion between above-mentioned various communications protocols.That is the multi-protocol gateway equipment
It can receive with the data of above-mentioned a variety of different communication protocol transmission, the default data frame of source signal can be TCP/IP data
Frame, CAN protocol data frame, Modbus protocol data frame or Bacnet protocol data frame.Further, above-mentioned communication means branch
Hold internet and local area network (including the mode that Ethernet and wireless communication are direct-connected) etc..Since the multi-protocol gateway can be with
Integrated Bacnet agreement, therefore be applied in the systems such as illumination, air-conditioning system, security and fire-fighting.
The default data frame of source signal is converted to normal data frame by S200, multi-protocol gateway;In this way, can by it is a variety of not
Source signal with communication protocol data frame is converted to specific normal data frame, thereby may be ensured that source device and gateway data are logical
The uniqueness of letter.For example, source signal is sent to gateway by ICP/IP protocol by host computer, to guarantee data communication only
The source signal for the TCP/IP data frame that its source device transmits can be converted to normal data frame by one property, gateway.
Specifically, as shown in figure 3, the normal data frame may include source address, guidance code, valid data section, function code,
Check code, data length and destination address.Wherein, the address for being originally sent equipment of the quasi- data frame of source address table indicating, such as may be used
Think the address of host computer;Destination address indicates that normal data frame eventually arrives at the address of equipment, can be such as controlled air conditioner
The address of group.Further, source address and destination address can be identified using 7 byte modes.For undefined such
The case where address data frame, each byte of its source address and destination address is disposed as 0.The MAC Address of 6 bytes is set
It is standby, MAC Address can successively be filled in from low to high, end byte is set as 0.
Guidance code is used for the beginning length of identification standard data frame, generally 2 bytes.Function code is used for identification standard number
According to the type of frame, generally 1 byte.Check code calculates acquisition by the way of cyclic redundancy.Data length is indicated from function
Code word section starts, to the length of the last byte of valid data section.Valid data section includes the main interior of normal data frame
Hold, the valid data section in the present embodiment can be converted to Json data frame format, which can be according to source signal
It obtains.For example, the source when host computer controls air-conditioner set (target device) as source device, in the normal data frame
Address, guidance code, function code and destination address can be set to default value, can be had according to the source signal that host computer issues
Data segment and data length are imitated, and calculates acquisition check code by way of cyclic redundancy.
S300, multi-protocol gateway carry out parsing to normal data frame and obtain Json data frame (JavaScript Object
Notation, JS object tag are a kind of data interchange formats of lightweight);Specifically, it can intercept in normal data frame
Valid data section, by being parsed the valid data section in normal data frame to obtain Json data frame.Due to default
Normal data frame in valid data section can be formed by specific Json frame format data conversion, therefore, can be by right
Normal data frame carries out parsing and obtains Json data frame.
S400, multi-protocol gateway carry out parsing to Json data frame and obtain the control parameter of target device, and target is set
Standby control parameter is sent to target device.Specifically, character string forms can be obtained by carrying out parsing to Json data frame
Json attribute, the control parameter of target device can be known according to the Json attribute.Further, by the target device of acquisition
Control parameter be converted into the data of 16 systems, and the data of 16 systems are further converted to the data frame of target device support
Format, in order to which the control parameter of target device is sent to target device.
In one embodiment, above-mentioned steps S200 further comprises:
Source signal is parsed, obtains the data segment information of source signal, in data segment information comprising target device to
Control parameter information;
Json data frame is obtained according to the parameter information to be controlled for the target device for including in data segment information, wherein
Json data frame may include control frame and/or the frame that gets parms;
Json data frame is converted to the data format of default system, is obtained and the matched target frame number of normal data frame
According to;Specifically, since Json data frame is expressed as the form of character string, which can be converted into 16 systems
Data format, obtain with the matched target frame data of normal data frame, i.e., the target frame data be 16 binary datas.
By in the valid data section of target frame data write-in normal data frame, normal data frame is obtained.Specifically, it can incite somebody to action
Target frame data be embedded in normal data frame valid data section in, can update later Current standards data frame data length and
Check code obtains normal data frame.
In one embodiment, as shown in Fig. 2, further including following steps before above-mentioned steps S400:
S500, judge Json data frame carry gateway dial-up information and the practical dial-up information of multi-protocol gateway equipment be
It is no consistent;Specifically, gateway dial-up information is carried in the control frame of Json data frame and the frame that gets parms.Further,
When the frame type of Json data frame is control frame, it can be determined that the gateway dial-up information and multi-protocol gateway that the control frame carries
Whether the practical dial-up information of equipment is consistent.When the frame type of Json data is to get parms frame, it can be determined that acquisition ginseng
Whether the gateway dial-up information that number frame carries is consistent with the practical dial-up information of multi-protocol gateway equipment.
When the gateway dial-up information that Json data frame carries is consistent with the practical dial-up information of multi-protocol gateway equipment, then
Step S510 is executed, multi-protocol gateway receives the Json data frame.Wherein, the physics that gateway dial-up information is expressed as gateway is dialled
Code carries out authentication code when data communication mainly as source device and gateway.When the gateway dial-up information that Json data frame carries
When consistent with the practical dial-up information of multi-protocol gateway equipment, then gateway can be determined that the Json data frame of source device transmission
Really it is destined to oneself, source device (such as host computer) can carry out data communication with gateway at this time, and receive host computer
Json data frame, gateway can feed back to data receiver successful information source device (such as host computer).When Json data
When the practical dial-up information of gateway dial-up information and multi-protocol gateway equipment that frame carries is inconsistent, then gateway can be determined that
Source device transmission Json data frame it is wrong, reject its transmission Json data frame, at this time source device (such as host computer) with
Gateway not can be carried out communication, and the information of data receiver failure can be fed back to source device (such as host computer) by gateway.
Further, as shown in Fig. 2, above-mentioned steps S400 further includes following steps:
S410, the frame type for judging received Json data frame;Specifically, when the gateway dial-up that Json data frame carries
When information is consistent with the practical dial-up information of multi-protocol gateway equipment, gateway receives above-mentioned Json data frame.Due to data
The frame type of frame is different, and corresponding processing method is also different, therefore can further judge the frame type of above-mentioned Json data
It is control frame or gets parms frame, determines its corresponding data frame processing method.
For example, the frame type of above-mentioned Json data can be control frame or the frame that gets parms, wherein control frame can be group
Control frame and multiselect control frame.Specifically, team control frame, which refers to, controls all target devices connecting with gateway, example
Such as, it when needing to control all air conditioner indoor unit connecting with gateway, then needs using team control frame.Multiselect control frame
Refer to the partial target equipment (can be one or more target devices, but not all target device) being connect with gateway
It is controlled.For example, 100 air conditioner indoor unit are connected under the gateway, when user needs to control 80 indoor units therein,
It then needs using multiselect control frame.When user needs to control 100 indoor units, then need using team control frame.Further, more
Select control frame and team control frame to needs control each indoor unit control parameter when it is optional.
The frame that gets parms is used to obtain the parameter information of target device.For example, user can be needed by upper computer selecting
The operating parameter for the air conditioner indoor unit that the air conditioner indoor unit and needs of inquiry are inquired.Further, when only need to controlling or obtain
When the indoor operating parameter of air-conditioning, then need to only there are interior machine number field and interior machine fortune in the valid data section of normal data frame
Row parameter information.If need to control indoor unit, outdoor unit and sub outer machine simultaneously, in the valid data section of normal data frame
Corresponding field information, field attribute are added, that is, increases the corresponding control parameter of Json field control table.
S420, interface function corresponding with present frame type is called according to the frame type of Json data frame;Wherein, herein
The corresponding interface function of present frame type is mainly used for limiting the data processing method of present frame type.
S430, the Json attribute that Json data frame is obtained according to the corresponding interface function of present frame type;Specifically, Json
Attribute can be text formatting, and the parameter to be controlled of target device can be intuitively obtained according to Json attribute.
S440, Json attribute is matched with preset Json field control table, obtains the control parameter of target device.
For example, preset Json field control table may include affiliated type (e.g., the entire air-conditioning system, air conditioning chamber of parameter to be controlled
Interior machine, air-conditioner outdoor unit etc.), the coordinate of parameter to be controlled, read-write field, the title of parameter to be controlled, Json field, to
Processing method of control parameter etc..In the present embodiment, the control address of each Json attribute can be obtained using hash algorithm,
Position of the Json attribute in Json field control table is obtained by hash algorithm Rapid matching, is set to obtain each target
Standby control parameter.
Meanwhile as shown in figure 4, one embodiment of the invention additionally provides a kind of multi-protocol gateway equipment 10, the multi-protocols net
Close equipment 10 can integrate ICP/IP protocol, CAN protocol (Controller Area Network, control area network,
A kind of serial communication protocol bus applied in real time), Modbus agreement (agreement support traditional RS-232, RS-422,
RS-485 and ethernet device) and Bacnet agreement (A Data Communication Protocol for Building
Automation and Control Networks, building automation and coutrol Data Communication in Computer Networks agreement) etc. a variety of different communications association
View, and realize the conversion between above-mentioned various communications protocols.Further, above-mentioned multi-protocol gateway equipment can be applied to interconnect
Net and local area network (including the mode that Ethernet and wireless communication are direct-connected).As shown in figure 5, the multi-protocol gateway 10 can connect
It connects between client (source device) 20 and air-conditioner set (target device) 30, between client 20 and air-conditioner set 30
Data communication.
Specifically, above-mentioned multi-protocol gateway equipment includes read module 110, conversion module 120, parsing module 140 and hair
Send module 150.Wherein, read module 110 is used to obtain the source signal of source device transmission, and the default data frame of source signal includes one
Kind or various communications protocols data frame;The default data frame of source signal is TCP/IP data frame, CAN protocol data frame, Modbus
Protocol data frame and Bacnet protocol data frame.Further, read module 110 includes the first reading unit, the second reading list
Member, third reading unit and the 4th reading unit;First reading unit is used to obtain the TCP/IP transmitted by ICP/IP protocol
Data frame;Second reading unit is used to obtain the CAN protocol data frame transmitted by CAN protocol;Third reading unit is for obtaining
Take the Modbus protocol data frame transmitted by Modbus agreement;4th reading unit is transmitted for obtaining by Bacnet agreement
Bacnet protocol data frame.
Conversion module 120 is used to the default data frame of source signal being converted to normal data frame.In this way, can by it is a variety of not
Source signal with communication protocol data frame is converted to specific normal data frame, thereby may be ensured that source device and gateway data are logical
The uniqueness of letter.For example, source signal is sent to gateway by ICP/IP protocol by host computer, to guarantee data communication only
The source signal for the TCP/IP data frame that its source device transmits can be converted to normal data frame by one property, gateway.
Parsing module 140 carries out parsing for normal data frame and obtains Json data frame, and solves to Json data frame
Analysis obtains the control parameter of target device.Specifically, the valid data section in normal data frame can be intercepted, by criterion numeral
It is parsed according to the valid data section in frame to obtain Json data frame.Due to the valid data section in preset normal data frame
It can be formed by specific Json frame format data conversion, therefore, Json can be obtained by carrying out parsing to normal data frame
Data frame.Meanwhile it can be belonged to by carrying out the Json attribute that parsing obtains character string forms to Json data frame according to the Json
Property can know the control parameter of target device.Further, 16 systems are converted by the control parameter of the target device of acquisition
Data, and the data of 16 systems are further converted to the data frame format that target setting is supported, in order to by target device
Control parameter be sent to target device.Sending module 150 is used to the control parameter of target device being sent to target device.
In one embodiment, conversion module 120 is further used for parsing source signal, obtains the data of source signal
Segment information includes the parameter information to be controlled of target device in data segment information;It is set according to the target for including in data segment information
Standby parameter information to be controlled obtains Json data frame, wherein Json data frame includes control frame and/or the frame that gets parms;It will
Json data frame is converted to the data format of default system, obtains and the matched target frame data of normal data frame;By target frame
Data are written in the valid data section of normal data frame, obtain normal data frame.
In one embodiment, multi-protocol gateway equipment further includes judgment module 130, for judging that Json data frame carries
Gateway dial-up information it is whether consistent with the practical dial-up information of multi-protocol gateway equipment;When the gateway that Json data frame carries is dialled
When code information is consistent with the practical dial-up information of multi-protocol gateway equipment, then Json data frame is received.Wherein, gateway dial-up information
It is expressed as the physics dial-up of gateway, authentication code when data communication is carried out mainly as source device and gateway.When Json data frame
When the gateway dial-up information of carrying is consistent with the practical dial-up information of multi-protocol gateway equipment, then gateway can be determined that source is set
The Json data frame of standby transmission is destined to oneself really, and it is logical can to carry out data with gateway for source device (such as host computer) at this time
News, and the Json data frame of host computer is received, the successful information of data receiver can be fed back to source device (as above by gateway
Position machine).When the practical dial-up information of gateway dial-up information and multi-protocol gateway equipment that Json data frame carries is inconsistent, then
Gateway can be determined that the Json data frame of source device transmission is wrong, reject the Json data frame of its transmission, at this time source
Equipment (such as host computer) and gateway not can be carried out communication, and the information of data receiver failure can be fed back to source by gateway
Equipment (such as host computer).
In one embodiment, parsing module 140 is further used for obtaining the frame type of received Json data frame;Root
Interface function corresponding with present frame type is called according to the frame type of Json data frame;According to the corresponding interface letter of present frame type
Number obtains the Json attribute of Json data frame;Json attribute is matched with preset Json field control table, obtains target
The control parameter of equipment.
Read module 110, conversion module 120, parsing module 140 and the transmission of the multi-protocol gateway equipment of the present embodiment
Module 150 is corresponding with step S100~step S400 in above-mentioned communication means respectively, working principle with above communicate
The execution step of method is almost the same, and the specific work process of the multi-protocol gateway equipment can be found in described above.
In addition, one embodiment of the invention additionally provides a kind of multi-protocol gateway equipment, including processor, memory and deposit
The computer program of storage on a memory specifically executes in any of the above-described embodiment when processor executes above-mentioned computer program
Communication means in step.
In addition, one embodiment of the invention additionally provide one kind can storage medium, this can be stored with computer on storage medium
Instruction, when above-mentioned computer instruction is executed by processor, specifically according to the step in the communication means in any of the above-described embodiment
It is rapid to execute.
Communication means based on multi-protocols of the invention, multi-protocol gateway equipment, computer equipment and can storage medium, lead to
The normal data frame that a variety of different communication protocol data frames received are converted to standard by gateway is crossed, and to above-mentioned standard
Data frame carries out parsing and obtains Json data, further carries out the control parameter that parsing obtains target device to Json data, mentions
The high versatility of gateway, can satisfy the demand of the building managements such as air-conditioning system communication.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously
Limitations on the scope of the patent of the present invention therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to guarantor of the invention
Protect range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.
Claims (10)
1. a kind of communication means based on multi-protocols, which is characterized in that described method includes following steps:
The source signal that source device is sent is obtained, the default data frame of the source signal includes one or more communication protocol datas
Frame;
The default data frame of the source signal is converted into normal data frame;
Parsing is carried out to the normal data frame and obtains Json data frame;
The control parameter that parsing obtains target device is carried out to the Json data frame, and by the control parameter of the target device
It is sent to the target device;
It is wherein, described that the default data frame of the source signal is converted into normal data frame, comprising:
According to source signal acquisition and the matched target frame data of the normal data frame, according to the target frame data and institute
The valid data section for stating normal data frame obtains the normal data frame;
Wherein, described according to source signal acquisition and the matched target frame data of the normal data frame, according to the target
The valid data section of frame data and the normal data frame obtains the normal data frame, comprising:
The source signal is parsed, the data segment information of the source signal is obtained, includes described in the data segment information
The parameter information to be controlled of target device;
Json data frame is obtained according to the parameter information to be controlled for the target device for including in the data segment information, wherein institute
Stating Json data frame includes control frame and/or the frame that gets parms;
The Json data frame is converted to the data format of default system, is obtained and the matched target frame of normal data frame
Data;
The target frame data are written in the valid data section of the normal data frame, obtain the normal data frame.
2. communication means according to claim 1, which is characterized in that the step of Json data frame is parsed it
Before further include:
Judge the gateway dial-up information and multi-protocol gateway equipment that the Json data frame carries practical dial-up information whether one
It causes;
When the gateway dial-up information that the Json data frame carries is consistent with the practical dial-up information of the multi-protocol gateway equipment
When, then receive the Json data frame.
3. communication means according to claim 2, which is characterized in that carry out parsing to the Json data frame and obtain target
The step of control parameter of equipment further include:
Judge the frame type of the received Json data frame;
Interface function corresponding with present frame type is called according to the frame type of the Json data frame;
The Json attribute of the Json data frame is obtained according to the corresponding interface function of present frame type;
The Json attribute is matched with preset Json field control table, obtains the control parameter of the target device.
4. communication means according to claim 1-3, which is characterized in that the communication means support internet with
And local area network;
The default data frame of the source signal be TCP/IP data frame, CAN protocol data frame, Modbus protocol data frame and
One of Bacnet protocol data frame is a variety of.
5. a kind of multi-protocol gateway equipment characterized by comprising
Read module, for obtaining the source signal of source device transmission, the default data frame of the source signal includes one or more
Communication protocol data frame;
Conversion module, for the default data frame of the source signal to be converted to normal data frame;
Parsing module carries out parsing for the normal data frame and obtains Json data frame, and carries out to the Json data frame
Parsing obtains the control parameter of target device;
Sending module, for the control parameter of the target device to be sent to the target device;
Wherein, the conversion module is used for:
According to source signal acquisition and the matched target frame data of the normal data frame, according to the target frame data and institute
The valid data section for stating normal data frame obtains the normal data frame;
Wherein, the conversion module is further used for parsing the source signal, obtains the data segment letter of the source signal
It ceases, includes the parameter information to be controlled of the target device in the data segment information;Include according in the data segment information
Target device parameter information to be controlled obtain Json data frame, wherein the Json data frame includes control frame and/or obtains
Take parameter frame;The Json data frame is converted to the data format of default system, is obtained matched with the normal data frame
Target frame data;The target frame data are written in the valid data section of the normal data frame, obtain the normal data
Frame.
6. multi-protocol gateway equipment according to claim 5, which is characterized in that the multi-protocol gateway equipment further includes sentencing
Disconnected module, for judging the gateway dial-up information of the Json data frame carrying and the practical dial-up information of multi-protocol gateway equipment
It is whether consistent;When the practical dial-up information of gateway dial-up information and the multi-protocol gateway equipment that the Json data frame carries
When consistent, then the Json data frame is received.
7. multi-protocol gateway equipment according to claim 6, which is characterized in that the parsing module is further used for obtaining
The frame type of the received Json data frame;It is called according to the frame type of the Json data frame corresponding with present frame type
Interface function;The Json attribute of the Json data frame is obtained according to the corresponding interface function of present frame type;It will be described
Json attribute is matched with preset Json field control table, obtains the control parameter of the target device.
8. multi-protocol gateway equipment according to claim 5, which is characterized in that the read module includes that the first reading is single
Member, the second reading unit, third reading unit and the 4th reading unit;
First reading unit is used to obtain the TCP/IP data frame transmitted by ICP/IP protocol;
Second reading unit is used to obtain the CAN protocol data frame transmitted by CAN protocol;
The third reading unit is for obtaining the Modbus protocol data frame transmitted by Modbus agreement;
4th reading unit is for obtaining the Bacnet protocol data frame transmitted by Bacnet agreement.
9. a kind of multi-protocol gateway equipment, which is characterized in that including processor, memory and be stored on the memory
Computer program when the processor executes the computer program, specifically executes according to any one of claims 1-4 logical
Step in letter method.
10. one kind can storage medium, which is characterized in that described to be stored with computer instruction, the computer on storage medium
When instruction is executed by processor, the step in communication means according to any one of claims 1-4 is specifically executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710329826.6A CN107124421B (en) | 2017-05-11 | 2017-05-11 | Communication means, multi-protocol gateway equipment based on multi-protocols and can storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710329826.6A CN107124421B (en) | 2017-05-11 | 2017-05-11 | Communication means, multi-protocol gateway equipment based on multi-protocols and can storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107124421A CN107124421A (en) | 2017-09-01 |
CN107124421B true CN107124421B (en) | 2019-10-18 |
Family
ID=59728063
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710329826.6A Active CN107124421B (en) | 2017-05-11 | 2017-05-11 | Communication means, multi-protocol gateway equipment based on multi-protocols and can storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107124421B (en) |
Families Citing this family (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107656704A (en) * | 2017-09-28 | 2018-02-02 | 郑州云海信息技术有限公司 | Multi-protocol data shares storage method, device, equipment and computer-readable storage medium |
CN107566403A (en) * | 2017-10-16 | 2018-01-09 | 郑州云海信息技术有限公司 | It is a kind of to realize general multi-protocols interconnecting method, system and control chip |
CN107770181B (en) * | 2017-10-26 | 2020-10-30 | 南京诚思机器人科技有限公司 | Interaction method, interaction processing device and system of robot system |
CN108337141B (en) * | 2018-01-05 | 2020-08-18 | 无锡腾越信息技术有限公司 | Modbus communication method for multi-split air conditioner gateway |
CN108737259A (en) * | 2018-05-08 | 2018-11-02 | 平安证券股份有限公司 | Gateway device, data transmission method and storage medium |
JP7210993B2 (en) * | 2018-10-15 | 2023-01-24 | 富士電機株式会社 | Vending machine system and communication method for the vending machine system |
CN111610765B (en) * | 2020-05-25 | 2022-09-30 | 珠海格力电器股份有限公司 | Distributed message control device and method and building control system |
CN112399446A (en) * | 2020-10-16 | 2021-02-23 | 云镝智慧科技有限公司 | Edge gateway communication method, device, computer equipment and storage medium |
CN112511557B (en) * | 2020-12-17 | 2022-09-30 | 南京理工大学 | Protocol conversion method for relay protection device application gateway on 10kV line |
CN115001884A (en) * | 2021-02-26 | 2022-09-02 | 星络家居云物联科技有限公司 | Computer readable storage medium, gateway device and communication protocol authorization method thereof |
CN113132158B (en) * | 2021-04-07 | 2022-05-31 | 珠海格力电器股份有限公司 | Point table configuration method, device, controller and storage medium |
CN113381999B (en) * | 2021-06-08 | 2023-04-28 | 杭州昊美科技有限公司 | Communication method and device and electronic equipment |
CN113422718A (en) * | 2021-06-18 | 2021-09-21 | 河南力安测控科技有限公司 | Configuration protocol-based internet of things gateway and method for docking equipment |
CN113722013B (en) * | 2021-09-10 | 2023-07-28 | 中国西安卫星测控中心 | Data exchange method suitable for Beidou No. three satellite measurement, operation and control system |
CN114006928B (en) * | 2021-11-04 | 2024-04-19 | 深圳市骏嘉科技发展有限公司 | Internet of things data processing method based on multi-protocol real-time communication |
CN115484130B (en) * | 2022-08-31 | 2023-11-03 | 江苏奥立信数字科技有限公司 | Internet of things gateway and air compression online storage system for same |
CN117896204B (en) * | 2024-03-14 | 2024-05-28 | 季华实验室 | CAN-based microwave power supply communication method and device, electronic equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101150584A (en) * | 2007-10-31 | 2008-03-26 | 中兴通讯股份有限公司 | A multi-protocol conversion device and method for SMS gateway |
US9286444B2 (en) * | 2012-02-28 | 2016-03-15 | Verizon Patent And Licensing Inc. | Next generation secure gateway |
CN104331028B (en) * | 2013-07-22 | 2017-11-28 | 上海联影医疗科技有限公司 | Control device and bus system |
CN104683173B (en) * | 2013-12-03 | 2018-08-28 | 北京赛迪电子系统测评实验室有限公司 | A kind of detecting system and its method of isomery Internet of Things |
-
2017
- 2017-05-11 CN CN201710329826.6A patent/CN107124421B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN107124421A (en) | 2017-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107124421B (en) | Communication means, multi-protocol gateway equipment based on multi-protocols and can storage medium | |
CN104270468B (en) | A kind of system of wechat control internet of things equipment | |
US20130086195A1 (en) | DEVICE AND METHOD FOR ENABLING BACnet COMMUNICATION FOR WIRED AND WIRELESS DEVICES OPERABLE WITHIN A BUILDING AUTOMATION SYSTEM | |
US8990444B2 (en) | Fieldbus gateway using virtual serial fieldbus port and data transmission method thereof | |
CN104618194B (en) | Software defined network monitoring messages method and SDN controllers, switching equipment | |
US7516187B2 (en) | Remote control system for home appliance network and method for operating the same | |
US11038706B2 (en) | Method for automatic configuration of sematic-based projects in building automation systems | |
US20060123811A1 (en) | Multi-air conditioner and group-unit control method thereof | |
CN107018165A (en) | The method and device of control internet of things equipment, server, mobile device | |
US20150148961A1 (en) | Building data managing apparatus and building management system comprising thereof | |
US11063901B2 (en) | Manufacturing line computer system and network setup method of the same | |
CN107062524A (en) | A kind of indoor apparatus of air conditioner addressing method and air-conditioner controller, indoor apparatus of air conditioner | |
ES2894243T3 (en) | Method, communication web service, web server and client for providing network communication service between IP devices over the Internet | |
CN108494671A (en) | A kind of gateway device | |
CN113341742A (en) | Method and device for linkage control of household appliances and cloud control equipment | |
Yue | Design of intelligent monitoring and control system based on modbus | |
US7026949B2 (en) | Method for transmitting and receiving messages in home appliance networking system | |
CN115208757A (en) | Intelligent home configuration method and device, computer equipment and readable storage medium | |
US6745247B1 (en) | Method and system for deploying smart card applications over data networks | |
CN105577489A (en) | Electrical appliance identification method in intelligent home system | |
US20100262734A1 (en) | Wireless usb device for networking with multiple wireless usb hosts and method thereof | |
JP4513506B2 (en) | Device management system and gateway device | |
CN100454825C (en) | Static user access network control method based on MAC address | |
CN208241667U (en) | Multi-line system | |
KR101225966B1 (en) | Building Management System and the Operating Method for the Same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |