WO2024119384A1 - 一种动态可配置的应用层通信协议测试方法 - Google Patents
一种动态可配置的应用层通信协议测试方法 Download PDFInfo
- Publication number
- WO2024119384A1 WO2024119384A1 PCT/CN2022/137083 CN2022137083W WO2024119384A1 WO 2024119384 A1 WO2024119384 A1 WO 2024119384A1 CN 2022137083 W CN2022137083 W CN 2022137083W WO 2024119384 A1 WO2024119384 A1 WO 2024119384A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- configuration
- communication
- configuration information
- protocol
- data
- Prior art date
Links
- 238000004891 communication Methods 0.000 title claims abstract description 195
- 238000012360 testing method Methods 0.000 title claims abstract description 93
- 238000000034 method Methods 0.000 claims abstract description 46
- 238000012545 processing Methods 0.000 claims description 18
- 238000007405 data analysis Methods 0.000 claims description 6
- 238000013507 mapping Methods 0.000 claims description 5
- 230000006870 function Effects 0.000 abstract description 68
- 238000012795 verification Methods 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 19
- 238000004590 computer program Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 238000013142 basic testing Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012812 general test Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
- 238000002054 transplantation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present application relates to the field of ground integrated testing, and in particular to a dynamically configurable application layer communication protocol testing method.
- the communication protocol of the serial port application layer is complex, involves many communication instructions, and the communication protocol implementation method is inefficient in test application scenarios where the protocol is easy to change.
- the present application provides a dynamically configurable application layer communication protocol testing method.
- the present application provides a dynamically configurable application layer communication protocol testing method, the method comprising:
- serial communication protocol classify the serial communication functional units
- the configuration is completed, and the configuration information is loaded and executed.
- serial communication functional unit categories are divided into:
- Serial port communication functional units are classified according to basic communication modes and protocol instruction processing modes.
- the functional unit categories include communication mode units and protocol instruction units.
- establishing a correspondence between the communication function unit and the configuration information according to the function unit category includes:
- perform communication protocol test configuration including:
- configure the communication mode including:
- the command protocol configuration information of each command is formed
- configuration information a corresponding relationship between all instruction protocol configuration information and the configuration information is established.
- perform protocol instruction data generation configuration including:
- Physical quantity data information includes: data name, type, data value, and scale factor.
- perform protocol data parsing configuration including:
- the criterion information includes: data name, type, criterion, and scaling factor.
- the completed configuration, loading and executing the configuration information includes:
- the read configuration information is passed to the corresponding communication function unit, and the configuration information is loaded and executed based on the completed configuration.
- the read configuration information is passed to the corresponding communication function unit, and the configuration information is loaded and executed based on the completed configuration, including:
- the corresponding communication function unit communicates with the device under test to execute the configuration information
- the received data is obtained through communication, the received data is analyzed and interpreted based on the protocol data analysis configuration, and the interpretation result is displayed.
- the present application provides a dynamically configurable application layer communication protocol testing method, the method comprising: dividing serial communication function unit categories according to the serial communication protocol; establishing a corresponding relationship between the communication function unit and the configuration information according to the function unit category; performing communication protocol test configuration; completing the configuration according to the corresponding relationship between the communication function unit and the configuration information, and then loading and executing the configuration information.
- the method provided by the present application by dividing the serial communication function unit categories, establishing a corresponding relationship between the communication function unit and the configuration information according to the function unit category; performing communication protocol test configuration, and then loading and executing the configuration information, can more efficiently carry out the test verification of various functions of the serial communication application layer protocol of the system and device under test, reduce tedious coding work, and improve the efficiency of the application layer communication protocol test of the device under test.
- FIG1 is a schematic diagram of a flow chart of a dynamically configurable application layer communication protocol testing method provided in an embodiment of the present application
- FIG2 is a flow chart of a communication protocol test provided in an embodiment of the present application.
- the inventors found that the current serial port application layer communication protocol is complex, involves many communication instructions, and the communication protocol implementation method is inefficient in test application scenarios where the protocol is easily changed.
- a dynamically configurable application layer communication protocol testing method comprising: classifying serial communication function units according to the serial communication protocol; establishing a corresponding relationship between the communication function units and the configuration information according to the function unit categories; performing communication protocol test configuration; and loading and executing the configuration information after completing the configuration according to the corresponding relationship between the communication function units and the configuration information.
- the method provided by the present application can more efficiently carry out the testing and verification of various functions of the serial communication application layer protocol of the system and device under test, reduce tedious coding work, and improve the efficiency of the application layer communication protocol testing of the device under test.
- the implementation process of a dynamically configurable application layer communication protocol testing method is as follows:
- This step is the process of classifying serial communication functional units.
- the functional unit categories include communication mode units and protocol instruction units.
- the serial communication functional units may be classified according to the serial communication protocol.
- an implementation method based on a reusable communication function unit is adopted to abstract the basic communication mode and protocol instruction processing mode of the serial communication instruction protocol, and the serial communication function unit categories are reasonably divided according to the communication protocol.
- This embodiment includes a communication mode unit and two protocol instruction units, as shown in Table 1.
- This step is the process of designing reusable functional units and configuration interfaces.
- a communication function unit whose function unit category is a communication mode unit or a protocol instruction unit is determined as a target unit.
- reusable communication function units and corresponding configuration information interfaces can be designed according to the functional unit categories, and a mapping relationship between the configuration information and the communication function units can be established.
- the identified single-frame output and single-frame input communication mode functional units and configuration interfaces are designed to form serial single-frame output and single-frame input communication mode functional units, and the corresponding CSV configuration file interface is established.
- the corresponding serial communication functional unit is completed by encapsulating the basic interface function of the serial communication, and the function of reading back a frame of data and judging after sending a frame of data is realized.
- the functional unit adopts a unified interface parameter, and the parameter interface includes input parameters, output parameters, and return values.
- the input parameters are configurable parameters, as shown in Table 2 below.
- the output data is the test result of the readback.
- the functional unit automatically compares and judges against the configured criteria to give a conclusion on whether it is qualified.
- the return value is the execution status of the functional unit.
- the identified data generation functional units and configuration interfaces are designed, and the frame format and physical quantity data information are configured in the configuration file.
- the physical quantity data information includes but is not limited to: data name, type, data value, and scale factor.
- the frame format and physical quantity data information (data name, type, data value, scale factor, etc.) can be configured in the configuration file, and the transmission data can be dynamically obtained through the serial port application data generation function unit module.
- the name of the data sending configuration file can be defined as the protocol instruction identifier.
- the application data generation function unit uses the protocol instruction identifier input by the communication mode function unit, passes through the processing module, extracts the data to be sent according to the name of the data sending configuration file, and then determines the data type, converts the physical quantity data into byte data to be sent according to different data types and scaling factors, and finally outputs the byte data to be sent.
- the configuration interface is shown in Table 3.
- the identified data parsing and judgment functional units and configuration interfaces are designed, and the frame format and judgment information are configured in the configuration file.
- the criterion information includes but is not limited to: data name, type, criterion, and scaling factor.
- the frame format and judgment information (data name, type, judgment, scaling factor, etc.) can be configured in the configuration file, and the read-back data can be analyzed and processed through the serial port data analysis and judgment function unit module.
- the data format configuration file name can be defined as a protocol instruction identifier.
- the data parsing and judgment function unit uses the protocol instruction identifier input by the communication mode function unit and the original communication data read back to extract the format information to be parsed according to the data format configuration file name, and then determines the data type, extracts the original data of the corresponding length bytes, performs data parsing, and finally obtains the parsed data and performs judgment.
- the configuration interface is shown in Table 4.
- This step is the serial port application layer communication protocol test configuration process.
- the corresponding test configuration file can be formed according to the corresponding configuration information interface of the design and the serial port application layer communication protocol test requirements.
- serial communication functional unit For example, based on the serial communication functional unit, according to the interface parameters of the functional unit, different protocol instructions in the communication protocol are implemented in the form of parameterized configuration information.
- the configuration information is stored in the form of a CSV file, and the serial communication protocol instruction configuration is completed according to the serial communication functional unit configuration information interface format (functional unit identification, functional unit parameters), forming the configuration information shown in Table 5.
- a CSV file can be used to form an instruction protocol configuration information for an instruction, and all instruction items in the communication protocol can be used in the form of configuration information to establish a correspondence between the communication protocol instructions and the protocol instruction unit configuration information.
- the application data (DataS1) generates a configuration example as shown in Table 6, and the application data analysis and interpretation configuration (DataR1) is shown in Table 7.
- This step performs protocol configuration according to the communication protocol.
- One instruction forms one instruction protocol configuration information. All instruction items in the communication protocol are configured in the form of configuration information to establish a corresponding relationship between the communication protocol and the configuration information.
- the configuration is completed, and the configuration information is loaded and executed.
- This step is to test the dynamic loading and execution process of configuration information.
- the read configuration information is passed to the corresponding communication function unit, and the configuration information is loaded and executed based on the completed configuration.
- the corresponding communication function unit Based on the communication mode configuration, the corresponding communication function unit communicates with the device under test to execute the configuration information.
- the received data is obtained through communication, the received data is analyzed and interpreted based on the protocol data analysis configuration, and the interpretation result is displayed.
- This step can sequentially read each configuration information from the configuration file, parse it, determine the corresponding communication function unit, and pass the configuration information to the interface parameters of the communication function unit, so that the communication function unit completes the execution of the current communication instruction.
- the corresponding configuration files are uniformly associated through the multi-mode processing unit, and each configuration information is sequentially read from the configuration file, and parsed to determine the corresponding communication function unit, and the configuration information is passed to the interface parameters of the communication function unit.
- the data to be sent is generated by the application data generation unit, and the communication mode function unit communicates with the device under test to complete the execution of the current communication instruction.
- the returned result is processed by the application data parsing and judgment unit, and the data is automatically parsed and judged, and finally displayed on the interface.
- the execution is completed, the next test is entered, and all test items are completed and the test process is exited.
- the multi-mode dynamic loading execution process of the serial communication protocol instruction is shown in Figure 2.
- the process After the process starts, obtain the human-machine operation information, enter the multi-mode processing unit, and configure the exclusive file test information.
- the application data generation unit read the application data configuration information, and generate the application data.
- the basic communication mode unit determine the corresponding communication function unit.
- the application data parsing and interpretation unit read the application data parsing configuration information, and parse and interpret the application data. Determine whether the execution is normal. If it is not normal, perform test exception processing. If it is normal, perform test information prompts. If the process is not over, proceed to the next test item, and repeat the steps of entering the multi-mode processing unit and subsequent steps.
- test log contains the timestamp and the current operation.
- the test report gives each test item and the corresponding test parameters, required values, measured values, and conclusions.
- the advantage of the dynamically configurable application layer communication protocol test method provided by this embodiment compared with the prior art is that it solves the problem that most of the methods for implementing each communication protocol instruction one by one in code for specific communication protocols are cumbersome, resulting in repeated testing and verification work, low efficiency and easy to cause potential problems.
- the reusable serial communication protocol function unit parameter configuration interface is implemented by formatting table configuration. Only the basic test function unit module program needs to be written, and the communication protocol instructions are designed for related application functions in the form of table information editing.
- the dynamically configurable application layer communication protocol testing method provided in this embodiment can improve the efficiency of application layer communication protocol testing of the system or device under test in ground comprehensive testing, solve the problem of low efficiency of communication protocol implementation methods in test application scenarios where the current serial port application layer communication protocol is complex, involves many communication instructions, and is easy to change within the protocol, and realize efficient and reliable serial port application layer communication protocol testing of the device under test.
- the dynamically configurable application layer communication protocol testing method adopts reusable serial port communication function unit technology, designs serial port protocol basic communication mode function unit, protocol instruction processing function unit and dynamic configuration interface of each function unit, and realizes dynamic configuration of application layer communication protocol in the comprehensive testing process through multi-mode dynamic loading and execution of serial port communication protocol instructions, thereby reducing tedious coding work and improving comprehensive testing efficiency.
- the method provided in this embodiment divides serial port communication function unit categories according to the serial port communication protocol; establishes a correspondence between the communication function unit and the configuration information according to the function unit category; performs communication protocol test configuration; completes the configuration according to the correspondence between the communication function unit and the configuration information, and loads and executes the configuration information.
- the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
- the scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
- each flow process and/or box in the flow chart and/or block diagram, and the combination of the flow process and/or box in the flow chart and/or block diagram can be realized by computer program instructions.
- These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart or multiple flows and/or one box or multiple boxes of the block diagram.
- These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
- These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Communication Control (AREA)
- Computer And Data Communications (AREA)
Abstract
本申请提供一种动态可配置的应用层通信协议测试方法,该方法包括:根据串口通信协议,划分串口通信功能单元类别;根据功能单元类别,建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置;根据通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息。本申请提供的方法,通过划分串口通信功能单元类别,根据功能单元类别建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置,进而加载并执行配置信息,可以更加高效开展对被测系统和设备串口通信应用层协议各项功能的测试验证,减少繁琐的编码工作,提高对被测设备应用层通信协议测试效率。
Description
本申请涉及地面综合测试领域,尤其涉及一种动态可配置的应用层通信协议测试方法。
随着装备的多样化和复杂化程度不断提高,对地面综合测试系统提出更高的要求,在综合测试系统中一般测试通信接口类型相对固定,但系统各装置间的应用层通信协议内容有较大差别,且较为繁琐复杂,由于不同协议指令格式、数据内容、接口地址、测试判据等均不相同,针对特定通信指令编码实现的方式代码不易复用,这种方式下进行维护变更也较为繁琐耗时。
目前串口应用层通信协议复杂、涉及的通信指令多、协议内容易变的测试应用场景下通信协议实现方式效率较低。
发明内容
为了解决上述技术缺陷之一,本申请提供了一种动态可配置的应用层通信协议测试方法。
本申请第一个方面,提供了一种动态可配置的应用层通信协议测试方法,方法包括:
根据串口通信协议,划分串口通信功能单元类别;
根据功能单元类别,建立通信功能单元和配置信息之间的对应关系;
进行通信协议测试配置;
根据通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息。
可选地,根据串口通信协议,划分串口通信功能单元类别,包括:
抽象出串口通信协议的基本通信模式和协议指令处理模式;
根据基本通信模式和协议指令处理模式,划分串口通信功能单元类别。
可选地,功能单元类别包括通信模式单元,协议指令单元。
可选地,根据功能单元类别,建立通信功能单元和配置信息之间的对应关系,包括:
将功能单元类别为通信模式单元、协议指令单元的通信功能单元确定为目标单元;
对目标单元及配置接口进行设计,建立目标单元的配置信息接口;
建立目标单元与配置信息接口的映射关系。
可选地,进行通信协议测试配置,包括:
进行通信模式配置;
进行协议指令数据生成配置;
进行协议数据解析配置。
可选地,进行通信模式配置,包括:
根据串口通信协议,形成每条指令的指令协议配置信息;
根据配置信息,建立所有指令协议配置信息与配置信息的对应关系。
可选地,进行协议指令数据生成配置,包括:
在配置文件中配置帧格式,物理量数据信息;
物理量数据信息包括:数据名称、类型、数据值、标度因子。
可选地,进行协议数据解析配置,包括:
在配置文件中配置帧格式,判据信息;
判据信息包括:数据名称、类型、判据、标度因子。
可选地,根据通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息,包括:
从配置文件中顺序读取每一条配置信息后,执行如下步骤:
根据通信功能单元和配置信息之间的对应关系,确定读取的配置信息所对应的通信功能单元;
将读取的配置信息传递至对应的通信功能单元,基于完成的配置加载并执行配置信息。
可选地,将读取的配置信息传递至对应的通信功能单元,基于完成的配 置加载并执行配置信息,包括:
基于协议指令数据生成配置,生成待发送数据;
基于通信模式配置,进行对应的通信功能单元与被测设备之间的通信,以便执行配置信息;
若通过通信获取到接收数据,则基于协议数据解析配置进行接收数据的解析判读,显示判读结果。
本申请提供一种动态可配置的应用层通信协议测试方法,该方法包括:根据串口通信协议,划分串口通信功能单元类别;根据功能单元类别,建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置;根据通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息。本申请提供的方法,通过划分串口通信功能单元类别,根据功能单元类别建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置,进而加载并执行配置信息,可以更加高效开展对被测系统和设备串口通信应用层协议各项功能的测试验证,减少繁琐的编码工作,提高对被测设备应用层通信协议测试效率。
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本申请实施例提供的一种动态可配置的应用层通信协议测试方法的流程示意图;
图2为本申请实施例提供的一种通信协议测试的流程示意图。
为了使本申请实施例中的技术方案及优点更加清楚明白,以下结合附图对本申请的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本申请的一部分实施例,而不是所有实施例的穷举。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
在实现本申请的过程中,发明人发现,目前串口应用层通信协议复杂、涉及的通信指令多、协议内容易变的测试应用场景下通信协议实现方式效率较低。
针对上述问题,本申请实施例中提供了一种动态可配置的应用层通信协议测试方法,该方法包括:根据串口通信协议,划分串口通信功能单元类别;根据功能单元类别,建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置;根据通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息。本申请提供的方法,通过划分串口通信功能单元类别,根据功能单元类别建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置,进而加载并执行配置信息,可以更加高效开展对被测系统和设备串口通信应用层协议各项功能的测试验证,减少繁琐的编码工作,提高对被测设备应用层通信协议测试效率。
参见图1,本实施例提供的一种动态可配置的应用层通信协议测试方法实现过程下:
101,根据串口通信协议,划分串口通信功能单元类别。
本步骤是串口通信功能单元类别划分的过程。
具体的,
1、抽象出串口通信协议的基本通信模式和协议指令处理模式。
2、根据基本通信模式和协议指令处理模式,划分串口通信功能单元类别。
例如功能单元类别包括通信模式单元,协议指令单元。
本步骤可以依据串口通信协议进行串口通信功能单元类别划分。
例如,采用基于可复用通信功能单元的实现方法,抽象出串口通信指令协议基本通信模式、协议指令处理模式,依据通信协议进行串口通信功能单元类别合理划分,本实施例中包含一种通信模式单元和两种协议指令单元,如表1所示。
表1
102,根据功能单元类别,建立通信功能单元和配置信息之间的对应关系。
本步骤是可复用功能单元及配置接口设计的过程。
具体实现时,
1、将功能单元类别为通信模式单元、协议指令单元的通信功能单元确定为目标单元。
2、对目标单元及配置接口进行设计,建立目标单元的配置信息接口。
3、建立目标单元与配置信息接口的映射关系。
本步骤可以依据功能单元类别设计可复用通信功能单元和对应配置信息接口,建立配置信息与通信功能单元的映射关系。
例如,根据串口通信功能单元类别划分结果,对识别出的单帧输出与单帧输入通信模式功能单元及配置接口进行设计,形成串口单帧输出与单帧输入通信模式功能单元,并建立相应CSV配置文件接口。通过对串口通信基本接口函数进行封装完成相应串口通信功能单元,实现发送一帧数据后回读一帧数据并判读的功能,功能单元采用统一接口参数,参数接口包含输入参数、输出参数、返回值。其中输入参数为可配置参数,具体见下表2,输出数据为回读的测试结果,由功能单元对照配置的判据进行自动比对判读,给出是否合格的结论,返回值为功能单元的执行状态。
表2
例如,根据串口通信功能单元类别划分结果,对识别出的数据生成功能单元及配置接口进行设计,在配置文件中配置帧格式,物理量数据信息。
其中,物理量数据信息包括但不限于:数据名称、类型、数据值、标度因子。
通过协议指令数据生成配置,可以在配置文件中配置好帧格式、物理量数据信息(数据名称、类型、数据值、标度因子等),可通过串口应用数据生成功能单元模块动态获取发送数据。
可定义发送数据配置文件名为协议指令标识,应用数据生成功能单元通过通信模式功能单元输入的协议指令标识,经过处理模块,依据发送数据配置文件名提取待发送的数据,然后断数据类型,将物理量数据按不同数据类型与标度因子转换成待发送的字节数据,最后输出待发送的字节数据。
例如,配置接口如表3所示。
表3
例如,根据串口通信功能单元类别划分结果,对识别出的数据解析判读功能单元及配置接口进行设计,在配置文件中配置帧格式,判据信息。
其中,判据信息包括但不限于:数据名称、类型、判据、标度因子。
通过协议数据解析配置,可以在配置文件中配置好帧格式、判据信息(数据名称、类型、判据、标度因子等),可通过串口数据解析与判读功能单元模块对回读的数据进行数据解析处理。
可定义数据格式配置文件名为协议指令标识,应用数据解析与判读功能单元通过通信模式功能单元输入的协议指令标识和回读的原始通信数据,依据数据格式配置文件名提取待解析格式信息,然后判断数据类型,提取对应长度字节原始数据,进行数据解析,后得到解析后的数据并进行判读。
例如,配置接口如表4所示。
表4
103,进行通信协议测试配置。
本步骤是串口应用层通信协议测试配置过程。
具体的,
例如,1)根据串口通信协议,形成每条指令的指令协议配置信息。2)根据配置信息,建立所有指令协议配置信息与配置信息的对应关系。
1、进行通信模式配置。
通过通信模式配置,可以依据设计的对应配置信息接口,串口应用层通信协议测试需求形成相应的测试配置文件。
例如,以串口通信功能单元为基础,根据功能单元的接口参数,对于通信协议中不同协议指令,采用参数化配置信息的形式实现。配置信息采用CSV文件方式进行存储,依据串口通信功能单元配置信息接口格式(功能单元标识、功能单元参数)完成串口通信协议指令配置,形成表5所示的配置信息。
表5
2、通信协议指令配置(协议指令数据生成配置、协议数据解析配置)
在进行串口通信协议指令配置时,可采用CSV文件表格化形式对一条指令形成一个指令协议配置信息,将通信协议中所有指令项目采用配置信息的形式建立通信协议指令与协议指令单元配置信息的对应关系,例如,应用数据(DataS1)生成配置实例如下表6,应用数据解析与判读配置(DataR1)如下表7。
表6
字节 | 数据名称 | 数据类型 | 数据值 | 标度因子k | 标度因子b |
1 | 命令字节 | uchar8 | 0xE4 | 1 | 0 |
1 | 命令发送标识 | uchar8 | 0xA1 | 1 | 0 |
8 | 发送数据1 | double64 | 86.35 | 57.3 | 0 |
1 | 发送数据2 | uchar8 | 0x3C | 1 | 0 |
表7
字节 | 数据名称 | 数据类型 | 判据 | 标度因子k | 标度因子b |
1 | 命令字节 | uchar8 | 0xA0 | 1 | 0 |
1 | 命令发送标识 | uchar8 | 0x1A | 1 | 0 |
1 | 测试结果1 | uchar8 | 0xAA | 1 | 0 |
1 | 测试结果2 | uchar8 | 0xBB | 1 | 0 |
本步骤依据通信协议进行协议配置,一条指令形成一个指令协议配置信息,将通信协议中所有指令项目采用配置信息的形式建立通信协议与配置信息的对应关系。
104,根据通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息。
本步骤是测试配置信息动态加载与执行过程。
具体实现时,从配置文件中顺序读取每一条配置信息后,执行如下步骤:
1、根据通信功能单元和配置信息之间的对应关系,确定读取的配置信息所对应的通信功能单元。
2、将读取的配置信息传递至对应的通信功能单元,基于完成的配置加载并执行配置信息。
1)基于协议指令数据生成配置,生成待发送数据。
2)基于通信模式配置,进行对应的通信功能单元与被测设备之间的通信,以便执行配置信息。
3)若通过通信获取到接收数据,则基于协议数据解析配置进行接收数据的解析判读,显示判读结果。
本步骤可以从配置文件中顺序读取每一条配置信息,并进行解析,判断对应的通信功能单元,并将配置信息传递至通信功能单元的接口参数,由通信功能单元完成当前通信指令执行。
例如,通过设计自动、单步、组合等多种测试模式,并建立与之相应的 配置文件映射关系。首先基于人机交互界面的用户选择操作(自动、单步、组合)信息,通过多模式处理单元统一关联相应的配置文件,从配置文件中顺序读取每一条配置信息,并进行解析,判断对应的通信功能单元,并将配置信息传递至通信功能单元的接口参数。然后通过应用数据生成单元处理生成待发送数据,通过通信模式功能单元进行与被测设备通信,完成当前通信指令执行,返回的结果通过应用数据解析与判读单元处理,并进行数据自动解析判读,最后进行界面显示。执行完成后进入下一项测试,所有测试项执行完成退出测试流程,串口通信协议指令多模式动态加载执行流程如图2所示。
参见图2,流程开始后,获取人机操作信息,进入多模式处理单元,独权配置文件测试信息。在应用数据生成单元中,读应用数据配置信息,应用数据生成。在基础通信模式单元中判断对应的通信功能单元。在应用数据解析与判读单元中,读应用数据解析配置信息,应用数据解析与判读。判断执行是否正常,如果不正常,则进行测试异常处理,如果正常,则进行测试信息提示。如果流程未结束,则进行下一测试项目,重复执行进入多模式处理单元的步骤及后续步骤。
测试过程中在后台存储测试过程的所有通信数据、测试日志信息,测试完成后输出测试报告,记录各测试项目的测试结果与测试是否合格的结论。测试过程中的通信数据和测试日志在测试流程任务执行中记录,测试日志包含时间戳和当前的操作,测试报告给出每个测试项目和对应的测试参数、要求值、实测值、结论。
本实施例提供的动态可配置的应用层通信协议测试方法与现有技术相比的优点在于,解决了大多面向具体通信协议通过对各通信协议指令逐一代码实现的方式,代码实现过程繁琐,带来的重复测试验证工作,效率低下且容易引发潜在问题。采用格式化表格配置的方式实现可复用串口通信协议功能单元参数配置接口,只需编写基本测试功能单元模块程序,通信协议指令以表格信息编辑的方式进行相关应用功能设计。实现了最大化减少串口通信协 议实现代码的编写工作,尤其对于通信协议指令数量大、测试流程序列长、测试项目、测试参数、判据易变的通信协议指令测试应用场景效果明显,提高代码复用率,方便移植和推广。
本实施例提供的动态可配置的应用层通信协议测试方法,可以提升地面综合测试中对被测系统或设备的应用层通信协议测试效率,解决目前串口应用层通信协议复杂、涉及的通信指令多、协议内容易变的测试应用场景下通信协议实现方式效率较低问题,实现对被测设备高效、可靠的串口应用层通信协议测试。
具体的,本实施例提供的动态可配置的应用层通信协议测试方法,通过采用可复用串口通信功能单元技术,设计串口协议基本通信模式功能单元、协议指令处理功能单元以及各功能单元动态配置接口,并通过串口通信协议指令多模式动态加载执行实现综合测试过程中应用层通信协议的动态可配置,减少繁琐的编码工作,提高综合测试效率。
本实施例提供的该方法,根据串口通信协议,划分串口通信功能单元类别;根据功能单元类别,建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置;根据通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息,可以更加高效开展对被测系统和设备串口通信应用层协议各项功能的测试验证,减少繁琐的编码工作,提高对被测设备应用层通信协议测试效率。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。本申请实施例中的方案可以采用各种计算机语言实现,例如,面向对象的程序设计语言Java和直译式脚本语言JavaScript等。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序 产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
Claims (10)
- 一种动态可配置的应用层通信协议测试方法,其特征在于,所述方法包括:根据串口通信协议,划分串口通信功能单元类别;根据所述功能单元类别,建立通信功能单元和配置信息之间的对应关系;进行通信协议测试配置;根据所述通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息。
- 根据权利要求1所述的方法,其特征在于,所述根据串口通信协议,划分串口通信功能单元类别,包括:抽象出所述串口通信协议的基本通信模式和协议指令处理模式;根据所述基本通信模式和协议指令处理模式,划分串口通信功能单元类别。
- 根据权利要求2所述的方法,其特征在于,所述功能单元类别包括通信模式单元,协议指令单元。
- 根据权利要求3所述的方法,其特征在于,所述根据所述功能单元类别,建立通信功能单元和配置信息之间的对应关系,包括:将功能单元类别为通信模式单元、协议指令单元的通信功能单元确定为目标单元;对所述目标单元及配置接口进行设计,建立所述目标单元的配置信息接口;建立目标单元与配置信息接口的映射关系。
- 根据权利要求1所述的方法,其特征在于,所述进行通信协议测试配置,包括:进行通信模式配置;进行协议指令数据生成配置;进行协议数据解析配置。
- 根据权利要求5所述的方法,其特征在于,所述进行通信模式配置,包括:根据串口通信协议,形成每条指令的指令协议配置信息;根据配置信息,建立所有指令协议配置信息与配置信息的对应关系。
- 根据权利要求5所述的方法,其特征在于,所述进行协议指令数据生成配置,包括:在配置文件中配置帧格式,物理量数据信息;所述物理量数据信息包括:数据名称、类型、数据值、标度因子。
- 根据权利要求5所述的方法,其特征在于,所述进行协议数据解析配置,包括:在配置文件中配置帧格式,判据信息;所述判据信息包括:数据名称、类型、判据、标度因子。
- 根据权利要求5所述的方法,其特征在于,所述根据所述通信功能单元和配置信息之间的对应关系,完成的配置,加载并执行配置信息,包括:从配置文件中顺序读取每一条配置信息后,执行如下步骤:根据所述通信功能单元和配置信息之间的对应关系,确定读取的配置信息所对应的通信功能单元;将读取的配置信息传递至对应的通信功能单元,基于完成的配置加载并执行配置信息。
- 根据权利要求9所述的方法,其特征在于,所述将读取的配置信息传递至对应的通信功能单元,基于完成的配置加载并执行配置信息,包括:基于协议指令数据生成配置,生成待发送数据;基于通信模式配置,进行对应的通信功能单元与被测设备之间的通信,以便执行配置信息;若通过所述通信获取到接收数据,则基于协议数据解析配置进行接收数 据的解析判读,显示判读结果。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/137083 WO2024119384A1 (zh) | 2022-12-06 | 2022-12-06 | 一种动态可配置的应用层通信协议测试方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/137083 WO2024119384A1 (zh) | 2022-12-06 | 2022-12-06 | 一种动态可配置的应用层通信协议测试方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024119384A1 true WO2024119384A1 (zh) | 2024-06-13 |
Family
ID=91378466
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/137083 WO2024119384A1 (zh) | 2022-12-06 | 2022-12-06 | 一种动态可配置的应用层通信协议测试方法 |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2024119384A1 (zh) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6717944B1 (en) * | 1999-11-10 | 2004-04-06 | Nortel Networks Corporation | System, device, and method for allocating virtual circuits in a communication network |
CN101043465A (zh) * | 2006-06-20 | 2007-09-26 | 华为技术有限公司 | 动态主机配置协议服务管理方法以及系统 |
CN101944033A (zh) * | 2009-07-09 | 2011-01-12 | 中兴通讯股份有限公司 | 一种嵌入式系统中动态支持多种协议的装置及方法 |
CN108696381A (zh) * | 2017-04-12 | 2018-10-23 | 腾讯科技(深圳)有限公司 | 一种协议配置方法及装置 |
US10516981B1 (en) * | 2015-12-03 | 2019-12-24 | Eta Vision Inc. | Systems and methods for sensing, recording, analyzing and reporting environmental conditions in data centers and similar facilities |
US20210144831A1 (en) * | 2012-06-15 | 2021-05-13 | Aleddra Inc. | Solid-State Lighting With Auto-Tests And Data Communications |
-
2022
- 2022-12-06 WO PCT/CN2022/137083 patent/WO2024119384A1/zh unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6717944B1 (en) * | 1999-11-10 | 2004-04-06 | Nortel Networks Corporation | System, device, and method for allocating virtual circuits in a communication network |
CN101043465A (zh) * | 2006-06-20 | 2007-09-26 | 华为技术有限公司 | 动态主机配置协议服务管理方法以及系统 |
CN101944033A (zh) * | 2009-07-09 | 2011-01-12 | 中兴通讯股份有限公司 | 一种嵌入式系统中动态支持多种协议的装置及方法 |
US20210144831A1 (en) * | 2012-06-15 | 2021-05-13 | Aleddra Inc. | Solid-State Lighting With Auto-Tests And Data Communications |
US10516981B1 (en) * | 2015-12-03 | 2019-12-24 | Eta Vision Inc. | Systems and methods for sensing, recording, analyzing and reporting environmental conditions in data centers and similar facilities |
CN108696381A (zh) * | 2017-04-12 | 2018-10-23 | 腾讯科技(深圳)有限公司 | 一种协议配置方法及装置 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106776515B (zh) | 数据处理的方法及装置 | |
CN106326122B (zh) | 一种软件单元测试用例管理系统 | |
CN109448100B (zh) | 三维模型格式转换方法、系统、计算机设备及存储介质 | |
CN110554958B (zh) | 图数据库测试方法、系统、设备和存储介质 | |
US9092408B2 (en) | Data listeners for type dependency processing | |
CN111210842B (zh) | 语音质检方法、装置、终端及计算机可读存储介质 | |
CN107885499A (zh) | 一种接口文档生成方法及终端设备 | |
CN111176979B (zh) | 一种图数据库的测试用例生成方法和装置 | |
CN107844424A (zh) | 基于模型的测试系统及方法 | |
CN112416369B (zh) | 一种面向异构混合环境的智能化部署方法 | |
CN103095726A (zh) | 一种协议解析器的处理方法和装置 | |
CN112433701A (zh) | 工业软件开发项目实施流程、内容及代码生成方法及装置 | |
CN113806429A (zh) | 基于大数据流处理框架的画布式日志分析方法 | |
WO2024119384A1 (zh) | 一种动态可配置的应用层通信协议测试方法 | |
CN111506305A (zh) | 工具包生成方法、装置、计算机设备及可读存储介质 | |
CN112559644B (zh) | 一种产品部件动态组装方法、装置、设备及存储介质 | |
CN112232960B (zh) | 交易应用系统监控方法及装置 | |
CN114297074A (zh) | 一种基于动态配置实现功能、接口、性能自动测试方法 | |
CN112308519A (zh) | 表单关联规则的配置方法、表单关联方法及其装置 | |
CN112883689B (zh) | 一种征信二代信用报告指衍生变量加工方法 | |
CN110162480B (zh) | 一种结构化诊断对象的自动化解析方法 | |
TW201327432A (zh) | 可調適之訂單資料驗證方法 | |
US20220245458A1 (en) | Apparatus and method for converting neural network | |
CN115718680B (zh) | 数据读取方法、系统、计算机及可读存储介质 | |
CN110879722B (zh) | 生成逻辑示意图的方法及装置、计算机可存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22967545 Country of ref document: EP Kind code of ref document: A1 |