1、 KSKSKSKSKSKSKSK KSKSKS KSKSK KSKS KSK KS KS X 4501 2 2: KS X 4501 2:2011 2011 12 30 http:/www.kats.go.krKS X 4501 2:2011 : ( ) ( ) () () ( ) : () ( ) RFID/USN : (http:/www.standard.go.kr) : :2011 3 3 :2011 12 30 2011-0702 : : ( 02-509-7262) (http:/www.kats.go.kr). 10 5 , . KS X 4501 2:2011 i ii 1 1
2、 2 1 3 .1 4 2 4.1 2 4.2 2 KS X 4501 2:2011 .58 KS X 4501 2:2011 ii , . . 5 , (interoperability), (efficiency), (consistency), (flexibility), (practicality) , , . 2011 3 KS X 4501 2, KS X 4502 3 . KS X 4501 . 1: 2: 3: 4: KS X 4501 2:2011 2: The interworking protocol between the heterogeneous home net
3、work control middlewares for the intelligent home network Part 2: Base protocol 1 . 2 . . ( ) . KS X 4501 1, 1: KS X 4501 3, 3: ISO/IEC 15045 1:2004, Information technology Home Electronic Systems (HES) gateway 3 KS X 4501 1 3. . KS X 4501 2:2011 2 4 4.1 “ISO/IEC 15045 1:2004 Information technology
4、Home Electronic Systems(HES) gateway” . , KS X 4501 1 5. . 1 , 1 . . (middleware A schema) (adaptor A) (IWF engine) (IWML schema) , (adaptor B) (middleware B schema) . A (middleware A schema) A XML . XML A (middleware A XML schema) A (rule) IWML . IWML B XML B (middleware B XML schema) , B B (middle
5、ware B schema) . . 4.2 TCP/IP , . , . KS X 4501 2:2011 3 4.2.1 4.2.1.1 Header Body . Header , , , , , , (binary code) . . Body Header . Message Endian Type Little Endian , Reserved . Des Adaptor ID 0 , Des Adaptor ID Adaptor . 1 Message Size (Binary) 4 BytesHeader Version (Binary) 1 BytesHeader Type
6、 Code Header Type 00000000(2) 00000001(2) 1 BytesHeader Size (Binary) 1 BytesHeader Reserved (Binary) 1 BytesSrc Adaptor ID Source Adaptor ID 4 BytesDes Adaptor ID Destination Adaptor ID 4 BytesMessage Type (4.2.1.3 ) 2 BytesMessage Sub Type (4.2.1.4 ) 2 BytesMessage Encoding Type Code Encoding Type
7、 0000000000000000(2)utf 8 0000000000000001(2)utf 16 0000000000000010(2)ksc 5601 0000000000000011(2)euc kr 0000000000000100(2)us en 0000000000000101(2)us ascii 0000000000000110(2) 1111111111111111(2)Reserved 2 BytesCheck Sum (Binary) Message Size 16bit Src Adaptor ID 16bit Message Type Message Encodi
8、ng Type Message Sub Type 2 BytesHeader Reserved 40 BytesBody . 4.2.1.2 KS X 4501 2:2011 4 4.2.1.1 (header type) . . , , , , , , , , , , , , , , , , , , , , , , , . , 4 , 4 . 4.2.1.2.1 1) 4.2.1.1 . 2) , , . 3) 3 . 4) XML, ASCII, Binary, NULL 4 , . 5) (header type, message type, message subtype) 2 , 4
9、.2.2 KS X 4501 3 . 2 Header Type Message Type Message SubType Body 0x0000 XML( .)0x0001 XML 0x0002 XML( .)0x0003 XML( .)0x0004 XML 0x0005 XML 0x0006 XML 0x0007 0x0008 XML 0x0009 XML 0x000A XML 0x000B XML 0x000C XML 0x000D XML 0x000E XML 0x000F XML 0x00 ( ) 0x0000 0x0010 XML KS X 4501 2:2011 5 2 ( )
10、Header Type Message Type Message SubType Body 0x0000 ASCII 0x0001 ASCII 0x0002 ASCII 0x0003 ASCII 0x0004 ASCII 0x0005 ASCII 0x0006 ASCII 0x0007 ASCII 0x0008 ASCII 0x0009 ASCII 0x000A ASCII 0x000B ASCII 0x000C ASCII 0x000D ASCII 0x000E ASCII 0x000F ASCII 0x0001 0x0010 ASCII 0x0000 XML( .)0x0001 XML 0
11、x0002 XML( .)0x0003 XML( .)0x0004 XML 0x0005 0x0006 XML 0x0007 0x0008 XML 0x0009 XML 0x000A 0x000B XML 0x000C 0x000D XML 0x000E 0x000F XML 0x00 ( ) 0x0002 0x0010 KS X 4501 2:2011 6 2 ( ) Header Type Message Type Message SubType Body 0x0000 ASCII 0x0001 ASCII 0x0002 ASCII 0x0003 ASCII 0x0004 ASCII 0x
12、0005 ASCII 0x0006 ASCII 0x0007 ASCII 0x0008 ASCII 0x0009 ASCII 0x000A ASCII 0x000B ASCII 0x000C ASCII 0x000D ASCII 0x000E ASCII 0x000F ASCII 0x00 ( ) 0x0003 0x0010 ASCII 0x0000 Binary 0x0001 NULL 0x0002 XML 0x0003 NULL 0x0004 NULL 0x0004 0x0005 Binary 0x0000 ASCII 0x0001 ASCII 0x0002 ASCII 0x0003 Bi
13、nary 0x0004 Binary 0x0005 0x0005 ASCII 0x0000 NULL 0x0001 NULL 0x0002 NULL 0006 0x0003 Binary 0x0000 Binary 0x0001 Binary 0x0002 NULL 01 ( ) 0007 0x0003 ASCII KS X 4501 2:2011 7 2 ( ) Header Type Message Type Message SubType Body 0008 NULL 0009 NULL 000A NULL 01 ( ) 000B NULL 4.2.1.2.2 2 . , Body .
14、4Bytes “0x00000816” Hex Message Size Header Version Header Type “0x00”, Header Size “0x40” , Src Adaptor ID “0x00000065”, Des Adaptor ID “00000000”, Message Type Message Sub Type “0x0000”, “ 0x0001” . Message Encoding Type “0x0000” UTF 8 , Check Sum “ 0x07B2” . 4.2.1.1 . AdaptorIWF EngineConnection
15、Setup00000816 00 00 40 00 00000065 00000000 0000 0001 0000 07B2Reserved(40Byte)0.Reserved(40Byte)100000041 00 00 40 00 00000000 00000065 0001 0001 0000 0043 2 3 . , Body , . 4Bytes “0x00000322” Hex Message Size Header Version Header Type “0x00”, Header Size “0x40” , Src Adaptor ID “0x0000000B”, Des
16、Adaptor ID “0x0000000C”, Message Type Message Sub Type “0x0002”, “0x0004” . KS X 4501 2:2011 8 Message Encoding Type “0x0000” UTF 8 , Check Sum “0x031D” . 4.2.1.1 . AdaptorIWF EngineConnection Setup00000322 00 00 40 00 0000000B 0000000C 0002 0004 0000 031DReserved(40Byte)Light.Reserved(40Byte)100000
17、041 00 00 40 00 00000000 0000000B 0003 0004 0000 0048 3 4 . , , . 4Bytes “0x00000040” Hex Message Size Header Version Header Type “0x00” “0x01”, Header Size “0x40” , Src Adaptor ID “0x00000065”, Des Adaptor ID “0x00000000”, Message Type Message Sub Type “0x0004”, “0x0004” . Message Encoding Type “0x
18、0000” UTF 8 , Check Sum “E3FF” . 4.2.1.1 . AdaptorIWF EngineConnection Setup00000040 00 01 40 00 00000065 00000000 0004 0004 0000 E3FFReserved(40Byte)Reserved(40Byte)100000044 00 01 40 00 00000000 00000065 0005 0004 0000 004D 4 KS X 4501 2:2011 9 5 . , , . 4Bytes “0x00000040” Hex Message Size Header
19、 Version Header Type “0x00” “0x01”, Header Size “0x40” , Src Adaptor ID “0x00000000”, Des Adaptor ID “0x00000065”, Message Type Message Sub Type “0x0006”, “0x0000” . Message Encoding Type “0x0000” UTF 8 , Check Sum “0x0046” . 4.2.1.1 . AdaptorIWF EngineConnection Setup00000040 00 01 40 00 00000000 0
20、0000065 0006 0000 0000 0046Reserved(40Byte)Reserved(40Byte)TESTAAABBB00000074 00 01 40 00 00000065 00000000 0007 0000 0000 0016 5 4.2.1.3 (header type) , 6 , (message type) , , . 3 . KS X 4501 2:2011 10 Message Size (4Byte) Header Version(1Byte) Header Type(1Byte)Header Size(1Byte) Header Reserved (
21、1Byte) Src Adaptor ID (4Byte) Des Adaptor ID(4Byte) Message Type (2Byte) Message Sub Type (2Byte) Message Encoding Type (2Byte) Check Sum (2Byte) Reserved(40Byte) (the contents of the body depends on the message type.) 6 3 Header Type Message Type 0x0000 (MTYPE_AI_MESSAGE) 4 0x0001 (MTYPE_IA_MESSAGE
22、_RES) 4 0x0002 (MTYPE_IA_MESSAGE) 5 0x00 ( ) 0x0003 (MTYPE_AI_MESSAGE_RES) 5 0x0004 (MTYPE_AI_MGR_MESSAGE) 6 0x0005 (MTYPE_IA_MGR_MESSAGE_RES) 6 0x0006 (MTYPE_IA_MGR_MESSAGE) 7 0x0007 (MTYPE_AI_MGR_MESSAGE_RES) 7 0x0008 (MTYPE_IA_NONE_MESSAGE) 0x0009 (MTYPE_AI_NONE_MESSAGE) 0x01 ( ) 0x000A (MTYPE_IA_HEAD_E