Journal of Computer Applications ›› 2025, Vol. 45 ›› Issue (4): 1263-1270.DOI: 10.11772/j.issn.1001-9081.2024040534
• Network and communications • Previous Articles Next Articles
Dingmu YANG, Longqiang NI(), Jing LIANG, Zhaoyuan QIU, Yongzhen ZHANG, Zhiqiang QI
Received:
2024-05-09
Revised:
2024-08-30
Accepted:
2024-09-02
Online:
2025-04-08
Published:
2025-04-10
Contact:
Longqiang NI
About author:
YANG Dingmu, born in 1999, M. S. candidate. His research interests include information communication, intelligent decision-making.通讯作者:
倪龙强
作者简介:
杨定木(1999—),男(布依族),贵州安龙人,硕士研究生,主要研究方向:信息通信、智能决策CLC Number:
Dingmu YANG, Longqiang NI, Jing LIANG, Zhaoyuan QIU, Yongzhen ZHANG, Zhiqiang QI. Protocol conversion method based on semantic similarity[J]. Journal of Computer Applications, 2025, 45(4): 1263-1270.
杨定木, 倪龙强, 梁晶, 邱照原, 张永真, 齐志强. 基于语义相似度的协议转换方法[J]. 《计算机应用》唯一官方网站, 2025, 45(4): 1263-1270.
Add to citation manager EndNote|Ris|BibTeX
URL: https://www.joca.cn/EN/10.11772/j.issn.1001-9081.2024040534
类型标签 | 类型 | 类型说明 |
---|---|---|
0 | 映射默认字段 | 字段值来源于其他报文的映射,当不存在映射值时,若字段是固定字段,则使用默认值填充, 例如HTTP的端口(port)字段;若是可选字段,直接舍弃,例如CoAP的请求参数(Uri-Query)字段 |
1 | 映射计算字段 | 字段值来源于其他报文的映射,当不存在映射值时,若字段是固定字段,按照指定的计算方法计算填充, 例如CoAP的报文编号(Message ID)字段,若是可选字段,直接舍弃 |
2 | 默认字段 | 字段值来源于默认值,例如HTTP的版本(Version)字段 |
3 | 计算字段 | 按照指定的计算方法计算字段值,例如报文长度字段 |
Tab. 1 Description of field types
类型标签 | 类型 | 类型说明 |
---|---|---|
0 | 映射默认字段 | 字段值来源于其他报文的映射,当不存在映射值时,若字段是固定字段,则使用默认值填充, 例如HTTP的端口(port)字段;若是可选字段,直接舍弃,例如CoAP的请求参数(Uri-Query)字段 |
1 | 映射计算字段 | 字段值来源于其他报文的映射,当不存在映射值时,若字段是固定字段,按照指定的计算方法计算填充, 例如CoAP的报文编号(Message ID)字段,若是可选字段,直接舍弃 |
2 | 默认字段 | 字段值来源于默认值,例如HTTP的版本(Version)字段 |
3 | 计算字段 | 按照指定的计算方法计算字段值,例如报文长度字段 |
类型 | 来源 |
---|---|
协议标准文档 | RFC 9110[ RFC 7641[ |
协议转换标准文档 | RFC 8075[ |
相关网页搜索 | MQTT协议等相关网页 |
Tab. 2 Data sources
类型 | 来源 |
---|---|
协议标准文档 | RFC 9110[ RFC 7641[ |
协议转换标准文档 | RFC 8075[ |
相关网页搜索 | MQTT协议等相关网页 |
字段名称 | 字段值 | 字段语义 | 分类标签 |
---|---|---|---|
Ver | 1 | 版本编号,指示协议的版本号 | 2 |
TKL | — | 用于指示Token字段的字节长度 | 3 |
Message ID | — | 报文编号,客户端和服务器 建立请求和响应报文之间的 一一对应关系。在同一次 会话中保持不变,会话结束后 将会被回收重复利用 | 1 |
Uri-Host | — | 请求将要发送到的服务器的 主机名 | 0 |
分隔符 | 0xFF | 分隔符,默认为0xFF,用于分隔 CoAP的首部和负载 | 2 |
Payload | — | 报文负载,有用的被交互的数据 | 0 |
Option-Length | — | Option Value字段的字节长度 | 3 |
Content- Format | 0 | 表示text/plain;charset=utf-8, 负载类型为文本数据,默认为 UTF8编码 | 0 |
42 | 表示application/octet-stream, 负载类型为二进制数据流 | 0 | |
Code | 0.01 | GET请求方法,用于访问获得 服务端的信息资源 | 0 |
4.04 | Not Found,服务器找不到资源 | 0 |
Tab. 3 Examples of some fields in CoAP
字段名称 | 字段值 | 字段语义 | 分类标签 |
---|---|---|---|
Ver | 1 | 版本编号,指示协议的版本号 | 2 |
TKL | — | 用于指示Token字段的字节长度 | 3 |
Message ID | — | 报文编号,客户端和服务器 建立请求和响应报文之间的 一一对应关系。在同一次 会话中保持不变,会话结束后 将会被回收重复利用 | 1 |
Uri-Host | — | 请求将要发送到的服务器的 主机名 | 0 |
分隔符 | 0xFF | 分隔符,默认为0xFF,用于分隔 CoAP的首部和负载 | 2 |
Payload | — | 报文负载,有用的被交互的数据 | 0 |
Option-Length | — | Option Value字段的字节长度 | 3 |
Content- Format | 0 | 表示text/plain;charset=utf-8, 负载类型为文本数据,默认为 UTF8编码 | 0 |
42 | 表示application/octet-stream, 负载类型为二进制数据流 | 0 | |
Code | 0.01 | GET请求方法,用于访问获得 服务端的信息资源 | 0 |
4.04 | Not Found,服务器找不到资源 | 0 |
评价指标 | 值 |
---|---|
微平均精准率 | 94.44 |
微平均召回率 | 94.44 |
微平均F1值 | 94.44 |
Tab. 4 Evaluation of classification results
评价指标 | 值 |
---|---|
微平均精准率 | 94.44 |
微平均召回率 | 94.44 |
微平均F1值 | 94.44 |
CoAP | HTTP | 标签 | ||||
---|---|---|---|---|---|---|
字段名 | 字段值 | 字段语义 | 字段名 | 字段值 | 字段语义 | |
Content- Format | 50 | 表示application/json,负载类型为 JSON格式的二进制数据 | Content-Type | application/json | 负载的数据类型为二进制的 JSON格式 | 1 |
42 | 表示application/octet-stream, 负载类型为二进制数据流 | application/xml | 负载类型为XML格式的二进制数据 | 0 | ||
Code | 0.01 | GET请求方法,用于访问获得服务端的信息资源 | Method | GET | 根据URL获得服务器的资源 | 1 |
0.03 | POST请求方法,请求服务端创建新的资源 | PUT | PUT请求方法,请求服务端更新资源 | 0 | ||
2.04 | 表示Changed,说明请求已执行,资源已更新 | Status-Code | 200 | 表示OK,说明请求已执行 | 1 | |
204 | 表示No Content,说明请求已执行, 响应负载为空 | 1 | ||||
2.05 | 表示Content,说明请求已执行,响应负载不为空 | 200 | 表示OK,说明请求已执行 | 1 |
Tab. 5 Some datasets with CoAP and HTTP field semantic matching
CoAP | HTTP | 标签 | ||||
---|---|---|---|---|---|---|
字段名 | 字段值 | 字段语义 | 字段名 | 字段值 | 字段语义 | |
Content- Format | 50 | 表示application/json,负载类型为 JSON格式的二进制数据 | Content-Type | application/json | 负载的数据类型为二进制的 JSON格式 | 1 |
42 | 表示application/octet-stream, 负载类型为二进制数据流 | application/xml | 负载类型为XML格式的二进制数据 | 0 | ||
Code | 0.01 | GET请求方法,用于访问获得服务端的信息资源 | Method | GET | 根据URL获得服务器的资源 | 1 |
0.03 | POST请求方法,请求服务端创建新的资源 | PUT | PUT请求方法,请求服务端更新资源 | 0 | ||
2.04 | 表示Changed,说明请求已执行,资源已更新 | Status-Code | 200 | 表示OK,说明请求已执行 | 1 | |
204 | 表示No Content,说明请求已执行, 响应负载为空 | 1 | ||||
2.05 | 表示Content,说明请求已执行,响应负载不为空 | 200 | 表示OK,说明请求已执行 | 1 |
方法 | 精准率 | 召回率 | F1 |
---|---|---|---|
文献[ | 79.61 | 80.12 | 79.86 |
本文方法 | 90.70 | 95.12 | 92.86 |
Tab. 6 Comparison of precision, recall, and F1 value for mapping relationship identification
方法 | 精准率 | 召回率 | F1 |
---|---|---|---|
文献[ | 79.61 | 80.12 | 79.86 |
本文方法 | 90.70 | 95.12 | 92.86 |
HTTP | CoAP | ||
---|---|---|---|
字段名称 | 字段值 | 字段名称 | 字段值 |
Method | GET | Code | 0.01 |
POST | 0.03 | ||
DELETE | 0.04 | ||
PUT | 0.02 | ||
Status-Code | 200 | 2.02 | |
204 | |||
400 | 4.02 | ||
500 | |||
Uri-Path | * | Uri-Path | * |
Payload | * | Entity | * |
Accept | application/json | Accept | 50 |
application/octet-stream | 42 | ||
Content-Type | text/plain | Content-Format | 0 |
application/xml | 41 |
Tab. 7 HTTP and CoAP field mapping tables (part)
HTTP | CoAP | ||
---|---|---|---|
字段名称 | 字段值 | 字段名称 | 字段值 |
Method | GET | Code | 0.01 |
POST | 0.03 | ||
DELETE | 0.04 | ||
PUT | 0.02 | ||
Status-Code | 200 | 2.02 | |
204 | |||
400 | 4.02 | ||
500 | |||
Uri-Path | * | Uri-Path | * |
Payload | * | Entity | * |
Accept | application/json | Accept | 50 |
application/octet-stream | 42 | ||
Content-Type | text/plain | Content-Format | 0 |
application/xml | 41 |
字段名 | 字段 大小/B | 字段 默认值 | 字段语义 |
---|---|---|---|
Version | 1 | 1.0 | 版本编号,指示协议的版本号 |
Server | 1 | 0 | 应用标识符,区分不同报文的应用服务 |
CRC | 2 | — | CRC校验,检测数据传输的正确性 |
Src | 2 | — | 发送端ID,表示协议报文的发送地址 |
Des | 2 | — | 接收端ID,表示协议报文的目的地址 |
Length | 4 | — | 报文字节长度、协议头和协议体的总长度 |
Key | 变长 | — | 表示Value字段的标签 |
Value | 变长 | — | 表示报文负载的具体内容 |
Tab. 8 JSON protocol field description
字段名 | 字段 大小/B | 字段 默认值 | 字段语义 |
---|---|---|---|
Version | 1 | 1.0 | 版本编号,指示协议的版本号 |
Server | 1 | 0 | 应用标识符,区分不同报文的应用服务 |
CRC | 2 | — | CRC校验,检测数据传输的正确性 |
Src | 2 | — | 发送端ID,表示协议报文的发送地址 |
Des | 2 | — | 接收端ID,表示协议报文的目的地址 |
Length | 4 | — | 报文字节长度、协议头和协议体的总长度 |
Key | 变长 | — | 表示Value字段的标签 |
Value | 变长 | — | 表示报文负载的具体内容 |
字段名 | 字段大小/B | 字段默认值 | 字段语义 |
---|---|---|---|
Server | 1 | 0 | 服务标识符,区分不同报文服务 |
TagNum | 1 | — | 报文负载的标签数量,根据它可计算报文的字节长度 |
CRC | 2 | — | 循环冗余校验,检测数据传输的正确性 |
Src | 2 | — | 发送方ID,表示报文的发送地址 |
Des | 2 | — | 接收方ID,表示报文的接收地址 |
Tag | 2 | — | 表示Value字段的类型或标签 |
Length | 2 | — | 表示Value字段的长度 |
Value | 变长 | — | 表示报文携带的负载内容 |
Tab. 9 TLV protocol field description
字段名 | 字段大小/B | 字段默认值 | 字段语义 |
---|---|---|---|
Server | 1 | 0 | 服务标识符,区分不同报文服务 |
TagNum | 1 | — | 报文负载的标签数量,根据它可计算报文的字节长度 |
CRC | 2 | — | 循环冗余校验,检测数据传输的正确性 |
Src | 2 | — | 发送方ID,表示报文的发送地址 |
Des | 2 | — | 接收方ID,表示报文的接收地址 |
Tag | 2 | — | 表示Value字段的类型或标签 |
Length | 2 | — | 表示Value字段的长度 |
Value | 变长 | — | 表示报文携带的负载内容 |
TLV协议 | JSON协议 | ||||
---|---|---|---|---|---|
Server | Src | Des | Key | Value | |
Server | 0.911 6 | 0.498 2 | 0.560 6 | 0.489 7 | 0.637 5 |
Src | 0.525 2 | 0.870 0 | 0.828 0 | 0.380 6 | 0.525 0 |
Des | 0.542 0 | 0.840 6 | 0.861 0 | 0.430 6 | 0.593 9 |
Tag | 0.424 7 | 0.485 1 | 0.501 8 | 0.885 9 | 0.527 9 |
Value | 0.502 2 | 0.472 5 | 0.498 9 | 0.465 3 | 0.866 0 |
Tab. 10 JSON and TLV protocol field semantic similarity
TLV协议 | JSON协议 | ||||
---|---|---|---|---|---|
Server | Src | Des | Key | Value | |
Server | 0.911 6 | 0.498 2 | 0.560 6 | 0.489 7 | 0.637 5 |
Src | 0.525 2 | 0.870 0 | 0.828 0 | 0.380 6 | 0.525 0 |
Des | 0.542 0 | 0.840 6 | 0.861 0 | 0.430 6 | 0.593 9 |
Tag | 0.424 7 | 0.485 1 | 0.501 8 | 0.885 9 | 0.527 9 |
Value | 0.502 2 | 0.472 5 | 0.498 9 | 0.465 3 | 0.866 0 |
1 | 刘亚秋,胡铁楠,吕云蕾. 基于嵌入式技术的多协议转换系统研究[J]. 仪表技术与传感器, 2020(2):62-66, 70. |
LIU Y Q, HU T N, LYU Y L. Research on multi-protocol conversion system based on embedded technology[J]. Instrument Technique and Sensor, 2020(2): 62-66, 70. | |
2 | 宗娜. M2M通信中HTTP与CoAP的协议转换代理的研究与实现[D]. 北京:北京邮电大学, 2016:10-46. |
ZONG N. Research and implementation of the protocol conversion proxy of HTTP and CoAP in M2M communication[D]. Beijing: Beijing University of Posts and Telecommunications, 2016:10-46. | |
3 | 赵小虎,王宽,沈雪茹,等. 面向煤矿井下的多协议融合网关设计[J]. 工矿自动化, 2019, 45(1):6-12. |
ZHAO X H, WANG K, SHEN X R, et al. Design of multi-protocol fusion gateway for underground coal mine[J]. Journal of Mine Automation, 2019, 45(1): 6-12. | |
4 | ZAINUDIN A, SYAIFUDIN M F, SYAHRONI N. Design and implementation of node gateway with MQTT and CoAP protocol for IoT applications[C]// Proceedings of the 4th International Conference on Information Technology, Information Systems and Electrical Engineering. Piscataway: IEEE, 2019:155-159. |
5 | 朱家祺. 物联网通信协议转换技术的研究与实现[D]. 武汉:华中科技大学, 2022:9-35. |
ZHU J Q. Research and implementation of internet of things communication protocol conversion technology[D]. Wuhan: Huazhong University of Science and Technology, 2022:9-35. | |
6 | 苗力心. 软件定义协议转换关键技术研究[D]. 郑州:信息工程大学, 2020:25-43. |
MIAO L X. Research on key technologies of software-defined protocol conversion[D]. Zhengzhou: Information Engineering University, 2020:25-43. | |
7 | 林映利. 基于知识图谱的通信协议转换方法研究与应用[D]. 北京:北京交通大学, 2023:25-41. |
LIN Y L. Research and application of communication protocol conversion based on knowledge graph[D]. Beijing: Beijing Jiaotong University, 2023:25-41. | |
8 | SAITO K, NISHI H. Application protocol conversion corresponding to various IoT protocols[C]// Proceedings of the 46th International Conference on Annual Conference of the IEEE Industrial Electronics Society. Piscataway: IEEE, 2020:5219-5225. |
9 | DEVLIN J, CHANG M W, LEE K, et al. BERT: pre-training of deep bidirectional transformers for language understanding[C]// Proceedings of the 2019 International Conference on North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). Stroudsburg: ACL, 2019:4171-4186. |
10 | REIMERS N, GUREVYCH I. Sentence-BERT: sentence embeddings using Siamese BERT-networks[C]// Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing. Stroudsburg: ACL, 2019: 3982-3992. |
11 | 中国电子协会. 机器人互操作通用规范: T/ [S/OL]. [2024-04-02].. |
Chinese Institute of Electronics. Robot-to-robot interoperability general specification: T/ [S/OL]. [2024-04-02].. | |
12 | 涂远来,周家乐,王慧锋. 基于BERT预训练模型的事故案例文本分类方法[J]. 华东理工大学学报(自然科学版), 2023, 49(4):576-582. |
TU Y L, ZHOU J L, WANG H F. Text classification method of accident cases based on BERT pre-training model[J]. Journal of East China University of Science and Technology, 2023, 49(4): 576-582. | |
13 | 杨飘,董文永. 基于BERT嵌入的中文命名实体识别方法[J]. 计算机工程, 2020, 46(4):40-45, 52. |
YANG P, DONG W Y. Chinese named entity recognition method based on BERT embedding[J]. Computer Engineering, 2020, 46(4): 40-45, 52. | |
14 | 段丹丹,唐加山,温勇,等. 基于BERT模型的中文短文本分类算法[J]. 计算机工程, 2021, 47(1):79-86. |
DUAN D D, TANG J S, WEN Y, et al. Chinese short text classification algorithm based on BERT model[J]. Computer Engineering, 2021, 47(1): 79-86. | |
15 | FIELDING R, NOTTINGHAM M, RESCHKE J. HTTP semantics: RFC 9110 [S/OL]. [2024-04-02].. |
16 | FIELDING R, NOTTINGHAM M, RESCHKE J. HTTP/1.1: RFC 9112 [S/OL]. [2024-04-02].. |
17 | SHELBY Z, HARTKE K, BORMANN C. The Constrained Application Protocol (CoAP): RFC 7252 [S/OL]. [2024-04-02].. |
18 | HARTKE K. Observing resources in the Constrained Application Protocol (CoAP): RFC 7641 [S/OL]. [2024-04-02].. |
19 | CASTELLANI A, LORETO S, RAHMAN A, et al. Guidelines for mapping implementations: HTTP to the Constrained Application Protocol (CoAP): RFC 8075 [S/OL]. [2024-04-02].. |
[1] | Rui XIAO, Mingyi LIU, Zhiying TU, Zhongjie WANG. Personal event detection method based on text mining in social media [J]. Journal of Computer Applications, 2022, 42(11): 3513-3519. |
[2] | ZHAO Xiaohu, ZHAO Chenglong. Knowledge base question answering system based on multi-feature semantic matching [J]. Journal of Computer Applications, 2020, 40(7): 1873-1878. |
[3] | WANG Yuanlong. Sentence composition model for reading comprehension [J]. Journal of Computer Applications, 2017, 37(6): 1741-1746. |
[4] | ZHANG Shuowang, OUYANG Chunping, YANG Xiaohua, LIU Yongbin, LIU Zhiming. Word semantic similarity computation based on integrating HowNet and search engines [J]. Journal of Computer Applications, 2017, 37(4): 1056-1060. |
[5] | QIU Yunfei, LIU Shixing, LIN Mingming, SHAO Liangshan. Feature transfer weighting algorithm based on distribution and term frequency-inverse class frequency [J]. Journal of Computer Applications, 2015, 35(6): 1643-1648. |
[6] | YANG Wu LI Yang LU Ling. Micro-blog hot topics detection method based on user role orientation [J]. Journal of Computer Applications, 2013, 33(11): 3076-3079. |
[7] | ZHANG Yiwen YUE Lihua Yifei LI Qing CHENG Jiaxing. Friends recommended method based on common users and similar labels [J]. Journal of Computer Applications, 2013, 33(08): 2273-2275. |
[8] | ZHU Zhengyu SUN Junhua. Improved vocabulary semantic similarity calculation based on HowNet [J]. Journal of Computer Applications, 2013, 33(08): 2276-2279. |
[9] | LI Hua CHU He-lan GAO Min. Semantic orientation study on Chinese network comments [J]. Journal of Computer Applications, 2012, 32(11): 3023-3033. |
[10] | JIANG Da-qing ZHOU Yong XIA Shi-xiong. Network performance data clustering method based on semantic description and optimization [J]. Journal of Computer Applications, 2012, 32(06): 1522-1525. |
[11] | FENG Yong ZHANG Yang. Deep Web query interface schema matching based on matching degree and semantic similarity [J]. Journal of Computer Applications, 2012, 32(06): 1688-1691. |
[12] | CHEN Bing-xin QIU Bao-zhi. Construction technology of cluster message-oriented middleware [J]. Journal of Computer Applications, 2012, 32(05): 1425-1428. |
[13] | XU An-long. Improved computation method for semantic similarity between gene ontology terms [J]. Journal of Computer Applications, 2012, 32(05): 1329-1331. |
[14] | CHEN Ming SONG Bao TANG Xiao-qi. Network conversion gateway based on DSP and FPGA [J]. Journal of Computer Applications, 2011, 31(10): 2617-2620. |
[15] | HAN Xian-yu JIANG Ying. Method of semantic similarity calculation for component testing ontology [J]. Journal of Computer Applications, 2011, 31(06): 1487-1490. |
Viewed | ||||||
Full text |
|
|||||
Abstract |
|
|||||