WO2018040664A1 - 一种跨平台的驱动测试方法、装置及系统 - Google Patents

一种跨平台的驱动测试方法、装置及系统 Download PDF

Info

Publication number
WO2018040664A1
WO2018040664A1 PCT/CN2017/087840 CN2017087840W WO2018040664A1 WO 2018040664 A1 WO2018040664 A1 WO 2018040664A1 CN 2017087840 W CN2017087840 W CN 2017087840W WO 2018040664 A1 WO2018040664 A1 WO 2018040664A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
test
hardware
hardware emulation
test data
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.)
Ceased
Application number
PCT/CN2017/087840
Other languages
English (en)
French (fr)
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.)
GRG Banking Equipment Co Ltd
Original Assignee
GRG Banking Equipment 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 GRG Banking Equipment Co Ltd filed Critical GRG Banking Equipment Co Ltd
Publication of WO2018040664A1 publication Critical patent/WO2018040664A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a cross-platform driving test method, apparatus, and system.
  • driver testing the method commonly used today is to directly connect physical hardware for testing or to develop a virtual simulation device based on a specific platform instead of real physical hardware for testing.
  • the virtual simulation device must be run on a certain operating system platform, and different operating systems have different characteristics to meet different customer needs. Different scenarios using different operating system platforms for application deployment are the most effective solutions and are generally accepted by the industry.
  • the embodiment of the invention provides a cross-platform driving test method, device and system, which can improve the driving test efficiency and stability.
  • Embodiments of the present invention provide a cross-platform driving test method, including:
  • the test command includes test data and a module identification code
  • the reading the test command sent by the test host specifically includes:
  • Reading the test command from a pre-generated second port the first port and the second port are paired with each other to form an IO loopback sub-module.
  • the module identifier is an identifier of the hardware emulation module
  • the module identifier is a network port number of a hardware emulation service submodule
  • test data Sending the test data to a hardware simulation module corresponding to the module identification code, so that the hardware simulation module is configured to
  • the test data is processed, including:
  • the method further includes:
  • the method further includes:
  • the present invention further provides a cross-platform driving test device, including a test instruction reading module and a hardware simulation service module;
  • the test instruction reading module is configured to read a test instruction sent by the test host; the test instruction includes test data and a module identification code;
  • the hardware emulation service module is configured to send the test data to a hardware emulation module corresponding to the module identifier, and cause the hardware emulation module to process the test data.
  • test instruction reading module includes a platform adaptation submodule and an IO loopback submodule;
  • the IO loopback submodule is configured to receive a test command sent by the test host, and write the test command into the pre-generated first port;
  • the platform adaptation submodule is configured to read the test command from a second port pre-generated by the IO loopback submodule; the first port and the second port are paired with each other to form an IO loopback submodule.
  • the module identifier is an identifier of the hardware emulation module
  • the hardware emulation service module is specifically configured to send the test data to a hardware emulation module corresponding to an identifier of the hardware emulation module.
  • the hardware emulation service module includes an adaptation management submodule and N hardware emulation service submodules; the N hardware emulation service submodules are in one-to-one correspondence with N hardware emulation modules; , N ⁇ 1;
  • the module identification code is a network port number of the hardware emulation service submodule
  • the adaptation management sub-module is configured to send the test data to a corresponding hardware emulation service sub-module through a network port number of the hardware emulation sub-service module;
  • the hardware emulation service sub-module is configured to send the test data to its corresponding hardware emulation module upon receiving the test data.
  • cross-platform driving test device further includes:
  • a processing result sending module configured to receive a processing result fed back by the hardware simulation module, and send the processing result to the test host.
  • the present invention also provides a cross-platform drive test system including a test host, a drive test device, and N hardware simulations. True module; where N ⁇ 1.
  • the test host is configured to send a test command to the drive test device; the test command includes test data and a module identification code.
  • the drive test device is the above-mentioned cross-platform drive test device, which will not be described in detail herein.
  • the hardware simulation module is configured to process the test data when receiving the test data sent by the drive test device.
  • the cross-platform driving test method, device and system provided by the embodiments of the present invention can receive test commands sent by the test host, and select corresponding hardware simulation modules according to the test instructions to perform testing, without developing virtual on each test host.
  • the simulation program realizes the multiplexing of the hardware simulation module on different platforms, shortens the development test cycle, and improves the efficiency and stability of the drive test.
  • FIG. 1 is a schematic structural diagram of an embodiment of a cross-platform drive test system provided by the present invention
  • FIG. 2 is a schematic flow chart of an embodiment of a cross-platform driving test method provided by the present invention
  • FIG. 3 is a schematic diagram of an implementation of an IO loopback submodule provided by the present invention.
  • FIG. 4 is a schematic diagram of a driving test provided by the present invention.
  • Figure 5 is a schematic diagram of another driving test provided by the present invention.
  • FIG. 6 is a schematic diagram of a specific process of the cross-platform driving test method shown in FIG. 2;
  • FIG. 7 is a schematic structural diagram of an embodiment of a cross-platform drive test apparatus provided by the present invention.
  • FIG. 8 is a schematic diagram of a specific structure of the cross-platform drive test device shown in FIG. 7;
  • FIG. 9 is another schematic structural view of the cross-platform drive test apparatus shown in FIG. 7.
  • FIG. 1 is a schematic structural diagram of an embodiment of a cross-platform drive test system provided by the present invention, including a test host 11, a drive test device 12, and N hardware emulation modules 13.
  • the drive test device 12 establishes a connection with the test host 11 and the N hardware emulation modules 13, respectively, N ⁇ 1.
  • the drive test device runs on the A platform, and the test host runs on the B platform.
  • the operating systems of platform A and platform B include but are not limited to Windows, Linux, mac, etc.
  • the A and B platforms are one-to-many relationships.
  • FIG. 2 a schematic flowchart of one embodiment of a cross-platform driving test method provided by the present invention is shown.
  • the driving test method provided by the embodiment of the present invention is described from the side of driving the test device, and includes:
  • test instruction includes test data and a module identification code
  • the A platform runs the driving test device
  • the driving test device includes a test instruction reading module and a hardware simulation service module
  • the B platform runs the test host.
  • the test host sends a test command to the drive test device
  • the test command read module receives and reads the test command, and sends the test command to the hardware simulation service module through TCP/IP
  • the hardware simulation service module sends the test code according to the module identification code in the test command.
  • the corresponding hardware simulation module is processed.
  • the embodiment of the invention does not need to develop a hardware simulation module on each B platform, realizes multiplexing of hardware simulation modules on different platforms, and improves driving test efficiency and stability.
  • the reading the test command sent by the test host specifically includes:
  • Reading the test command from a pre-generated second port the first port and the second port are paired with each other to form an IO loopback sub-module.
  • the test instruction reading module includes a platform adaptation sub-module, and different operating system environments in the test host need to drive the test device to develop a platform adaptation sub-module application supported by the corresponding version.
  • the platform adaptation sub-module includes an IO loopback sub-module, and the IO loopback sub-module automatically determines the status of the system port and generates a required communication port, such as a serial port, a USB port, etc., and the port characteristics are consistent with the real port.
  • the IO loopback submodule generates a variety of methods, such as python scripts.
  • the port communication generated by the IO loopback sub-module adopts a loopback pair mode, that is, there are two communication ports, each of which can be read and written, and can be read from one end and read from the other end.
  • a loopback pair mode that is, there are two communication ports, each of which can be read and written, and can be read from one end and read from the other end.
  • the platform adapting sub-module can read data from the port 2; and after processing, the original path is returned to the test command 21, that is, the platform.
  • the adaptation sub-module writes data from port 2 and reads data from port 1.
  • Table 1 The flow of the IO loopback submodule to generate the required communication port is shown in Table 1.
  • the platform A runs the platform adaptation sub-module, the platform adaptation sub-module calls the IO loopback sub-module, and the IO loopback sub-module opens and reads the port pair port 1 with multiple threads, and records the generated port pair information.
  • a text file is used in order to test the instructions.
  • the B platform knows the port 2 provided by the IO loopback submodule according to the port pair information recorded in the text file, opens the port 2, and writes the test command to the port 2, and the platform adapting submodule immediately reads the test from the port 1 of the IO loopback submodule.
  • the instructions are sent to the hardware emulation service module via TCP/IP for driver testing.
  • the module identifier is an identifier of the hardware emulation module
  • one hardware emulation service module is in the same process as multiple hardware emulation modules, and the hardware emulation service module is expressed in the form of an executable program, such as an .EXE.
  • the hardware emulation module is a dynamic link library, such as .DLL.
  • a hardware emulation service module executable program EXE loads multiple hardware emulation submodule DLLs.
  • the test command 31 is sent to the port generated by the IO loopback sub-module 32, wherein the test command includes the identification code of the hardware emulation module, and the platform adapting sub-module 33 reads the IO loopback sub-module 32.
  • the port data is sent to the hardware emulation service module 34, and the hardware emulation service module 34 forwards the hardware emulation module 35 corresponding to the identifier of the hardware emulation module.
  • the hardware emulation module 35 processes the data and updates the status. And the simulation action, if the hardware simulation module 35 does not process the result to return, then the data is not returned, and the test is completed.
  • This test method facilitates the unified management of the hardware simulation module and simplifies the design of the operation interface.
  • the module identifier is a network port number of a hardware emulation service submodule
  • the hardware emulation service module has multiple hardware emulation service sub-modules, and each hardware emulation service sub-module and each hardware emulation module are in a separate process, and the hardware emulation service sub-module codes are consistently implemented.
  • the form is an executable program, such as .EXE.
  • the hardware emulation module is a dynamic link library, such as .DLL.
  • the hardware emulation service submodule and the hardware emulation module have the same name except for the suffix name, such as GrgVirDev_JournalPrt.exe and GrgVirDev_JournalPrt.dll.
  • the hardware emulation service submodule automatically loads the corresponding hardware emulation submodule by getting the front part of its own process name.
  • the test command 41 is sent to the port generated by the IO loopback sub-module 42, the platform adapting sub-module 43 reads the port data of the IO loopback sub-module 42, and the platform adapting sub-module 43 runs more.
  • the thread reads the relevant port.
  • the read data is sent to the corresponding network port through TCP/IP, and the hardware emulation service sub-module 44 with the network port forwards the data after receiving the data.
  • the hardware emulation module 45 processes the data, updates the state and the simulated action. If the hardware emulation module 45 does not return the result, the data is not returned, and the test is completed.
  • the use of this test method makes the impact between processes small. When a process has a problem, it will not affect the operation of other processes, so that each hardware simulation module does not affect each other independently.
  • the method further includes:
  • the hardware emulation service module establishes a SOCKET network server and adopts TCP communication. Set the corresponding configuration table for each hardware emulation service submodule. The node information contained in the configuration table is shown in Table 2.
  • Explanation COMMTYPE Communication type including serial port, USB, network
  • ComID Specify the communication port number when the type is serial port.
  • ComBaud Specify the baud rate of the communication port number when the type is serial port
  • VID Specify the VID number when the type is USB
  • PID Specify the PID number when the type is USB NetPort
  • the communication type is serial port or USB, it is mainly used for local simulation test; if the communication type is selected as network, it is mainly used for simulation test across operating system platforms.
  • Different network port numbers of the hardware emulation service sub-modules are associated with different hardware emulation modules.
  • the hardware emulation service sub-module monitors different network port data for different hardware emulation modules according to the configuration table setting at runtime.
  • the network port number of the hardware emulation service sub-module is not set with the common system service port number. Conflicts, so as not to cause abnormal communication data, affecting the use.
  • the method further includes:
  • the hardware simulation module returns data after the update state and the simulation action operation are completed, the data is returned.
  • the hardware simulation module returns the processing result to the hardware simulation service module, and the hardware simulation service module returns the processing result to the platform adaptation sub-module, and the platform adaptation sub-module forwards the processing result to the port 1 generated by the IO loopback sub-module, and the test instruction reads Take port 2 data and complete this test.
  • FIG. 6 is a schematic flowchart of a specific embodiment of a cross-platform driving test method provided by the present invention, including:
  • test command sends data to the port.
  • the test command opens a port previously generated by the IO loopback submodule and sends data through the port.
  • the platform adaptation submodule reads the port data and sends the data to the hardware emulation service submodule.
  • the platform adaptation submodule runs a multi-threaded read port, and when the data is read, the read data is sent to the corresponding network port through TCP/IP.
  • the hardware emulation service submodule receives the data and forwards the data to the corresponding hardware emulation module.
  • the device is forwarded to the corresponding hardware emulation module according to the network port number monitored by each thread.
  • the hardware simulation module simulates hardware processing, and determines whether there is a return result.
  • the processing operation is an update state and an analog action. If the hardware simulation module does not return a result, the data is not returned, and the execution of the command is completed.
  • the platform adaptation submodule forwards the result data to the port generated by the IO loopback submodule.
  • test instruction reads the hardware return data, and the execution of the command is completed.
  • the cross-platform driving test method provided by the embodiment of the invention can receive the test instruction sent by the test host, and select the corresponding hardware simulation module according to the test instruction to perform the test, without developing a virtual simulation program on each test host,
  • the hardware simulation module is reused on different platforms to improve the efficiency and stability of the drive test.
  • the present invention also provides a cross-platform drive test device capable of implementing all the processes of the cross-platform drive test method in the above embodiment.
  • FIG. 7 is a schematic structural diagram of an embodiment of a cross-platform driving test apparatus provided by the present invention, including a test instruction reading module 61 and a hardware emulation service module 62;
  • the test instruction reading module 61 is configured to read a test instruction sent by the test host; the test instruction includes test data and a module identification code;
  • the hardware emulation service module 62 is configured to send the test data to a hardware emulation module corresponding to the module identifier, and cause the hardware emulation module to process the test data.
  • test instruction reading module 61 includes a platform adaptation sub-module 611 and an IO loopback sub-module 612;
  • the IO loopback submodule 612 is configured to receive a test command sent by the test host, and write the test command into the pre-generated first port;
  • the platform adapting sub-module 611 is configured to read the test command from a second port pre-generated by the IO loopback sub-module 612; the first port and the second port are paired with each other to form an IO loopback sub-module .
  • the module identification code is an identification code of the hardware emulation module.
  • the hardware emulation service module 62 is specifically configured to send the test data to a hardware emulation module corresponding to an identifier of the hardware emulation module.
  • the hardware emulation service module 62 includes an adaptation management sub-module 621 and N hardware emulation service sub-modules 622; the N hardware emulation service sub-modules and N One hardware simulation module corresponds one-to-one; wherein, N ⁇ 1;
  • the module identification code is a network port number of the hardware emulation service submodule
  • the adaptation management sub-module 621 is configured to send the test data to the corresponding hardware emulation service sub-module 622 through the network port number of the hardware emulation sub-service module;
  • the hardware emulation service sub-module 622 is configured to send the test data to its corresponding hardware emulation module when the test data is received.
  • cross-platform driving test device further includes:
  • a port number setting module that sets a unique network port number for each hardware emulation service submodule.
  • cross-platform driving test device further includes:
  • a processing result sending module configured to receive a processing result fed back by the hardware simulation module, and send the processing result to the test host.
  • the cross-platform driving test device provided by the embodiment of the invention can receive the test command sent by the test host, and select the corresponding hardware simulation module according to the test command to perform the test, without developing a virtual simulation program on each test host,
  • the hardware simulation module is reused on different platforms to improve the efficiency and stability of the drive test.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种跨平台的驱动测试方法、装置及系统,所述方法包括:读取测试主机发送的测试指令;所述测试指令包括测试数据和模块识别码(S1);将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理(S2)。该方法能够提高驱动测试效率和稳定性。

Description

一种跨平台的驱动测试方法、装置及系统 技术领域
本发明涉及计算机技术领域,尤其涉及一种跨平台的驱动测试方法、装置及系统。
背景技术
在驱动测试方面,现今普遍采用的方法是直接连接物理硬件进行测试或基于特定平台开发一套虚拟仿真设备来代替真实的物理硬件进行测试。其中,采用虚拟仿真技术进行测试,必须使虚拟仿真设备运行在某种操作系统平台上,而不同的操作系统拥有不同的特性,以满足不同的客户需求。不同的场景采用不同的操作系统平台来进行应用部署是最有效的解决方案,也是行业普遍认同的做法。
现有技术中,由于硬件资源或其它工程需求,在一种操作系统平台上进行驱动测试时需要一套能够在其平台上运行的虚拟仿真程序。而在某种操作系统平台上开发的虚拟仿真程序不能直接在其它操作系统平台上运行,导致同一套硬件仿真程序在不同操作系统平台上分别被重新设计开发与测试,不能直接被复用,从而降低了驱动测试效率和稳定性。
发明内容
本发明实施例提出一种跨平台的驱动测试方法、装置及系统,能够提高驱动测试效率和稳定性。
本发明实施例提供一种跨平台的驱动测试方法,包括:
读取测试主机发送的测试指令;所述测试指令包括测试数据和模块识别码;
将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理。
进一步地,所述读取测试主机发送的测试指令,具体包括:
接收测试主机发送的测试指令,并将所述测试指令写入预先生成的第一端口中;
从预先生成的第二端口中读取所述测试指令;所述第一端口与所述第二端口相互配对形成IO回环子模块。
在一个优选地实施方式中,所述模块识别码为硬件仿真模块的识别码;
所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理,具体包括:
将所述测试数据发送给所述硬件仿真模块的识别码所对应的硬件仿真模块,以使所述硬件仿真模块对所述测试数据进行处理。
在另一个优选地实施方式中,所述模块识别码为硬件仿真服务子模块的网络端口号;
所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述 测试数据进行处理,具体包括:
将所述测试数据通过所述硬件仿真服务子模块的网络端口号发送给相应的硬件仿真服务子模块,使所述硬件仿真服务子模块将所述测试数据发送给其对应的硬件仿真模块,以使所述对应的硬件仿真模块对所述测试数据进行处理。
进一步地,在所述接收测试主机发送的测试指令之前,还包括:
建立N个硬件仿真服务子模块与N个硬件仿真模块的一一对应关系,并为每个硬件仿真服务子模块设置唯一的网络端口号;其中,N≥1。
进一步地,在所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理之后,还包括:
接收所述硬件仿真模块反馈的处理结果,并将所述处理结果发送给所述测试主机。
相应地,本发明还提供一种跨平台的驱动测试装置,包括测试指令读取模块和硬件仿真服务模块;
所述测试指令读取模块用于读取测试主机发送的测试指令;所述测试指令包括测试数据和模块识别码;
所述硬件仿真服务模块用于将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理。
进一步地,所述测试指令读取模块包括平台适配子模块和IO回环子模块;
所述IO回环子模块用于接收测试主机发送的测试指令,并将所述测试指令写入预先生成的第一端口中;
所述平台适配子模块用于从所述IO回环子模块预先生成的第二端口中读取所述测试指令;所述第一端口与所述第二端口相互配对形成IO回环子模块。
在一个优选地实施方式中,所述模块识别码为硬件仿真模块的识别码;
所述硬件仿真服务模块具体用于将所述测试数据发送给所述硬件仿真模块的识别码所对应的硬件仿真模块。
在另一个优选地实施方式中,所述硬件仿真服务模块包括适配管理子模块和N个硬件仿真服务子模块;所述N个硬件仿真服务子模块与N个硬件仿真模块一一对应;其中,N≥1;
所述模块识别码为硬件仿真服务子模块的网络端口号;
所述适配管理子模块用于将所述测试数据通过所述硬件仿真子服务模块的网络端口号发送给相应的硬件仿真服务子模块;
所述硬件仿真服务子模块用于在接收到所述测试数据时,将所述测试数据发送给其对应的硬件仿真模块。
进一步地,所述跨平台的驱动测试装置还包括:
处理结果发送模块,用于接收所述硬件仿真模块反馈的处理结果,并将所述处理结果发送给所述测试主机。
相应地,本发明还提供一种跨平台的驱动测试系统,包括测试主机、驱动测试装置和N个硬件仿 真模块;其中,N≥1。
所述测试主机用于向所述驱动测试装置发送测试指令;所述测试指令包括测试数据和模块识别码。
所述驱动测试装置为上述跨平台的驱动测试装置,在此不再详细描述。
所述硬件仿真模块用于在接收到所述驱动测试装置发送的测试数据时,对所述测试数据进行处理。
实施本发明实施例,具有如下有益效果:
本发明实施例提供的跨平台的驱动测试方法、装置及系统,能够接收测试主机发送的测试指令,并根据该测试指令选取相应的硬件仿真模块来进行测试,无需在每个测试主机上开发虚拟仿真程序,实现硬件仿真模块在不同平台的复用,缩短了开发测试周期,提高驱动测试效率和稳定性。
附图说明
图1是本发明提供的跨平台的驱动测试系统的一个实施例的结构示意图;
图2是本发明提供的跨平台的驱动测试方法的一个实施例的流程示意图;
图3是本发明提供的IO回环子模块实现的原理图;
图4是本发明提供的一种驱动测试原理图;
图5是本发明提供的另一种驱动测试原理图;
图6是图2所示的跨平台的驱动测试方法的一种具体流程示意图;
图7是本发明提供的跨平台的驱动测试装置的一个实施例的结构示意图;
图8是图7所示的跨平台的驱动测试装置的一个具体结构示意图;
图9是图7所示的跨平台的驱动测试装置的另一个具体结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
参见图1,是本发明提供的跨平台的驱动测试系统的一个实施例的结构示意图,包括测试主机11、驱动测试装置12和N个硬件仿真模块13。其中,驱动测试装置12分别与测试主机11和N个硬件仿真模块13建立连接,N≥1。驱动测试装置运行于A平台上,测试主机运行于B平台上。A平台和B平台的操作系统包括但不限于Windows、Linux、mac等,A、B平台是一对多的关系。
参见图2,本发明提供的跨平台的驱动测试方法的一个实施例的流程示意图。
本发明实施例提供的驱动测试方法是从驱动测试装置这一侧进行描述的,包括:
S1、读取测试主机发送的测试指令;所述测试指令包括测试数据和模块识别码;
S2、将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述 测试数据进行处理。
需要说明的是,在测试时,A平台运行驱动测试装置,驱动测试装置中包括测试指令读取模块和硬件仿真服务模块,B平台运行测试主机。测试主机向驱动测试装置发送测试指令,测试指令读取模块接收并读取该测试指令,并通过TCP/IP发送给硬件仿真服务模块,硬件仿真服务模块再根据测试指令中的模块识别码发送给相应的硬件仿真模块进行处理。本发明实施例无需在每个B平台上开发硬件仿真模块,实现硬件仿真模块在不同平台的复用,提高驱动测试效率和稳定性。
进一步地,所述读取测试主机发送的测试指令,具体包括:
接收测试主机发送的测试指令,并将所述测试指令写入预先生成的第一端口中;
从预先生成的第二端口中读取所述测试指令;所述第一端口与所述第二端口相互配对形成IO回环子模块。
需要说明的是,测试指令读取模块包括平台适配子模块,测试主机中不同的操作系统环境需要驱动测试装置开发相应版本支持的平台适配子模块应用程序。平台适配子模块包含IO回环子模块,IO回环子模块自动判断系统端口状态并生成所需通讯端口,例如串口,USB口等,其端口特性与真实端口一致。IO回环子模块生成端口的方法技术多样,例如采用python脚本。IO回环子模块生成的端口通讯采用回环对模式,即通讯端口有两个,每一端分别可以读写,从一端写入可从另一端读出。如图3所示,测试指令21从IO回环子模块22的端口1写入数据时,平台适配子模块可以从端口2读出数据;并处理完后原路返回给测试指令21,即平台适配子模块从端口2写入数据,从端口1读出数据。其中,IO回环子模块生成所需通讯端口的流程如表1。
Figure PCTCN2017087840-appb-000001
表1
在测试时,A平台运行平台适配子模块,平台适配子模块调用IO回环子模块,IO回环子模块用多线程打开并读写端口对的端口1,并将生成的端口对信息记录到一个文本文件中,以便测试指令使用。B平台根据文本文件中记录的端口对信息获知IO回环子模块提供的端口2,打开端口2,向端口2写入测试指令,平台适配子模块马上从IO回环子模块的端口1读到测试指令,并通过TCP/IP发送给硬件仿真服务模块进行驱动测试。
在一个优选地实施方式中,所述模块识别码为硬件仿真模块的识别码;
所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理,具体包括:
将所述测试数据发送给所述硬件仿真模块的识别码所对应的硬件仿真模块,以使所述硬件仿真模块对所述测试数据进行处理。
在本实施方式中,一个硬件仿真服务模块与多个硬件仿真模块处于同一个进程,硬件仿真服务模块表现形式为一个可执行程序,比如.EXE。硬件仿真模块为一个动态链接库,比如.DLL。运行时,一个硬件仿真服务模块可执行程序EXE会加载多个硬件仿真子模块DLL。
如图4所示,测试时,将测试指令31发送给IO回环子模块32生成的端口,其中,测试指令中包括硬件仿真模块的识别码,平台适配子模块33读取IO回环子模块32的端口数据,并将该数据发送给硬件仿真服务模块34,使硬件仿真服务模块34转发给硬件仿真模块的识别码所对应的硬件仿真模块35,硬件仿真模块35对该数据进行处理,更新状态与模拟动作,如果硬件仿真模块35没有处理结果要返回,则不返回数据,完成本次测试。采用这种测试方式方便硬件仿真模块的统一管理,简化操作界面的设计。
在另一个优选地实施方式中,所述模块识别码为硬件仿真服务子模块的网络端口号;
所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理,具体包括:
将所述测试数据通过所述硬件仿真服务子模块的网络端口号发送给相应的硬件仿真服务子模块,使所述硬件仿真服务子模块将所述测试数据发送给其对应的硬件仿真模块,以使所述对应的硬件仿真模块对所述测试数据进行处理。
在本实施方式中,硬件仿真服务模块中具有多个硬件仿真服务子模块,每个硬件仿真服务子模块与每个硬件仿真模块处于独立的一个进程,各硬件仿真服务子模块代码实现一致,表现形式为一个可执行程序,比如.EXE。硬件仿真模块为一个动态链接库,比如.DLL。硬件仿真服务子模块与硬件仿真模块除后缀名不同外,前部分名称一致,比如GrgVirDev_JournalPrt.exe和GrgVirDev_JournalPrt.dll。硬件仿真服务子模块通过得到自己的进程名的前部分来自动加载相应的硬件仿真子模块。
如图5所示,测试时,将测试指令41发送给IO回环子模块42生成的端口,平台适配子模块43读取IO回环子模块42的端口数据,平台适配子模块43会运行多线程去读取相关的端口,当有读到数据时,将读取的数据通过TCP/IP发送到相应的网络端口,具有该网络端口的硬件仿真服务子模块44接收到数据后,将数据转发给其对应的硬件仿真模块45,硬件仿真模块45对该数据进行处理,更新状态与模拟动作,如果硬件仿真模块45没有处理结果要返回,则不返回数据,完成本次测试。采用这种测试方式使得进程间的影响小,当某个进程出现问题时,不会影响其它进程的运行,使得各个硬件仿真模块独立工作互不影响。
进一步地,在所述接收测试主机发送的测试指令之前,还包括:
建立N个硬件仿真服务子模块与N个硬件仿真模块的一一对应关系,并为每个硬件仿真服务子模块设置唯一的网络端口号;其中,N≥1。
需要说明的是,在测试之前,硬件仿真服务模块建立一个SOCKET网络服务端,采用TCP通讯方式。为每个硬件仿真服务子模块设置相应的配置表,其配置表所包含的节点信息如表2所示。
名称 解释
COMMTYPE 通讯类型,包含串口,USB,网络
ComID 当类型为串口时,指定通讯端口号
ComBaud 当类型为串口时,指定通讯端口号的波特率
VID 当类型为USB时,指定VID号
PID 当类型为USB时,指定PID号
NetPort 当类型为网络时,指定网络端口号
表2
其中,若选择通讯类型为串口或USB时,主要用于本地仿真模拟测试;若选择通讯类型为网络时,主要用于跨操作系统平台仿真模拟测试。
硬件仿真服务子模块的不同网路端口号关联不同的硬件仿真模块。硬件仿真服务子模块在运行时根据配置表的设定,针对不同的硬件仿真模块监听不同的网络端口数据,其中,硬件仿真服务子模块的网络端口号的设置不要与常见的系统服务端口号相冲突,以免造成通信数据异常,影响使用。
进一步地,在所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理之后,还包括:
接收所述硬件仿真模块反馈的处理结果,并将所述处理结果发送给所述测试主机。
需要说明的是,若硬件仿真模块在更新状态与模拟动作操作完成后,有数据返回,则将数据原路返回。硬件仿真模块将处理结果返回给硬件仿真服务模块,硬件仿真服务模块将处理结果返回给平台适配子模块,平台适配子模块将处理结果转发给IO回环子模块生成的端口1,测试指令读取端口2数据,完成本次测试。
参见图6,是本发明提供的跨平台的驱动测试方法的一个具体实施例的流程示意图,包括:
S51、测试指令向端口发送数据。其中,测试指令打开事先由IO回环子模块生成的端口,并通过该端口发送数据。
S52、平台适配子模块读取端口数据并将数据发送到硬件仿真服务子模块。其中,平台适配子模块运行多线程读取相关的端口,当有读到数据时,会将读入的数据通过TCP/IP发送到相应的网络端口。
S53、硬件仿真服务子模块收到数据,将数据转发给对应的硬件仿真模块。其中,根据每个线程所监听的网络端口号来转发给相应的硬件仿真模块。
S54、硬件仿真模块模拟硬件进行处理,并判断是否有返回结果。其中,处理操作为更新状态与模拟动作,若硬件仿真模块没有返回结果就不返回数据,本次命令执行完成。
S55、若硬件仿真模块有返回结果,则将结果数据发送给平台适配子模块。
S56、平台适配子模块将结果数据转发给IO回环子模块生成的端口。
S57、测试指令读取到硬件返回数据,本次命令执行完成。
本发明实施例提供的跨平台的驱动测试方法,能够接收测试主机发送的测试指令,并根据该测试指令选取相应的硬件仿真模块来进行测试,无需在每个测试主机上开发虚拟仿真程序,实现硬件仿真模块在不同平台的复用,提高驱动测试效率和稳定性。
相应的,本发明还提供一种跨平台的驱动测试装置,能够实现上述实施例中的跨平台的驱动测试方法的所有流程。
参见图7,是本发明提供的跨平台的驱动测试装置的一个实施例的结构示意图,包括测试指令读取模块61和硬件仿真服务模块62;
所述测试指令读取模块61用于读取测试主机发送的测试指令;所述测试指令包括测试数据和模块识别码;
所述硬件仿真服务模块62用于将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理。
进一步地,如图8所示,所述测试指令读取模块61包括平台适配子模块611和IO回环子模块612;
所述IO回环子模块612用于接收测试主机发送的测试指令,并将所述测试指令写入预先生成的第一端口中;
所述平台适配子模块611用于从所述IO回环子模块612预先生成的第二端口中读取所述测试指令;所述第一端口与所述第二端口相互配对形成IO回环子模块。
在一个优选地实施方式中,所述模块识别码为硬件仿真模块的识别码。
如图8所示,所述硬件仿真服务模块62具体用于将所述测试数据发送给所述硬件仿真模块的识别码所对应的硬件仿真模块。
在另一个优选地实施方式中,如图9所示,所述硬件仿真服务模块62包括适配管理子模块621和N个硬件仿真服务子模块622;所述N个硬件仿真服务子模块与N个硬件仿真模块一一对应;其中,N≥1;
所述模块识别码为硬件仿真服务子模块的网络端口号;
所述适配管理子模块621用于将所述测试数据通过所述硬件仿真子服务模块的网络端口号发送给相应的硬件仿真服务子模块622;
所述硬件仿真服务子模块622用于在接收到所述测试数据时,将所述测试数据发送给其对应的硬件仿真模块。
进一步地,所述跨平台的驱动测试装置还包括:
端口号设置模块,用于为每个硬件仿真服务子模块设置唯一的网络端口号。
进一步地,所述跨平台的驱动测试装置还包括:
处理结果发送模块,用于接收所述硬件仿真模块反馈的处理结果,并将所述处理结果发送给所述测试主机。
本发明实施例提供的跨平台的驱动测试装置,能够接收测试主机发送的测试指令,并根据该测试指令选取相应的硬件仿真模块来进行测试,无需在每个测试主机上开发虚拟仿真程序,实现硬件仿真模块在不同平台的复用,提高驱动测试效率和稳定性。
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。

Claims (11)

  1. 一种跨平台的驱动测试方法,其特征在于,包括:
    读取测试主机发送的测试指令;所述测试指令包括测试数据和模块识别码;
    将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理。
  2. 如权利要求1所述的跨平台的驱动测试方法,其特征在于,所述读取测试主机发送的测试指令,具体包括:
    接收测试主机发送的测试指令,并将所述测试指令写入预先生成的第一端口中;
    从预先生成的第二端口中读取所述测试指令;所述第一端口与所述第二端口相互配对形成IO回环子模块。
  3. 如权利要求1所述的跨平台的驱动测试方法,其特征在于,所述模块识别码为硬件仿真模块的识别码;
    所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理,具体包括:
    将所述测试数据发送给所述硬件仿真模块的识别码所对应的硬件仿真模块,以使所述硬件仿真模块对所述测试数据进行处理。
  4. 如权利要求1所述的跨平台的驱动测试方法,其特征在于,所述模块识别码为硬件仿真服务子模块的网络端口号;
    所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理,具体包括:
    将所述测试数据通过所述硬件仿真服务子模块的网络端口号发送给相应的硬件仿真服务子模块,使所述硬件仿真服务子模块将所述测试数据发送给其对应的硬件仿真模块,以使所述对应的硬件仿真模块对所述测试数据进行处理。
  5. 如权利要求1至4任一项所述的跨平台的驱动测试方法,其特征在于,在所述将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理之后,还包括:
    接收所述硬件仿真模块反馈的处理结果,并将所述处理结果发送给所述测试主机。
  6. 一种跨平台的驱动测试装置,其特征在于,包括测试指令读取模块和硬件仿真服务模块;
    所述测试指令读取模块用于读取测试主机发送的测试指令;所述测试指令包括测试数据和模块识 别码;
    所述硬件仿真服务模块用于将所述测试数据发送给所述模块识别码所对应的硬件仿真模块,使所述硬件仿真模块对所述测试数据进行处理。
  7. 如权利要求6所述的跨平台的驱动测试装置,其特征在于,所述测试指令读取模块包括平台适配子模块和IO回环子模块;
    所述IO回环子模块用于接收测试主机发送的测试指令,并将所述测试指令写入预先生成的第一端口中;
    所述平台适配子模块用于从所述IO回环子模块预先生成的第二端口中读取所述测试指令;所述第一端口与所述第二端口相互配对形成IO回环子模块。
  8. 如权利要求6所述的跨平台的驱动测试装置,其特征在于,所述模块识别码为硬件仿真模块的识别码;
    所述硬件仿真服务模块具体用于将所述测试数据发送给所述硬件仿真模块的识别码所对应的硬件仿真模块。
  9. 如权利要求6所述的跨平台的驱动测试装置,其特征在于,所述硬件仿真服务模块包括适配管理子模块和N个硬件仿真服务子模块;所述N个硬件仿真服务子模块与N个硬件仿真模块一一对应;其中,N≥1;
    所述模块识别码为硬件仿真服务子模块的网络端口号;
    所述适配管理子模块用于将所述测试数据通过所述硬件仿真子服务模块的网络端口号发送给相应的硬件仿真服务子模块;
    所述硬件仿真服务子模块用于在接收到所述测试数据时,将所述测试数据发送给其对应的硬件仿真模块。
  10. 如权利要求6至9任一项所述的跨平台的驱动测试装置,其特征在于,所述跨平台的驱动测试装置还包括:
    处理结果发送模块,用于接收所述硬件仿真模块反馈的处理结果,并将所述处理结果发送给所述测试主机。
  11. 一种驱动测试系统,其特征在于,包括测试主机、驱动测试装置和N个硬件仿真模块;其中,N≥1;
    所述测试主机用于向所述驱动测试装置发送测试指令;所述测试指令包括测试数据和模块识别码;
    所述驱动测试装置是如权利要求6至10任一项所述的驱动测试装置;
    所述硬件仿真模块用于在接收到所述驱动测试装置发送的测试数据时,对所述测试数据进行处理。
PCT/CN2017/087840 2016-08-30 2017-06-10 一种跨平台的驱动测试方法、装置及系统 Ceased WO2018040664A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610768594.X 2016-08-30
CN201610768594.XA CN106371962B (zh) 2016-08-30 2016-08-30 一种跨平台的驱动测试方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2018040664A1 true WO2018040664A1 (zh) 2018-03-08

Family

ID=57902257

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/087840 Ceased WO2018040664A1 (zh) 2016-08-30 2017-06-10 一种跨平台的驱动测试方法、装置及系统

Country Status (2)

Country Link
CN (1) CN106371962B (zh)
WO (1) WO2018040664A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106371962B (zh) * 2016-08-30 2019-01-01 广州广电运通金融电子股份有限公司 一种跨平台的驱动测试方法、装置及系统
WO2018191849A1 (zh) * 2017-04-17 2018-10-25 华为技术有限公司 云管理平台、虚拟机管理方法及其系统
CN111752840B (zh) * 2020-06-28 2023-08-08 中电长城(长沙)信息技术有限公司 一种跨系统的金融自助设备sp自动测试方法、设备及介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382905A (zh) * 2004-06-30 2009-03-11 微软公司 用于虚拟机环境中的仿真设备的开发的系统和方法
CN102591780A (zh) * 2012-01-13 2012-07-18 广州广电运通金融电子股份有限公司 一种设备驱动软件测试方法和测试系统
CN104834576A (zh) * 2015-04-30 2015-08-12 捷鼎国际股份有限公司 基于虚拟机进行硬件装置测试的计算机系统及方法
CN106371962A (zh) * 2016-08-30 2017-02-01 广州广电运通金融电子股份有限公司 一种跨平台的驱动测试方法、装置及系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8386867B2 (en) * 2009-07-02 2013-02-26 Silicon Image, Inc. Computer memory test structure
CN102479130B (zh) * 2010-11-25 2015-09-09 上海宇芯科技有限公司 一种跨平台跨语言单芯片系统的验证方法
CN102346235A (zh) * 2011-07-11 2012-02-08 北京北大众志微系统科技有限责任公司 一种面向硬件设备功能的自动测试系统及方法
CN103019939B (zh) * 2012-12-27 2015-07-22 广州广电运通金融电子股份有限公司 一种测试驱动程序的方法及系统
CN103441900B (zh) * 2013-08-27 2016-04-27 上海新炬网络技术有限公司 集中式跨平台自动化测试系统及其控制方法
CN104778121B (zh) * 2015-03-25 2018-09-18 网易(杭州)网络有限公司 游戏程序的测试方法、装置及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382905A (zh) * 2004-06-30 2009-03-11 微软公司 用于虚拟机环境中的仿真设备的开发的系统和方法
CN102591780A (zh) * 2012-01-13 2012-07-18 广州广电运通金融电子股份有限公司 一种设备驱动软件测试方法和测试系统
CN104834576A (zh) * 2015-04-30 2015-08-12 捷鼎国际股份有限公司 基于虚拟机进行硬件装置测试的计算机系统及方法
CN106371962A (zh) * 2016-08-30 2017-02-01 广州广电运通金融电子股份有限公司 一种跨平台的驱动测试方法、装置及系统

Also Published As

Publication number Publication date
CN106371962B (zh) 2019-01-01
CN106371962A (zh) 2017-02-01

Similar Documents

Publication Publication Date Title
US11144439B2 (en) Emulation-based testing of a microservices architecture
US9386079B2 (en) Method and system of virtual desktop infrastructure deployment studio
CN109960643B (zh) 一种代码测试方法和装置
US8261354B2 (en) System, method and program product for dynamically performing an audit and security compliance validation in an operating environment
US20190340115A1 (en) System and method for automated thin client contact center agent desktop testing
KR102158754B1 (ko) 스마트 네트워크 인터페이스 카드의 조작 방법 및 조작 장치
US11894983B2 (en) Simulation and testing of infrastructure as a service scale using a container orchestration engine
WO2016177124A1 (zh) 一种实现持续集成测试的方法及装置
US9411711B2 (en) Adopting an existing automation script to a new framework
US11281571B2 (en) System and method for validating cloud-native applications for a production-ready deployment
CN110347590A (zh) 业务系统的接口测试控制方法及装置
US8839188B2 (en) Automated build process and root-cause analysis
CN110955589A (zh) 基于浏览器的无头模式的测试方法、系统、设备及介质
CN117785593B (zh) 一种基于UVM的xHCI驱动的实现系统及方法
CN109977012A (zh) 系统的联调测试方法、装置、设备及计算机可读存储介质
US10445201B2 (en) System and method for automated integration and stress testing of hardware and software service in management controller using containerized toolbox
CN108804279A (zh) 修改日志打印等级的方法及应用设备
CN112506772A (zh) web自动化测试方法、装置、电子设备和存储介质
WO2018040664A1 (zh) 一种跨平台的驱动测试方法、装置及系统
US11474930B2 (en) Software bug reproduction
US8762781B2 (en) Method and apparatus useful in manufacturing test case operations
CN105373398A (zh) 一种基于Xshell脚本的整机柜服务器BMC IP批量设置方法
CN111984275A (zh) 基于cpu架构类型的系统部署方法、系统、终端及存储介质
US11474794B2 (en) Generating mock services based on log entries
CN113986263A (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: 17844971

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23.07.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17844971

Country of ref document: EP

Kind code of ref document: A1