CN114363423B - B-SA supported embedded BACnet device, actuator and building automatic control system - Google Patents

B-SA supported embedded BACnet device, actuator and building automatic control system Download PDF

Info

Publication number
CN114363423B
CN114363423B CN202111677704.9A CN202111677704A CN114363423B CN 114363423 B CN114363423 B CN 114363423B CN 202111677704 A CN202111677704 A CN 202111677704A CN 114363423 B CN114363423 B CN 114363423B
Authority
CN
China
Prior art keywords
bacnet
read
request message
attribute
actuator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111677704.9A
Other languages
Chinese (zh)
Other versions
CN114363423A (en
Inventor
曾珞亚
许锦标
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN202111677704.9A priority Critical patent/CN114363423B/en
Publication of CN114363423A publication Critical patent/CN114363423A/en
Application granted granted Critical
Publication of CN114363423B publication Critical patent/CN114363423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embedded BACnet device supporting B-SA comprises a main control module and a communication module, wherein the main control module comprises a control unit, and an executor interface, a storage unit, a communication interface, a decoding unit and an encoding unit which are respectively connected with the control unit; the control unit acquires detection data of the actuator in real time through the actuator interface and updates the detection data into the current value of the corresponding object created by the storage unit; the communication interface is connected with the communication module for data transmission, and the control unit decodes the data packet received by the communication interface through the decoding unit; when the decoding unit judges that the data packet is a read/write attribute request message and requests the current value of the read object, the control unit reads/writes the current value of the read object, encodes the current value by the encoding unit to generate a BACnet data packet, and outputs the BACnet data packet as a read/write attribute response message through the communication interface to return.

Description

B-SA supported embedded BACnet device, actuator and building automatic control system
Technical Field
The invention relates to the technical field of building intellectualization, in particular to an embedded BACnet device supporting B-SA, a BACnet intelligent actuator and a BACnet building automatic control system.
Background
The intelligent building construction in China starts in the 90 s of the 19 th century, but has been slow to develop. Until the beginning of the 21 st century, people gradually began to really attach importance to the development of building intellectualization along with the proposal of concepts such as green, ecological, sustainable development and the like. Early building intelligent system integration and information interconnection are very big problems, equipment information of various factories cannot be shared, equipment of different factories cannot be managed simultaneously through one piece of software, and limitation of building intelligent development is brought.
With the development of technology, BACnet (AData Communication Protocol for Building Automation and Control Network), a data communication protocol specially formulated for building automation networks was proposed in the united states. The birth of BACnet standard meets the wide requirement of users on the interoperability of building automatic control equipment, namely equipment of different factories forms a compatible automatic control system, thereby realizing interconnection and intercommunication. Building intelligence has also emerged with new opportunities for development as BACnet is proposed.
Currently, a BACnet system is constructed mainly by converting collected signals into field bus signals, such as LonWork, interBus, CAN, modbus, through a controller, a protocol conversion gateway and other devices, and then converting the bus signals into standard BACnet protocol signals. However, the above manner is still based on the traditional DCS (Distributed Control System ) architecture, and after the data passes through the controller or the intelligent instrument, the data is communicated with the operator workstation through the protocol conversion gateway, which is not flexible enough and needs to rely on expensive gateway equipment to realize the protocol conversion; in addition, BAS based on DCS architecture is not a pure BACnet system, BACnet communication protocol is adopted between management layer equipment and control layer equipment, and a plurality of field buses are adopted between the control layer equipment and field layer equipment, and an analog signal transmission mode is adopted between the field layer equipment and bottom layer equipment. In addition, each device in the existing pure BACnet system is a BACnet device, so that manufacturers providing the underlying devices need to develop BACnet communication interfaces for the respective underlying devices, so that the respective underlying devices become standard BACnet devices, and great waste of resources is caused.
BACnet Smart Actuator (abbreviated as B-SA) is one of standard BACnet devices and is a simple actuator with extremely limited functions. Before introducing the standard service of B-SA, a concept is introduced: BIBB. The english full name of BIBB is BACnet Interoperability Building Blocks, BACnet interoperation basic module. From the literal meaning, it is known that a BIBB is a minimum unit function of a BACnet standard device, and a BACnet device may be composed of one or more BIBBs. To facilitate the technician's development of BACnet devices, BACnet grouped BIBBs as follows in table 1-1:
TABLE 1-1
These BIBBs constitute standard equipment of BACnet, such as BACnet intelligent sensor (B-SS), BACnet intelligent actuator (B-SA), BACnet special controller (B-ASC), etc.
BIBB consists of one or more BACnet services, and each service has a pair of class A and class B devices, corresponding to the initiator and responder of the interoperation function. While B-SA is a simple actuator with very limited functionality, belonging to class B devices, its corresponding supported BIBBs are DS-RP-B and DS-WP-B functions within a Data Sharing (DS-Data Sharing) packet. Where DS (Data Sharing) refers to data sharing, RP (ReadProperty) refers to read attribute request service, WP (WriteProperty) refers to write attribute request service, and B refers to B device. DS-RP-B means that the B device has interoperability in response to the ReadProperty service request (also indicated as other A devices can read parameters such as the state of the actuator), while DS-WP-B means that the B device has interoperability in response to the WriteProperty service request (also indicated as other A devices can control parameters of the actuator). In pure BACnet systems, most actuators are B-SA devices, such as valves, dampers, etc., which have become the dominant forces in building intelligent devices.
Therefore, research on BACnet, in particular research and development of standard BACnet equipment, such as B-SA and the like, has great significance for accelerating the development of intelligent building in China.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides an embedded BACnet device supporting B-SA, a BACnet intelligent actuator and a BACnet building automatic control system, wherein the embedded BACnet device can be quickly connected with the actuator to form the BACnet intelligent actuator so as to quickly realize the construction of a pure BACnet system, and the embedded BACnet device is low in access cost and saves resources.
The technical scheme adopted by the invention is as follows:
the embedded BACnet device supporting B-SA comprises a main control module and a communication module, wherein the main control module comprises a control unit, and an executor interface, a storage unit, a communication interface, a decoding unit and an encoding unit which are respectively connected with the control unit; the controller interface is used for acquiring the current state of the actuator in real time through the controller interface and updating the current state into the current value of the corresponding first object created by the storage unit; the communication interface is used for being connected with the communication module to perform data transmission, and the control unit decodes the data packet received by the communication interface through the decoding unit; when the decoding unit judges that the data packet is a read attribute request message and requests to read the current value of the first object, the control unit encodes the current value of the first object through the encoding unit to generate a BACnet data packet, and outputs the BACnet data packet as a read attribute response message through the communication interface to return; when the decoding unit judges that the data packet is a writing attribute request message and requests to modify the current value of the second object created by the storage unit, the control unit updates the parameters of the object requested to be modified in the writing attribute request message to the current value of the second object, encodes the parameters by the encoding unit to generate a BACnet data packet serving as a writing attribute response message, and outputs the BACnet data packet by the communication interface to return; the control unit is also used for reading in real time and correspondingly controlling according to the current value of the second object so as to update the current state of the actuator.
By adopting the embedded BACnet device supporting B-SA, the embedded BACnet device can be quickly connected with an actuator to construct the BACnet intelligent actuator to directly perform data transmission with other equipment supporting the BACnet protocol, and the embedded BACnet device is convenient and flexible and saves resources.
Further, the decoding unit includes:
the BACnet message judging unit is used for judging whether the data packet received by the communication interface is a BACnet/IP message or not;
the message service type judging unit is used for judging that the BACnet/IP message is a read attribute request message or a write attribute request message when the data packet received by the communication interface is the BACnet/IP message;
a request object judging unit, configured to judge whether an object that the read attribute request message/write attribute request message requests to read/write exists in the storage unit when the BACnet/IP message is a read attribute request message or a write attribute request message;
and the request object attribute judging unit is used for judging whether the request attribute is a read/write current value or not when the object of the read/write attribute request message requested by the read attribute request message exists in the storage unit.
Further, the request object judging unit judges that the object of the read/write request of the read/write attribute request message exists in the storage unit according to the object identifier of the read/write request of the read attribute request message; the request object attribute judging unit judges whether the request attribute is a read current value or not according to the object attribute identifier which is requested to be read/written by the read attribute request message/write attribute request message.
Further, the decoding unit further includes:
an invokeID extraction unit, configured to extract an invokeID of the read attribute request message/write attribute request message when the BACnet/IP message is the read attribute request message/write attribute request message;
an instance serial number extracting unit, configured to extract an instance serial number of an object identifier that is requested to be read/written by the read attribute request message/write attribute request message when the request attribute is a read/write current value;
the extracted invokeID and the instance serial number of the object identifier are further used for encoding by the encoding unit to generate the BACnet data packet.
Further, the first object and the second object may be the same object.
Further, the main control module further comprises a data conversion unit connected with the control unit;
when the parameter value of the current state of the actuator received by the actuator interface is an analog signal, the control unit converts the parameter value of the analog signal into the parameter value of the digital signal through the data conversion unit and then updates the parameter value into the current value of the first object created by the storage unit; and
the control unit converts the current value of the second object read in real time into an analog signal through the data conversion unit and then outputs the analog signal to update the current state of the actuator.
Further, the communication module and the communication interface of the main control module are integrally connected or detachably spliced.
Further, the communication module is an ethernet module or a WIFI module.
The invention further provides a BACnet intelligent actuator, which comprises an actuator and the embedded BACnet device supporting B-SA, wherein the actuator interface of the actuator and the embedded BACnet device supporting B-SA can realize quick connection.
Further, the actuator and the actuator interface of the embedded BACnet device supporting the B-SA are detachably spliced.
The embedded BACnet device supporting the B-SA can be quickly connected with the executor to be constructed into the BACnet intelligent executor, so that the executor can be directly accessed into a communication network (for example, a BACnet network) to communicate with other Bacnet equipment in a Bacnet data packet mode.
Another embodiment of the present invention provides a BACnet building automatic control system, wherein the actuator serving as a bottom device adopts the embedded BACnet intelligent actuator, and the embedded BACnet intelligent actuator is connected to a communication network to communicate with other BACnet devices, wherein the communication network comprises a wired network, a wireless network, a BACnet network, an 802.11X network or an ethernet network.
Compared with the prior art, the embedded BACnet device supporting B-SA, the BACnet intelligent actuator and the BACnet building automatic control system provided by the embodiment of the invention have the following beneficial technical effects:
(1) In the prior art, a current state signal of a general actuator is converted into a field bus (such as Modbus) through a controller and other devices, and then the bus signal is converted into a BACnet standard signal. The technical scheme provided by the invention is that the standard Bacnet device (an embedded BACnet device supporting B-SA) is embedded at a signal source end, and a standard access interface is provided for a current state signal of the signal source no matter whether the current state signal is a digital signal or an analog signal or whether the digital signal is a single bus or a double bus or whether the analog signal is a voltage signal or a current signal; the executor can directly communicate with other Bacnet devices in a Bacnet message mode after being accessed to the embedded BACnet device provided by the invention through the interface module.
(2) The prior art scheme is still based on a DCS architecture, and the data is communicated with an operator workstation through a gateway module after passing through a controller or an intelligent instrument; the technical scheme provided by the invention is that the communication problem is solved from the bottom equipment, after an actuator is embedded into the standard Bacnet device, the original traditional distributed control system DCS is converted into a field bus-based fully-distributed control system FCS (Fieldbus Control System ), so that a pure Bacnet system is constructed.
(3) The prior art scheme is not flexible enough and needs to rely on expensive gateway equipment to realize protocol conversion; the embedded standard Bacnet device adopts the general embedded chip integration, and has low cost and easy access; therefore, the possibility of upward system integration is provided for a large number of domestic sensor manufacturers, the manufacturers do not need to develop communication interfaces respectively, and resource waste is avoided.
Drawings
Fig. 1 is a schematic structural diagram of an embedded BACnet device supporting B-SA according to a first embodiment of the present invention.
Fig. 2 is a schematic diagram of a decoding unit according to a first embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a coding unit according to a first embodiment of the present invention.
Fig. 4 is a schematic diagram of a physical frame generation process of BACnet transmission over a network.
Fig. 5 is a standard label structure diagram of BACnet.
Fig. 6 is a schematic structural diagram of an embedded BACnet device supporting B-SA according to a second embodiment of the present invention.
Fig. 7 is a schematic diagram of an engineering picture of an ADVIEW (configuration software integrated with BACnet protocol) of a client according to an embodiment of the present invention.
Fig. 8 shows a first example of a switch state display for an ADVIEW (integrated BACnet protocol configuration software) project.
Fig. 9 shows a second example of a switch state display for an ADVIEW (integrated BACnet protocol configuration software) project.
Fig. 10 is a schematic structural diagram of an embedded BACnet intelligent actuator according to a third embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. Based on this, all other embodiments of the present invention that a person of ordinary skill in the art could achieve without inventive effort are within the scope of the present invention.
Referring to fig. 1, a schematic structure diagram of an embedded BACnet device supporting B-SA according to a first embodiment of the present invention is shown.
The embedded BACnet device 100 supporting B-SA in this embodiment includes a main control module 1 and a communication module 2, where the main control module 1 includes a control unit 10, and an actuator interface 11, a storage unit 12, a communication interface 13, a decoding unit 14 and an encoding unit 15, which are respectively connected to the control unit 10. The actuator interface 11 is configured to connect to an actuator, and the control unit 10 obtains, through the actuator interface 11, a current state of the actuator in real time and updates the current state to a current value of a corresponding first object created by the storage unit 12. The communication interface 13 is used for being connected with the communication module 2 for data transmission, and the control unit 10 decodes the data packet received by the communication interface 13 through the decoding unit 14. When the decoding unit 14 determines that the data packet is a read attribute request message and requests to read the current value of the first object, the control unit 10 encodes the current value of the first object through the encoding unit 15 to generate a BACnet data packet, and outputs the BACnet data packet as a read attribute response message through the communication interface 13 to return. When the decoding unit 14 determines that the data packet is a write attribute request message and requests to modify the current value of the second object created by the storage unit 12, the control unit 10 updates the parameter of the object requested to be modified in the write attribute request message to the current value of the second object, and encodes the parameter by the encoding unit 15 to generate a BACnet data packet serving as a write attribute response message and outputs the BACnet data packet to return through the communication interface 13; the control unit 10 is further configured to read in real time and correspondingly control to update the current state of the actuator according to the current value of the second object.
In specific implementation, the embedded BACnet device 100 may be quickly connected to an actuator through the actuator interface 11, for example, may be detachably plugged in a direct plugging manner, or may be quickly connected through a connector (such as a connection wire) or the like. Wherein the actuator is a switch, a valve, a relay, etc., but is not limited thereto.
When the embedded BACnet device 100 is connected to an actuator through the actuator interface 11, the control unit 10 acquires the current state of the actuator through the actuator interface 11 in real time and updates the current state to the current value of the corresponding first object created by the storage unit 12. For example, it may be provided that the control unit 10 acquires the current state of the actuator via the actuator interface 11 every second or every 100ms and updates it into the current value of the first object created in advance by the storage unit 12. Wherein the memory unit 12 may be a register.
Wherein, before expanding the creation description about the object, a concept is introduced: an object. In building automation systems, a lot of information transmission and data exchange are performed between various building devices, which may come from different manufacturers and are incompatible with each other, in order to implement an inter-operation function between the devices, BACnet adopts an object-oriented technology, and the functions of any building automation device are represented by a set of objects with attributes. An object is a set of data structures transmitted between network devices, and an attribute of the object is information in the data structures. This representation may be understood as a "common language" in which building automation devices implement interoperability. In BACnet networks, communication between devices is actually operations such as reading and writing of device object attributes, and the devices can read information from a data structure or write information into the data structure. Currently BACnet defines 28 subjects, as shown in table 2-1 below:
TABLE 2-1
Analog Input Analog Output
Analog Value Digital Input Binary Input
Digital Output Binary Output Digital Value Binary Value
Timing chart Calendar Command Command
Device Event registration Event Enrollment
File File Group
Loop Multi-state Input
Multi-state Output Notification class Notification Class
Program Schedule
Accumulator Accumulator Average Analog Vlaue
Event log Life safety point life Safety Point
Life Safety Zone Multi-state Value
Program Pulse Converter
Trend record Trend Log Multi-trend recording Trend Log Multiple
For a B-SA, describing an actuator device requires at least three objects: binary-Input (or Analog-Input), binary-Output (or Analog-Output), and Device. For example, a switching valve that requires a Device to represent the switching valve, a Binary-Input to represent its switching state, and a Binary-Output to refresh its switching state.
The objects all have attributes, and the BACnet standard defines a total of 123 attributes that all objects may have, each object specifying a different subset of attributes, attribute values describing the characteristics and control features of various aspects of the underlying control function unit corresponding to the object. Information of building automatic control equipment can be obtained by reading the related attributes in the object; by writing the relevant properties in the object, the state of the object can be changed. The following are the objects used by the embedded B-SA module and their corresponding required attributes:
Device object:
typedef struct
{
unsigned int Object _identifier; load/object identifier
char object_name; name of the/object
unsigned int Vendor _identifier; a// manufacturer identifier
unsigned int max_apdu_length_accepted; maximum length of/reception APDU
unsigned char Segmentation _supported; support for/segmentation
}Device;
The Binary Output object:
typedef struct
{
unsigned int Object _identifier; load/object identifier
char_object_name; name of the/object
B, boolPresent_Value; current value//
}Binary_Output;
In this embodiment, the communication module 2 is a wifi module, and the wifi module is integrally connected or detachably plugged with the communication interface 13 of the main control module 1. When the embedded BACnet device 100 provided in the embodiment of the present invention is connected to an actuator through the actuator interface 11, the control unit 10 performs real-time/timing control through the actuator interface 11 to obtain the current state parameter value of the actuator to update to the current value of the first object, while the control unit 10 continuously monitors and receives a BACnet data packet through the communication module 2, decodes and determines whether the data packet is a read attribute request message (ReadProperty request message) or a write attribute request message (write property request message) through the decoding unit when receiving a new data packet, thereby further determining whether the attribute of the request object exists, and returns a read attribute response message (ReadProperty-ACK message) or a write attribute response message (write property response message) if the attribute of the request object exists, otherwise, returns a non-response message.
It can be seen that the embedded BACnet device supporting B-SA provided in the embodiment of the present invention can be quickly connected with an executor to form an embedded BACnet intelligent executor, so that the formed embedded BACnet intelligent executor is equivalent to a B device, and can acquire the current state of the executor in real time/at fixed time, then wait for an a device to send a ReadProperty request message/a WriteProperty request message to the embedded BACnet device, and after decoding by the embedded BACnet device, when judging that the attribute of the request object exists, return a ReadProperty-ACK message/WriteProperty response message to the a device. Therefore, the embedded BACnet intelligent executor formed by the rapid connection of the embedded BACnet device supporting B-SA and the executor provided by the embodiment of the invention can respond to the ReadProperty request message and the WriteProperty request message and has the basic function of B-SA (namely supporting B-SA).
In the following, how the embedded BACnet device supporting B-SA according to the embodiment of the present invention implements the response ReadProperty request message and the WriteProperty request message will be described in detail with reference to fig. 2 to 3.
The response ReadProperty request message and the WriteProperty request message involve the respective decoding of the two service requests and the encoding of the response. Taking the readProperty service as an example, we analyze the structure of the readProperty request message. The read attribute request service data structure of the BACnet standard is:
ReadProperty::=SEQUENCE{
objectIdentifier[0]BACnetObjectIdentfier,
propertyIdentifier[1]BACnetPropertyIdentifier
propertyArrayIndex[2]Unsigned OPTIONAL
--used only with array datatype
--if omitted with an array the entire array is referenced
}[4]
As can be seen from this data structure of the read attribute request service, the included message must contain an object identifier (BACnetObjectIdentifier) and an attribute of the object (BACnetPropertyIdentifier), while propertyarrandex is optional.
In addition, since BACnet does not cross a character string at the time of processing data, it crosses a byte by byte in binary representation. It is also necessary to analyze how the underlying data of the ReadProperty attribute is in the BACnet protocol.
With VTS (Visual Test Shell) this software, a read Present-Value attribute service request for Analog Input 1 can be sent. The received bit string data is:
“0x C0 A8 2B E0 BA C0 81 0A 00 11 01 04 00 03 93 0C 0C 00 0 00 01 19 55”。
the received data has a total of 23 bytes. The effect of each part of the data is first analyzed in a simple manner using a table as shown in tables 2-3:
tables 2 to 3
As can be seen from tables 2-3, the message associated with ReadProperty is only 17 bytes, i.e. 6 bytes of the IP header are removed, and the remaining 17 bytes are all information describing the ReadProperty request. And, only the latter service-related data portion is variable, which can be arbitrarily modified by the user. While other parts, such as APCI, NPCI, etc., can only be defined according to the standards specified by BACnet. Meanwhile, a process of generating a physical frame that BACnet transmits on the network can be obtained as shown in fig. 4.
The ReadProperty request message information of BACnet is parsed in detail below, wherein descriptions for IP header, BVLLPCI, NPCI, and APCI are omitted herein, focusing on parsing service-related data 1:0x0C 00000001 19 55. The VTS resolution content is as follows:
first, the beginning of the data is a BACnet Tag (refer to fig. 5, which is a standard Tag structure diagram of BACnet), in 0x0C, class=1 belongs to the context Tag, the context Tag is marked with 0 (Tag number=0), the Length/Value/Type is 4, that is, the Length is 4 bytes, so the following 4 bytes (0 x 00000001) of the BACnet Tag are all identifiers representing objects, the identifiers of the objects are represented by instance, which is an int Type of data of 4 bytes, the instance Number (instance) is 1, and the object Input 1 is represented.
Then looking at the following, this one BACnet Tag (class=1 of Tag (0 x 19), belonging to the context Tag, with a context Number of 1 (Tag number=1), length/Value/Type of 1, i.e. 1 byte in Length, so that the following one byte indicates its content, while the following one byte indicates 85, which is an enum Type of data, indicating the Present-Vlaue attribute.
In summary, the structure of the readProperty request message is: bvllpci+npci+apci+readpeoporty service related data.
Similarly, the structure of the WriteProperty request message is: bvllpci+npci+apci+data related to the writepeoporty service.
After having in depth knowledge of the structure of the readProperty request message and the writeProperty request message of BACnet, we will now describe in detail the identification and response of the readProperty request message/writeProperty request message, for example, by using the decoding unit 14 and the encoding unit 15 provided by the embodiment of the present invention.
Referring to fig. 2-3, a schematic structural diagram of the decoding unit 14 according to an embodiment of the present invention and a schematic structural diagram of the encoding unit 15 according to an embodiment of the present invention are shown.
In the present embodiment, the decoding unit 14 includes:
a BACnet message judging unit 141, configured to judge whether a data packet received by the communication interface is a BACnet/IP message;
a message service type judging unit 142, configured to judge that the BACnet/IP packet is a read attribute request packet or a write attribute request packet when the data packet received by the communication interface is a BACnet/IP packet;
a request object judging unit 143, configured to judge whether an object that the read attribute request message/write attribute request message requests to read/write exists in the storage unit when the BACnet/IP message is a read attribute request message or a write attribute request message;
And a request object attribute determining unit 144, configured to determine whether the request attribute is a current value of read/write when the object of the read attribute request message requesting the read/write attribute request message exists in the storage unit.
In this embodiment, the BACnet message determining unit 141 determines whether the type of the data message received by the communication interface 13 is a BACnet/IP message, which specifically includes:
judging whether the first two bytes of the BVLPCI part are 0x 81 and 0A, if so, judging that the type of the data message is BACnet/IP message.
In this embodiment, the message service type determining unit 142 determines that the BACnet/IP message is a read attribute request message by determining whether the service type described by the APCI is a read attribute request or a write attribute request, for example, by determining that the 6 th byte and the 9 th byte in the data message are 0x00 and 0x0C, respectively.
The request Object determining unit 143 determines that an Object of the read/write attribute request packet is present in the storage unit 12 according to an Object Identifier (object_identifier) of the read/write attribute request packet. The request object attribute determining unit 144 determines whether the request attribute is a read/write current value by the object attribute identifier (Property Identifier) of the read/write request message.
With continued reference to fig. 2, in this embodiment, the decoding unit 14 further includes an invokeID extracting unit 145 and an instance sequence number extracting unit 146, wherein:
an invokeID extracting unit 145, configured to extract an invokeID of the read attribute request message/write attribute request message when the message service type determining unit 142 determines that the BACnet/IP message is the read attribute request message/write attribute request message;
an instance sequence number extracting unit 146, configured to extract an instance sequence number (instance) of an object identifier that the read/write attribute request message requests to read/write when the request object attribute determining unit 144 determines that the request attribute is a read/write current value;
wherein the extracted instance number (instance) of the invokeID and the object identifier is further used for encoding by the encoding unit 15 to generate the BACnet packet.
It will be appreciated that in the decoding unit 14 provided in this embodiment, a function dedicated to determining whether the received data is to be served by a read attribute request may also be defined:
bool find_ReadProperty(unsigned char*apdu,unsigned int instance,unsigned char
invokeID);
the function of the function is to judge whether the received data information is the data of the read attribute service request, if the received data information is the read attribute service request and is the request for reading the Present-Value, the instance serial number of the request object is assigned to instance, the invokeID is stored, and the function returns true. If not, the function returns false.
Also, in the decoding unit 14 provided in the present embodiment, a function dedicated to judging whether or not the received data is a write attribute request service may be defined.
In this embodiment, the encoding unit 15 includes:
a read attribute response message encoding unit 151a, configured to perform BACnet marking and encoding on the object identifier requested to be read, the object attribute identifier, and the current value of the object;
a write attribute response message encoding unit 151b, configured to perform BACnet marking and encoding on the object identifier requested to be read and the object attribute identifier;
a header adding unit 152, configured to sequentially add an application layer PCI, a network layer PCI, and a virtual link layer PCI to the data that completes the marking and encoding of the BACnet, and generate a BACnet packet; wherein, the invokeID of the application layer PCI is the invokeID in the read attribute request message, and the network layer PCI is the network layer PCI in the read attribute request message.
Specifically, in this embodiment, the BACnet packet serving as the read attribute response packet includes an invokeID of the read attribute service request packet, an instance sequence number of an object identifier requested to be read by the read attribute service request packet, and a current value of the object requested to be read. The current value of the object requested to be read is the current state of the actuator.
It can be understood that when the embedded BACnet device supporting B-SA provided by the embodiment of the present invention receives the read attribute request service from other devices (a devices), all that is required is to send the current state of the connected executor to the other devices (a devices) that request. According to the above-mentioned data structure of the BACnet standard, the embedded BACnet device supporting B-SA needs to send 3 parameters to other devices (a devices), which are respectively an object identifier (objectIdentifier), an object attribute identifier (propertyIdentifier), and a current value (PropertyValue) of a corresponding attribute.
In this embodiment, the read attribute response packet encoding unit 151a performs BACnet marking and encoding on the object identifier requested to be read, the object attribute identifier, and the current value of the object by:
(1) Encoding the object identifier: firstly, generating a BACnet mark, namely respectively assigning values of Class, tag Number and Length/Value/Type, for example, class=1, tag number=0, length/Value/type=4, and the Value of instance serial Number (instance) is 0x00000001;
(2) Encoding an identifier of an object attribute: firstly, generating a BACnet mark, namely respectively assigning values of Class, tag Number and Length/Value/Type, for example, class=1, tag number=1, length/Value/type=1, and immediately following that the Value of bytes of the BACnet mark is 0x55 (representing the content of the object attribute identifier);
(3) Encoding the current value of the object attribute:
a start mark, which respectively assigns a Class, a Tag Number and a Length/Value/Type, for example, class=1, tag number=3, length/Value/type= 'B110', and the generated BACnet mark Value is 0x3E;
constructing element codes, and respectively assigning values of Class, tag Number and Length/Value/Type, for example, class=0, tag number=4 and Length/Value/type=4, and generating a Value of a BACnet mark as 0x44;
and (3) end marking, namely assigning values to the Class, the Tag Number and the Length/Value/Type respectively, wherein for example, class=1, tag number=3 and Length/Value/type= 'B111', and the generated BACnet is marked as 0x3F.
The encoding of the ReadProperty-ACK data portion has been completed by this point. And then, the header adding unit 152 sequentially adds APCI, NPCI and BVLCI to the ReadProperty-ACK data portion, so as to obtain a complete ReadProperty-ACK BVLL message.
It can be appreciated that, in the encoding unit 15 provided in this embodiment, a ReadProperty-ACK encoding function may also be defined:
void ReadPropertyACK_encode(unsigned char*send_data,int instance,unsigned char invokeID)
wherein, instance and invokeID are values extracted from the decoding ReadProperty request message.
Similarly, when the embedded BACnet device supporting B-SA provided by the embodiment of the Present invention receives the write attribute request service of other devices (a devices), all that is required is to write the object parameter requested to be modified in the write attribute request service into the corresponding current Value (Present-Value) of the second object, and continuously read the current Value (Present-Value) of the second object to update the current state of the executor in real time, and send the write attribute response message to the requested other devices (a devices). According to the above-mentioned write attribute request service data structure of the BACnet standard, the embedded BACnet device supporting B-SA needs to send 2 parameters to other devices (a devices), namely, an object identifier (objectIdentifier) and an object attribute identifier (propertyIdentifier). The process of performing BACnet marking and encoding on the object identifier and the object attribute identifier requested to be written by the writing attribute response packet encoding unit 151b may refer to the reading attribute response packet encoding unit 151a, and a description thereof will be omitted herein.
It can be seen that the embedded BACnet device supporting B-SA provided in this embodiment can be quickly connected with an actuator to convert current state data of the actuator into BACnet data, or convert received BACnet data into data for refreshing the current state of the actuator, so as to facilitate data transmission with other devices supporting the BACnet protocol, and is convenient and flexible, and saves resources.
Referring to fig. 6, a schematic structural diagram of an embedded BACnet device supporting B-SA according to a second embodiment of the present invention is shown. As with the embedded BACnet device 100 supporting B-SA provided in the first embodiment, the embedded BACnet device 200 provided in this embodiment includes a main control module 1 and a communication module 2, where the main control module 1 includes a control unit 10, and an actuator interface 11, a storage unit 12, a communication interface 13, a decoding unit 14, and an encoding unit 15, which are respectively connected to the control unit 10. Unlike the embedded BACnet device 100 supporting B-SA provided in the first embodiment, the main control module 1 of the embedded BACnet device 200 provided in the present embodiment further includes a data conversion unit 16 connected to the control unit 10. When the detected data of the actuator received by the actuator interface 11 is an analog signal, the control unit 10 converts the detected data of the analog signal into the detected data of the digital signal through the data conversion unit 16 and then updates the detected data of the digital signal into the current value of the corresponding first object created by the storage unit 12, and the control unit 10 may convert the current value of the second object read in real time into the analog signal through the data conversion unit 16 and then output the converted analog signal to update the current state of the actuator.
It will be appreciated that the structures and functions of the other units of the present embodiment may refer to the structures and functions of the corresponding units of the first embodiment, and will not be described herein.
The following describes the workflow of the embedded BACnet device supporting B-SA according to the above embodiment, taking a switch as an example:
the switch is connected with an actuator interface 11 of a main control module 1 of the embedded BACnet device supporting B-SA, and the communication module 2 is connected with the client through a wireless network.
The main control unit 10 of the main control module 1 controls and acquires the current state of the switch in real time/in timing through the actuator interface 11, and updates the acquired current state to the current Value (Present-Value) of the first object (Binary Input) created in advance by the storage unit 12.
The communication module receives a data message of a client through a wireless network and transmits the data message to the main control module 1 through the communication interface 13, and the control unit 10 of the main control module 1 decodes the data message received by the communication interface 13 through the decoding unit 14 to judge whether the received data message is a read attribute request message or a write attribute request message; when the data message is a read attribute request message or a write attribute request message, extracting an invokeID of the data message, storing the invokeID in a user-defined variable, and judging whether a request object corresponding to the read attribute request message/the write attribute request message exists in the storage unit 12; then:
When a first object which is requested to be read by the read attribute request message exists in the storage unit 12, judging whether the attribute of the request object is a read current value or not; when the attribute of the request object is a read current value, extracting an instance sequence number of an object identifier of the request object of the read attribute request message, and encoding the object identifier, the object attribute identifier and the current value of the object attribute of the request object based on the read attribute request message to generate a BACnet data packet; when a request object corresponding to the read attribute request message exists in the storage unit 12, the generated BACnet data packet is returned to the client as a read attribute response message, otherwise, a no-response message is returned to the client. Wherein, the BACnet data packet comprises an invokeID of the read attribute request message, an instance sequence number of an object identifier of a request object of the read attribute request message and a current value of the request object;
when a second object which is requested to be read by the read attribute request message exists in the storage unit 12, judging whether the attribute of the request object is a written current value or not; when the attribute of the request object is a writing current value, updating the parameter of the object requested to be modified in the writing attribute request message to the current value of the second object (Binary Output), and encoding the object identifier of the request object, the object attribute identifier and the current value of the object attribute through the encoding unit to generate a BACnet data packet; when a request object corresponding to the writing attribute request message exists in the storage unit 12, the generated BACnet data packet is returned to the client as a writing attribute response message, otherwise, a non-response message is returned to the client. Wherein, the BACnet data packet includes an invokeID of the write attribute request message and an instance sequence number of an object identifier of a request object of the read attribute request message. Meanwhile, the control unit 10 reads the current value of the second object (Binary Output) in real time, and correspondingly controls to update the current state of the switch according to the current value of the second object (Binary Output).
In the following, taking a switch as an actuator and an ESP8266 WIFI module as a communication module as an example, the functions (capable of responding to a read attribute request message and a write attribute request message) of the embedded BACnet device supporting B-SA described in the above embodiment are verified:
firstly, an engineering is created at a client ADVIEW (configuration software integrated with a BACnet communication protocol), a channel is newly created under the newly created engineering, such as Bacnet is selected, a local IP address and a remote IP address are set in a next click mode, and the remote IP address is the IP address of an embedded B-SA device. Two variables are created representing the switch state and the output state of the switch, respectively. These two variables correspond to the binary_input object and the binary_output object of the embedded BACnet device. Creating a picture in the picture options of the engineering column of the client, creating 1 real-time data for representing the current state of the switch, associating the real-time data with the attribute of the switch state, and creating a picture as shown in fig. 7. When the project is established, clicking operation is carried out, the project firstly sends a readProperty message, and the current value of a binary_input object of the embedded BACnet device is read (as shown in FIG. 8); when the switch state of the switch button is switched, the engineering also changes the state of the switch correspondingly to sending a WriteProperty message, as shown in fig. 9. The engineering normally displays the switch state, which indicates that the module responds to the readProperty/WriteProperty message without errors. It can be seen that the embedded BACnet device supporting B-SA in this embodiment may be connected to a general actuator to implement real-time monitoring of the actuator, and meets the requirements of the BACnet system.
Referring to fig. 10, a schematic structural diagram of an embedded BACnet intelligent actuator according to a third embodiment of the present invention is provided.
In this embodiment, the embedded BACnet intelligent actuator includes an actuator 3 and the embedded BACnet device supporting B-SA described in any of the foregoing embodiments, where the actuator 3 and an actuator interface 11 of the embedded BACnet device supporting B-SA may be quickly connected. Preferably, the actuator 3 is detachably plugged with the actuator interface 11 of the embedded BACnet device supporting B-SA.
According to the embodiment, the embedded BACnet intelligent actuator can be quickly built by connecting the embedded BACnet device supporting the B-SA with the actuator, and can be accessed into a BACnet network to directly communicate with other Bacnet devices in a Bacnet data packet mode, so that a pure BACnet system can be formed, and resource waste is avoided.
Another embodiment of the invention provides a BACnet building automatic control system. In the BACnet building automatic control system, the embedded BACnet intelligent actuator according to any one of the embodiments is adopted as an actuator of the bottom device, and the embedded BACnet intelligent actuator is connected to a communication network to communicate with other BACnet devices, wherein the communication network comprises a wired network, a wireless network, a BACnet network, an 802.11X network or an ethernet network.
It can be seen that in the BACnet building automatic control system provided in this embodiment, since the actuator serving as the bottom device is connected to the embedded BACnet device supporting the B-SA to form the embedded BACnet intelligent actuator, the embedded BACnet intelligent actuator can be directly connected to the BACnet network to communicate with other BACnet devices. The technical scheme provided by the invention is that the communication problem is solved from the bottom equipment, after an actuator is connected with the embedded BACnet device supporting the B-SA (or the embedded BACnet device supporting the B-SA is embedded into the actuator), the original traditional distributed control system DCS is converted into a field bus-based fully-distributed control system FCS (Fieldbus Control System ), so that a pure Bacnet system can be constructed.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (10)

1. The embedded BACnet device supporting B-SA is characterized by adopting an embedded chip for integration, and comprising a main control module and a communication module, wherein the main control module comprises a control unit, and an executor interface, a storage unit, a communication interface, a decoding unit and an encoding unit which are respectively connected with the control unit;
The controller interface is used for acquiring the current state of the actuator in real time through the controller interface and updating the current state into the current value of the corresponding first object created by the storage unit; the embedded BACnet device is connected with the execution quick through the executor interface to form a BACnet intelligent executor to be directly connected into a BACnet network;
the communication interface is used for being connected with the communication module to perform data transmission, and the control unit decodes the data packet received by the communication interface through the decoding unit;
when the decoding unit judges that the data packet is a read attribute request message and requests to read the current value of the first object, the control unit encodes the current value of the first object through the encoding unit to generate a BACnet data packet, and outputs the BACnet data packet as a read attribute response message through the communication interface to return;
when the decoding unit judges that the data packet is a writing attribute request message and requests to modify the current value of the second object created by the storage unit, the control unit updates the parameters of the object requested to be modified in the writing attribute request message to the current value of the second object, encodes the parameters by the encoding unit to generate a BACnet data packet serving as a writing attribute response message, and outputs the BACnet data packet by the communication interface to return; the control unit is also used for reading in real time and correspondingly controlling according to the current value of the second object so as to update the current state of the actuator.
2. The B-SA enabled embedded BACnet device of claim 1, wherein the decoding unit comprises:
the BACnet message judging unit is used for judging whether the data packet received by the communication interface is a BACnet/IP message or not;
the message service type judging unit is used for judging that the BACnet/IP message is a read attribute request message or a write attribute request message when the data packet received by the communication interface is the BACnet/IP message;
a request object judging unit, configured to judge whether an object that the read attribute request message/write attribute request message requests to read/write exists in the storage unit when the BACnet/IP message is a read attribute request message or a write attribute request message;
and the request object attribute judging unit is used for judging whether the request attribute is a read/write current value or not when the object of the read/write attribute request message requested by the read attribute request message exists in the storage unit.
3. The B-SA supporting embedded BACnet device according to claim 2, wherein the request object judging unit judges that an object of the read attribute request message/write attribute request message request read/write exists in the storage unit by an object identifier of the read attribute request message/write attribute request message request read/write; the request object attribute judging unit judges whether the request attribute is a read current value or not according to the object attribute identifier which is requested to be read/written by the read attribute request message/write attribute request message.
4. The B-SA enabled embedded BACnet device of claim 3, wherein the decoding unit further comprises:
an invokeID extraction unit, configured to extract an invokeID of the read attribute request message/write attribute request message when the BACnet/IP message is the read attribute request message/write attribute request message;
an instance serial number extracting unit, configured to extract an instance serial number of an object identifier that is requested to be read/written by the read attribute request message/write attribute request message when the request attribute is a read/write current value;
the extracted invokeID and the instance serial number of the object identifier are further used for encoding by the encoding unit to generate the BACnet data packet.
5. The B-SA enabled embedded BACnet device of claim 1, wherein the first object and the second object may be the same object.
6. The B-SA enabled embedded BACnet device of claim 2, wherein the master control module further comprises a data conversion unit connected to the control unit;
when the parameter value of the current state of the actuator received by the actuator interface is an analog signal, the control unit converts the parameter value of the analog signal into the parameter value of the digital signal through the data conversion unit and then updates the parameter value into the current value of the first object created by the storage unit; and
The control unit converts the current value of the second object read in real time into an analog signal through the data conversion unit and then outputs the analog signal to update the current state of the actuator.
7. The embedded BACnet device supporting B-SA according to claim 1, wherein the communication module is integrally connected or detachably plugged with a communication interface of the main control module; the communication module is an Ethernet module or a WIFI module.
8. An embedded BACnet intelligent actuator, characterized in that the embedded BACnet intelligent actuator comprises an actuator and the embedded BACnet device supporting B-SA according to any of claims 1 to 7, wherein the actuator can be quickly connected with an actuator interface of the embedded BACnet device supporting B-SA.
9. The embedded BACnet intelligent actuator of claim 8, wherein the actuator interface with the B-SA enabled embedded BACnet device is a detachable plug-in.
10. A BACnet building automatic control system, characterized in that the embedded BACnet intelligent actuator as claimed in claim 9 is adopted as an actuator of an underlying device, and the embedded BACnet intelligent actuator is connected into a communication network to communicate with other BACnet devices, wherein the communication network comprises a wired network, a wireless network, a BACnet network, an 802.11X network or an ethernet network.
CN202111677704.9A 2021-12-31 2021-12-31 B-SA supported embedded BACnet device, actuator and building automatic control system Active CN114363423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111677704.9A CN114363423B (en) 2021-12-31 2021-12-31 B-SA supported embedded BACnet device, actuator and building automatic control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111677704.9A CN114363423B (en) 2021-12-31 2021-12-31 B-SA supported embedded BACnet device, actuator and building automatic control system

Publications (2)

Publication Number Publication Date
CN114363423A CN114363423A (en) 2022-04-15
CN114363423B true CN114363423B (en) 2023-12-19

Family

ID=81105496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111677704.9A Active CN114363423B (en) 2021-12-31 2021-12-31 B-SA supported embedded BACnet device, actuator and building automatic control system

Country Status (1)

Country Link
CN (1) CN114363423B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571795A (en) * 2012-01-12 2012-07-11 浙江大学 Building automatic control system based on building automatic control network (BACnet) and European installation bus (EIB) protocol
CN109417497A (en) * 2016-04-12 2019-03-01 江森自控科技公司 The device and method of system integrating for HVAC device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571795A (en) * 2012-01-12 2012-07-11 浙江大学 Building automatic control system based on building automatic control network (BACnet) and European installation bus (EIB) protocol
CN109417497A (en) * 2016-04-12 2019-03-01 江森自控科技公司 The device and method of system integrating for HVAC device

Also Published As

Publication number Publication date
CN114363423A (en) 2022-04-15

Similar Documents

Publication Publication Date Title
US20060067209A1 (en) Universal configurable device gateway
CN110417783B (en) Data transmission method and device based on Internet of things, storage medium and terminal
EP1696606A1 (en) Service framework for home network
CN104521219A (en) Message tunneling in industrial networks
CN100367235C (en) Method for realizing automatic test and its system
WO2011150715A1 (en) Method and device for collecting data of third-party equipment in distributed control system
KR101743904B1 (en) Gateway and tranforming method between iec61850 protocol and dnp3.0 protocol
JP2003263334A (en) Equipment diagnostic method, remote testing device and network equipment
CN106790222A (en) A kind of MODBUS/ interconnects manufacture network information service adapter and its implementation entirely
CN104010005A (en) Method and system supporting access of sensors of different types
WO2018176244A1 (en) Data collection method, device, and dynamic environment network management system
EP1396962A1 (en) Bus service interface
CN111522727A (en) Simulation object test method, device and system
CN111510363A (en) Slave station conversion device based on MODBUS protocol and control method thereof
CN104378372B (en) The method of electronic equipment and operation electronic equipment for communicating in a network
CN109445384B (en) Multi-device control system
CN103905233B (en) Realize method, system and the access network device of analog sensor plug and play
CN112235325B (en) Method and system for performing access control on functional module connected with intelligent terminal
CN114363423B (en) B-SA supported embedded BACnet device, actuator and building automatic control system
CN114374574B (en) B-SS supporting embedded BACnet device, sensor and building automatic control system
CN116095191A (en) Wireless communication method, system and storage medium of zigbee bridging data
CN106059635A (en) Bluetooth setting method and device for electronic equipment and Bluetooth connection method
CN115695090A (en) Data transmission method, internet of things gateway equipment and computer readable storage medium
CN112527453B (en) Virtualization information simulation system, method and computer-readable storage medium
CN108391245A (en) Plug and play type wireless sensor network node

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