WO2017198051A1 - Method and apparatus for data transmission, and computer storage medium - Google Patents

Method and apparatus for data transmission, and computer storage medium Download PDF

Info

Publication number
WO2017198051A1
WO2017198051A1 PCT/CN2017/081996 CN2017081996W WO2017198051A1 WO 2017198051 A1 WO2017198051 A1 WO 2017198051A1 CN 2017081996 W CN2017081996 W CN 2017081996W WO 2017198051 A1 WO2017198051 A1 WO 2017198051A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
data transmission
thread
connection port
transmission thread
Prior art date
Application number
PCT/CN2017/081996
Other languages
French (fr)
Chinese (zh)
Inventor
兰凯
Original Assignee
深圳市中兴微电子技术有限公司
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 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2017198051A1 publication Critical patent/WO2017198051A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

Disclosed in the present invention are a method and an apparatus for data transmission, and a computer storage medium. The method comprises: monitoring hardware configuration information of a first terminal, acquiring the connection port number of a second terminal connected to the first terminal; configuring the connection port number to an idle data transfer thread; running the data transfer thread, and transmitting data between the first terminal and the second terminal.

Description

一种数据传输方法、装置及计算机存储介质Data transmission method, device and computer storage medium
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201610323532.8、申请日为2016年05月16日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is based on a Chinese patent application filed on Jan. 16, 2016, the entire disclosure of which is hereby incorporated by reference.
技术领域Technical field
本发明实施例涉及数据传输技术,尤其涉及一种数据传输方法、装置及计算机存储介质。Embodiments of the present invention relate to data transmission technologies, and in particular, to a data transmission method, apparatus, and computer storage medium.
背景技术Background technique
电子设备及其零部件的生产过程中需要经过多次检验和测试,其中的功能测试是很重要的。比如,对于手机的功能测试而言,需要测试各功能应用的运行是否正常、流畅等;对于存储卡的功能测试而言,需要测试资料存储是否完好等。The testing of electronic equipment and its components requires extensive testing and testing, and functional testing is important. For example, for the functional test of the mobile phone, it is necessary to test whether the operation of each functional application is normal, smooth, etc.; for the functional test of the memory card, it is necessary to test whether the data storage is intact.
在功能测试中,由于被测件(如需要测试的电子设备或零部件)还是裸机,故一般都需要测试主机传输相关的数据(如测试数据或应用数据)到被测件中,测试传输通过的路径由测试主机到被测件的硬件端口,如异步传输标准接口(RS-232)、智能仪表(RS-485)、通用串行总线(Universal Serial Bus,USB)等。In the functional test, because the device under test (such as the electronic equipment or components to be tested) is still bare metal, it is generally necessary to test the host to transmit relevant data (such as test data or application data) to the device under test, and the test transmission is passed. The path is from the test host to the hardware port of the device under test, such as asynchronous transfer standard interface (RS-232), smart meter (RS-485), universal serial bus (USB), and so on.
但是,目前在被测件的硬件端口连接到测试主机的硬件端口后,需要作业人员在测试主机的测试应用中手动选择相应的硬件端口,如先从测试主机的设备管理器中查看被测件的端口,然后再选择对应的端口。而功能测试一般都是在生产线全检的,一台测试主机也会设置很多的端口,同时 测试很多的被测件。这样,每次都手动选择端口,测试效率就比较低,而且容易选错端口。However, after the hardware port of the device under test is connected to the hardware port of the test host, the operator needs to manually select the corresponding hardware port in the test application of the test host. For example, first view the device under test from the device manager of the test host. Port, then select the corresponding port. The functional test is generally in the production line full inspection, a test host will also set a lot of ports, while Test a lot of DUTs. In this way, each time the port is manually selected, the test efficiency is lower, and it is easy to select the wrong port.
发明内容Summary of the invention
本发明实施例提供一种数据传输方法、装置及计算机存储介质,能够有效提高测试效率,避免选错端口。Embodiments of the present invention provide a data transmission method, apparatus, and computer storage medium, which can effectively improve test efficiency and avoid selecting a wrong port.
本发明实施例提供一种数据传输方法,所述方法包括:An embodiment of the present invention provides a data transmission method, where the method includes:
监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;Monitoring hardware configuration information of the first terminal, and acquiring a connection port number of the second terminal connected to the first terminal;
将所述连接端口号配置到空闲的数据传输线程;Configuring the connection port number to an idle data transmission thread;
运行所述数据传输线程,在所述第一终端和第二终端之间传输数据。Running the data transmission thread to transfer data between the first terminal and the second terminal.
在一实施例中,所述监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号,包括:In an embodiment, the monitoring the hardware configuration information of the first terminal, and obtaining the connection port number of the second terminal connected to the first terminal, includes:
当所述第二终端连接到所述第一终端时,将所述连接端口号记录到所述第一终端的硬件配置信息中;When the second terminal is connected to the first terminal, recording the connection port number into hardware configuration information of the first terminal;
通过监控所述硬件配置信息,获取所述连接端口号。The connection port number is obtained by monitoring the hardware configuration information.
在一实施例中,所述将所述连接端口号配置到空闲的数据传输线程,包括:In an embodiment, the configuring the connection port number to an idle data transmission thread includes:
根据数据传输线程列表,确定空闲的数据传输线程,所述数据传输线程列表包括数据传输线程的状态;Determining an idle data transmission thread according to a data transmission thread list, where the data transmission thread list includes a state of the data transmission thread;
将获取的所述连接端口号配置到空闲的数据传输线程;Configuring the obtained connection port number to an idle data transmission thread;
将配置的结果记录在所述数据传输线程列表。The result of the configuration is recorded in the list of data transmission threads.
在一实施例中,所述运行所述数据传输线程,在所述第一终端和第二终端之间传输数据之后,还包括:In an embodiment, the operating the data transmission thread, after transmitting data between the first terminal and the second terminal, further includes:
当传输任务完成,释放所述数据传输线程,更新数据传输线程列表中数据传输线程的状态为空闲。 When the transfer task is completed, the data transfer thread is released, and the state of the data transfer thread in the update data transfer thread list is idle.
在一实施例中,所述方法还包括:In an embodiment, the method further includes:
读取数据传输线程列表中数据传输线程的状态;Reading the state of the data transfer thread in the data transfer thread list;
为每个数据传输线程分配传输带宽。A transmission bandwidth is allocated for each data transmission thread.
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本发明实施例所述的数据传输方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the data transmission method according to the embodiment of the invention.
本发明实施例还提供一种数据传输装置,所述装置包括监控模块、配置模块和传输模块;An embodiment of the present invention further provides a data transmission apparatus, where the apparatus includes a monitoring module, a configuration module, and a transmission module;
所述监控模块,配置为监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;The monitoring module is configured to monitor hardware configuration information of the first terminal, and obtain a connection port number of the second terminal connected to the first terminal;
所述配置模块,配置为将所述连接端口号配置到空闲的数据传输线程;The configuration module is configured to configure the connection port number to an idle data transmission thread;
所述传输模块,配置为运行所述数据传输线程,在所述第一终端和第二终端之间传输数据。The transmission module is configured to run the data transmission thread to transmit data between the first terminal and the second terminal.
在一实施例中,所述监控模块包括:In an embodiment, the monitoring module comprises:
设置单元,配置为设置监控所述第一终端的硬件配置信息的监控组件;a setting unit configured to set a monitoring component that monitors hardware configuration information of the first terminal;
记录单元,配置为当所述第二终端连接到所述第一终端时,将所述连接端口号记录到所述第一终端的硬件配置信息中;a recording unit configured to record the connection port number into hardware configuration information of the first terminal when the second terminal is connected to the first terminal;
监控单元,配置为通过监控所述硬件配置信息,获取所述连接端口号。And a monitoring unit configured to obtain the connection port number by monitoring the hardware configuration information.
在一实施例中,所述配置模块包括:In an embodiment, the configuration module includes:
确定单元,配置为根据数据传输线程列表,确定空闲的数据传输线程,所述数据传输线程列表包括数据传输线程的状态;a determining unit configured to determine an idle data transmission thread according to a data transmission thread list, where the data transmission thread list includes a state of the data transmission thread;
配置单元,配置为将获取的所述连接端口号配置到空闲的数据传输线程;将配置的结果记录在所述数据传输线程列表。And a configuration unit configured to configure the acquired connection port number to an idle data transmission thread; record the configured result in the data transmission thread list.
在一实施例中,所述传输模块,还配置为当传输任务完成,释放所述数据传输线程,更新数据传输线程列表中数据传输线程的状态为空闲。 In an embodiment, the transmission module is further configured to release the data transmission thread when the transmission task is completed, and update the state of the data transmission thread in the data transmission thread list to be idle.
在一实施例中,所述配置模块,还配置为读取数据传输线程列表中数据传输线程的状态;为每个数据传输线程分配传输带宽。In an embodiment, the configuration module is further configured to read a state of a data transmission thread in the data transmission thread list; and allocate a transmission bandwidth for each data transmission thread.
本发明实施例所述数据传输方法、装置及计算机存储介质,监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;将所述连接端口号配置到空闲的数据传输线程;运行所述数据传输线程,在所述第一终端和第二终端之间传输数据;可见,本发明实施例通过监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号,自动将获取的连接端口号配置到空闲的数据传输线程,启动数据传输线程,不用每次都手动选择连接端口,避免人工操作,从而在提高测试效率的基础上,有效避免端口选错。The data transmission method and device and the computer storage medium according to the embodiment of the present invention monitor the hardware configuration information of the first terminal, obtain the connection port number of the second terminal connected to the first terminal, and configure the connection port number to idle. a data transmission thread; running the data transmission thread to transmit data between the first terminal and the second terminal; as shown in the embodiment of the present invention, the second terminal and the The connection port number of the first terminal connection automatically configures the obtained connection port number to the idle data transmission thread, starts the data transmission thread, does not need to manually select the connection port every time, avoids manual operation, thereby improving test efficiency. , effectively avoid port selection errors.
附图说明DRAWINGS
图1为本发明实施例数据传输方法的实现流程示意图;1 is a schematic flowchart of an implementation process of a data transmission method according to an embodiment of the present invention;
图2为本发明实施例数据传输装置的组成结构示意图;2 is a schematic structural diagram of a structure of a data transmission apparatus according to an embodiment of the present invention;
图3为本发明实施例所述监控模块的组成结构示意图;3 is a schematic structural diagram of a monitoring module according to an embodiment of the present invention;
图4为本发明实施例所述配置模块的组成结构示意图。FIG. 4 is a schematic structural diagram of a configuration module according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合附图及具体实施例对本发明再做进一步的说明。The invention will be further described with reference to the drawings and specific embodiments.
图1为本发明实施例数据传输方法的流程示意图,所述方法的执行主体可以是第一终端,如图1所示,所述方法包括:FIG. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present invention. The execution body of the method may be a first terminal. As shown in FIG. 1 , the method includes:
步骤101:监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;Step 101: Monitor hardware configuration information of the first terminal, and obtain a connection port number of the second terminal connected to the first terminal.
所述第一终端可以是一台测试主机,更具体的,可以包括但不限于个人计算机(Personal Computer,PC)主机、工控机(Industrial Personal Computer,IPC)主机、小型机(minicomputer)主机等智能终端设备,且 设置专用的数据传输组件;The first terminal may be a test host, and more specifically, may include but not limited to a personal computer (PC) host, an industrial personal computer (IPC) host, a minicomputer host, and the like. Terminal equipment, and Set up a dedicated data transfer component;
在电子设备或零部件的功能测试中,所述数据传输组件可以是第一终端的测试应用的一个组件。In a functional test of an electronic device or component, the data transfer component can be a component of a test application of the first terminal.
所述第二终端是被测件,包括但不限于,手机、平板电脑、动态影像专家压缩标准音频层面3(Moving Picture Experts Group Audio Layer III,MP3)播放器、存储卡等。The second terminal is a device to be tested, including but not limited to, a mobile phone, a tablet computer, a Motion Picture Experts Group Audio Layer III (MP3) player, a memory card, and the like.
所述硬件配置信息一般会记录第一终端的硬件情况,如果第一终端添加了新的硬件,第一终端会在第一时间记录到其硬件配置信息中;所述硬件配置信息一般依附于第一终端的操作系统,如在微软公司的视窗(Windows)操作系统中,由注册表(Registry)记录第一终端的硬件配置信息,如果第一终端添加新的硬件,就会在第一时间记录到注册表中;当所述第二终端接入所述第一终端,可以视作是所述第二终端添加到所述第一终端的新硬件(当然从所述第二终端的角度看,也是所述第一终端添加到第二终端中,但由于在测试中,所述第一终端居于主导地位,所以认为是所述第二终端添加到所述第一终端中),所以在所述第一终端的硬件配置信息中,会记录所述第二终端的信息,如第二终端是否正常工作等,如果所述第一终端是Windwos操作系统,则第二终端的信息,会被记录到第一终端的注册表中。The hardware configuration information generally records the hardware status of the first terminal. If the first terminal adds new hardware, the first terminal records the hardware configuration information in the first time; the hardware configuration information is generally attached to the first A terminal operating system, such as in Microsoft's Windows (Windows) operating system, the registry records the hardware configuration information of the first terminal, if the first terminal adds new hardware, it will be recorded in the first time. Going to the registry; when the second terminal accesses the first terminal, it can be regarded as new hardware added by the second terminal to the first terminal (of course, from the perspective of the second terminal, The first terminal is also added to the second terminal, but since the first terminal is in a dominant position in the test, it is considered that the second terminal is added to the first terminal, so In the hardware configuration information of the first terminal, the information of the second terminal is recorded, such as whether the second terminal is working normally, etc., if the first terminal is a Windwos operating system, the information of the second terminal, Will be recorded to the registry of the first terminal.
这里,所述第二终端连接到所述第一终端的过程是,当所述第二终端与第一终端连接时,所述第一终端的操作系统会对所述第二终端进行识别;识别完成后,如果需要安装所述第二终端的驱动程序,则安装驱动程序,然后进入下一步;如果是之前连接过的第二终端或是即插即用的第二终端,直接进入下一步;第一终端会将第二终端的信息记录到第一终端的硬件配置信息中,如第二终端是否正常工作、第二终端的工作模式、第二终端的连接端口号等等;如果所述第一终端的操作系统是Windows操作系统,则 第二终端的信息具体会记录到注册表中。Here, the process of connecting the second terminal to the first terminal is: when the second terminal is connected to the first terminal, the operating system of the first terminal identifies the second terminal; After completion, if the driver of the second terminal needs to be installed, the driver is installed, and then proceeds to the next step; if it is the previously connected second terminal or the plug-and-play second terminal, directly enters the next step; The first terminal records the information of the second terminal in the hardware configuration information of the first terminal, such as whether the second terminal works normally, the working mode of the second terminal, the connection port number of the second terminal, and the like; The operating system of a terminal is the Windows operating system, then The information of the second terminal is specifically recorded in the registry.
因此,第一终端通过监控硬件配置信息,就能获取所述第二终端和第一终端连接的连接端口号,在Windows操作系统中,监控硬件配置信息可以是监控注册表。Therefore, the first terminal can obtain the connection port number of the second terminal and the first terminal by monitoring the hardware configuration information. In the Windows operating system, the monitoring hardware configuration information can be a monitoring registry.
这里,连接端口号具体可以是指物理端口号,更具体的就是第一终端的硬件端口号,一个物理端口号唯一地标识一个第一终端的硬件端口;Here, the connection port number may specifically refer to a physical port number, and more specifically, a hardware port number of the first terminal, and a physical port number uniquely identifies a hardware port of the first terminal;
这里,硬件端口可以是RS-232、RS-485、USB等。Here, the hardware port may be RS-232, RS-485, USB, or the like.
第一终端对硬件配置信息的监控,可以通过设置一个能监控硬件配置信息变化的监控组件实现;设置的方法可以是调用第一终端的操作系统的相关组件,也可以重新设置一个应用组件。The monitoring of the hardware configuration information by the first terminal may be implemented by setting a monitoring component that can monitor changes in the hardware configuration information; the setting method may be to call related components of the operating system of the first terminal, or to reset an application component.
如果所述第一终端的操作系统是Windwos操作系统,则所述调用第一终端的操作系统的相关组件,就是调用Windwos系统的相关组件。If the operating system of the first terminal is the Windwos operating system, the related component of the operating system that invokes the first terminal is to call related components of the Windwos system.
本发明实施例中,基于使用Windwos操作系统的第一终端,在所述第一终端预先设置了一个应用组件来监控第一终端的硬件配置信息,更具体的就是设置了一个UI线程(界面线程),通过UI线程来捕捉第一终端的注册表在添加第二终端后发出的消息。In the embodiment of the present invention, based on the first terminal using the Windwos operating system, an application component is preset in the first terminal to monitor hardware configuration information of the first terminal, and more specifically, a UI thread is set (interface thread ), through the UI thread to capture the message sent by the first terminal's registry after adding the second terminal.
步骤102:将所述连接端口号配置到空闲的数据传输线程;Step 102: Configure the connection port number to an idle data transmission thread.
第一终端获取连接端口号,就需要将连接端口号配置到空闲的数据传输线程,通过数据传输线程传输相关的数据到第二终端中;The first terminal acquires the connection port number, and needs to configure the connection port number to the idle data transmission thread, and transmit the relevant data to the second terminal through the data transmission thread;
本发明实施例中,所述将所述连接端口号配置到空闲的数据传输线程包括:In the embodiment of the present invention, the configuring the connection port number to the idle data transmission thread includes:
设置包括所有数据传输线程状态的数据传输线程列表;根据所述数据传输线程列表,确定空闲的数据传输线程;将获取的所述连接端口号配置到空闲的数据传输线程;将配置的结果记录在所述数据传输线程列表。Setting a data transmission thread list including all data transmission thread states; determining an idle data transmission thread according to the data transmission thread list; configuring the acquired connection port number to an idle data transmission thread; recording the configured result in The list of data transmission threads.
相比生产线上的装配等工序,功能测试的时间是比较长的,因此在功 能测试中,测试应用会设置多个测试线程,相对应的,第一终端会设有多个数据传输线程。Compared with the assembly process on the production line, the time of functional test is relatively long, so In the test, the test application will set up multiple test threads. Correspondingly, the first terminal will have multiple data transfer threads.
为了合理、有序使用数据传输线程,第一终端需要设置包括所有数据传输线程的状态的数据传输线程列表,如表1:In order to use the data transmission thread reasonably and orderly, the first terminal needs to set a list of data transmission threads including the state of all data transmission threads, as shown in Table 1:
数据传输线程号Data transmission thread number 数据传输线程状态Data transfer thread status
11 COM1COM1
22 COM2COM2
33 空闲idle
44 空闲idle
55 空闲idle
……...... ……......
表1Table 1
表1中,第一列为“数据传输线程号”,如1就是序号为1的数据传输线程;第二列为“数据传输线程状态”,本实施例中,设置有两种状态,一种是工作中,表中会显示工作的连接端口号,如COM1,另一种是空闲;In Table 1, the first column is “data transmission thread number”, such as 1 is the data transmission thread with sequence number 1; the second column is “data transmission thread state”. In this embodiment, two states are set, one In the work, the connection port number of the work will be displayed in the table, such as COM1, and the other is idle;
根据上述数据传输线程列表,第一终端确定空闲的数据传输线程,当存在空闲的数据传输线程时,将获取的连接端口号配置到空闲的数据传输线程中,并更新所述数据传输线程列表中的数据传输线程状态,配置的方式可以是按顺序配置。According to the foregoing data transmission thread list, the first terminal determines an idle data transmission thread, and when there is an idle data transmission thread, configures the acquired connection port number into the idle data transmission thread, and updates the data transmission thread list. The status of the data transfer thread can be configured in order.
当传输任务完成后,第一终端释放所述数据传输线程,并更新所述数据传输线程列表中的数据传输线程状态为空闲;如果没有空闲的数据传输线程(一般第二终端的数量多于数据传输线程的数量),则刚刚接入所述第一终端的所述第二终端会等待,为了有序安排所述第二终端和第一终端的连接和传输,第一终端还设置有包括所有第二终端的第二终端工作状态表,如表2: After the transmission task is completed, the first terminal releases the data transmission thread, and updates the data transmission thread status in the data transmission thread list to idle; if there is no idle data transmission thread (generally, the second terminal has more data than the data) The number of transmission threads), the second terminal that has just accessed the first terminal waits, in order to arrange the connection and transmission of the second terminal and the first terminal in an orderly manner, the first terminal is further configured to include all The second terminal working state table of the second terminal, as shown in Table 2:
序号Serial number 第二终端名称Second terminal name 连接端口号Connection port number 工作状态Working status
11 被测件1DUT 1 COM1COM1 线程1Thread 1
22 被测件2Tested part 2 COM2COM2 线程2Thread 2
33 被测件3DUT 3 COM3COM3 线程3Thread 3
44 被测件4DUT 4 COM4COM4 线程4Thread 4
55 被测件5DUT 5 COM5COM5 完成carry out
……...... ……...... ……...... ……......
1515 被测件15DUT 15 COM15COM15 等待wait
1616 被测件16DUT 16 COM16COM16 等待wait
表2Table 2
表2中,第二列为“第二终端名称”,就是具体的第二终端名称,如被测件1、被测件2,实际中,这里的名称就是如手机AAA、平板电脑BBB等更具体的名称;第三列为“连接端口号”,如COM1就是第二终端连接到第一终端的连接端口为COM1;第四列是工作状态。In Table 2, the second column is the “second terminal name”, which is the specific second terminal name, such as the device under test 1, the device under test 2, in fact, the name here is such as mobile phone AAA, tablet BBB, etc. The specific name; the third column is the "connection port number". For example, COM1 is the connection port of the second terminal connected to the first terminal to COM1; the fourth column is the working state.
本实施例中,设置有三种状态,第一种工作状态是工作中,表中会显示配置的数据传输线程号,如表中的线程1,就是表示第二终端连接的COM1被配置到线程1,而且传输工作还未结束;第二种工作状态是完成,表示传输工作刚结束,但第二终端还未从第一终端的连接端口移除,一般这种情况,第一终端的数据传输组件会发出提示,让工作人员及时移除,如跳出对话框、闪烁图标等;第三种工作状态是等待,表示的是第二终端已经通过连接端口添加到第一终端,但是因为没有空闲的数据传输线程,所以暂时等待中。In this embodiment, three states are set. The first working state is in operation, and the configured data transmission thread number is displayed in the table. For example, the thread 1 in the table indicates that the COM1 connected to the second terminal is configured to the thread 1 And the transmission work has not ended; the second working state is completed, indicating that the transmission work has just ended, but the second terminal has not been removed from the connection port of the first terminal. Generally, the data transmission component of the first terminal A prompt will be issued to prompt the staff to remove, such as jumping out of the dialog box, flashing icon, etc.; the third working state is waiting, indicating that the second terminal has been added to the first terminal through the connection port, but because there is no idle data The thread is transferred, so wait for a while.
为了保证数据传输的有序进行,第一终端一般设置一个第二终端只对应一个数据传输线程,如果需要加快其中一个第二终端的测试速度,可以减少同时传输的第二终端即可;这和通过网络访问服务器的客户端不一样, 那种情况,客户端数量是无法控制的。In order to ensure the orderly execution of the data transmission, the first terminal generally sets a second terminal to correspond to only one data transmission thread. If it is necessary to speed up the testing speed of one of the second terminals, the second terminal that can be simultaneously transmitted can be reduced; Clients accessing the server over the network are different. In that case, the number of clients is uncontrollable.
当数据传输线程列表中出现“空闲”的数据传输线程后,第一终端会主动访问第二终端工作状态表,查询是否有等待的第二终端,如果有,就将该第二终端的连接端口号配置到所述“空闲”的数据传输线程。When an "idle" data transmission thread appears in the data transmission thread list, the first terminal actively accesses the second terminal working status table to query whether there is a waiting second terminal, and if so, the second terminal connection port The number is configured to the "idle" data transfer thread.
在一实施例中,本步骤还包括如下步骤:In an embodiment, the step further includes the following steps:
读取所述数据传输线程列表中所有数据传输线程的状态;Reading the status of all data transmission threads in the data transmission thread list;
为每个数据传输线程分配传输带宽。A transmission bandwidth is allocated for each data transmission thread.
作为一个特定的第一终端来说,其在测试过程中,通过硬件端口传输的总带宽是一定的,这样,数据传输线程的带宽取决于同时工作的数据传输线程,第一终端、具体的数据传输组件会根据所述数据传输线程列表中数据传输线程的状态,确定同时工作的数据传输线程数量,根据同时工作的数据传输线程数量为数据传输线程分配传输带宽,这里的分配原则一般是平均分配。As a specific first terminal, the total bandwidth transmitted through the hardware port is certain during the test, so that the bandwidth of the data transmission thread depends on the data transmission thread working at the same time, the first terminal, and the specific data. The transmission component determines the number of data transmission threads working at the same time according to the state of the data transmission thread in the data transmission thread list, and allocates transmission bandwidth to the data transmission thread according to the number of data transmission threads working at the same time. The allocation principle here is generally evenly distributed. .
步骤103:运行所述数据传输线程,在所述第一终端和第二终端之间传输数据。Step 103: Run the data transmission thread to transfer data between the first terminal and the second terminal.
在将连接端口号配置到空闲的数据传输线程后,第一终端的数据传输组件运行,第一终端和第二终端之间就开始传输数据,在电子设备或零部件的功能测试中,就是传输与功能测试相关的数据,包括:After the connection port number is configured to the idle data transmission thread, the data transmission component of the first terminal operates, and the data is transmitted between the first terminal and the second terminal, and in the functional test of the electronic device or component, the transmission is performed. Data related to functional testing, including:
运行配置连接端口号的数据传输线程,通过所述连接端口号对应的连接端口,在所述第一终端和第二终端之间传输数据;当传输任务完成,释放所述数据传输线程,更新所述数据传输线程列表中的数据传输线程状态为空闲。Running a data transmission thread configuring a connection port number, transmitting data between the first terminal and the second terminal by using a connection port corresponding to the connection port number; releasing the data transmission thread when the transmission task is completed, and updating the station The data transfer thread status in the data transfer thread list is idle.
每次数据传输线程的状态变更,都需要及时更新数据传输线程列表,这样便于及时分配数据传输线程给等待的第二终端。Each time the state of the data transfer thread changes, it is necessary to update the data transfer thread list in time, so that it is convenient to timely allocate the data transfer thread to the waiting second terminal.
本发明实施例所述数据传输方法,监控第一终端的硬件配置信息,获 取第二终端与所述第一终端连接的连接端口号;将所述连接端口号配置到空闲的数据传输线程;运行所述数据传输线程,在所述第一终端和第二终端之间传输数据。如此,本发明实施例通过监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号,自动将获取的连接端口号配置到空闲的数据传输线程,启动数据传输线程,不用每次都手动选择连接端口,避免人工操作,从而在提高测试效率的基础上,有效避免端口选错。The data transmission method according to the embodiment of the present invention monitors hardware configuration information of the first terminal, and obtains Taking a connection port number of the second terminal connected to the first terminal; configuring the connection port number to an idle data transmission thread; and running the data transmission thread to transmit between the first terminal and the second terminal data. As such, the embodiment of the present invention obtains the connection port number of the second terminal and the first terminal by monitoring the hardware configuration information of the first terminal, and automatically configures the obtained connection port number to the idle data transmission thread to start data transmission. Threads do not need to manually select the connection port every time, avoiding manual operations, thus effectively avoiding port selection errors based on improved test efficiency.
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本发明实施例所述的数据传输方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the data transmission method according to the embodiment of the invention.
图2为本发明实施例数据传输装置的示意图,如图2所示,所述装置包括:监控模块21、配置模块22和传输模块23;2 is a schematic diagram of a data transmission apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes: a monitoring module 21, a configuration module 22, and a transmission module 23;
所述监控模块21,配置为监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;The monitoring module 21 is configured to monitor hardware configuration information of the first terminal, and obtain a connection port number of the second terminal connected to the first terminal;
所述配置模块22,配置为将所述连接端口号配置到空闲的数据传输线程;The configuration module 22 is configured to configure the connection port number to an idle data transmission thread;
所述传输模块23,配置为运行所述数据传输线程,在所述第一终端和第二终端之间传输数据。The transmission module 23 is configured to run the data transmission thread to transmit data between the first terminal and the second terminal.
在一实施例中,如图3所示,所述监控模块21包括:In an embodiment, as shown in FIG. 3, the monitoring module 21 includes:
设置单元211,配置为设置监控所述第一终端的硬件配置信息的监控组件;The setting unit 211 is configured to set a monitoring component that monitors hardware configuration information of the first terminal;
记录单元212,配置为当所述第二终端连接到所述第一终端时,将所述连接端口号记录到所述第一终端的硬件配置信息中;The recording unit 212 is configured to record the connection port number into the hardware configuration information of the first terminal when the second terminal is connected to the first terminal;
监控单元213,配置为通过监控所述硬件配置信息,获取所述连接端口号。 The monitoring unit 213 is configured to acquire the connection port number by monitoring the hardware configuration information.
在一实施例中,如图4所示,所述配置模块22包括:In an embodiment, as shown in FIG. 4, the configuration module 22 includes:
确定单元221,配置为根据数据传输线程列表,确定空闲的数据传输线程,所述数据传输线程列表包括数据传输线程的状态;The determining unit 221 is configured to determine an idle data transmission thread according to the data transmission thread list, where the data transmission thread list includes a state of the data transmission thread;
配置单元222,配置为将获取的所述连接端口号配置到空闲的数据传输线程;将配置的结果记录在所述数据传输线程列表。The configuration unit 222 is configured to configure the acquired connection port number to an idle data transmission thread; and record the result of the configuration in the data transmission thread list.
为了说明的更清楚,下面将分别对各个模块作详细说明:For a clearer explanation, each module will be described in detail below:
所述监控模块监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号。The monitoring module monitors hardware configuration information of the first terminal, and obtains a connection port number of the second terminal connected to the first terminal.
所述第一终端可以是一台测试主机,更具体的,可以包括但不限于PC主机、IPC主机、minicomputer主机等智能终端设备,且设置专用的数据传输组件;在电子设备或零部件的功能测试中,所述数据传输组件可以是第一终端的测试应用的一个组件。The first terminal may be a test host, and more specifically, may include but not limited to a smart terminal device such as a PC host, an IPC host, a minicomputer host, and the like, and a dedicated data transmission component is set; the function of the electronic device or component In the test, the data transmission component may be a component of the test application of the first terminal.
所述第二终端是被测件,包括但不限于,手机、平板电脑、MP3播放器、存储卡等。The second terminal is a device to be tested, including but not limited to, a mobile phone, a tablet computer, an MP3 player, a memory card, and the like.
所述硬件配置信息一般会记录第一终端的硬件情况,如果第一终端添加了新的硬件,会在第一时间由第一终端记录到其硬件配置信息中;所述硬件配置信息一般依附于第一终端的操作系统,如在微软公司的Windows操作系统中,由Registry记录第一终端的硬件配置信息,如果第一终端添加新的硬件,就会在第一时间记录到注册表中;当所述第二终端接入所述第一终端,可以视作是所述第二终端添加到所述第一终端的新硬件(当然从所述第二终端的角度看,也是所述第一终端添加到第二终端中,但由于在测试中,所述第一终端居于主导地位,所以认为是所述第二终端添加到所述第一终端中),所以在所述第一终端的硬件配置信息中,会记录所述第二终端的信息,如果所述第一终端是Windwos操作系统,则第二终端的信息,会被记录到第一终端的注册表中。 The hardware configuration information generally records the hardware status of the first terminal. If the first terminal adds new hardware, the first terminal records the hardware configuration information in the first time; the hardware configuration information is generally attached to the hardware configuration information. The operating system of the first terminal, such as in the Windows operating system of Microsoft Corporation, records the hardware configuration information of the first terminal by the Registry, and if the first terminal adds new hardware, it will be recorded in the registry at the first time; The second terminal accessing the first terminal may be regarded as new hardware added by the second terminal to the first terminal (of course, from the perspective of the second terminal, the first terminal is also Adding to the second terminal, but since the first terminal is in a dominant position in the test, it is considered that the second terminal is added to the first terminal), so the hardware configuration in the first terminal In the information, the information of the second terminal is recorded. If the first terminal is the Windwos operating system, the information of the second terminal is recorded in the registry of the first terminal.
这里,所述第二终端连接到所述第一终端的过程是,当所述第二终端与第一终端连接时,所述第一终端的操作系统会对所述第二终端进行识别;识别完成后,如果需要安装所述第二终端的驱动程序,则安装驱动程序,然后进入下一步;如果是之前连接过的第二终端或是即插即用的第二终端,直接进入下一步;第一终端会将第二终端的信息记录到第一终端的硬件配置信息中,如第二终端是否正常工作、第二终端的工作模式、第二终端的连接端口号等等;如果所述第一终端的操作系统是Windows操作系统,则第二终端的信息具体会记录到注册表中。Here, the process of connecting the second terminal to the first terminal is: when the second terminal is connected to the first terminal, the operating system of the first terminal identifies the second terminal; After completion, if the driver of the second terminal needs to be installed, the driver is installed, and then proceeds to the next step; if it is the previously connected second terminal or the plug-and-play second terminal, directly enters the next step; The first terminal records the information of the second terminal in the hardware configuration information of the first terminal, such as whether the second terminal works normally, the working mode of the second terminal, the connection port number of the second terminal, and the like; The operating system of a terminal is a Windows operating system, and the information of the second terminal is specifically recorded in the registry.
因此,监控模块通过监控硬件配置信息,就能获取所述第二终端和第一终端连接的连接端口号,在Windows操作系统中,监控硬件配置信息可以是监控注册表。Therefore, the monitoring module can obtain the connection port number of the second terminal and the first terminal by monitoring the hardware configuration information. In the Windows operating system, the monitoring hardware configuration information can be a monitoring registry.
这里,连接端口号具体可以是指物理端口号,更具体的就是第一终端的硬件端口号,一个物理端口号唯一地标识一个第一终端的硬件端口;Here, the connection port number may specifically refer to a physical port number, and more specifically, a hardware port number of the first terminal, and a physical port number uniquely identifies a hardware port of the first terminal;
这里,硬件端口可以是RS-232、RS-485、USB等。Here, the hardware port may be RS-232, RS-485, USB, or the like.
监控模块对硬件配置信息的监控,可以通过设置一个能监控硬件配置信息变化的监控组件实现;设置的方法可以是调用第一终端的操作系统的相关组件,也可以重新设置一个应用组件;如果所述第一终端的操作系统是Windwos操作系统,则所述调用第一终端的操作系统的相关组件,就是调用Windwos系统的相关组件。The monitoring module monitors the hardware configuration information by setting a monitoring component that can monitor changes in the hardware configuration information; the setting method may be to call related components of the operating system of the first terminal, or to reset an application component; The operating system of the first terminal is the Windwos operating system, and the related component of the operating system that invokes the first terminal is to call related components of the Windwos system.
本发明实施例中,基于使用Windwos操作系统的第一终端,在所述第一终端预先设置一个应用组件来监控第一终端的硬件配置信息,更具体的就是设置了一个UI线程(界面线程),通过UI线程来捕捉第一终端的注册表在添加第二终端后发出的消息。In the embodiment of the present invention, based on the first terminal using the Windwos operating system, an application component is preset in the first terminal to monitor hardware configuration information of the first terminal, and more specifically, a UI thread (interface thread) is set. The UI thread is used to capture the message sent by the first terminal's registry after adding the second terminal.
所述配置模块将所述连接端口号配置到空闲的数据传输线程。The configuration module configures the connection port number to an idle data transmission thread.
监控模块获取到连接端口号,就需要通过配置模块将连接端口号配置 到空闲的数据传输线程,包括:If the monitoring module obtains the connection port number, you need to configure the connection port number through the configuration module. To idle data transfer threads, including:
设置包括所有数据传输线程状态的数据传输线程列表;根据所述数据传输线程列表,确定空闲的数据传输线程;将获取的所述连接端口号配置到空闲的数据传输线程;将配置的结果记录在所述数据传输线程列表。Setting a data transmission thread list including all data transmission thread states; determining an idle data transmission thread according to the data transmission thread list; configuring the acquired connection port number to an idle data transmission thread; recording the configured result in The list of data transmission threads.
相比生产线上的装配等工序,功能测试的时间是比较长的,因此在功能测试中,测试应用会设置多个测试线程,相对应的,配置模块会设有多个数据传输线程。Compared with the assembly process on the production line, the function test time is relatively long. Therefore, in the function test, the test application sets multiple test threads. Correspondingly, the configuration module will have multiple data transfer threads.
为了合理、有序使用数据传输线程,配置模块需要设置包括所有数据传输线程的状态的数据传输线程列表,如表1。其中,第一列为“数据传输线程号”,如1就是序号第一的数据传输线程;第二列为“数据传输线程状态”,本实施例中,设置有两种状态,一种是工作中,表中会显示工作的连接端口号,如COM1,另一种是空闲。In order to use the data transfer thread reasonably and orderly, the configuration module needs to set a list of data transfer threads including the state of all data transfer threads, as shown in Table 1. The first column is the “data transmission thread number”. For example, 1 is the data transmission thread with the first serial number; the second column is the “data transmission thread state”. In this embodiment, two states are set, one is work. In the table, the working connection port number is displayed, such as COM1, and the other is idle.
根据上述数据传输线程列表,配置模块确定空闲的数据传输线程,当存在空闲的数据传输线程时,将获取的连接端口号配置到空闲的数据传输线程中,并更新所述数据传输线程列表中的数据传输线程状态,配置的方式可以是按顺序配置。According to the foregoing data transmission thread list, the configuration module determines an idle data transmission thread, and when there is an idle data transmission thread, configures the acquired connection port number into the idle data transmission thread, and updates the data transmission thread list Data transfer thread status, which can be configured in order.
在一实施例中,所述传输模块23,还配置为当传输任务完成后,释放所述数据传输线程,并更新所述数据传输线程列表中的数据传输线程状态为空闲。In an embodiment, the transmission module 23 is further configured to release the data transmission thread after the completion of the transmission task, and update the data transmission thread status in the data transmission thread list to be idle.
这里,如果没有空闲的数据传输线程(一般第二终端的数量多于数据传输线程的数量),则刚刚接入所述第一终端的所述第二终端会等待,为了有序安排所述第二终端和第一终端的连接和传输,配置模块还设置有包括所有第二终端的第二终端工作状态表,如前述表2。其中,第二列为“第二终端名称”,就是具体的第二终端名称,如被测件1、被测件2,实际中,这里的名称就是如手机AAA、平板电脑BBB等更具体的名称;第三列为 “连接端口号”,如COM1就是第二终端连接到第一终端的连接端口为COM1;第四列是工作状态,本实施例中,设置有三种状态,第一种工作状态是工作中,表中会显示配置的数据传输线程号,如表中的线程1,就是表示第二终端连接的COM1被配置到线程1,而且传输工作还未结束;第二种工作状态是完成,表示传输工作刚结束,但第二终端还未从第一终端的连接端口移除,一般这种情况,第一终端的数据传输组件会发出提示,让工作人员及时移除,如跳出对话框、闪烁图标等;第三种工作状态是等待,表示的是第二终端已经通过连接端口添加到第一终端,但是因为没有空闲的数据传输线程,所以暂时等待中。Here, if there is no idle data transmission thread (generally the number of second terminals is more than the number of data transmission threads), the second terminal that has just accessed the first terminal will wait, in order to arrange the first The connection and transmission of the second terminal and the first terminal, the configuration module is further provided with a second terminal working state table including all the second terminals, as in Table 2 above. The second column is the "second terminal name", which is the specific second terminal name, such as the device under test 1, the device under test 2, in fact, the name here is more specific such as mobile phone AAA, tablet BBB, etc. Name; the third column is "Connection port number", such as COM1 is the connection port of the second terminal connected to the first terminal is COM1; the fourth column is the working state, in this embodiment, three states are set, the first working state is working, the table The configured data transmission thread number is displayed, such as thread 1 in the table, that is, the COM1 connected to the second terminal is configured to thread 1, and the transmission work has not ended; the second working state is completed, indicating that the transmission work is just completed. End, but the second terminal has not been removed from the connection port of the first terminal. Generally, the data transmission component of the first terminal will prompt the staff to remove in time, such as jumping out of the dialog box, flashing icon, etc. The third working state is waiting, indicating that the second terminal has been added to the first terminal through the connection port, but because there is no idle data transmission thread, it is temporarily waiting.
为了保证数据传输的有序进行,配置模块一般设置一个第二终端只对应一个数据传输线程,如果需要加快其中一个第二终端的测试速度,可以减少同时传输的第二终端即可;这和通过网络访问服务器的客户端不一样,那种情况,客户端数量是无法控制的。In order to ensure the orderly execution of the data transmission, the configuration module generally sets a second terminal to correspond to only one data transmission thread. If it is necessary to speed up the test speed of one of the second terminals, the second terminal can be reduced at the same time; The client of the network access server is different. In that case, the number of clients is beyond control.
当数据传输线程列表中出现“空闲”的数据传输线程后,数据传输组件会主动访问第二终端工作状态表,查询是否有等待的第二终端,如果有,就将该第二终端的连接端口号配置到所述“空闲”的数据传输线程。When an "idle" data transmission thread appears in the data transmission thread list, the data transmission component actively accesses the second terminal working state table to query whether there is a waiting second terminal, and if so, the second terminal connection port The number is configured to the "idle" data transfer thread.
在一实施例中,本发明实施例配置模块22,还配置为读取所述数据传输线程列表中所有数据传输线程的状态;为每个数据传输线程分配传输带宽。In an embodiment, the configuration module 22 of the embodiment of the present invention is further configured to read a state of all data transmission threads in the data transmission thread list; and allocate a transmission bandwidth for each data transmission thread.
作为一个特定的第一终端来说,其在测试过程中,通过硬件端口传输的总带宽是一定的,这样,数据传输线程的带宽取决于同时工作的数据传输线程,第一终端、具体的数据传输组件会根据所述数据传输线程列表中数据传输线程的状态,确定同时工作的数据传输线程数量,根据同时工作的数据传输线程数量分配带宽,这里的分配原则一般是平均分配。As a specific first terminal, the total bandwidth transmitted through the hardware port is certain during the test, so that the bandwidth of the data transmission thread depends on the data transmission thread working at the same time, the first terminal, and the specific data. The transmission component determines the number of data transmission threads working at the same time according to the state of the data transmission thread in the data transmission thread list, and allocates bandwidth according to the number of data transmission threads working at the same time. The allocation principle here is generally an even distribution.
所述传输模块,用于运行所述数据传输线程,在所述第一终端和第二 终端之间传输数据。The transmission module is configured to run the data transmission thread at the first terminal and the second Transfer data between terminals.
在将连接端口号配置到空闲的数据传输线程后,传输模块开始运行,第一终端和第二终端之间就开始传输数据了,在电子设备或零部件的功能测试中,具体的就是传输与功能测试相关的数据,具体包括:After the connection port number is configured to the idle data transmission thread, the transmission module starts to operate, and the data is transmitted between the first terminal and the second terminal. In the functional test of the electronic device or component, the specific transmission is Functional test related data, including:
运行配置了连接端口号的数据传输线程,通过所述连接端口号对应的连接端口,在所述第一终端和第二终端之间传输数据;Running a data transmission thread configured with a connection port number, and transmitting data between the first terminal and the second terminal by using a connection port corresponding to the connection port number;
当传输任务完成,释放所述数据传输线程,更新所述数据传输线程列表中的数据传输线程状态为空闲。When the transfer task is completed, the data transfer thread is released, and the status of the data transfer thread in the list of data transfer threads is updated to be idle.
每次数据传输线程的状态变更,都需要及时更新数据传输线程列表,这样便于及时分配数据传输线程给等待的第二终端。Each time the state of the data transfer thread changes, it is necessary to update the data transfer thread list in time, so that it is convenient to timely allocate the data transfer thread to the waiting second terminal.
在实际应用中,所述数据传输装置中的各模块及其各模块所包括的各单元均可由位于第一终端的中央处理器(Central Processing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)、或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。In practical applications, each module included in the data transmission device and each unit included in each module may be configured by a central processing unit (CPU), a microprocessor (Micro Processor Unit, MPU) located at the first terminal. ), digital signal processor (DSP), or Field Programmable Gate Array (FPGA) implementation.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得 通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, a special purpose computer, an embedded processor or other programmable data processing device to produce a machine such that Instructions executed by a processor of a computer or other programmable data processing device generate means for implementing the functions specified in a block or blocks of a flow or a flow and/or a block diagram of the flowchart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in Within the scope of protection of the present invention.
工业实用性Industrial applicability
本发明实施例所述数据传输方法,监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;将所述连接端口号配置到空闲的数据传输线程;运行所述数据传输线程,在所述第一终端和第二终端之间传输数据;可见,本发明实施例通过监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号,自动将获取的连接端口号配置到空闲的数据传输线程,启动数据传输线程,不用每次都手动选择连接端口,避免人工操作,从而在提高测试效率的基础上,有效避免端口选错。 The data transmission method of the embodiment of the present invention monitors hardware configuration information of the first terminal, acquires a connection port number of the second terminal connected to the first terminal, and configures the connection port number to an idle data transmission thread; The data transmission thread transmits data between the first terminal and the second terminal. It can be seen that, by monitoring the hardware configuration information of the first terminal, the connection between the second terminal and the first terminal is obtained. The port number automatically configures the obtained connection port number to the idle data transmission thread, starts the data transmission thread, does not need to manually select the connection port every time, avoids manual operation, thereby effectively avoiding port selection error based on improving test efficiency. .

Claims (11)

  1. 一种数据传输方法,所述方法包括:A data transmission method, the method comprising:
    监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;Monitoring hardware configuration information of the first terminal, and acquiring a connection port number of the second terminal connected to the first terminal;
    将所述连接端口号配置到空闲的数据传输线程;Configuring the connection port number to an idle data transmission thread;
    运行所述数据传输线程,在所述第一终端和第二终端之间传输数据。Running the data transmission thread to transfer data between the first terminal and the second terminal.
  2. 根据权利要求1所述的方法,其中,所述监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号,包括:The method of claim 1, wherein the monitoring the hardware configuration information of the first terminal, and obtaining the connection port number of the second terminal connected to the first terminal, includes:
    当所述第二终端连接到所述第一终端时,将所述连接端口号记录到所述第一终端的硬件配置信息中;When the second terminal is connected to the first terminal, recording the connection port number into hardware configuration information of the first terminal;
    通过监控所述硬件配置信息,获取所述连接端口号。The connection port number is obtained by monitoring the hardware configuration information.
  3. 根据权利要求1或2所述的方法,其中,所述将所述连接端口号配置到空闲的数据传输线程,包括:The method according to claim 1 or 2, wherein the configuring the connection port number to an idle data transmission thread comprises:
    根据数据传输线程列表,确定空闲的数据传输线程,所述数据传输线程列表包括数据传输线程的状态;Determining an idle data transmission thread according to a data transmission thread list, where the data transmission thread list includes a state of the data transmission thread;
    将获取的所述连接端口号配置到空闲的数据传输线程;Configuring the obtained connection port number to an idle data transmission thread;
    将配置的结果记录在所述数据传输线程列表。The result of the configuration is recorded in the list of data transmission threads.
  4. 根据权利要求1或2所述的方法,其中,所述运行所述数据传输线程,在所述第一终端和第二终端之间传输数据之后,还包括:The method according to claim 1 or 2, wherein the running the data transmission thread, after transmitting data between the first terminal and the second terminal, further comprises:
    当传输任务完成,释放所述数据传输线程,更新数据传输线程列表中数据传输线程的状态为空闲。When the transfer task is completed, the data transfer thread is released, and the state of the data transfer thread in the update data transfer thread list is idle.
  5. 根据权利要求1或2所述的方法,其中,所述方法还包括:The method of claim 1 or 2, wherein the method further comprises:
    读取数据传输线程列表中数据传输线程的状态;Reading the state of the data transfer thread in the data transfer thread list;
    为每个数据传输线程分配传输带宽。A transmission bandwidth is allocated for each data transmission thread.
  6. 一种数据传输装置,所述装置包括监控模块、配置模块和传输模块; A data transmission device, the device comprising a monitoring module, a configuration module and a transmission module;
    所述监控模块,配置为监控第一终端的硬件配置信息,获取第二终端与所述第一终端连接的连接端口号;The monitoring module is configured to monitor hardware configuration information of the first terminal, and obtain a connection port number of the second terminal connected to the first terminal;
    所述配置模块,配置为将所述连接端口号配置到空闲的数据传输线程;The configuration module is configured to configure the connection port number to an idle data transmission thread;
    所述传输模块,配置为运行所述数据传输线程,在所述第一终端和第二终端之间传输数据。The transmission module is configured to run the data transmission thread to transmit data between the first terminal and the second terminal.
  7. 根据权利要求6所述的装置,其中,所述监控模块包括:The apparatus of claim 6 wherein said monitoring module comprises:
    设置单元,配置为设置监控所述第一终端的硬件配置信息的监控组件;a setting unit configured to set a monitoring component that monitors hardware configuration information of the first terminal;
    记录单元,配置为当所述第二终端连接到所述第一终端时,将所述连接端口号记录到所述第一终端的硬件配置信息中;a recording unit configured to record the connection port number into hardware configuration information of the first terminal when the second terminal is connected to the first terminal;
    监控单元,配置为通过监控所述硬件配置信息,获取所述连接端口号。And a monitoring unit configured to obtain the connection port number by monitoring the hardware configuration information.
  8. 根据权利要求6或7所述的装置,其中,所述配置模块包括:The apparatus according to claim 6 or 7, wherein the configuration module comprises:
    确定单元,配置为根据数据传输线程列表,确定空闲的数据传输线程,所述数据传输线程列表包括数据传输线程的状态;a determining unit configured to determine an idle data transmission thread according to a data transmission thread list, where the data transmission thread list includes a state of the data transmission thread;
    配置单元,配置为将获取的所述连接端口号配置到空闲的数据传输线程;将配置的结果记录在所述数据传输线程列表。And a configuration unit configured to configure the acquired connection port number to an idle data transmission thread; record the configured result in the data transmission thread list.
  9. 根据权利要求6或7所述的装置,其中,The apparatus according to claim 6 or 7, wherein
    所述传输模块,还配置为当传输任务完成,释放所述数据传输线程,更新数据传输线程列表中数据传输线程的状态为空闲。The transmission module is further configured to release the data transmission thread when the transmission task is completed, and update the state of the data transmission thread in the data transmission thread list to be idle.
  10. 根据权利要求6或7所述的装置,其中,The apparatus according to claim 6 or 7, wherein
    所述配置模块,还配置为读取数据传输线程列表中数据传输线程的状态;为每个数据传输线程分配传输带宽。The configuration module is further configured to read a state of a data transmission thread in the data transmission thread list; and allocate a transmission bandwidth for each data transmission thread.
  11. 一种计算机存储介质,所述计算机存储介质中存储有可执行指令,所述可执行指令用于执行权利要求1至5任一项所述的数据传输方法。 A computer storage medium having stored therein executable instructions for performing the data transmission method of any one of claims 1 to 5.
PCT/CN2017/081996 2016-05-16 2017-04-26 Method and apparatus for data transmission, and computer storage medium WO2017198051A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610323532.8 2016-05-16
CN201610323532.8A CN107391404B (en) 2016-05-16 2016-05-16 Data transmission method and device based on hardware port

Publications (1)

Publication Number Publication Date
WO2017198051A1 true WO2017198051A1 (en) 2017-11-23

Family

ID=60324812

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/081996 WO2017198051A1 (en) 2016-05-16 2017-04-26 Method and apparatus for data transmission, and computer storage medium

Country Status (2)

Country Link
CN (1) CN107391404B (en)
WO (1) WO2017198051A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113253640B (en) * 2021-04-25 2022-07-15 湖南航天机电设备与特种材料研究所 Flight control computer and general hardware abstraction layer thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102202132A (en) * 2010-03-24 2011-09-28 中兴通讯股份有限公司 Method, system and equipment for initializing networking equipment
CN102300118A (en) * 2011-09-06 2011-12-28 博威科技(深圳)有限公司 Testing system and testing method for monitoring system
CN105007195A (en) * 2015-07-15 2015-10-28 广东欧珀移动通信有限公司 Port binding method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848043B (en) * 2010-04-30 2013-07-24 青岛海信移动通信技术股份有限公司 Radio frequency test system and method
US20120198181A1 (en) * 2011-01-31 2012-08-02 Srinjoy Das System and Method for Managing a Memory as a Circular Buffer
CN103324569B (en) * 2013-06-08 2016-06-15 四川长虹电器股份有限公司 The testing method of embedded system application code
CN103617063A (en) * 2013-12-10 2014-03-05 Tcl通讯(宁波)有限公司 Software updating method and device for mobile terminals
CN104809214A (en) * 2015-04-23 2015-07-29 中国电子科技集团公司第四十一研究所 Test-data breakpoint continuous transmission method applied to microwave automatic test system
CN104881388A (en) * 2015-06-12 2015-09-02 哈尔滨工业大学 FPGA (field programmable gate array) based USB3.0 interface module

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102202132A (en) * 2010-03-24 2011-09-28 中兴通讯股份有限公司 Method, system and equipment for initializing networking equipment
CN102300118A (en) * 2011-09-06 2011-12-28 博威科技(深圳)有限公司 Testing system and testing method for monitoring system
CN105007195A (en) * 2015-07-15 2015-10-28 广东欧珀移动通信有限公司 Port binding method and device

Also Published As

Publication number Publication date
CN107391404B (en) 2021-12-28
CN107391404A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
JP6530462B2 (en) Determining and monitoring the performance capabilities of computer resource services
CN109302522B (en) Test method, test device, computer system, and computer medium
US9386079B2 (en) Method and system of virtual desktop infrastructure deployment studio
US10877876B2 (en) System and method for automated thin client contact center agent desktop testing
US20160315838A1 (en) Virtual Intelligent Platform Management Interface for Hardware Components
KR102158754B1 (en) Method and apparatus for operating on smart network interface card
CN105511936B (en) Test system, method and device
US9122508B2 (en) Real time measurement of I/O interrupt delay times by hypervisor by selectively starting and/or stopping corresponding LPARs
US20140331209A1 (en) Program Testing Service
US20170031694A1 (en) System and method for remote system configuration managment
US20150074302A1 (en) Automated Cabling Process for a Complex Environment
CN103927255A (en) Software testing method based on cloud testing system, cloud testing system and client side of cloud testing system
US10146674B2 (en) Plugin-based software verification system
JP6893531B2 (en) Request processing method and equipment
WO2020177385A1 (en) Virtual machine function detection method and apparatus, electronic device and storage medium
US20210173759A1 (en) Dynamic distributed tracing instrumentation in a microservice architecture
WO2013075501A1 (en) Method and device for hot-plugging a node
US8364871B2 (en) Providing virtual functions after an input/output adapter is moved from a first location to a second location
WO2017198051A1 (en) Method and apparatus for data transmission, and computer storage medium
US10382311B2 (en) Benchmarking servers based on production data
CN110399209B (en) Data processing method, system, electronic device and storage medium
CN109039765B (en) Network configuration method and device
US20160275351A1 (en) Monitoring space usage in a computer rack
US9696986B2 (en) Managing a code load
US20150088880A1 (en) Systems and methods for supporting multiple database server versions on a database machine

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17798614

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17798614

Country of ref document: EP

Kind code of ref document: A1