CN115834432A - Data link detection method, device, equipment and storage medium - Google Patents

Data link detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN115834432A
CN115834432A CN202211473913.6A CN202211473913A CN115834432A CN 115834432 A CN115834432 A CN 115834432A CN 202211473913 A CN202211473913 A CN 202211473913A CN 115834432 A CN115834432 A CN 115834432A
Authority
CN
China
Prior art keywords
sampling
test data
data
sampling time
time
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.)
Pending
Application number
CN202211473913.6A
Other languages
Chinese (zh)
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.)
Xiamen Ziguang Zhanrui Technology Co ltd
Original Assignee
Xiamen Ziguang Zhanrui Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Ziguang Zhanrui Technology Co ltd filed Critical Xiamen Ziguang Zhanrui Technology Co ltd
Priority to CN202211473913.6A priority Critical patent/CN115834432A/en
Publication of CN115834432A publication Critical patent/CN115834432A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The embodiment of the application provides a method, a device, equipment and a storage medium for detecting a data link, which are applied to a first device, wherein the first device is connected with a second device through a target bus, the target bus comprises a control signal line and at least two data signal lines, and the method comprises the following steps: determining a sampling time of at least one sampling period, and sampling the test data block in the at least two data signal lines based on the sampling time of the at least one sampling period; acquiring test data according to the test data blocks sampled in the at least two data signal lines aiming at the sampling time of each sampling period, and detecting whether the test data is correct or not; when the test data is correct, determining the sampling time of the sampling period as a first effective sampling time; and determining the signal transmission quality of at least two data signal lines according to the determined first effective sampling time. So as to improve the quality of the finished product.

Description

数据链路的检测方法、装置、设备及存储介质Data link detection method, device, equipment and storage medium

技术领域technical field

本申请涉及通信技术领域,具体地涉及一种数据链路的检测方法、装置、设备及存储介质。The present application relates to the technical field of communications, and in particular to a data link detection method, device, device and storage medium.

背景技术Background technique

在移动设备的电路中通常会使用SDIO总线将移动设备的控制端与外部通信模块连接。其中,SDIO总线通常包括一根控制信号线和四根数据信号线。由于数据在数据信号线的传输过程中,为了提高数据的传输速度,通常将数据划分至多个数据块,将多个数据块分别在不同的数据信号线中传输。基于此在设计电路时,需要保证SDIO总线中的每根数据线走线等长,使得控制端与外部通信模块之间的数据块能够同步,即为控制端或者外部通信模块可以通过四根数据信号线同时接收到正确的数据块,以便传输高速信号时具有较好的完整性,使对端能够更容易更准确的获取到相应的信号。In the circuit of the mobile device, an SDIO bus is usually used to connect the control end of the mobile device with an external communication module. Wherein, the SDIO bus generally includes one control signal line and four data signal lines. During the transmission of data on the data signal lines, in order to increase the transmission speed of the data, the data is usually divided into multiple data blocks, and the multiple data blocks are respectively transmitted on different data signal lines. Based on this, when designing the circuit, it is necessary to ensure that the length of each data line in the SDIO bus is equal, so that the data blocks between the control terminal and the external communication module can be synchronized, that is, the control terminal or the external communication module can pass four data lines. The signal line receives the correct data block at the same time, so as to have better integrity when transmitting the high-speed signal, so that the opposite end can obtain the corresponding signal more easily and accurately.

但是,在实际应用中,由于存在多种因素,例如连接点焊接不同、噪声干扰或者数据线不等长等,造成数据在不同数据信号线上传输时延不同,导致一个时钟周期内不同数据信号线间在数据传输时能够同步的时刻降低了,通过数据信号线传输数据的模块间在一个时钟周期内能够正确解析出数据的时刻减少了,即为数据信号线的信号传输质量变差了。基于此,需要在移动设备生产过程中,对移动设备的不同模块间的数据信号线的信号传输质量进行测试,将数据信号线中信号传输质量较差的移动设备找出,防止流入市场,降低成品质量。However, in practical applications, due to various factors, such as different welding points, noise interference, or unequal lengths of data lines, the transmission delay of data on different data signal lines is different, resulting in different data signals in one clock cycle. The time at which the lines can be synchronized during data transmission is reduced, and the time at which the modules that transmit data through the data signal line can correctly parse the data within one clock cycle is reduced, that is, the signal transmission quality of the data signal line has deteriorated. Based on this, it is necessary to test the signal transmission quality of the data signal lines between different modules of the mobile device during the production process of the mobile device, find out the mobile devices with poor signal transmission quality in the data signal line, prevent them from entering the market, and reduce the Finished product quality.

发明内容Contents of the invention

有鉴于此,本申请提供一种数据链路的检测方法、装置、设备及存储介质,用以通过检测数据线的信号传输质量,降低问题产品流入市场,提高成品质量。In view of this, the present application provides a data link detection method, device, equipment and storage medium, which are used to reduce the flow of problematic products into the market and improve the quality of finished products by detecting the signal transmission quality of data lines.

第一方面,本申请实施例提供了一种数据链路的检测方法,应用于第一器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述方法包括:In the first aspect, the embodiment of the present application provides a data link detection method, which is applied to a first device, and the first device is connected to a second device through a target bus, wherein the target bus includes control signal lines and At least two data signal lines, the method includes:

确定至少一个采样周期的采样时间,并基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块;determining a sampling time for at least one sampling period, and sampling test data blocks in at least two data signal lines based on the sampling time for at least one sampling period;

针对每个采样周期的采样时间,根据在所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述采样周期的采样时间确定为第一有效采样时间;For the sampling time of each sampling period, according to the test data blocks sampled in the at least two data signal lines, obtain test data, and detect whether the test data is correct; when the test data is correct, set the sampling period The sampling time of is determined as the first effective sampling time;

根据确定出的第一有效采样时间,确定所述至少两根数据信号线的信号传输质量。According to the determined first effective sampling time, the signal transmission quality of the at least two data signal lines is determined.

优选地,在所述基于所述至少一个采样周期的采样时间在所述至少两根数据信号线中采样测试数据块之前,还包括:Preferably, before sampling the test data block in the at least two data signal lines at the sampling time based on the at least one sampling period, the method further includes:

通过所述控制信号线向所述第二器件发送测试指令消息;sending a test instruction message to the second device through the control signal line;

通过所述控制信号线接收所述第二器件发送的测试响应消息。receiving a test response message sent by the second device through the control signal line.

优选地,在所述基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块之前,还包括:Preferably, before sampling the test data block in at least two data signal lines at the sampling time based on the at least one sampling period, it further includes:

确定目标总线的传输模式为第一模式;Determining that the transfer mode of the target bus is the first mode;

基于所述至少一个采样周期的采样时间在目标数据信号线中采样测试数据;其中,所述目标信号线是所述至少两根数据信号线中的任一根数据信号线;Sampling test data in the target data signal line based on the sampling time of the at least one sampling period; wherein the target signal line is any one of the at least two data signal lines;

针对每个采样周期的采样时间,检测在所述目标数据线中采样的测试数据是否正确,且将正确的测试数据对应的采样时间确定为第二有效采样时间;For the sampling time of each sampling period, detect whether the test data sampled in the target data line is correct, and determine the sampling time corresponding to the correct test data as the second effective sampling time;

将所述目标总线的传输模式更新为第二模式;updating the transmission mode of the target bus to a second mode;

所述基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块包括:The sampling test data block in at least two data signal lines based on the sampling time of the at least one sampling period includes:

在所述目标总线的传输模式为第二模式时,基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块;When the transmission mode of the target bus is the second mode, sampling test data blocks in at least two data signal lines based on the sampling time of the at least one sampling period;

所述根据确定出的第一有效采样时间,确定所述至少两根数据信号线的信号传输质量包括:The determining the signal transmission quality of the at least two data signal lines according to the determined first effective sampling time includes:

根据确定出的第一有效采样时间及第二有效采样时间,确定所述至少两根数据信号线的信号传输质量。According to the determined first effective sampling time and the determined second effective sampling time, the signal transmission quality of the at least two data signal lines is determined.

优选地,还包括:Preferably, it also includes:

获取测试数据的预设采样次数;Obtain the preset sampling times of test data;

获取测试数据的已采样次数,并检测所述测试数据的已采样次数是否达到所述测试数据的预设采样次数;Obtaining the number of times the test data has been sampled, and detecting whether the number of times the test data has been sampled reaches the preset number of times of sampling the test data;

所述确定至少一个采样周期的采样时间,并基于所述至少一个采样周期的采样时间采样测试数据块包括:The determining the sampling time of at least one sampling period, and sampling the test data block based on the sampling time of the at least one sampling period includes:

在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间;在第i个采样周期中,基于所述第i个采样周期的采样时间在所述至少两根数据信号线中采样测试数据;其中,i的值为已采样次数与1之和;When the sampling times of the test data do not reach the preset sampling times of the test data, determine the sampling time of the i-th sampling period; in the i-th sampling period, based on the sampling time of the i-th sampling period in the Sampling test data in at least two data signal lines; wherein, the value of i is the sum of the number of times sampled and 1;

所述针对每个采样周期的采样时间,利用所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述采样周期的采样时间确定为第一有效采样时间包括:For the sampling time of each sampling period, use the test data blocks sampled in the at least two data signal lines to obtain test data, and detect whether the test data is correct; when the test data is correct, the sampled The sampling time of the period determined as the first effective sampling time includes:

针对第i个采样周期的采样时间,根据所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述第i个采样周期的采样时间确定为第一有效采样时间;For the sampling time of the i-th sampling period, according to the test data blocks sampled in the at least two data signal lines, the test data is obtained, and whether the test data is correct; when the test data is correct, the i-th The sampling time of a sampling period is determined as the first effective sampling time;

在测试数据正确时,将所述第i个采样周期的采样时间确定为第一有效采样时间之后,还包括:When the test data is correct, after determining the sampling time of the i-th sampling period as the first effective sampling time, it also includes:

根据所述i的值更新所述已采样次数,并重新执行步骤获取测试数据的已采样次数,并检测所述测试数据的已采样次数是否达到所述测试数据的预设采样次数,至步骤针对第i个采样周期的采样时间,根据所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述第i个采样周期的采样时间确定为第一有效采样时间,直至所述测试数据的已采样次数达到所述测试数据的预设采样次数。Update the number of times of sampling according to the value of i, and re-execute the step of obtaining the number of times of sampling of the test data, and detect whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data, and go to the step for The sampling time of the i-th sampling period is to obtain test data according to the test data blocks sampled in the at least two data signal lines, and detect whether the test data is correct; when the test data is correct, the i-th The sampling time of the sampling cycle is determined as the first effective sampling time until the number of times the test data has been sampled reaches the preset number of times of sampling the test data.

优选地,所述在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间包括:Preferably, when the sampling times of the test data do not reach the preset sampling times of the test data, determining the sampling time of the i-th sampling period includes:

根据所述测试数据的预设采样次数,确定采样基准值,并获取采样时间的第一预设间隔时间;Determining a sampling reference value according to the preset sampling times of the test data, and obtaining a first preset interval time of sampling time;

在测试数据的已采样次数未达到测试数据的预设采样次数时,根据所述采样基准值,及采样时间的第一预设间隔时间,确定第i个采样周期的采样时间。When the sampling times of the test data do not reach the preset sampling times of the test data, the sampling time of the i-th sampling period is determined according to the sampling reference value and the first preset interval time of the sampling time.

优选地,所述在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间包括:Preferably, when the sampling times of the test data do not reach the preset sampling times of the test data, determining the sampling time of the i-th sampling period includes:

获取采样时间的第二预设间隔时间;Obtain a second preset interval time of the sampling time;

在测试数据的已采样次数未达到测试数据的预设采样次数时,根据采样时间的第二预设间隔时间及第i-1个采样周期的采样时间,确定第i个采样周期的采样时间。When the sampling times of the test data do not reach the preset sampling times of the test data, the sampling time of the i-th sampling period is determined according to the second preset interval time of the sampling time and the sampling time of the i-1th sampling period.

优选地,所述目标总线包括:安全数字输入输出接口SDIO总线。Preferably, the target bus includes: a secure digital input and output interface SDIO bus.

第二方面,本申请实施例提供了一种数据链路的检测方法,应用于第二器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述方法包括:In the second aspect, the embodiment of the present application provides a data link detection method, which is applied to a second device, and the first device is connected to the second device through a target bus, wherein the target bus includes control signal lines and At least two data signal lines, the method includes:

根据所述至少两根数据信号线,将测试数据划分为至少两个测试数据块;dividing the test data into at least two test data blocks according to the at least two data signal lines;

通过所述至少两根数据信号线,分别向第一器件发送所述至少两个测试数据块;其中,不同数据信号线传输不同的测试数据块。The at least two test data blocks are respectively sent to the first device through the at least two data signal lines; wherein different data signal lines transmit different test data blocks.

优选地,在所述根据所述至少两根数据信号线,将测试数据划分为至少两个测试数据块之前,还包括:Preferably, before dividing the test data into at least two test data blocks according to the at least two data signal lines, the method further includes:

通过所述控制信号线接收所述第一器件发送的测试指令消息;receiving a test instruction message sent by the first device through the control signal line;

通过所述控制信号线向所述第一器件发送测试响应消息。sending a test response message to the first device through the control signal line.

第三方面,本申请实施例提供了一种数据链路的检测装置,应用于第一器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述装置包括:In a third aspect, the embodiment of the present application provides a data link detection device, which is applied to a first device, and the first device is connected to a second device through a target bus, wherein the target bus includes control signal lines and At least two data signal lines, the device comprising:

处理单元,用于确定至少一个采样周期的采样时间,并基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块;A processing unit, configured to determine a sampling time of at least one sampling period, and sample a test data block in at least two data signal lines based on the sampling time of the at least one sampling period;

所述处理单元,还用于针对每个采样周期的采样时间,根据在所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述采样周期的采样时间确定为第一有效采样时间;The processing unit is further configured to obtain test data according to the test data blocks sampled in the at least two data signal lines for the sampling time of each sampling period, and detect whether the test data is correct; When correct, determine the sampling time of the sampling period as the first effective sampling time;

确定单元,用于根据确定出的第一有效采样时间,确定所述至少两根数据信号线的信号传输质量。The determination unit is configured to determine the signal transmission quality of the at least two data signal lines according to the determined first effective sampling time.

第四方面,本申请实施例提供了一种数据链路的检测装置,应用于第二器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述装置包括:In a fourth aspect, the embodiment of the present application provides a data link detection device, which is applied to a second device, and the first device is connected to the second device through a target bus, wherein the target bus includes control signal lines and At least two data signal lines, the device comprising:

处理单元,用于根据所述至少两根数据信号线,将测试数据划分为至少两个测试数据块;a processing unit, configured to divide the test data into at least two test data blocks according to the at least two data signal lines;

发送单元,用于通过所述至少两根数据信号线,分别向第一器件发送所述至少两个测试数据块;其中,不同数据信号线传输不同的测试数据块。The sending unit is configured to respectively send the at least two test data blocks to the first device through the at least two data signal lines; wherein different data signal lines transmit different test data blocks.

第五方面,本申请实施例提供了一种电子设备,包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被所述处理器执行时,触发所述电子设备执行上述第一方面任一项所述的方法或第二方面任一项所述的方法。In the fifth aspect, the embodiment of the present application provides an electronic device, including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, trigger The electronic device executes the method described in any one of the first aspect or the method described in any one of the second aspect.

第六方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行上述第一方面任一项所述的方法或第二方面任一项所述的方法。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium includes a stored program, wherein, when the program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned The method of any one of the first aspects or the method of any one of the second aspects.

采用本申请实施例所提供的方案,可以先确定至少一个采样时间,并基于至少一个采样时间在至少两根数据信号线中采样测试数据块,针对每个采样时间,根据该采样时间在每根数据信号线中采样的测试数据块获取测试数据,并检测测试数据是否正确,在测试数据正确时,将正确的测试数据对应的采样时间确定为第一有效采样时间。由于第一有效采样时间的个数越多,说明不同根数据信号线可以同时传输信号的时刻越多,则可以正确获取数据的概率越大,即为信号传输质量越好,基于此在本申请实施例中,可以根据第一有效采样时间,确定至少两根数据信号线的信号传输质量,实现对至少两根数据信号线的传输质量的检测,从而可以查找出至少两根数据信号线中信号传输质量较差的产品,进而可以降低问题产品流入市场的概率,提高成品质量。Using the solution provided by the embodiment of the present application, at least one sampling time can be determined first, and the test data block is sampled in at least two data signal lines based on the at least one sampling time. For each sampling time, according to the sampling time in each The test data block sampled in the data signal line acquires test data, and checks whether the test data is correct. When the test data is correct, the sampling time corresponding to the correct test data is determined as the first effective sampling time. Since the number of the first effective sampling time is more, it means that different data signal lines can transmit signals at the same time, and the probability of correctly obtaining data is greater, that is, the signal transmission quality is better. Based on this, in this application In an embodiment, the signal transmission quality of at least two data signal lines can be determined according to the first effective sampling time, and the detection of the transmission quality of at least two data signal lines can be realized, so that the signal in at least two data signal lines can be found The transmission of poor quality products can reduce the probability of problematic products entering the market and improve the quality of finished products.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. Those of ordinary skill in the art can also obtain other drawings based on these drawings without paying creative labor.

图1为本申请实施例提供的一种数据链路的检测方法的场景示意图;FIG. 1 is a schematic diagram of a scene of a data link detection method provided by an embodiment of the present application;

图2为本申请实施例提供的一种数据链路的检测方法的流程示意图;FIG. 2 is a schematic flowchart of a data link detection method provided by an embodiment of the present application;

图3a为本申请实施例提供的另一种数据链路的检测方法的场景示意图;FIG. 3a is a schematic diagram of another data link detection method provided by the embodiment of the present application;

图3b为本申请实施例提供的另一种数据链路的检测方法的场景示意图;FIG. 3b is a schematic diagram of another data link detection method provided by the embodiment of the present application;

图4a为本申请实施例提供的另一种数据链路的检测方法的场景示意图;FIG. 4a is a schematic diagram of another data link detection method provided by the embodiment of the present application;

图4b为本申请实施例提供的另一种数据链路的检测方法的场景示意图;FIG. 4b is a schematic diagram of another data link detection method provided by the embodiment of the present application;

图5为本申请实施例提供的另一种数据链路的检测方法的流程示意图;FIG. 5 is a schematic flowchart of another data link detection method provided by the embodiment of the present application;

图6为本申请实施例提供的另一种数据链路的检测方法的流程示意图;FIG. 6 is a schematic flowchart of another data link detection method provided by the embodiment of the present application;

图7为本申请实施例提供的另一种数据链路的检测方法的流程示意图;FIG. 7 is a schematic flowchart of another data link detection method provided by the embodiment of the present application;

图8为本申请实施例提供的一种数据链路的检测装置的结构示意图;FIG. 8 is a schematic structural diagram of a data link detection device provided by an embodiment of the present application;

图9为本申请实施例提供的另一种数据链路的检测装置的结构示意图;FIG. 9 is a schematic structural diagram of another data link detection device provided by an embodiment of the present application;

图10为本申请实施例提供的另一种数据链路的检测装置的结构示意图;FIG. 10 is a schematic structural diagram of another data link detection device provided by an embodiment of the present application;

图11为本申请实施例提供的另一种数据链路的检测装置的结构示意图;FIG. 11 is a schematic structural diagram of another data link detection device provided by an embodiment of the present application;

图12为本申请实施例提供的一种电子设备的结构示意图。FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。In order to better understand the technical solutions of the present application, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。It should be clear that the described embodiments are only some of the embodiments of the present application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.

在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。Terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of this application and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.

应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,甲和/或乙,可以表示:单独存在甲,同时存在甲和乙,单独存在乙这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" used herein is only an association relationship describing associated objects, which means that there may be three relationships, for example, A and/or B, which may mean that A exists alone, and A and B exist simultaneously. B, there are three situations of B alone. In addition, the character "/" in this article generally indicates that the contextual objects are an "or" relationship.

在对本申请实施例进行具体介绍之前,首先对本申请实施例应用或可能应用的术语进行解释。Before the specific introduction of the embodiment of the present application, the terms applied or possibly applied in the embodiment of the present application are firstly explained.

SDIO(Secure Digital Input and Output,安全数字输入输出),一种外接接口。SDIO (Secure Digital Input and Output, safe digital input and output), an external interface.

CLK(Clock signal),时钟信号。CLK (Clock signal), clock signal.

CMD(Command line),控制信号线。CMD (Command line), control signal line.

DAT(Data line),数据信号线。DAT (Data line), data signal line.

在移动设备的电路中通常会使用SDIO总线将移动设备的控制端与外部通信模块连接。其中,SDIO总线通常包括一根控制信号线和四根数据信号线。由于数据在数据信号线的传输过程中,为了提高数据的传输速度,通常将数据划分至多个数据块,将多个数据块分别在不同的数据信号线中传输。基于此在设计电路时,需要保证SDIO总线中的每根数据线走线等长,使得控制端与外部通信模块之间的数据块能够同步,即为控制端或者外部通信模块可以通过四根数据信号线同时接收到正确的数据块,以便传输高速信号时具有较好的完整性,使对端能够更容易更准确的获取到相应的信号。In the circuit of the mobile device, an SDIO bus is usually used to connect the control end of the mobile device with an external communication module. Wherein, the SDIO bus generally includes one control signal line and four data signal lines. During the transmission of data on the data signal lines, in order to increase the transmission speed of the data, the data is usually divided into multiple data blocks, and the multiple data blocks are respectively transmitted on different data signal lines. Based on this, when designing the circuit, it is necessary to ensure that the length of each data line in the SDIO bus is equal, so that the data blocks between the control terminal and the external communication module can be synchronized, that is, the control terminal or the external communication module can pass four data lines. The signal line receives the correct data block at the same time, so as to have better integrity when transmitting the high-speed signal, so that the opposite end can obtain the corresponding signal more easily and accurately.

但是,在实际应用中,由于存在多种因素,例如连接点焊接不同、噪声干扰或者数据线不等长等,造成数据在不同数据信号线上传输时延不同,导致一个时钟周期内不同数据信号线间在数据传输时能够同步的时刻降低了,通过数据信号线传输数据的模块间在一个时钟周期内能够正确解析出数据的时刻减少了,参考图4b所示,即为数据信号线的信号传输质量变差了。基于此,需要在移动设备生产过程中,对移动设备的不同模块间的数据信号线的信号传输质量进行测试,将数据信号线中信号传输质量较差的移动设备找出,防止流入市场,降低成品质量。However, in practical applications, due to various factors, such as different welding points, noise interference, or unequal lengths of data lines, the transmission delay of data on different data signal lines is different, resulting in different data signals in one clock cycle. The time at which the lines can be synchronized during data transmission is reduced, and the time at which the modules that transmit data through the data signal line can correctly parse the data within one clock cycle is reduced. Refer to Figure 4b, which is the signal of the data signal line The transmission quality has deteriorated. Based on this, it is necessary to test the signal transmission quality of the data signal lines between different modules of the mobile device during the production process of the mobile device, find out the mobile devices with poor signal transmission quality in the data signal line, prevent them from entering the market, and reduce the Finished product quality.

针对上述问题,本申请实施例提供了一种数据链路的检测方法、装置、设备及存储介质,可以先确定至少一个采样时间,并基于至少一个采样时间在至少两根数据信号线中采样测试数据块,针对每个采样时间,根据在每根数据信号线中采样的测试数据块获取测试数据,并检测测试数据是否正确,在测试数据正确时,将正确的测试数据对应的采样时间确定为第一有效采样时间。由于第一有效采样时间的个数越多,说明不同根数据信号线可以同时传输信号的时刻越多,则可以正确获取数据的概率越大,即为信号传输质量越好,基于此在本申请实施例中,可以根据第一有效采样时间,确定至少两根数据信号线的信号传输质量,实现对至少两根数据信号线的传输质量的检测,从而可以查找出至少两根数据信号线中信号传输质量较差的产品,进而可以降低问题产品流入市场的概率,提高成品质量。以下进行详细说明。In view of the above problems, the embodiment of the present application provides a data link detection method, device, equipment and storage medium, which can first determine at least one sampling time, and based on at least one sampling time, sample and test in at least two data signal lines The data block, for each sampling time, obtains test data according to the test data block sampled in each data signal line, and detects whether the test data is correct. When the test data is correct, the corresponding sampling time of the correct test data is determined as The first valid sampling time. Since the number of the first effective sampling time is more, it means that different data signal lines can transmit signals at the same time, and the probability of correctly obtaining data is greater, that is, the signal transmission quality is better. Based on this, in this application In an embodiment, the signal transmission quality of at least two data signal lines can be determined according to the first effective sampling time, and the detection of the transmission quality of at least two data signal lines can be realized, so that the signal in at least two data signal lines can be found The transmission of poor quality products can reduce the probability of problematic products entering the market and improve the quality of finished products. The details will be described below.

参见图1,为本申请实施例提供的一种电子设备的结构示意图。如图1所示,该电子设备包括第一器件10及第二器件11。第一器件10与第二器件11之间通过目标总线12连接。例如,目标总线为SDIO总线。目标总线包括控制信号线121及至少两根数据信号线122。其中,在目标总线为SDIO总线时,SDIO总线中包括四根数据信号线122。Referring to FIG. 1 , it is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in FIG. 1 , the electronic device includes a first device 10 and a second device 11 . The first device 10 and the second device 11 are connected through a target bus 12 . For example, the target bus is the SDIO bus. The target bus includes a control signal line 121 and at least two data signal lines 122 . Wherein, when the target bus is an SDIO bus, the SDIO bus includes four data signal lines 122 .

其中,第一器件10可以为处理器,为存储设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器内的软件程序和/或模块,以及调用存储在存储器内的数据,以执行电子设备的各种功能和/或处理数据。所述处理器可以由集成电路(integrated circuit,IC)组成,例如可以由单颗封装的IC所组成,也可以由连接多颗相同功能或不同功能的封装IC而组成。举例来说,第一器件10可以仅包括中央处理器(central processing unit,CPU)。在本发明实施方式中,CPU可以是单运算核心,也可以包括多运算核心。Among them, the first device 10 can be a processor, which is the control center of the storage device, and uses various interfaces and lines to connect various parts of the entire electronic device, by running or executing software programs and/or modules stored in the memory, and calling Data stored in memory to perform various functions of an electronic device and/or to process data. The processor may be composed of an integrated circuit (integrated circuit, IC), for example, may be composed of a single packaged IC, or may be composed of multiple packaged ICs connected with the same function or different functions. For example, the first device 10 may only include a central processing unit (central processing unit, CPU). In the embodiments of the present invention, the CPU may be a single computing core, or may include multiple computing cores.

第二器件11可以是与处理器进行通信的其他器件,例如,可以是无线网络通信器件,或其他需与第一器件10通过数据信号线传输数据的器件。The second device 11 may be other devices that communicate with the processor, for example, may be a wireless network communication device, or other devices that need to transmit data with the first device 10 through a data signal line.

在实际电路设计时,通常要求第一器件10与第二器件11间的至少两根数据信号线走线等长,且第一器件10与第二器件11件的距离不能太远,否则信号传输质量较差。为了保证第一器件10与第二器件11间的通信质量,可以检测第一器件10与第二器件11间的数据信号线的传输质量。在本申请中可以通过检测在一个采样周期内第一器件10与第二器件11间的至少两根数据信号线中可以同步传输信号的时间,来确定至少两根数据信号间信号传输质量。In actual circuit design, it is usually required that at least two data signal lines between the first device 10 and the second device 11 have the same length, and the distance between the first device 10 and the second device 11 should not be too far, otherwise the signal transmission The quality is poor. In order to ensure the communication quality between the first device 10 and the second device 11 , the transmission quality of the data signal line between the first device 10 and the second device 11 may be detected. In this application, the quality of signal transmission between at least two data signal lines can be determined by detecting the time during which signals can be transmitted synchronously in at least two data signal lines between the first device 10 and the second device 11 within a sampling period.

参见图2,为本申请实施例提供的一种数据链路的检测方法的流程示意图。所述检测方法应用于上述图1所示的第一器件10中。如图2所示,所述方法包括:Referring to FIG. 2 , it is a schematic flowchart of a method for detecting a data link provided by an embodiment of the present application. The detection method is applied to the first device 10 shown in FIG. 1 above. As shown in Figure 2, the method includes:

步骤S201、确定至少一个采样周期的采样时间,并基于至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块。Step S201. Determine a sampling time of at least one sampling period, and sample test data blocks in at least two data signal lines based on the sampling time of at least one sampling period.

应理解的是,在数据信号线的传输过程中,数据以模拟信号的方式传输。根据传输的数据的具体数值不同,模拟信号的电平信号也不同,例如为高电平信号或者低电平信号。在数据块的传输过程中,存在电平信号切换的过程,如图3a所示。在进行数据解析时,通常是根据模拟信号为高电平还是低电平信号进行数据的解析。在电平信号的切换过程,由于无法解析出电平信号为高电平信号还是低电平信号,因此,此部分数据为无效数据。因此,在数据的传输过程中,数据信号线传输的数据块中存在能被器件解析出数据的有效数据部分及无法被器件解析出数据的无效数据部分,如图3b所示。器件在数据信号线中采集数据时,若当前采集时间采集的数据为有效数据部分,则可以正确解析出对端传输的数据,若当前采集时间采集的数据为无效数据部分,则无法正确解析出对端传输的数据。在一个采样周期中,能够采集到有效数据部分的时间越长,则说明获取到有效数据部分的概率越大,可以认为该数据信号线传输的信号质量越好。在将数据划分为多个数据块,分别通过不同的数据信号线同时传输时,则一个采样周期中,不同数据信号线间能够同时采集到有效数据部分的时间越长,则说明正确获取到对端传输的数据的概率越大,可以认为不同数据信号线间的信号传输质量越好。It should be understood that, during the transmission process of the data signal line, the data is transmitted in the form of an analog signal. Depending on the specific value of the transmitted data, the level signal of the analog signal is also different, for example, a high level signal or a low level signal. During the transmission of data blocks, there is a process of level signal switching, as shown in Figure 3a. When performing data analysis, the data analysis is usually performed according to whether the analog signal is a high level signal or a low level signal. During the switching process of the level signal, since it is impossible to analyze whether the level signal is a high-level signal or a low-level signal, this part of the data is invalid data. Therefore, in the data transmission process, there are valid data parts that can be parsed out by the device and invalid data parts that cannot be parsed out by the device in the data block transmitted by the data signal line, as shown in Figure 3b. When the device collects data in the data signal line, if the data collected at the current collection time is valid data, the data transmitted by the peer end can be correctly parsed; if the data collected at the current collection time is invalid data, it cannot be correctly parsed. The data transmitted by the peer. In a sampling period, the longer the time for collecting valid data, the greater the probability of obtaining valid data, and it can be considered that the signal quality transmitted by the data signal line is better. When the data is divided into multiple data blocks, which are transmitted simultaneously through different data signal lines, the longer the time for valid data to be collected simultaneously between different data signal lines in one sampling period, it means that the correct data is obtained. The greater the probability of the data transmitted by the terminal, the better the signal transmission quality between different data signal lines can be considered.

示例性的,假设第一器件与第二器件间通过SDIO总线连接,此时第一器件与第二器件间具有四根数据信号线。在理想状态下,在四根数据信号线等长的情况下,可以认为四根数据信号线间对应的有效数据的采集时间是完全相同的,如图4a所示。但是在实际实现中,由于存在多种因素,导致不同的数据信号线间传输数据时存在不同的延时,导致不同数据信号对应的有效数据部分的采集时间不完全相同,如图4b所示。由于传输的数据被划分至不同的数据块,且分别通过不同的数据信号线传输,因此在对四根数据信号线进行数据采集时,只有四根数据信号线同时采集到有效数据部分时,才能正确解析出对端发送的数据。一个采样周期内四根数据信号线同时采集到有效数据部分的时间越长,则说明正确获取到对端传输的数据的概率越大,可以认为不同数据信号线间的信号传输质量越好。Exemplarily, assuming that the first device and the second device are connected through an SDIO bus, there are four data signal lines between the first device and the second device. In an ideal state, when the four data signal lines are of equal length, it can be considered that the acquisition time of valid data corresponding to the four data signal lines is exactly the same, as shown in FIG. 4 a . However, in actual implementation, due to various factors, there are different delays when transmitting data between different data signal lines, resulting in different acquisition times of valid data corresponding to different data signals, as shown in Figure 4b. Since the transmitted data is divided into different data blocks and transmitted through different data signal lines, when collecting data on four data signal lines, only when the four data signal lines collect valid data at the same time can the Correctly parse out the data sent by the peer. The longer it takes for the four data signal lines to collect valid data at the same time in a sampling period, the greater the probability of correctly obtaining the data transmitted by the opposite end, and it can be considered that the signal transmission quality between different data signal lines is better.

在本申请实施了中,为了检测第一器件与第二器件间数据信号线的信号传输质量,可以通过检测一个采样周期内不同数据信号线中同时采集到有效数据部分的采集时间来确定第一器件与第二器件间数据信号线的信号传输质量。由于在一个采样周期内仅能采样一次,且在不同采样周期的相同采样时刻采集数据时,在不同采样周期采集到有效部分或者无效部分是相同的。因此为了检测出一个采样周期中在不同数据信号线同时采集到有效数据部分的时间,可以通过多个采样周期,且每个采样周期的采样时间不同来确定不同数据信号线中同时采集到有效数据部分的时间。In the implementation of this application, in order to detect the signal transmission quality of the data signal line between the first device and the second device, the first part can be determined by detecting the acquisition time of valid data part simultaneously collected in different data signal lines within one sampling period. The signal transmission quality of the data signal line between the device and the second device. Since it can only be sampled once in a sampling period, and when data is collected at the same sampling moment in different sampling periods, the effective part or invalid part collected in different sampling periods is the same. Therefore, in order to detect the time when valid data is collected simultaneously on different data signal lines in a sampling period, multiple sampling periods can be used, and the sampling time of each sampling period is different to determine that valid data is simultaneously collected in different data signal lines part of the time.

基于此,第一器件需要确定每个采样周期的采样时间,此时可以按照采样时间的预设间隔时间确定至少一个采样时间,即为按照采样时间的预设间隔时间确定至少一个采样周期的采样时间。基于每个采样周期的采样时间,在每个采样周期的采样时间采样测试数据块。其中,该预设间隔时间可以是相邻采样周期的采样时间间的间隔时间,也可以是预先设定采样基准时间,该预设间隔时间是采样时间与采样基准时间间的间隔时间。当然,还可以通过其他方式确定每个采样周期的采样时间,本申请对此不作限制。Based on this, the first device needs to determine the sampling time of each sampling period. At this time, at least one sampling time can be determined according to the preset interval time of the sampling time, that is, the sampling time of at least one sampling period can be determined according to the preset interval time of the sampling time. time. Based on the sampling time of each sampling period, the test data block is sampled at the sampling time of each sampling period. Wherein, the preset interval time may be an interval time between sampling times of adjacent sampling periods, or may be a preset sampling reference time, and the preset interval time is an interval time between a sampling time and a sampling reference time. Certainly, the sampling time of each sampling period may also be determined in other ways, which is not limited in the present application.

由于需要确定一个采样周期内不同数据信号线中采集到有效数据部分的时间,可以将采样周期划分为m个采样时间,m个采样时间中每相邻两个采样时间的时间间隔相同,其中m为大于0的整数。由于每个采样周期仅能进行一次采样,因此为了验证m个采样时间哪些采样时间能够采集到有效数据部分,哪些采样时间能够采集到无效数据部分,可以通过m个采样周期分别在不同的采样时间中进行数据块的采集。这样可以确定m个采样周期中每个采样周期的采样时间。Since it is necessary to determine the time when valid data is collected in different data signal lines within a sampling period, the sampling period can be divided into m sampling times, and the time interval between every two adjacent sampling times in the m sampling times is the same, where m is an integer greater than 0. Since each sampling period can only be sampled once, in order to verify which sampling time can collect valid data and which sampling time can collect invalid data in m sampling periods, you can use m sampling periods at different sampling times Collect data blocks. In this way, the sampling time of each sampling period in the m sampling periods can be determined.

应理解的是,m是根据实际需要预先设置的采样次数。m越大则采集时间确定的月精确。例如,m为256,128,1024等。It should be understood that m is a sampling number preset according to actual needs. The larger m is, the more accurate the month of acquisition time is. For example, m is 256, 128, 1024, etc.

作为一种可能的实现方式,第一器件确定至少一个采样周期的采样时间时,可以根据上一采样周期的采样时间来确定当前采样周期的采样时间。此时,第一器件可以获取采样时间的第二预设间隔时间。第二预设间隔时间是预先设置的采样时间的间隔时间。此时,需要预先设置第一个采样周期的采样时间。例如,可以预先设置第一个采样周期的采样时间为T/256,预先设置第二预设间隔时间为T/256。这样,在确定出第一个采样周期的采样时间为T/256时,可以按照第二预设间隔时间T/256,确定第二个采样周期的采样时间为2T/256,第三个采样周期周期的采样时间为3T/256,第q个采样周期的采样时间为qT/256,其中q为大于0且不大于256的整数,T表示采样周期。通过分别确定每个采样周期的采样时间,可以在每个采样周期中,基于该采样周期的采样时间在至少两根数据信号线中进行数据块的采集。As a possible implementation manner, when determining the sampling time of at least one sampling period, the first device may determine the sampling time of the current sampling period according to the sampling time of a previous sampling period. At this time, the first device may obtain a second preset interval time of the sampling time. The second preset interval time is a preset interval time of sampling time. At this point, the sampling time of the first sampling period needs to be set in advance. For example, the sampling time of the first sampling period may be preset as T/256, and the second preset interval time may be preset as T/256. In this way, when the sampling time of the first sampling period is determined to be T/256, the sampling time of the second sampling period can be determined to be 2T/256 according to the second preset interval time T/256, and the sampling time of the third sampling period can be determined to be 2T/256. The sampling time of the period is 3T/256, and the sampling time of the qth sampling period is qT/256, where q is an integer greater than 0 and not greater than 256, and T represents the sampling period. By separately determining the sampling time of each sampling period, data blocks can be collected in at least two data signal lines in each sampling period based on the sampling time of the sampling period.

作为另一种可能的实现方式,第一器件在确定至少一个采样周期的采样时间时,可以预先设定一个基准时间,即为采样基准值。每个采样周期的采样时间均是相对于该采样基准值来确定的。此时,第一器件可以先确定采样基准值。并且获取采样时间的第一预设间隔时间。第一预设间隔时间是采样时间相对于采样基准值的间隔时间。此时,第一器件可以根据采样基准值及第一预设间隔时间确定每个采样周期的采样时间。例如,假设预先设定采样基准值为T/128,第一预设间隔时间为T/128,则第i个采样周期的采样时间为a+(i-1)*b,其中,a表示采样基准值,b表示第一预设间隔时间。即为,第i个采样周期的采样时间为T/128+(i-1)*T/128。As another possible implementation manner, when determining the sampling time of at least one sampling period, the first device may preset a reference time, which is a sampling reference value. The sampling time of each sampling period is determined relative to the sampling reference value. At this time, the first device may first determine the sampling reference value. And acquire the first preset interval time of the sampling time. The first preset interval time is an interval time between the sampling time and the sampling reference value. At this time, the first device may determine the sampling time of each sampling period according to the sampling reference value and the first preset interval time. For example, assuming that the preset sampling reference value is T/128 and the first preset interval time is T/128, the sampling time of the i-th sampling period is a+(i-1)*b, where a represents the sampling reference Value, b represents the first preset interval time. That is, the sampling time of the i-th sampling period is T/128+(i-1)*T/128.

第一器件在确定出至少一个采样周期的采样时间后,基于至少一个采样周期的采样时间,在每个采样周期中按照其对应的采样时间,在至少两根数据信号中进行测试数据块的采样。After determining the sampling time of at least one sampling period, the first device performs sampling of the test data block in at least two data signals in each sampling period according to the corresponding sampling time based on the sampling time of at least one sampling period .

需要说明的是,第一器件在确定至少一个采样周期的采样时间时,可以将所有采样周期的采样时间确定出。也可以确定每次仅确定当前采样周期的采样时间,在确定出当前采样周期的采样时间是否为第一有效采样时间后,进入下一采样周期时,再确定下一采样周期的采样时间。本申请对此不作限制。It should be noted that, when determining the sampling time of at least one sampling period, the first device may determine the sampling times of all sampling periods. It is also possible to determine only the sampling time of the current sampling period each time. After determining whether the sampling time of the current sampling period is the first effective sampling time, when entering the next sampling period, determine the sampling time of the next sampling period. This application is not limited to this.

步骤S202、针对每个采样周期的采样时间,根据在至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将采样周期的采样时间确定为第一有效采样时间。Step S202, for the sampling time of each sampling period, obtain test data according to the test data blocks sampled in at least two data signal lines, and check whether the test data is correct; when the test data is correct, set the sampling time of the sampling period to Determined as the first effective sampling time.

在本申请实施例中,在进行第一器件与第二器件间的数据信号线的质量检测时,第二器件可以通过与第一器件间的至少两根数据信号线向第一器件传输测试数据块。其中,第二器件可以将测试数据划分为至少两个测试数据块,分别通过至少两根数据信号线向第一器件发送至少两个测试数据块。第一器件在至少两根数据信号线中采集数据时,由于至少两根数据信号线中传输的测试数据块分别为测试数据中不同部分的数据,因此在第一器件中需要在至少两根数据信号线中均采集到有效数据部分才能获取到测试数据的不同部分的数据,合成测试数据。In the embodiment of the present application, when performing quality inspection of the data signal lines between the first device and the second device, the second device can transmit test data to the first device through at least two data signal lines between the first device and the first device piece. Wherein, the second device may divide the test data into at least two test data blocks, and send the at least two test data blocks to the first device through at least two data signal lines respectively. When the first device collects data in at least two data signal lines, since the test data blocks transmitted in the at least two data signal lines are the data of different parts of the test data, it is necessary in the first device The data of different parts of the test data can be obtained only when the effective data part is collected in the signal line, and the test data is synthesized.

基于此,第一器件针对每个采样周期的采样时间,根据在至少两根数据信号中采集测试数据块,获取到至少两个采集数据块后,第一器件对采集的测试数据块进行解析,确定每个测试数据块在测试数据中的位置,利用采集的每个测试数据块合成测试数据。在本申请实施例中,第二器件在向第一器件发送测试数据时,该测试数据是预设固定格式的数据。即为,是用于测试的数据格式的数据。第一器件在将采集的数据块合成为测试数据后,需要检测该测试数据是否正确,此时第一器件可以检测测试数据的数据格式是否为预设固定格式的数据,若是,则可以确定该测试数据正确。若不是,则确定该测试数据错误。Based on this, the first device collects test data blocks in at least two data signals according to the sampling time of each sampling period, and after obtaining at least two collected data blocks, the first device parses the collected test data blocks, The position of each test data block in the test data is determined, and the test data is synthesized by using each test data block collected. In the embodiment of the present application, when the second device sends the test data to the first device, the test data is data in a preset fixed format. That is, the data in the data format used for testing. After the first device synthesizes the collected data blocks into test data, it needs to detect whether the test data is correct. At this time, the first device can detect whether the data format of the test data is data in a preset fixed format. The test data is correct. If not, it is determined that the test data is wrong.

第一器件在确定出测试数据正确时,则说明第一器件在至少两根数据信号线中采集的测试数据块均为有效数据部分,可以将该采样周期的采样时间确定为第一有效时间。When the first device determines that the test data is correct, it means that the test data blocks collected by the first device in at least two data signal lines are valid data parts, and the sampling time of the sampling period can be determined as the first valid time.

或者,第一器件在确定出测试数据错误时,则说明第一器件在至少两根数据信号线中采集的测试数据块存在无效数据部分,可以将该采样周期的采样时间确定为无效时间。Alternatively, when the first device determines that the test data is wrong, it means that the test data blocks collected by the first device in at least two data signal lines have invalid data portions, and the sampling time of the sampling period can be determined as the invalid time.

作为一种可能的实现方式,为了防止传输过程中数据块被篡改,第二器件在将测试数据划分为至少两个测试数据块时,在每个测试数据块中添加校验信息。例如,在每个测试数据块中增加CRC校验码。此时,第一器件基于当前采样周期的采样时间在至少两根数据信号线采集到测试数据块后,需先解析每个测试数据块,并根据每个测试数据块内携带的校验信息对测试数据块进行校验,若存在至少一个测试数据块的校验信息错误,则说明当前采集的测试数据块不正确,此时,可以直接将当前采样周期的采样时间确定为无效时间。或者,若检测出每个测试数据块的校验信息均正确,则可以将测试数据块合成为测试数据,进一步检测测试数据是否为确定。具体检测过程可以参考上述描述,在此不再赘述。As a possible implementation manner, in order to prevent the data blocks from being tampered with during transmission, the second device adds check information to each test data block when dividing the test data into at least two test data blocks. For example, a CRC check code is added to each test data block. At this time, after at least two data signal lines collect test data blocks based on the sampling time of the current sampling period, the first device needs to parse each test data block first, and perform a check based on the verification information carried in each test data block. The test data blocks are verified. If there is an error in the verification information of at least one test data block, it means that the currently collected test data block is incorrect. At this time, the sampling time of the current sampling period can be directly determined as an invalid time. Alternatively, if it is detected that the check information of each test data block is correct, the test data blocks may be synthesized into test data, and further checked whether the test data is definite. For a specific detection process, reference may be made to the foregoing description, and details are not repeated here.

示例性的,第一器件与第二器件间通过四根数据信号线连接。第一器件针对每个采样周期的采样时间,根据在四根数据信号线中采集测试数据块,分别为测试数据块a,b,c,d。第一器件在采集到测试数据块a,b,c,d后,可以分析解析测试数据块a,b,c,d,获取测试数据块a,b,c,d中的校验信息,假设测试数据块a,b,c,d的校验信息为CRC校验码。第一器件可以分别检测测试数据块a,b,c,d的CRC校验码是否正确。若测试数据块a,b,c,d的CRC校验码均正确,则第一器件可以根据测试数据块在测试数据中的位置,合成测试数据。第一器件可以进一步检测合成的测试数据是否为预设固定格式的数据,若是预设固定格式的数据,则确定测试数据正确,此时将该采样周期的采样时间确定为第一有效采样时间。Exemplarily, the first device is connected to the second device through four data signal lines. According to the sampling time of each sampling period, the first device collects test data blocks in the four data signal lines, which are respectively test data blocks a, b, c, and d. After the first device collects the test data blocks a, b, c, d, it can analyze and analyze the test data blocks a, b, c, d, and obtain the verification information in the test data blocks a, b, c, d, assuming The check information of the test data blocks a, b, c, and d is a CRC check code. The first device can respectively detect whether the CRC check codes of the test data blocks a, b, c, and d are correct. If the CRC check codes of the test data blocks a, b, c, and d are all correct, the first device can synthesize the test data according to the positions of the test data blocks in the test data. The first device may further detect whether the synthesized test data is data in a preset fixed format, and if it is data in a preset fixed format, then determine that the test data is correct, and at this time determine the sampling time of the sampling period as the first effective sampling time.

基于上述过程,第一器件可以将每个采样周期的采样时间是否为第一有效采样时间确定出。Based on the above process, the first device may determine whether the sampling time of each sampling period is the first effective sampling time.

步骤S203、根据确定出的第一有效采样时间,确定至少两根数据信号线的信号传输质量。Step S203. Determine the signal transmission quality of at least two data signal lines according to the determined first effective sampling time.

在本申请实施例中,第一器件确定出每个采样周期的采样时间是否为第一有效采样时间后,可以获取到所有第一有效采样时间。由于第一有效采样时间是至少两根数据信号线同时采集大有效数据部分的时间,因此第一器件可以根据确定出的所有第一有效采样时间确定至少两根数据信号线的信号传输质量。In the embodiment of the present application, after the first device determines whether the sampling time of each sampling period is the first valid sampling time, all first valid sampling times may be obtained. Since the first effective sampling time is the time when at least two data signal lines simultaneously collect a large effective data portion, the first device can determine the signal transmission quality of the at least two data signal lines according to all determined first effective sampling times.

作为一种可能的实现方式,第一器件可以根据确定所有第一有效采样时间的时间总长与一个采样周期时间间的比值来确定至少两根数据信号线的信号传输质量。例如,在所有第一有效采样时间的时间总长与一个采样周期时间间的比值大于第一预设阈值时,则说明采样周期内第一有效采样时间占比较大,可以确定至少两根数据信号线的信号传输质量较好。若所有第一有效采样时间的时间总长与一个采样周期时间间的比值不大于第一预设阈值,则说明采样周期内第一有效采样时间占比较小,可以确定至少两根数据信号线的信号传输质量较差。As a possible implementation manner, the first device may determine the signal transmission quality of the at least two data signal lines according to a ratio between a total time length of all first valid sampling times and a sampling cycle time. For example, when the ratio of the total time length of all first effective sampling times to a sampling cycle time is greater than the first preset threshold, it indicates that the proportion of the first effective sampling time in the sampling cycle is relatively large, and at least two data signal lines can be determined The signal transmission quality is better. If the ratio of the total time length of all first effective sampling times to a sampling cycle time is not greater than the first preset threshold, it means that the proportion of the first effective sampling time in the sampling cycle is relatively small, and the signals of at least two data signal lines can be determined Transmission quality is poor.

作为一种可能的实现方式,第一器件还可以先确定出第二有效采样时间。即为,第一器件与第二器件采用一根数据信号线进行数据传输时,第一器件确定通过一根数据信号线进行数据传输时,对应的能够采集到有效数据部分的采集时间为第二有效采样时间。此时,第一器件可以计算第一有效采样时间总长与第二有效采样时间总长间的占比,根据该占比确定至少两根数据信号线的信号传输质量。例如,该占比大于第二预设阈值时,则说明采样周期内第一有效采样时间占比较大,可以确定至少两根数据信号线的信号传输质量较好。若该占比不大于第二预设阈值,则说明采样周期内第一有效采样时间占比较小,可以确定至少两根数据信号线的信号传输质量较差。As a possible implementation manner, the first device may also first determine the second effective sampling time. That is, when the first device and the second device use one data signal line for data transmission, when the first device determines that data transmission is performed through one data signal line, the corresponding collection time that can collect valid data is the second Effective sampling time. At this time, the first device may calculate the ratio between the total length of the first effective sampling time and the total length of the second effective sampling time, and determine the signal transmission quality of the at least two data signal lines according to the ratio. For example, when the proportion is greater than the second preset threshold, it indicates that the proportion of the first effective sampling time in the sampling period is relatively large, and it can be determined that the signal transmission quality of at least two data signal lines is relatively good. If the proportion is not greater than the second preset threshold, it means that the proportion of the first effective sampling time in the sampling period is relatively small, and it can be determined that the signal transmission quality of at least two data signal lines is poor.

这样一来,可以先确定至少一个采样时间,并基于至少一个采样时间在至少两根数据信号线中采样测试数据块,针对每个采样时间,根据在每根数据信号线中采样的测试数据块获取测试数据,并检测测试数据是否正确,在测试数据正确时,将正确的测试数据对应的采样时间确定为第一有效采样时间。由于第一有效采样时间的个数越多,说明不同根数据信号线可以同时传输信号的时刻越多,则可以正确获取数据的概率越大,即为信号传输质量越好,基于此在本申请实施例中,可以根据第一有效采样时间,确定至少两根数据信号线的信号传输质量,实现对至少两根数据信号线的传输质量的检测,从而可以查找出至少两根数据信号线中信号传输质量较差的产品,进而可以降低问题产品流入市场的概率,提高成品质量。In this way, at least one sampling time can be determined first, and test data blocks are sampled in at least two data signal lines based on at least one sampling time, and for each sampling time, according to the test data blocks sampled in each data signal line Acquire test data, and check whether the test data is correct, and determine the sampling time corresponding to the correct test data as the first effective sampling time when the test data is correct. Since the number of the first effective sampling time is more, it means that different data signal lines can transmit signals at the same time, and the probability of correctly obtaining data is greater, that is, the signal transmission quality is better. Based on this, in this application In an embodiment, the signal transmission quality of at least two data signal lines can be determined according to the first effective sampling time, and the detection of the transmission quality of at least two data signal lines can be realized, so that the signal in at least two data signal lines can be found The transmission of poor quality products can reduce the probability of problematic products entering the market and improve the quality of finished products.

参见图5,为本申请实施例提供的一种数据链路的检测方法。该方法应用于附图1所述的第二器件。其中,第一器件通过目标总线与第二器件连接,其中,目标总线包括控制信号线及至少两根数据信号线。如图5所示,所述方法包括:Referring to FIG. 5 , it is a data link detection method provided by an embodiment of the present application. The method is applied to the second device described in FIG. 1 . Wherein, the first device is connected to the second device through a target bus, wherein the target bus includes a control signal line and at least two data signal lines. As shown in Figure 5, the method includes:

步骤S501、根据至少两根数据信号线,将测试数据划分为至少两个测试数据块。Step S501. Divide test data into at least two test data blocks according to at least two data signal lines.

在本申请实施例中,第二器件需要向第一器件发送测试数据。为了提高数据的发送速度,在第二器件向第一器件传输数据时,通常需要将数据划分为不同的数据块,通过不同的数据信号线传输不同的数据块。因此,第二器件可以将预设固定格式的测试数据根据至少两根数据信号线的数量,划分为至少两个测试数据块。In the embodiment of the present application, the second device needs to send test data to the first device. In order to improve the sending speed of data, when the second device transmits data to the first device, it is usually necessary to divide the data into different data blocks, and transmit different data blocks through different data signal lines. Therefore, the second device may divide the test data in a preset fixed format into at least two test data blocks according to the number of at least two data signal lines.

作为一种可能的实现方式,测试数据块的数量与至少两根数据信号线的数量相同。As a possible implementation manner, the number of test data blocks is the same as the number of at least two data signal lines.

例如,第二器件与第一器件间有4根数据信号线,假设预设固定格式的测试数据为8字节,此时,第二器件可以将8字节的测试数据划分为4个2字节的测试数据块。For example, there are 4 data signal lines between the second device and the first device, assuming that the test data in the preset fixed format is 8 bytes, at this time, the second device can divide the 8-byte test data into four 2-word Section's test data block.

作为一种可能的实现方式,第二器件为了方式测试数据块在数据信号线传输过程中被篡改,可以在每个测试数据块中添加校验信息,例如添加CRC校验码。此时,每个测试数据块中均携带有CRC校验码。As a possible implementation manner, in order to test that the data block is tampered during the transmission process of the data signal line, the second device may add check information, such as a CRC check code, to each test data block. At this time, each test data block carries a CRC check code.

步骤S502、通过至少两根数据信号线,分别向第一器件发送所述至少两个测试数据块。Step S502, sending the at least two test data blocks to the first device respectively through at least two data signal lines.

其中,不同数据信号线传输不同的测试数据块。Wherein, different data signal lines transmit different test data blocks.

在本申请实施例中,第二器件在将测试数据划分为不同的测试数据块后,可以分别通过不同的数据信号线分别向第一器件发送测试数据块。其中,不同的测试数据块通过不同的数据信号线传输。In the embodiment of the present application, after the second device divides the test data into different test data blocks, it may respectively send the test data blocks to the first device through different data signal lines. Wherein, different test data blocks are transmitted through different data signal lines.

参见图6,为本申请实施例提供的一种数据链路的检测方法的流程示意图。如图6所示,所述方法包括:Referring to FIG. 6 , it is a schematic flowchart of a method for detecting a data link provided by an embodiment of the present application. As shown in Figure 6, the method includes:

步骤S601、第一器件获取测试数据的预设采样次数。Step S601, the first device acquires a preset number of sampling times of test data.

在本申请实施例中,测试数据采集的次数就是一个采样周期划分的采样时间的个数。第一器件可以获取测试数据的预设采样次数。第一器件可以响应于用户的设置操作,获取到采样次数。采样次数可以是预先设置或者默认设置,并存储在存储器件中,第一器件可以从存储器件中获取预设采样次数。In the embodiment of the present application, the number of test data collections is the number of sampling times divided by one sampling period. The first device can obtain a preset sampling number of test data. The first device may acquire the number of samples in response to a user's setting operation. The number of sampling times may be preset or set by default, and stored in the storage device, and the first device may acquire the preset sampling times from the storage device.

步骤S602、第一器件获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数。Step S602, the first device acquires the number of times of sampling of the test data, and detects whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data.

在本申请实施例中,第一器件获取到测试数据的预设采样次数后,需要检测当前已采样次数是否达到了预设采样次数。此时,第一器件获取测试数据的已采样次数,并将测试数据的已采样次数与预设采样次数进行比较,检测测试数据的已采样次数是否达到测试数据的预设采样次数。In the embodiment of the present application, after the first device acquires the preset sampling times of the test data, it needs to detect whether the current sampling times have reached the preset sampling times. At this time, the first device acquires the number of times of sampling of the test data, compares the number of times of sampling of the test data with the preset number of samples, and detects whether the number of times of sampling of the test data reaches the number of times of preset sampling of the test data.

需要说明的是,第一器件根据检测结果的不同,下面执行的步骤不同,在测试数据的已采样此时达到预设次数时,则直接执行步骤S610,若测试数据的已采样次数未达到预设次数,需要进行测试数据的采样,此时执行下述步骤S603。It should be noted that the first device performs different steps according to different detection results. When the sampled test data reaches the preset number of times, step S610 is directly executed. If the sampled test data has not reached the preset number of times, The number of times is set, and it is necessary to sample the test data. At this time, the following step S603 is performed.

步骤S603、第一器件确定至少一个采样周期的采样时间。Step S603, the first device determines a sampling time of at least one sampling period.

在本申请实施例中,在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间。In the embodiment of the present application, when the sampling times of the test data do not reach the preset sampling times of the test data, the sampling time of the i-th sampling period is determined.

其中,i的值为已采样次数与1之和。Among them, the value of i is the sum of the number of samples and 1.

即为,第一器件在确定出测试数据的已采样次数未达到测试数据的预设采样次数时,说明需要继续采集测试数据。也就是说,在将采样周期划分为m个采样时间时,预设采样次数即为m次。第一器件在出测试数据的已采样次数未达到测试数据的预设采样次数时,则说明第一器件采样测试数据的采样周期并未达到m个采样周期。此时,第一器件需要进行采集。在当前采样周期为第i个采样周期时,第一器件需要先确定第i个采样周期的采样时间。That is, when the first device determines that the number of times the test data has been sampled does not reach the preset number of samples of the test data, it indicates that it is necessary to continue collecting the test data. That is to say, when the sampling period is divided into m sampling times, the preset number of sampling times is m times. When the number of times the first device has sampled the test data does not reach the preset number of samples of the test data, it means that the sampling period of the first device for sampling the test data does not reach m sampling periods. At this point, the first device needs to collect. When the current sampling period is the i-th sampling period, the first device needs to first determine the sampling time of the i-th sampling period.

作为一种可能的实现方式,在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间包括:根据测试数据的预设采样次数,确定采样基准值,并获取采样时间的第一预设间隔时间;在测试数据的已采样次数未达到测试数据的预设采样次数时,根据采样基准值,及采样时间的第一预设间隔时间,确定第i个采样周期的采样时间。As a possible implementation, when the number of times the test data has been sampled does not reach the preset number of samples of the test data, determining the sampling time of the i-th sampling cycle includes: determining the sampling reference value according to the preset number of samples of the test data , and obtain the first preset interval time of the sampling time; when the number of times the test data has been sampled does not reach the preset number of sampling times of the test data, according to the sampling reference value and the first preset interval time of the sampling time, determine the i-th The sampling time of sampling period.

在本申请实施例中,第一预设间隔时间是采样时间与采样基准值间的时间间隔。每个采样周期的采样时间均是基于采样基准时间确定的。第一器件在确定出测试数据的已采样次数未达到测试数据的预设采样次数时,在当前采样周期为第i个采样周期时,需要先确定第i个采样周期的采样时间。此时,第一器件可以根据测试数据的预设采样次数,确定采样基准值,即为将采样基准值确定为预设采样次数相同的时间值,例如,可以将采样基准值确定为T/预设采样次数。第一器件在确定出采样基准值后,可以按照第一预设间隔时间确定出每个周期的采样时间。例如,第一预设间隔时间包括:(p-1)×T/m,其中,p表示第p个采样周期,p为大于0的整数;T表示采样周期,m表示测试数据的预设采样次数。在确定第i个采样周期的采样时间时,第一器件根据采样基准值,及第一预设间隔时间可以计算出第i个采样周期的采样时间。此时,第一器件确定出第i个采样周期的采样时间为T/m+(p-1)×T/m。具体可参考步骤S201在此不再赘述。In the embodiment of the present application, the first preset interval time is the time interval between the sampling time and the sampling reference value. The sampling time of each sampling period is determined based on the sampling reference time. When the first device determines that the sampling times of the test data have not reached the preset sampling times of the test data, when the current sampling period is the i-th sampling period, it needs to first determine the sampling time of the i-th sampling period. At this time, the first device can determine the sampling reference value according to the preset sampling times of the test data, that is, the sampling reference value can be determined as the same time value as the preset sampling times, for example, the sampling reference value can be determined as T/preset Set the number of samples. After determining the sampling reference value, the first device may determine the sampling time of each cycle according to the first preset interval time. For example, the first preset interval time includes: (p-1)×T/m, wherein, p represents the pth sampling period, and p is an integer greater than 0; T represents the sampling period, and m represents the preset sampling of test data frequency. When determining the sampling time of the i-th sampling period, the first device can calculate the sampling time of the i-th sampling period according to the sampling reference value and the first preset interval time. At this time, the first device determines that the sampling time of the i-th sampling period is T/m+(p-1)×T/m. For details, refer to step S201, which will not be repeated here.

应理解的是,上述第一预设间隔时间与采样周期有关,是随着采样周期的增加而逐渐变大的。It should be understood that the above-mentioned first preset interval time is related to the sampling period, and gradually becomes larger as the sampling period increases.

作为另一种可能的实现方式,在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间包括:As another possible implementation, when the sampling times of the test data do not reach the preset sampling times of the test data, determining the sampling time of the i-th sampling period includes:

获取采样时间的第二预设间隔时间;在测试数据的已采样次数未达到测试数据的预设采样次数时,根据采样时间的第二预设间隔时间及第i-1个采样周期的采样时间,确定第i个采样周期的采样时间。Obtain the second preset interval time of the sampling time; when the number of times the test data has been sampled does not reach the preset number of sampling times of the test data, according to the second preset interval time of the sampling time and the sampling time of the i-1th sampling cycle , to determine the sampling time of the i-th sampling period.

即为,第二预设间隔时间是两个相邻采样周期中采样时间的时间间隔。此时第一器件可以根据前一个采样周期的采样时间及第二预设间隔时间来确定当前采样周期的采样时间。也就是说,第一器件仅需获取第i-1个采样周期的采样时间及第二预设间隔时间即可计算出第i个采样周期的采样时间。具体的确定过程可参考步骤S201在此不再赘述。That is, the second preset interval time is a time interval between sampling times in two adjacent sampling periods. At this time, the first device may determine the sampling time of the current sampling period according to the sampling time of the previous sampling period and the second preset interval time. That is to say, the first device only needs to obtain the sampling time of the i-1th sampling period and the second preset interval time to calculate the sampling time of the i-th sampling period. The specific determination process may refer to step S201 and will not be repeated here.

应理解的是,第二预设间隔时间可以是固定的,其仅是采样时间的间隔时间。It should be understood that the second preset interval time may be fixed, which is only the interval time of the sampling time.

通过上述不同的方式,均可以第一器件均可以确定出第i个采样周期的采样时间。Through the above different methods, the first device can determine the sampling time of the i-th sampling period.

步骤S604、在第i个采样周期中,第一器件通过控制信号线向第二器件发送测试指令消息。第二器件通过控制信号线接收第一器件发送的测试指令消息。Step S604, in the i-th sampling period, the first device sends a test instruction message to the second device through the control signal line. The second device receives the test instruction message sent by the first device through the control signal line.

其中,测试指令消息用于指示第二器件发送测试数据。Wherein, the test command message is used to instruct the second device to send test data.

在本申请实施例中,在第i个采样周期中,第一器件需要获取测试数据,第一器件需要向第二器件发送测试指令消息,以告知第二器件向第一器件发送测试数据。第二器件通过控制信号线接收测试指令消息。In the embodiment of the present application, in the i-th sampling period, the first device needs to obtain test data, and the first device needs to send a test instruction message to the second device to inform the second device to send test data to the first device. The second device receives the test instruction message through the control signal line.

例如,在进入系统下载流程时,第一器件需自动检测与第二器件间的数据传输质量。此时,第一器件需要在测试过程中的第i个采样周期中,向第二器件发送测试指令消息,以便告知第二器件发送测试数据。第二器件通过控制信号线接收测试指令消息。For example, when entering a system download process, the first device needs to automatically detect the quality of data transmission with the second device. At this time, the first device needs to send a test instruction message to the second device in the i-th sampling period during the test, so as to inform the second device to send test data. The second device receives the test instruction message through the control signal line.

步骤S605、第二器件通过控制信号线向第一器件发送测试响应消息。第一器件通过控制信号线接收第二器件发送的测试响应消息。Step S605, the second device sends a test response message to the first device through the control signal line. The first device receives the test response message sent by the second device through the control signal line.

在本申请实施例中,第二器件在接收到第一器件通过控制信号线传输的测试指令消息后,可以通过测试指令消息获知其需向第一器件发送测试数据。第二器件在可以向第一器件发送测试数据时,通过控制信号线向第一器件发送测试响应消息。第一器件在通过控制信号线接收到测试响应消息后,获知第二器件可以发送测试数据。此时,第一器件可以在采样周期的采样时间到达时,进行测试数据块的采样。In the embodiment of the present application, after receiving the test instruction message transmitted by the first device through the control signal line, the second device may know through the test instruction message that it needs to send test data to the first device. When the second device can send test data to the first device, it sends a test response message to the first device through the control signal line. After receiving the test response message through the control signal line, the first device learns that the second device can send test data. At this time, the first device may perform sampling of the test data block when the sampling time of the sampling period arrives.

步骤S606、第二器件根据至少两根数据信号线,将测试数据划分为至少两个测试数据块。Step S606, the second device divides the test data into at least two test data blocks according to the at least two data signal lines.

具体可参考步骤S501在此不再赘述。For details, refer to step S501, which will not be repeated here.

步骤S607、第二器件通过至少两根数据信号线,分别向第一器件发送至少两个测试数据块。第一器件基于第i个采样周期的采样时间在至少两根数据信号线中采样测试数据块。Step S607, the second device respectively sends at least two test data blocks to the first device through at least two data signal lines. The first device samples the test data block in at least two data signal lines based on the sampling time of the i-th sampling period.

其中,不同数据信号线传输不同的测试数据块。Wherein, different data signal lines transmit different test data blocks.

具体可参考步骤S502及步骤S201在此不再赘述。For details, reference may be made to step S502 and step S201, which will not be repeated here.

步骤S608、针对第i个采样周期的采样时间,根据至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将第i个采样周期的采样时间确定为第一有效采样时间。Step S608, for the sampling time of the i-th sampling period, obtain test data according to the test data blocks sampled in at least two data signal lines, and check whether the test data is correct; when the test data is correct, set the i-th sampling period The sampling time of is determined as the first effective sampling time.

具体可参考步骤S202在此不再赘述。For details, refer to step S202, which will not be repeated here.

步骤S609、第一器件根据i的值更新已采样次数,并重新执行步骤获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数,至步骤针对第i个采样周期的采样时间,根据至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将第i个采样周期的采样时间确定为第一有效采样时间,直至测试数据的已采样次数达到测试数据的预设采样次数。Step S609, the first device updates the number of times of sampling according to the value of i, and re-executes the step of obtaining the number of times of sampling of the test data, and detects whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data. The sampling time of a sampling cycle, according to the test data blocks sampled in at least two data signal lines, obtains the test data, and detects whether the test data is correct; when the test data is correct, the sampling time of the i sampling cycle is determined as the first sampling time. an effective sampling time until the number of samples of the test data reaches the preset number of samples of the test data.

在本申请实施例中,第一器件在第i个采样周期采样完测试数据,并确定出第i个采样周期的采样时间是否为第一有效采样时间后,则当前第i个采样周期可以结束,进入一个采样周期。此时,第一器件将已采样次数进行更新。第一器件可以将上述步骤S602中获取的已采样次数自动加1,也可以直接将i值更新为已采样数据。在更新完已采样次数后,可以重新执行步骤S602至步骤S608,直至已采样次数达到预设采样次数。此时可以完成对m个采样时间中哪些采样时间为第一有效采样时间哪些时间为无效时间进行确定。In the embodiment of the present application, after the first device samples the test data in the i-th sampling period, and determines whether the sampling time of the i-th sampling period is the first effective sampling time, the current i-th sampling period can end , into a sampling period. At this time, the first device updates the number of samples taken. The first device may automatically add 1 to the number of samples obtained in the above step S602, or may directly update the value of i to the sampled data. After the number of samples has been updated, step S602 to step S608 may be re-executed until the number of samples has reached the preset number of samples. At this point, it may be completed to determine which of the m sampling times is the first valid sampling time and which is the invalid time.

步骤S610、第一器件根据确定出的第一有效采样时间,确定至少两根数据信号线的信号传输质量。Step S610, the first device determines the signal transmission quality of at least two data signal lines according to the determined first effective sampling time.

具体可参考步骤S203在此不再赘述。For details, refer to step S203 and will not repeat it here.

参见图7,为本申请实施例提供了一种数据链路的检测方法的流程示意图。本申请实施例相对于图6所示的方法,增加了确定一根数据信号线对应的有效采样时间的相关步骤。如图7所示,所述方法包括:Referring to FIG. 7 , it provides a schematic flowchart of a method for detecting a data link according to an embodiment of the present application. Compared with the method shown in FIG. 6 , the embodiment of the present application adds related steps of determining an effective sampling time corresponding to a data signal line. As shown in Figure 7, the method includes:

步骤S701、第一器件确定目标总线的传输模式为第一模式。Step S701, the first device determines that the transmission mode of the target bus is the first mode.

在本申请实施例中,目标总线具有两种传输模式,分别为第一模式及第二模式。在目标总线的传输模式为第一模式时,则第一器件与第二器件间通过目标数据信号线传输数据。其中,目标数据信号线可以是至少两根数据信号线中的任一根数据信号线。也可以是至少两根数据信号线中预先设定的一根数据信号线。在目标总线的传输模式为第二模式时,则第一器件与第二器件间通过至少两根数据信号线传输数据。In the embodiment of the present application, the target bus has two transmission modes, namely the first mode and the second mode. When the transmission mode of the target bus is the first mode, data is transmitted between the first device and the second device through the target data signal line. Wherein, the target data signal line may be any one of the at least two data signal lines. It may also be a preset data signal line among the at least two data signal lines. When the transmission mode of the target bus is the second mode, data is transmitted between the first device and the second device through at least two data signal lines.

为了更准确的判断出第一器件与第二器件间的至少两根数据信号线的信号传输质量。可以先确定出第一器件与第二器件间的一根数据信号线传输数据时,在一个采样周期中的第二有效采样时间。然后在确定出第一器件与第二器件间的至少两根数据信号线同时传输数据时,在一个采样周期内的第一有效采样时间,根据第一有效采样时间及第二有效采样时间确定至少两根数据信号线的信号传输质量。基于此,需要先确定出第一器件与第二器件间的一根数据信号线传输数据时,在一个采样周期中的第二有效采样时间。此时,第一器件可以将目标总线的传输模式设置为第一模式,以便第一器件与第二器件间通过目标数据信号线传输测试数据。In order to more accurately judge the signal transmission quality of at least two data signal lines between the first device and the second device. The second effective sampling time in one sampling period can be determined first when a data signal line between the first device and the second device transmits data. Then when it is determined that at least two data signal lines between the first device and the second device transmit data at the same time, the first effective sampling time in one sampling period is determined according to the first effective sampling time and the second effective sampling time at least The signal transmission quality of the two data signal lines. Based on this, it is necessary to first determine the second effective sampling time in one sampling period when a data signal line between the first device and the second device transmits data. At this time, the first device may set the transmission mode of the target bus to the first mode, so that the test data is transmitted between the first device and the second device through the target data signal line.

步骤S702、第一器件获取测试数据的预设采样次数。Step S702, the first device acquires a preset number of sampling times of test data.

具体可参考步骤S601在此不再赘述。For details, refer to step S601, which will not be repeated here.

步骤S703、第一器件获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数。Step S703, the first device obtains the number of times of sampling of the test data, and detects whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data.

具体可参考步骤S602在此不再赘述。For details, refer to step S602, which will not be repeated here.

步骤S704、第一器件确定至少一个采样周期的采样时间。Step S704, the first device determines a sampling time of at least one sampling period.

具体可参考步骤S603在此不再赘述。For details, refer to step S603, which will not be repeated here.

步骤S705、在第i个采样周期中,第一器件通过控制信号线向第二器件发送测试指令消息。第二器件通过控制信号线接收第一器件发送的测试指令消息。Step S705, in the i-th sampling period, the first device sends a test instruction message to the second device through the control signal line. The second device receives the test instruction message sent by the first device through the control signal line.

其中,测试指令消息中携带有目标总线的传输模式,且目标总线的传输模式为第一模式。Wherein, the test instruction message carries the transmission mode of the target bus, and the transmission mode of the target bus is the first mode.

在本申请实施例中,第一器件向第二器件发送测试指令消息时,可以将目标总线的传输模式添加至该消息中,以便第二器件按照指定的传输模式进行数据的传输。此时,第二器件获取到测试指令消息,解析测试指令消息获取其内携带的目标总线的传输模式。具体可参考步骤S604在此不再赘述。In the embodiment of the present application, when the first device sends a test command message to the second device, the transmission mode of the target bus may be added to the message, so that the second device transmits data according to the specified transmission mode. At this time, the second device obtains the test command message, and parses the test command message to obtain the transmission mode of the target bus carried in it. For details, refer to step S604, which will not be repeated here.

步骤S706、第二器件通过控制信号线向第一器件发送测试响应消息。第一器件通过控制信号线接收第二器件发送的测试响应消息。Step S706, the second device sends a test response message to the first device through the control signal line. The first device receives the test response message sent by the second device through the control signal line.

具体可参考步骤S605在此不再赘述。For details, refer to step S605, which will not be repeated here.

步骤S707、第二器件将测试数据通过目标数据信号线发送至第一器件。第一器件基于第i个采样周期的采样时间在目标数据信号线中采样测试数据。Step S707, the second device sends the test data to the first device through the target data signal line. The first device samples test data in the target data signal line based on the sampling time of the i-th sampling period.

在本申请实施例中,第二器件在接收到测试指令消息后,需要向第一器件发送测试数据。此时,由于目标总线的传输模式为第一模式,因此第二器件可以将测试数据通过目标数据信号线发送至第一器件。第一器件在第i个采样周期的采样时间,在目标数据信号线中采样测试数据。In the embodiment of the present application, after receiving the test instruction message, the second device needs to send test data to the first device. At this time, since the transmission mode of the target bus is the first mode, the second device can send the test data to the first device through the target data signal line. The first device samples test data in the target data signal line at the sampling time of the i-th sampling period.

步骤S708、第一器件针对第i个采样周期的采样时间,检测在目标数据线中采样的测试数据是否正确,且将正确的测试数据对应的采样时间确定为第二有效采样时间。Step S708 , the first device detects whether the test data sampled in the target data line is correct for the sampling time of the i-th sampling period, and determines the sampling time corresponding to the correct test data as the second effective sampling time.

在本申请实施例中,第一器件在获取到测试数据后,需要检测测试数据是否正确,在检测到测试数据正确时,可以将第i个采样周期的采样时间确定为第二有效采样时间。第一器件检测测试数据是否正确可参考步骤S608在此不再赘述。In the embodiment of the present application, after the first device acquires the test data, it needs to check whether the test data is correct, and when it detects that the test data is correct, the sampling time of the i-th sampling period can be determined as the second effective sampling time. Whether the first device detection test data is correct can refer to step S608 and will not be repeated here.

步骤S709、根据i的值更新所述已采样次数,并重新执行步骤获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数,至步骤针对第i个采样周期的采样时间,根据至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将第i个采样周期的采样时间确定为第一有效采样时间,直至测试数据的已采样次数达到测试数据的预设采样次数。Step S709, update the number of times of sampling according to the value of i, and re-execute the step of obtaining the number of times of sampling of the test data, and check whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data, and go to the step for the ith The sampling time of the sampling period is to obtain test data according to the test data blocks sampled in at least two data signal lines, and detect whether the test data is correct; when the test data is correct, determine the sampling time of the i-th sampling period as the first Effective sampling time until the number of samples of test data reaches the preset number of samples of test data.

具体可参考步骤S609在此不再赘述。For details, refer to step S609, which will not be repeated here.

步骤S710、在测试数据的已采样次数达到测试数据的预设采样次数时,第一器件将目标总线的传输模式更新为第二模式。Step S710, when the number of times the test data has been sampled reaches the preset number of samples of the test data, the first device updates the transmission mode of the target bus to the second mode.

在本申请实施例,在目标总线的传输模式为第一模式,若测试数据的已采样次数达到测试数据的预设采样次数,则需要进行目标总线的传输模式为第二模式时,一个采样周期中的有效采样时间的确定。此时,第一器件将目标总线的传输模式设置为第二模式。In this embodiment of the application, when the transmission mode of the target bus is the first mode, if the number of times the test data has been sampled reaches the preset number of sampling times of the test data, when the transmission mode of the target bus is the second mode, one sampling cycle Determination of the effective sampling time in . At this time, the first device sets the transfer mode of the target bus to the second mode.

步骤S711、第一器件获取测试数据的预设采样次数。Step S711, the first device acquires a preset number of sampling times of test data.

具体可参考步骤S601在此不再赘述。For details, refer to step S601, which will not be repeated here.

步骤S712、第一器件获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数。Step S712, the first device obtains the number of times of sampling of the test data, and detects whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data.

具体可参考步骤S602在此不再赘述。For details, refer to step S602, which will not be repeated here.

步骤S713、第一器件确定至少一个采样周期的采样时间。Step S713, the first device determines a sampling time of at least one sampling period.

具体可参考步骤S603在此不再赘述。For details, refer to step S603, which will not be repeated here.

步骤S714、在第i个采样周期中,第一器件通过控制信号线向第二器件发送测试指令消息。第二器件通过控制信号线接收第一器件发送的测试指令消息。Step S714, in the i-th sampling period, the first device sends a test instruction message to the second device through the control signal line. The second device receives the test instruction message sent by the first device through the control signal line.

其中,测试指令消息用于指示第二器件发送测试数据。Wherein, the test command message is used to instruct the second device to send test data.

具体可参考步骤S604在此不再赘述。For details, refer to step S604, which will not be repeated here.

步骤S715、第二器件通过控制信号线向第一器件发送测试响应消息。第一器件通过控制信号线接收第二器件发送的测试响应消息。Step S715, the second device sends a test response message to the first device through the control signal line. The first device receives the test response message sent by the second device through the control signal line.

具体可参考步骤S605在此不再赘述。For details, refer to step S605, which will not be repeated here.

步骤S716、第二器件根据至少两根数据信号线,将测试数据划分为至少两个测试数据块。Step S716, the second device divides the test data into at least two test data blocks according to the at least two data signal lines.

具体可参考步骤S606在此不再赘述。For details, refer to step S606, which will not be repeated here.

步骤S717、第二器件通过至少两根数据信号线,分别向第一器件发送至少两个测试数据块。第一器件基于第i个采样周期的采样时间在至少两根数据信号线中采样测试数据块。Step S717, the second device respectively sends at least two test data blocks to the first device through at least two data signal lines. The first device samples the test data block in at least two data signal lines based on the sampling time of the i-th sampling period.

其中,不同数据信号线传输不同的测试数据块。Wherein, different data signal lines transmit different test data blocks.

具体可参考步骤S607在此不再赘述。For details, refer to step S607, which will not be repeated here.

步骤S718、针对第i个采样周期的采样时间,根据至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将第i个采样周期的采样时间确定为第一有效采样时间。Step S718, for the sampling time of the i-th sampling period, obtain test data according to the test data blocks sampled in at least two data signal lines, and check whether the test data is correct; when the test data is correct, set the i-th sampling period The sampling time of is determined as the first effective sampling time.

具体可参考步骤S608在此不再赘述。For details, refer to step S608, which will not be repeated here.

步骤S719、第一器件根据i的值更新已采样次数,并重新执行步骤获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数,至步骤针对第i个采样周期的采样时间,根据至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将第i个采样周期的采样时间确定为第一有效采样时间,直至测试数据的已采样次数达到测试数据的预设采样次数。Step S719, the first device updates the number of times of sampling according to the value of i, and re-executes the step to obtain the number of times of sampling of the test data, and detects whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data. The sampling time of a sampling cycle, according to the test data blocks sampled in at least two data signal lines, obtains the test data, and detects whether the test data is correct; when the test data is correct, the sampling time of the i sampling cycle is determined as the first sampling time. an effective sampling time until the number of samples of the test data reaches the preset number of samples of the test data.

具体可参考步骤S609在此不再赘述。For details, refer to step S609, which will not be repeated here.

步骤S720、第一器件根据确定出的第一有效采样时间,确定至少两根数据信号线的信号传输质量。Step S720, the first device determines the signal transmission quality of at least two data signal lines according to the determined first effective sampling time.

具体可参考步骤S203在此不再赘述。For details, refer to step S203 and will not repeat it here.

参见图8,为本申请实施例提供的一种数据链路的检测装置的结构示意图。所述检测装置应用于第一器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线。如图8所示,所述检测装置包括:Referring to FIG. 8 , it is a schematic structural diagram of an apparatus for detecting a data link provided by an embodiment of the present application. The detection device is applied to a first device, and the first device is connected to a second device through a target bus, wherein the target bus includes a control signal line and at least two data signal lines. As shown in Figure 8, the detection device includes:

处理单元801,用于确定至少一个采样周期的采样时间,并基于至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块。The processing unit 801 is configured to determine a sampling time of at least one sampling period, and sample test data blocks in at least two data signal lines based on the sampling time of at least one sampling period.

处理单元801,还用于针对每个采样周期的采样时间,根据在至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将采样周期的采样时间确定为第一有效采样时间。The processing unit 801 is also used to obtain test data according to the test data blocks sampled in at least two data signal lines for the sampling time of each sampling period, and detect whether the test data is correct; when the test data is correct, the sampled The sampling time of the period is determined as the first effective sampling time.

确定单元802,用于根据确定出的第一有效采样时间,确定至少两根数据信号线的信号传输质量。The determining unit 802 is configured to determine the signal transmission quality of at least two data signal lines according to the determined first effective sampling time.

作为一种可能的实现方式,如图9所示,上述检测装置还包括:As a possible implementation, as shown in Figure 9, the above-mentioned detection device also includes:

发送单元803,用于通过控制信号线向第二器件发送测试指令消息。The sending unit 803 is configured to send a test instruction message to the second device through the control signal line.

接收单元804,用于通过控制信号线接收第二器件发送的测试响应消息。The receiving unit 804 is configured to receive the test response message sent by the second device through the control signal line.

作为一种可能的实现方式,确定单元802,还用于确定目标总线的传输模式为第一模式。As a possible implementation manner, the determining unit 802 is further configured to determine that the transmission mode of the target bus is the first mode.

处理单元801,还用于基于至少一个采样周期的采样时间在目标数据信号线中采样测试数据;及针对每个采样周期的采样时间,检测在目标数据线中采样的测试数据是否正确,且将正确的测试数据对应的采样时间确定为第二有效采样时间。The processing unit 801 is further configured to sample test data in the target data signal line based on the sampling time of at least one sampling period; and for the sampling time of each sampling period, detect whether the test data sampled in the target data line is correct, and The sampling time corresponding to the correct test data is determined as the second effective sampling time.

其中,目标信号线是至少两根数据信号线中的任一根数据信号线。Wherein, the target signal line is any one of the at least two data signal lines.

处理单元801,还用于将目标总线的传输模式更新为第二模式。The processing unit 801 is further configured to update the transmission mode of the target bus to the second mode.

处理单元801,具体用于在目标总线的传输模式为第二模式时,基于至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块。The processing unit 801 is specifically configured to sample test data blocks in at least two data signal lines based on a sampling time of at least one sampling period when the transmission mode of the target bus is the second mode.

确定单元802,具体用于根据确定出的第一有效采样时间及第二有效采样时间,确定至少两根数据信号线的信号传输质量。The determining unit 802 is specifically configured to determine the signal transmission quality of at least two data signal lines according to the determined first effective sampling time and the determined second effective sampling time.

作为一种可能的实现方式,处理单元801,还用于获取测试数据的预设采样次数;以及获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数。As a possible implementation, the processing unit 801 is also configured to obtain the preset sampling times of the test data; and obtain the sampled times of the test data, and detect whether the sampled times of the test data reach the preset sampling times of the test data .

处理单元801,具体用于在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间;在第i个采样周期中,基于第i个采样周期的采样时间在至少两根数据信号线中采样测试数据。其中,i的值为已采样次数与1之和。The processing unit 801 is specifically configured to determine the sampling time of the i-th sampling period when the number of times the test data has been sampled does not reach the preset number of sampling times of the test data; in the i-th sampling period, based on the i-th sampling period The sampling time samples test data in at least two data signal lines. Among them, the value of i is the sum of the number of samples and 1.

针对第i个采样周期的采样时间,根据至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将第i个采样周期的采样时间确定为第一有效采样时间。For the sampling time of the i-th sampling period, obtain test data according to the test data blocks sampled in at least two data signal lines, and detect whether the test data is correct; when the test data is correct, set the sampling time of the i-th sampling period to Determined as the first effective sampling time.

处理单元801,还用于根据i的值更新所述已采样次数,并重新执行步骤获取测试数据的已采样次数,并检测测试数据的已采样次数是否达到测试数据的预设采样次数,至步骤针对第i个采样周期的采样时间,根据至少两根数据信号线中采样的测试数据块,获取测试数据,并检测测试数据是否正确;在测试数据正确时,将第i个采样周期的采样时间确定为第一有效采样时间,直至测试数据的已采样次数达到测试数据的预设采样次数。The processing unit 801 is further configured to update the number of times of sampling according to the value of i, and re-execute the step of obtaining the number of times of sampling of the test data, and detect whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data, to step For the sampling time of the i-th sampling period, obtain test data according to the test data blocks sampled in at least two data signal lines, and detect whether the test data is correct; when the test data is correct, set the sampling time of the i-th sampling period to It is determined as the first effective sampling time until the number of times the test data has been sampled reaches the preset number of samples of the test data.

作为一种可能的实现方式,处理单元801,具体用于根据测试数据的预设采样次数,确定采样基准值,并获取采样时间的第一预设间隔时间;在测试数据的已采样次数未达到测试数据的预设采样次数时,根据所述采样基准值,及采样时间的第一预设间隔时间,确定第i个采样周期的采样时间。As a possible implementation, the processing unit 801 is specifically configured to determine the sampling reference value according to the preset sampling times of the test data, and obtain the first preset interval time of the sampling time; When testing the preset sampling times of the data, the sampling time of the i-th sampling period is determined according to the sampling reference value and the first preset interval time of the sampling time.

作为一种可能的实现方式,处理单元801,具体用于获取采样时间的第二预设间隔时间;在测试数据的已采样次数未达到测试数据的预设采样次数时,根据所述采样时间的第二预设间隔时间及第i-1个采样周期的采样时间,确定第i个采样周期的采样时间。As a possible implementation, the processing unit 801 is specifically configured to obtain the second preset interval time of the sampling time; The second preset interval time and the sampling time of the i-1 sampling period determine the sampling time of the i sampling period.

作为一种可能的实现方式,目标总线包括:安全数字输入输出接口SDIO总线。As a possible implementation manner, the target bus includes: a secure digital input and output interface SDIO bus.

参见图10,为本申请实施例提供的一种数据链路的检测装置的结构示意图。所述检测装置应用于第二器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线。如图10所示,所述检测装置包括:Referring to FIG. 10 , it is a schematic structural diagram of a data link detection device provided by an embodiment of the present application. The detection device is applied to a second device, and the first device is connected to the second device through a target bus, wherein the target bus includes a control signal line and at least two data signal lines. As shown in Figure 10, the detection device includes:

处理单元1001,用于根据至少两根数据信号线,将测试数据划分为至少两个测试数据块。The processing unit 1001 is configured to divide the test data into at least two test data blocks according to at least two data signal lines.

发送单元1002,用于通过至少两根数据信号线,分别向第一器件发送至少两个测试数据块。其中,不同数据信号线传输不同的测试数据块。The sending unit 1002 is configured to respectively send at least two test data blocks to the first device through at least two data signal lines. Wherein, different data signal lines transmit different test data blocks.

作为一种可能的实现方式,如图11所示,所述检测装置还包括:As a possible implementation, as shown in Figure 11, the detection device further includes:

接收单元1003,用于通过控制信号线接收第一器件发送的测试指令消息。The receiving unit 1003 is configured to receive the test instruction message sent by the first device through the control signal line.

发送单元1002,还用于通过控制信号线向第一器件发送测试响应消息。The sending unit 1002 is further configured to send a test response message to the first device through the control signal line.

与上述实施例相对应,本申请还提供了一种电子设备。图12为本发明实施例提供的一种电子设备的结构示意图,所述电子设备1200可以包括:处理器1201、存储器1202及通信单元1203。这些组件通过一条或多条总线进行通信,本领域技术人员可以理解,图中示出的服务器的结构并不构成对本发明实施例的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Corresponding to the foregoing embodiments, the present application further provides an electronic device. FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device 1200 may include: a processor 1201 , a memory 1202 and a communication unit 1203 . These components communicate through one or more buses. Those skilled in the art can understand that the structure of the server shown in the figure does not constitute a limitation to the embodiment of the present invention. It can be a bus structure or a star structure , may also include more or fewer components than shown, or combine certain components, or have different component arrangements.

其中,所述通信单元1203,用于建立通信信道,从而使所述存储设备可以与其它设备进行通信。接收其他设备发是的用户数据或者向其他设备发送用户数据。Wherein, the communication unit 1203 is configured to establish a communication channel, so that the storage device can communicate with other devices. Receive user data from other devices or send user data to other devices.

所述处理器1201,为存储设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器1202内的软件程序和/或模块,以及调用存储在存储器内的数据,以执行电子设备的各种功能和/或处理数据。所述处理器可以由集成电路(integrated circuit,IC)组成,例如可以由单颗封装的IC所组成,也可以由连接多颗相同功能或不同功能的封装IC而组成。举例来说,处理器1201可以仅包括中央处理器(central processing unit,CPU)。在本发明实施方式中,CPU可以是单运算核心,也可以包括多运算核心。The processor 1201, as the control center of the storage device, uses various interfaces and lines to connect various parts of the entire electronic device, and runs or executes software programs and/or modules stored in the memory 1202, and calls stored in the memory data to perform various functions of electronic devices and/or process data. The processor may be composed of an integrated circuit (integrated circuit, IC), for example, may be composed of a single packaged IC, or may be composed of multiple packaged ICs connected with the same function or different functions. For example, the processor 1201 may only include a central processing unit (central processing unit, CPU). In the embodiments of the present invention, the CPU may be a single computing core, or may include multiple computing cores.

所述存储器1202,用于存储处理器1201的执行指令,存储器1202可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 1202 is used to store the execution instructions of the processor 1201. The memory 1202 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.

当存储器1202中的执行指令由处理器1201执行时,使得电子设备1200能够执行图7所示实施例中的部分或全部步骤。When the execution instructions in the memory 1202 are executed by the processor 1201, the electronic device 1200 is enabled to execute some or all of the steps in the embodiment shown in FIG. 7 .

具体实现中,本发明还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可包括本发明提供的数据链路的检测方法的各实施例中的部分或全部步骤。所述的存储介质可为磁碟、光盘、只读存储记忆体(read-only memory,ROM)或随机存储记忆体(random access memory,RAM)等。In a specific implementation, the present invention also provides a computer storage medium, wherein the computer storage medium can store a program, and when the program is executed, it can include part or all of the embodiments of the data link detection method provided by the present invention. step. The storage medium may be a magnetic disk, an optical disk, a read-only memory (read-only memory, ROM) or a random access memory (random access memory, RAM), etc.

本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。Those skilled in the art can clearly understand that the technologies in the embodiments of the present invention can be implemented by means of software plus a necessary general-purpose hardware platform. Based on this understanding, the essence of the technical solutions in the embodiments of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM , magnetic disk, optical disk, etc., including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.

本说明书中各个实施例之间相同相似的部分互相参见即可。尤其,对于装置实施例和终端实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例中的说明即可。For the same and similar parts among the various embodiments in this specification, refer to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and for relevant details, please refer to the description in the method embodiment.

Claims (13)

1.一种数据链路的检测方法,其特征在于,应用于第一器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述方法包括:1. A detection method for a data link, characterized in that it is applied to a first device, and the first device is connected to a second device through a target bus, wherein the target bus includes a control signal line and at least two data lines signal lines, the method comprising: 确定至少一个采样周期的采样时间,并基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块;determining a sampling time for at least one sampling period, and sampling test data blocks in at least two data signal lines based on the sampling time for at least one sampling period; 针对每个采样周期的采样时间,根据在所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述采样周期的采样时间确定为第一有效采样时间;For the sampling time of each sampling period, according to the test data blocks sampled in the at least two data signal lines, obtain test data, and detect whether the test data is correct; when the test data is correct, set the sampling period The sampling time of is determined as the first effective sampling time; 根据确定出的第一有效采样时间,确定所述至少两根数据信号线的信号传输质量。According to the determined first effective sampling time, the signal transmission quality of the at least two data signal lines is determined. 2.根据权利要求1所述的方法,其特征在于,在所述基于所述至少一个采样周期的采样时间在所述至少两根数据信号线中采样测试数据块之前,还包括:2. The method according to claim 1, wherein, before sampling a test data block in the at least two data signal lines at the sampling time based on the at least one sampling cycle, further comprising: 通过所述控制信号线向所述第二器件发送测试指令消息;sending a test instruction message to the second device through the control signal line; 通过所述控制信号线接收所述第二器件发送的测试响应消息。receiving a test response message sent by the second device through the control signal line. 3.根据权利要求1所述的方法,其特征在于,在所述基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块之前,还包括:3. The method according to claim 1, further comprising: before sampling a test data block in at least two data signal lines at the sampling time based on the at least one sampling period: 确定目标总线的传输模式为第一模式;Determining that the transfer mode of the target bus is the first mode; 基于所述至少一个采样周期的采样时间在目标数据信号线中采样测试数据;其中,所述目标信号线是所述至少两根数据信号线中的任一根数据信号线;Sampling test data in the target data signal line based on the sampling time of the at least one sampling period; wherein the target signal line is any one of the at least two data signal lines; 针对每个采样周期的采样时间,检测在所述目标数据线中采样的测试数据是否正确,且将正确的测试数据对应的采样时间确定为第二有效采样时间;For the sampling time of each sampling period, detect whether the test data sampled in the target data line is correct, and determine the sampling time corresponding to the correct test data as the second effective sampling time; 将所述目标总线的传输模式更新为第二模式;updating the transmission mode of the target bus to a second mode; 所述基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块包括:The sampling test data block in at least two data signal lines based on the sampling time of the at least one sampling period includes: 在所述目标总线的传输模式为第二模式时,基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块;When the transmission mode of the target bus is the second mode, sampling test data blocks in at least two data signal lines based on the sampling time of the at least one sampling period; 所述根据确定出的第一有效采样时间,确定所述至少两根数据信号线的信号传输质量包括:The determining the signal transmission quality of the at least two data signal lines according to the determined first effective sampling time includes: 根据确定出的第一有效采样时间及第二有效采样时间,确定所述至少两根数据信号线的信号传输质量。According to the determined first effective sampling time and the determined second effective sampling time, the signal transmission quality of the at least two data signal lines is determined. 4.根据权利要求1所述的方法,其特征在于,还包括:4. The method according to claim 1, further comprising: 获取测试数据的预设采样次数;Obtain the preset sampling times of test data; 获取测试数据的已采样次数,并检测所述测试数据的已采样次数是否达到所述测试数据的预设采样次数;Obtaining the number of times the test data has been sampled, and detecting whether the number of times the test data has been sampled reaches the preset number of times of sampling the test data; 所述确定至少一个采样周期的采样时间,并基于所述至少一个采样周期的采样时间采样测试数据块包括:The determining the sampling time of at least one sampling period, and sampling the test data block based on the sampling time of the at least one sampling period includes: 在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间;在第i个采样周期中,基于所述第i个采样周期的采样时间在所述至少两根数据信号线中采样测试数据;其中,i的值为已采样次数与1之和;When the sampling times of the test data do not reach the preset sampling times of the test data, determine the sampling time of the i-th sampling period; in the i-th sampling period, based on the sampling time of the i-th sampling period in the Sampling test data in at least two data signal lines; wherein, the value of i is the sum of the number of times sampled and 1; 所述针对每个采样周期的采样时间,利用所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述采样周期的采样时间确定为第一有效采样时间包括:For the sampling time of each sampling period, use the test data blocks sampled in the at least two data signal lines to obtain test data, and detect whether the test data is correct; when the test data is correct, the sampled The sampling time of the period determined as the first effective sampling time includes: 针对第i个采样周期的采样时间,根据所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述第i个采样周期的采样时间确定为第一有效采样时间;For the sampling time of the i-th sampling period, according to the test data blocks sampled in the at least two data signal lines, the test data is obtained, and whether the test data is correct; when the test data is correct, the i-th The sampling time of a sampling period is determined as the first effective sampling time; 在测试数据正确时,将所述第i个采样周期的采样时间确定为第一有效采样时间之后,还包括:When the test data is correct, after determining the sampling time of the i-th sampling period as the first effective sampling time, it also includes: 根据所述i的值更新所述已采样次数,并重新执行步骤获取测试数据的已采样次数,并检测所述测试数据的已采样次数是否达到所述测试数据的预设采样次数,至步骤针对第i个采样周期的采样时间,根据所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述第i个采样周期的采样时间确定为第一有效采样时间,直至所述测试数据的已采样次数达到所述测试数据的预设采样次数。Update the number of times of sampling according to the value of i, and re-execute the step of obtaining the number of times of sampling of the test data, and detect whether the number of times of sampling of the test data reaches the preset number of times of sampling of the test data, and go to the step for The sampling time of the i-th sampling period is to obtain test data according to the test data blocks sampled in the at least two data signal lines, and detect whether the test data is correct; when the test data is correct, the i-th The sampling time of the sampling period is determined as the first effective sampling time until the number of times the test data has been sampled reaches the preset number of times the test data has been sampled. 5.根据权利要求4所述的方法,其特征在于,所述在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间包括:5. The method according to claim 4, wherein, when the number of samples of the test data does not reach the preset number of samples of the test data, determining the sampling time of the i-th sampling cycle includes: 根据所述测试数据的预设采样次数,确定采样基准值,并获取采样时间的第一预设间隔时间;Determining a sampling reference value according to the preset sampling times of the test data, and obtaining a first preset interval time of sampling time; 在测试数据的已采样次数未达到测试数据的预设采样次数时,根据所述采样基准值,及采样时间的第一预设间隔时间,确定第i个采样周期的采样时间。When the sampling times of the test data do not reach the preset sampling times of the test data, the sampling time of the i-th sampling period is determined according to the sampling reference value and the first preset interval time of the sampling time. 6.根据权利要求4所述的方法,其特征在于,所述在测试数据的已采样次数未达到测试数据的预设采样次数时,确定第i个采样周期的采样时间包括:6. The method according to claim 4, wherein, when the number of times of sampling of the test data does not reach the preset number of times of sampling of the test data, determining the sampling time of the i-th sampling period comprises: 获取采样时间的第二预设间隔时间;Obtain a second preset interval time of the sampling time; 在测试数据的已采样次数未达到测试数据的预设采样次数时,根据所述采样时间的第二预设间隔时间及第i-1个采样周期的采样时间,确定第i个采样周期的采样时间。When the number of times that the test data has been sampled does not reach the preset number of samples of the test data, according to the second preset interval time of the sampling time and the sampling time of the i-1th sampling cycle, determine the sampling of the i-th sampling cycle time. 7.根据权利要求1-6任一项所述的方法,其特征在于,所述目标总线包括:安全数字输入输出接口SDIO总线。7. The method according to any one of claims 1-6, wherein the target bus comprises: a secure digital input and output interface SDIO bus. 8.一种数据链路的检测方法,其特征在于,应用于第二器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述方法包括:8. A detection method for a data link, characterized in that it is applied to a second device, and the first device is connected to the second device through a target bus, wherein the target bus includes a control signal line and at least two data lines signal lines, the method comprising: 根据所述至少两根数据信号线,将测试数据划分为至少两个测试数据块;dividing the test data into at least two test data blocks according to the at least two data signal lines; 通过所述至少两根数据信号线,分别向第一器件发送所述至少两个测试数据块;其中,不同数据信号线传输不同的测试数据块。The at least two test data blocks are respectively sent to the first device through the at least two data signal lines; wherein, different data signal lines transmit different test data blocks. 9.根据权利要求8所述的方法,其特征在于,在所述根据所述至少两根数据信号线,将测试数据划分为至少两个测试数据块之前,还包括:9. The method according to claim 8, wherein, before said dividing the test data into at least two test data blocks according to said at least two data signal lines, further comprising: 通过所述控制信号线接收所述第一器件发送的测试指令消息;receiving a test instruction message sent by the first device through the control signal line; 通过所述控制信号线向所述第一器件发送测试响应消息。sending a test response message to the first device through the control signal line. 10.一种数据链路的检测装置,其特征在于,应用于第一器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述装置包括:10. A data link detection device, characterized in that it is applied to a first device, and the first device is connected to a second device through a target bus, wherein the target bus includes a control signal line and at least two data lines signal line, the device includes: 处理单元,用于确定至少一个采样周期的采样时间,并基于所述至少一个采样周期的采样时间在至少两根数据信号线中采样测试数据块;A processing unit, configured to determine a sampling time of at least one sampling period, and sample a test data block in at least two data signal lines based on the sampling time of the at least one sampling period; 所述处理单元,还用于针对每个采样周期的采样时间,根据在所述至少两根数据信号线中采样的测试数据块,获取测试数据,并检测所述测试数据是否正确;在测试数据正确时,将所述采样周期的采样时间确定为第一有效采样时间;The processing unit is further configured to obtain test data according to the test data blocks sampled in the at least two data signal lines for the sampling time of each sampling period, and detect whether the test data is correct; When correct, determine the sampling time of the sampling period as the first effective sampling time; 确定单元,用于根据确定出的第一有效采样时间,确定所述至少两根数据信号线的信号传输质量。The determination unit is configured to determine the signal transmission quality of the at least two data signal lines according to the determined first effective sampling time. 11.一种数据链路的检测装置,其特征在于,应用于第二器件,所述第一器件通过目标总线与第二器件连接,其中,所述目标总线包括控制信号线及至少两根数据信号线,所述装置包括:11. A data link detection device, characterized in that it is applied to a second device, and the first device is connected to the second device through a target bus, wherein the target bus includes a control signal line and at least two data lines signal line, the device includes: 处理单元,用于根据所述至少两根数据信号线,将测试数据划分为至少两个测试数据块;a processing unit, configured to divide the test data into at least two test data blocks according to the at least two data signal lines; 发送单元,用于通过所述至少两根数据信号线,分别向第一器件发送所述至少两个测试数据块;其中,不同数据信号线传输不同的测试数据块。The sending unit is configured to respectively send the at least two test data blocks to the first device through the at least two data signal lines; wherein different data signal lines transmit different test data blocks. 12.一种电子设备,其特征在于,包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被所述处理器执行时,触发所述电子设备执行权利要求1-7任一项所述的方法或8-9任一项所述的方法。12. An electronic device, characterized by comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered Carry out the method described in any one of claims 1-7 or the method described in any one of 8-9. 13.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行权利要求1-7中任意一项所述的方法或8-9任一项所述的方法。13. A computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute claims 1-7 The method described in any one of or the method described in any one of 8-9.
CN202211473913.6A 2022-11-22 2022-11-22 Data link detection method, device, equipment and storage medium Pending CN115834432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211473913.6A CN115834432A (en) 2022-11-22 2022-11-22 Data link detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211473913.6A CN115834432A (en) 2022-11-22 2022-11-22 Data link detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115834432A true CN115834432A (en) 2023-03-21

Family

ID=85530617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211473913.6A Pending CN115834432A (en) 2022-11-22 2022-11-22 Data link detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115834432A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116505972A (en) * 2023-06-27 2023-07-28 北京易桓科技有限公司 Intelligent detection method and system for cable signal transmission

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120047411A1 (en) * 2010-08-18 2012-02-23 King Tiger Technology (Canada) Inc. Determining data valid windows in a system and method for testing an integrated circuit device
CN103036667A (en) * 2012-11-30 2013-04-10 北京控制工程研究所 Self-adaption timing sequence calibrating method of high-speed serial communication interface
CN111225404A (en) * 2018-11-23 2020-06-02 华为技术有限公司 A kind of network quality monitoring method and device
CN112763888A (en) * 2019-11-04 2021-05-07 中兴通讯股份有限公司 Link detection method and device, electronic equipment and computer readable medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120047411A1 (en) * 2010-08-18 2012-02-23 King Tiger Technology (Canada) Inc. Determining data valid windows in a system and method for testing an integrated circuit device
CN103036667A (en) * 2012-11-30 2013-04-10 北京控制工程研究所 Self-adaption timing sequence calibrating method of high-speed serial communication interface
CN111225404A (en) * 2018-11-23 2020-06-02 华为技术有限公司 A kind of network quality monitoring method and device
CN112763888A (en) * 2019-11-04 2021-05-07 中兴通讯股份有限公司 Link detection method and device, electronic equipment and computer readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116505972A (en) * 2023-06-27 2023-07-28 北京易桓科技有限公司 Intelligent detection method and system for cable signal transmission
CN116505972B (en) * 2023-06-27 2023-09-01 北京易桓科技有限公司 Intelligent detection method and system for cable signal transmission

Similar Documents

Publication Publication Date Title
CN111314945B (en) Test method, system and terminal equipment
JP5266206B2 (en) Method for testing an embedded radio transceiver with minimal interaction between the radio transceiver and the host processor during testing
KR101001074B1 (en) Method for transferring data on the bus
CN110636536A (en) A frequency calibration method and device
CN115834432A (en) Data link detection method, device, equipment and storage medium
CN110248379A (en) The performance test methods and device of base station in WLAN
CN112463067A (en) Data protection method and equipment in NVMe-oF scene
CN116455789A (en) Method for detecting data packet loss, self-mobile device and storage medium
CN111757371B (en) Statistical method of transmission delay, server and storage medium
CN113535578B (en) CTS test method, CTS test device and CTS test equipment
CN111315026A (en) Channel selection method, device, gateway, and computer-readable storage medium
CN113177014A (en) Serial port communication method based on inspection mode and serial port chip
CN118626420A (en) Chip operating parameter calibration method and device, storage medium and electronic device
CN112241615A (en) Method and system for detecting data balance time sequence and electronic equipment
CN118035014A (en) System and method for verifying PSI5-S of vehicle-mounted chip based on UVM
KR101989340B1 (en) Data link layer test method and system of CAN communication
CN114513385A (en) Data transmission method and device, electronic equipment and storage medium
CN119171939B (en) Adaptive rate decoding method, system and device for power line host communication core
CN113037832A (en) Electric energy meter file checking method and system
CN117389813B (en) RDMA test method, RDMA test device, electronic equipment and computer storage medium
CN110519116A (en) Cyclic redundancy check code stores comparison module and exchanges device capabilities test macro
CN119575420B (en) Positioning method for active interference of navigation signal in complex field environment
CN118093491B (en) Serial port communication method, computer equipment and computer readable storage medium
CN115914028B (en) A network communication test method, device, equipment and readable storage medium
CN113347698B (en) Communication system, control method, and computer-readable medium storing control program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination