CN115190184B - Binary message cell editing method, system and storage medium - Google Patents

Binary message cell editing method, system and storage medium Download PDF

Info

Publication number
CN115190184B
CN115190184B CN202210672260.8A CN202210672260A CN115190184B CN 115190184 B CN115190184 B CN 115190184B CN 202210672260 A CN202210672260 A CN 202210672260A CN 115190184 B CN115190184 B CN 115190184B
Authority
CN
China
Prior art keywords
binary
encoding
module
format file
message cell
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
CN202210672260.8A
Other languages
Chinese (zh)
Other versions
CN115190184A (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.)
Shenzhen Shenghui Technology Co ltd
Original Assignee
Shenzhen Shenghui Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Shenghui Technology Co ltd filed Critical Shenzhen Shenghui Technology Co ltd
Priority to CN202210672260.8A priority Critical patent/CN115190184B/en
Publication of CN115190184A publication Critical patent/CN115190184A/en
Application granted granted Critical
Publication of CN115190184B publication Critical patent/CN115190184B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Abstract

The invention provides a binary message cell editing method, a binary message cell editing system and a storage medium, wherein the binary message cell editing method comprises the following steps of: writing an ASN.1 protocol description file of a binary protocol according to the protocol document; step 2: converting the generated ASN.1 protocol description file into a specified code through an ASN.1 compiler; step 3: compiling the codes into a dynamic library; step 4: the encoding and decoding module is responsible for encoding and decoding binary information and editing the binary information, the binary information is converted into a specified format file through the encoding and decoding module, the specified format file is edited, and the edited specified format file can be converted into a binary code stream through the encoding and decoding module. The beneficial effects of the invention are as follows: the invention converts the binary information into the XML format file which can be read and written by the user, quickly modifies the binary information cells, recodes the binary information cells into binary code streams and improves the working efficiency.

Description

Binary message cell editing method, system and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a binary message cell editing method, system, and storage medium.
Background
Currently, in performance testing in the communication field, editing binary messages such as ICP requires writing an interface for a message structure to modify a message cell. ICP is a signaling control protocol between a terminal and a switching gateway. The ICP may be replaced with other binary protocols, ICP being just one example.
The defects of the background technology are as follows:
1. code is written for each cell modification in the message, modification interfaces are added, operation is troublesome, and efficiency is low.
2. The presentation readability of the message structure is poor.
Disclosure of Invention
The invention provides a binary message cell editing method, which comprises the following steps:
step 1: writing an ASN.1 protocol description file of a binary protocol according to the protocol document;
step 2: converting the generated ASN.1 protocol description file into a specified code by an ASN.1 compiler, wherein the code comprises a corresponding structure definition and a coding and decoding function of a binary message;
step 3: compiling codes generated by an ASN.1 compiler into a dynamic library, wherein the dynamic library is called by a coding and decoding module;
step 4: the encoding and decoding module is responsible for encoding and decoding binary information and editing the binary information, the binary information is converted into a specified format file through the encoding and decoding module, the specified format file is edited, and the edited specified format file can be converted into a binary code stream through the encoding and decoding module.
As a further improvement of the present invention, in the step 2 and the step 3, the code is a code of the C language.
As a further improvement of the present invention, the specified format file is an XML format file.
As a further improvement of the present invention, in the step 2, the codec function includes rules of binary messages and rules of XML format files.
As a further development of the invention, the codec module is responsible for managing the protocol library.
The invention also provides a binary message cell editing system, which comprises:
and (3) writing a module: an ASN.1 protocol description file for writing binary protocol according to the protocol document;
and a conversion module: the code comprises corresponding structure definition and coding and decoding functions of binary information;
and a compiling module: the code generation module is used for compiling codes generated by the ASN.1 compiler into a dynamic library, and the dynamic library is called by the encoding and decoding module;
the processing module is used for: the encoding and decoding module is responsible for encoding and decoding binary information and editing the binary information, the binary information is converted into a specified format file through the encoding and decoding module, the specified format file is edited, and the edited specified format file can be converted into a binary code stream through the encoding and decoding module.
As a further improvement of the present invention, in the conversion module and the compiling module, the code is a code of the C language.
As a further improvement of the present invention, the specified format file is an XML format file.
As a further improvement of the invention, in the conversion module, the codec function includes rules of binary messages and rules of XML format files.
The present invention also provides a computer readable storage medium storing a computer program configured to implement the steps of the binary message cell editing method of the present invention when called by a processor.
The beneficial effects of the invention are as follows: the invention converts the binary information into the XML format file which can be read and written by the user, quickly modifies the binary information cells, recodes the binary information cells into binary code streams and improves the working efficiency.
Drawings
Fig. 1 is a flow chart of the method of the present invention.
Detailed Description
As shown in fig. 1, the invention discloses a binary message cell editing method, which comprises the following steps:
step 1: an ASN.1 protocol description file of a binary protocol is written according to the protocol document.
Step 2: the generated ASN.1 protocol description file is converted into appointed codes (the codes can be codes in C language, C++ language or java language) through an ASN.1 compiler, the codes comprise corresponding structure body definitions and encoding and decoding functions of binary messages, and the encoding and decoding functions comprise binary rules and XML rules.
Step 3: code generated by an ASN.1 compiler is compiled into a dynamic library (the dynamic library refers to a dll library under windows or a so library under linux), and the dynamic library is called by a coding and decoding module.
Step 4: a coding and decoding module is compiled, the coding and decoding module is responsible for coding and decoding binary information and editing the binary information, and the binary information is converted into a specified format file (the specified format file is an XML format file) through the coding and decoding module; the encoding and decoding module is responsible for managing a protocol library, and the support of a new protocol is increased by a plug-in mode, wherein the new protocol refers to another protocol which is not compiled by the encoding and decoding module.
The codec module is capable of interconverting binary messages and XML formatted files.
The edited XML format file can be converted into binary code stream through the encoding and decoding module.
Example 1setup message editing
Binary message:
00 00 00 01 00 06 10 47 80 16 f9 9d 00 00 08 00 45 60 00 5f 00 00 40 00
30 11 f6 09 0e 99 5f dc 67 05 7e aa 4b 31 1f 40 00 4b 23 b7 10 7e 00 43 00
00 00 17 00 16 00 17 02 00 08 d6 af 00 00 00 00 00 00 00 0b ff ff ff ff 0e 30
30 38 35 35 33 38 33 30 30 31 39 31 36 0a 30 33 38 33 30 30 31 39 32 30
03 c0 a8 01 6a 0f a0 03 04 00 00 00
by converting into XML format file:
Figure BDA0003693649670000031
Figure BDA0003693649670000041
the binary code stream is reconverted by modifying the values of the cells associated therewith. Such as modification of
After < connect-ip > is 192.168.1.1:
00 00 00 01 00 06 10 47 80 16 f9 9d 00 00 08 00 45 60 00 5f 00 00 40 00 30 11 f6 09 0e 99 5f dc 67 05 7e aa 4b 31 1f 40 00 4b 23 b7 10 7e 00 43 00 00 00 17 00 16 00 17 02 00 08 d6 af 00 00 00 00 00 00 00 0b ff ff ff ff 0e 30 30 38 35 35 33 38 33 30 30 31 39 31 36 0a 30 33 38 33 30 30 31 39 32 30 03 c0 a8 01 01 0f a0 03 04 00 00 00。
the beneficial effects of the invention are as follows: the invention converts the binary information into the XML format file which can be read and written by the user, quickly modifies the binary information cells, recodes the binary information cells into binary code streams and improves the working efficiency.
The invention is applied to protocol test, and a tester only needs to conveniently modify the cell value in the binary message without adding a new code.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.

Claims (10)

1. A binary message cell editing method, comprising the steps of:
step 1: writing an ASN.1 protocol description file of a binary protocol according to the protocol document;
step 2: converting the generated ASN.1 protocol description file into a specified code by an ASN.1 compiler, wherein the code comprises a corresponding structure definition and a coding and decoding function of a binary message;
step 3: compiling codes generated by an ASN.1 compiler into a dynamic library, wherein the dynamic library is called by a coding and decoding module;
step 4: the encoding and decoding module is responsible for encoding and decoding binary information and editing the binary information, the binary information is converted into a specified format file through the encoding and decoding module, the specified format file is edited, and the edited specified format file can be converted into a binary code stream through the encoding and decoding module.
2. The binary message cell editing method according to claim 1, wherein in the step 2 and the step 3, the code is a code of C language.
3. The binary message cell editing method of claim 1, wherein the specified format file is an XML format file.
4. A binary message cell editing method according to claim 3, wherein in said step 2, said codec function comprises rules of binary message and rules of XML format file.
5. The binary message cell editing method of claim 4, wherein the codec module is responsible for managing a protocol library.
6. A binary message cell editing system, comprising:
and (3) writing a module: an ASN.1 protocol description file for writing binary protocol according to the protocol document;
and a conversion module: the code comprises corresponding structure definition and coding and decoding functions of binary information;
and a compiling module: the code generation module is used for compiling codes generated by the ASN.1 compiler into a dynamic library, and the dynamic library is called by the encoding and decoding module;
the processing module is used for: the encoding and decoding module is responsible for encoding and decoding binary information and editing the binary information, the binary information is converted into a specified format file through the encoding and decoding module, the specified format file is edited, and the edited specified format file can be converted into a binary code stream through the encoding and decoding module.
7. The binary message cell editing system of claim 6 wherein in the translation module and the compilation module, the code is in the C language.
8. The binary message cell editing system of claim 6, wherein the specified format file is an XML format file.
9. The binary message cell editing system of claim 8, wherein in the conversion module, the codec function includes rules for binary messages and rules for XML format files.
10. A computer-readable storage medium, characterized by: the computer readable storage medium stores a computer program configured to implement the steps of the binary message cell editing method of any of claims 1-5 when called by a processor.
CN202210672260.8A 2022-06-14 2022-06-14 Binary message cell editing method, system and storage medium Active CN115190184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210672260.8A CN115190184B (en) 2022-06-14 2022-06-14 Binary message cell editing method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210672260.8A CN115190184B (en) 2022-06-14 2022-06-14 Binary message cell editing method, system and storage medium

Publications (2)

Publication Number Publication Date
CN115190184A CN115190184A (en) 2022-10-14
CN115190184B true CN115190184B (en) 2023-06-23

Family

ID=83513922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210672260.8A Active CN115190184B (en) 2022-06-14 2022-06-14 Binary message cell editing method, system and storage medium

Country Status (1)

Country Link
CN (1) CN115190184B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0421623A2 (en) * 1989-09-28 1991-04-10 Texas Instruments Incorporated Portable and dynamic distributed applications architecture
CN1627757A (en) * 2003-12-12 2005-06-15 华为技术有限公司 Method for realizing general message interpreter
CN101197818A (en) * 2006-12-08 2008-06-11 中兴通讯股份有限公司 ASN.1 packet object oriented processing method
US7647415B1 (en) * 2004-02-25 2010-01-12 Sun Microsystems, Inc. Dynamic web services stack
CN110765592A (en) * 2019-10-09 2020-02-07 成都天和讯达科技有限公司 Simulation model, design method thereof, information updating method, device and storage medium
CN111930359A (en) * 2020-06-30 2020-11-13 绵阳慧视光电技术有限责任公司 System and method for algorithm development on heterogeneous embedded system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5325920B2 (en) * 2011-03-28 2013-10-23 株式会社東芝 Encoder compiler, program and communication equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0421623A2 (en) * 1989-09-28 1991-04-10 Texas Instruments Incorporated Portable and dynamic distributed applications architecture
CN1627757A (en) * 2003-12-12 2005-06-15 华为技术有限公司 Method for realizing general message interpreter
US7647415B1 (en) * 2004-02-25 2010-01-12 Sun Microsystems, Inc. Dynamic web services stack
CN101197818A (en) * 2006-12-08 2008-06-11 中兴通讯股份有限公司 ASN.1 packet object oriented processing method
CN110765592A (en) * 2019-10-09 2020-02-07 成都天和讯达科技有限公司 Simulation model, design method thereof, information updating method, device and storage medium
CN111930359A (en) * 2020-06-30 2020-11-13 绵阳慧视光电技术有限责任公司 System and method for algorithm development on heterogeneous embedded system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"基于ASN.1的通用编解码方案的设计与实现";陈军成;《中国优秀硕士学位论文全文数据库(电子期刊)》;全文 *
D. Mundy ; D.W. Chadwick."An XML alternative for performance and security: ASN.1".《IT Professional ( Volume: 6, Issue: 1, Jan.-Feb. 2004)》.2004,全文. *

Also Published As

Publication number Publication date
CN115190184A (en) 2022-10-14

Similar Documents

Publication Publication Date Title
CN111091876A (en) DNA storage method, system and electronic equipment
EP2124419B1 (en) An object oriented management device for asn.1 message
CN110673856B (en) Data processing method and device and machine-readable storage medium
US20100211867A1 (en) Processing module, a device, and a method for processing of xml data
CN113835693A (en) Code generation method and device, electronic equipment and storage medium
US20100095283A1 (en) Migration Apparatus Which Convert Application Program of Mainframe System into Application Program of Open System and Method for Thereof
CN112417515A (en) Configuration software protocol processing method and system
CN115190184B (en) Binary message cell editing method, system and storage medium
CN111124380A (en) Front-end code generation method
CN109358845B (en) Method, tool and storage medium for writing JS code based on XMPP protocol
CN112269566A (en) Script generation processing method, device, equipment and system
CN116405091B (en) Method and device for analyzing telemetry data, electronic equipment and storage medium
US20230214577A1 (en) Character string transmission method and device, computer, and readable storage medium
Riedel et al. A model driven internet of things
CN115525260A (en) Code generation method and device based on protobuf
CN115099194A (en) Binary message matching method, system and storage medium
CN115834717A (en) Communication protocol rapid development method for Internet of things equipment
CN111708573B (en) System for H5 adaptation has APP, weChat, nail
KR101142322B1 (en) ASN.1 Compiler
KR100878044B1 (en) Application translating method for providing compatible BREW and WIPI and device thereof
CN109509467B (en) Code generation method and device
CN112328256A (en) Method for automatically generating structure body parser source code
CN114070470A (en) Encoding and decoding method and device
KR20080039577A (en) Device and method of converting contents for heterogeneous mobile platforms and computer-readable medium having thereon program performing function embodying the same
CN112069549A (en) Method and system for downloading picture when Bootstrap-table plug-in exports table

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