A method for improving data transmission quality, USB device and storage medium

The method improves USB device data transmission quality by dynamically optimizing hardware parameters based on error statistics, addressing the challenges of varying hardware environments and reducing costs.

CN115114217BActive Publication Date: 2025-01-03ZHEJIANG HUARAY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210495399.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2025-01-03
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

USB devices experience data packet loss and device disconnection during communication due to varying hardware environments, which affects data transmission quality and requires costly professional testing or manual adjustments that cannot adapt dynamically.

Method used

A method to improve data transmission quality by initializing hardware parameters, counting error statistics, optimizing parameters based on preset strategies, and updating the USB device with optimized settings to enhance communication quality without manual intervention or specialized equipment.

Benefits of technology

Adaptive parameter adjustment enhances data transmission quality by monitoring communication links, reducing costs, and providing a wide range of applicability without reliance on dedicated chips or professional testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114217B_ABST
    Figure CN115114217B_ABST
Patent Text Reader

Abstract

The present application discloses a method for improving data transmission quality, a USB device and a storage medium. The method is applied to a USB device supporting the USB3.0 protocol. The USB device is used to communicate with a receiving device through a communication link. The method includes: initializing the hardware parameters of the USB device to obtain the initial hardware parameters; counting the number of errors in the communication link to obtain the error statistics; in response to the error statistics satisfying the preset adjustment conditions, optimizing the initial hardware parameters based on the preset adjustment strategy set to obtain the optimized hardware parameters; updating the USB device using the optimized hardware parameters, and using the updated USB device to send the data to be transmitted to the receiving device through the communication link. Through the above-mentioned method, the present application can adaptively improve the data transmission quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method for improving data transmission quality, a USB device, and a storage medium. Background Art

[0002] Since the hardware environment of devices using Universal Serial Bus (USB) (i.e., USB devices) varies, including the types of USB devices, USB3.0 communication buses, and receiving devices, USB devices are prone to data packet loss or device disconnection during communication with receiving devices, which seriously affects the data transmission quality of USB devices. In order to improve the data transmission quality, the hardware circuit of the USB device can be adjusted, but this solution relies on professional testing equipment, and has high time and labor costs. Alternatively, manual experimental tests can be used to adjust the hardware parameters that affect the data transmission quality, but due to the hardware environment, dynamic adaptive adjustment cannot be achieved, which has strong limitations. Summary of the invention

[0003] The present application provides a method for improving data transmission quality, a USB device and a storage medium, which can adaptively improve data transmission quality.

[0004] To solve the above technical problems, the technical solution adopted in the present application is: to provide a method for improving data transmission quality, the method comprising: initializing the hardware parameters of a USB device to obtain initial hardware parameters; counting the number of errors occurring in a communication link to obtain error statistics; in response to the error statistics satisfying a preset adjustment condition, optimizing the initial hardware parameters based on a preset adjustment strategy set to obtain optimized hardware parameters; updating the USB device using the optimized hardware parameters, and using the updated USB device to send data to be transmitted to a receiving device via a communication link.

[0005] To solve the above technical problems, another technical solution adopted in the present application is: to provide a USB device, the USB device includes a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the method for improving data transmission quality in the above technical solution.

[0006] To solve the above technical problems, another technical solution adopted in the present application is: to provide a computer-readable storage medium for storing a computer program, which, when executed by a processor, is used to implement the method for improving data transmission quality in the above technical solution.

[0007] Through the above scheme, the beneficial effects of the present application are: first, the hardware parameters of the USB device are initialized to obtain initial hardware parameters; then, the error statistics are obtained by counting the number of errors occurring in the communication link, and then the data transmission quality of the communication link is judged according to the error statistics; when it is judged that the error statistics meet the preset adjustment conditions, that is, the data transmission quality of the communication link is poor, the initial hardware parameters can be optimized according to the preset adjustment strategy set to obtain optimized hardware parameters, so as to update the USB device using the optimized hardware parameters, thereby improving the communication quality between the USB device and the receiving device; the present application realizes communication quality monitoring according to the error statistics, thereby improving the data transmission quality of the communication link, does not require manual intervention, and does not rely on dedicated integrated circuit chips or professional detection equipment, has low cost and wide application range. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0009] Figure 1 It is a flowchart of an embodiment of a method for improving data transmission quality provided by the present application;

[0010] Figure 2 It is a flowchart of another embodiment of the method for improving data transmission quality provided by the present application;

[0011] Figure 3 It is a flowchart of an embodiment of a first preset adjustment strategy provided by the present application;

[0012] Figure 4 It is a flowchart of an embodiment of a second preset adjustment strategy provided by the present application;

[0013] Figure 5 It is a structural schematic diagram of an embodiment of a USB device provided by the present application;

[0014] Figure 6 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0015] The present application is further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present application, but are not intended to limit the scope of the present application. Similarly, the following examples are only some embodiments of the present application rather than all embodiments, and all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0016] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0017] It should be noted that the terms "first", "second" and "third" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0018] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a method for improving data transmission quality provided by the present application. The method is applied to a USB device supporting the USB 3.0 protocol. The USB device is used to communicate with a receiving device through a communication link. The method includes:

[0019] Step 11: Initialize the hardware parameters of the USB device to obtain initial hardware parameters.

[0020] The USB device may be a device that uses a USB interface to communicate with a receiving device through a USB protocol, and the USB device may be a USB camera or a USB scanner, etc. Specifically, the receiving device may be a device with a USB interface, which may be a USB acquisition card, etc. The USB device may establish a communication link with the receiving device through a USB3.0 communication bus to perform data transmission through the communication link.

[0021] Furthermore, the hardware parameters of the USB device may affect the data transmission quality of the USB device. The hardware parameters of the USB device supporting the USB3.0 protocol may include differential voltage swing, de-emphasis level or DC differential impedance, etc. The values ​​of the above hardware parameters may affect the communication quality between the USB device and the receiving device. The DC differential impedance is determined by the hardware characteristics of the USB3.0 communication bus, such as: the impedance of the communication bus or the impedance of the USB interface, etc., which is a fixed value. Therefore, this embodiment can improve the data transmission quality by adjusting the differential voltage swing and the de-emphasis level; specifically, the differential voltage swing and the de-emphasis level can be initialized first to obtain the initial hardware parameters, and then when the communication quality is detected to be poor, the differential voltage swing and the de-emphasis level can be adjusted to adapt to different hardware environments to the greatest extent and improve the data transmission quality; it can be understood that the initial hardware parameters can be customized by the user based on experience, or automatically configured according to the default parameter values, which are not limited here.

[0022] Step 12: Count the number of times errors occur in the communication link to obtain an error statistics value.

[0023] The number of times errors occur in the communication link is counted to obtain an error statistical value. Specifically, the USB device may include a USB3.0 control chip, and the USB3.0 control chip may include a register. The register in the USB3.0 control chip may count the number of times errors occur in the communication link to obtain an error statistical value; the error statistical value can reflect the data transmission quality of the communication link. The more error statistical values, the worse the data transmission quality of the communication link. The register can monitor the port status of the USB3.0 communication bus to determine whether an error occurs in the current communication link, thereby counting the number of errors when an error occurs.

[0024] Step 13: In response to the error statistics satisfying the preset adjustment condition, the initial hardware parameters are optimized based on the preset adjustment strategy set to obtain optimized hardware parameters.

[0025] Whether the preset adjustment conditions are met can be determined based on the error statistics. When the error statistics meet the preset adjustment conditions, it indicates that the data transmission quality of the communication link is poor. At this time, the data transmission quality of the communication link can be improved by optimizing the initial hardware parameters. Specifically, the initial hardware parameters can be optimized based on the preset adjustment strategy set to obtain optimized hardware parameters. The preset adjustment strategy set can be customized by the user.

[0026] It can be understood that during the process of optimizing the initial hardware parameters, the quality of the communication link can be monitored in real time. When the error statistics do not meet the preset adjustment conditions, that is, the data transmission quality of the communication link is good, it means that the hardware parameters are adjusted, thereby obtaining the final optimized hardware parameters.

[0027] Step 14: Update the USB device using the optimized hardware parameters, and use the updated USB device to send the data to be transmitted to the receiving device through the communication link.

[0028] After obtaining the optimized hardware parameters, the USB device is updated using the optimized hardware parameters, and the updated USB device is used to send the data to be transmitted to the receiving device through the communication link to improve the data transmission quality of the communication link; specifically, the hardware parameters can be updated by restarting the USB device. When an error occurs in the communication link, the port of the USB device can automatically enter the error recovery state (Recovery). After the USB device is restarted, the port state can be switched to the training state (Polling), so that the link training is re-performed using the optimized hardware parameters in the training state, and then the normal working state (U0) is entered to perform the data transmission task and improve the data transmission quality. It can be understood that the error recovery state, the training state and the normal working state are the states of the USB device in the related art, which will not be repeated here.

[0029] This embodiment monitors the communication quality through error statistics to determine whether the current communication quality is good. When the current communication quality is poor, a customized parameter adjustment strategy is used to optimize the initial hardware parameters of the USB device, and the optimized parameters are used to update the USB device to improve the data transmission quality of the communication link. No human intervention is required, and no reliance is required on dedicated integrated circuit chips or professional testing equipment. The cost is low and the application range is wide.

[0030] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of a method for improving data transmission quality provided by the present application, the method comprising:

[0031] Step 21: Initialize the hardware parameters of the USB device to obtain initial hardware parameters.

[0032] Step 21 is the same as step 11 in the above embodiment and will not be described again.

[0033] Step 22: Count the number of times errors occur in the communication link to obtain an error statistics value.

[0034] The register in the USB device can be used to count the number of times errors occur in the communication link to obtain error statistics. The situations in which errors occur in the communication link may include link error situations and physical error situations, and the error statistics may include link error statistics and physical error statistics. Specifically, an error that causes the port state of the USB device to switch to an error recovery state may be called a link error situation, and an error that does not cause the port state of the USB device to switch to an error recovery state may be called a physical error situation. Furthermore, the number of times errors occur in the communication link may be counted at intervals of a preset period to obtain link error statistics and physical error statistics, wherein the preset period may be customized according to actual conditions, and may be 1s or 10s, etc., which is not limited here.

[0035] In one embodiment, after obtaining the link error statistics and the physical error statistics, the frequency of occurrence of link errors and the frequency of occurrence of physical errors can be calculated respectively according to the link error statistics and the physical error statistics, so that the data transmission quality of the communication link can be judged by the frequency of occurrence of link errors and the frequency of occurrence of physical errors. The specific judgment method is shown in the following steps 23 to 25; in other embodiments, the size of the link error statistics and the physical error statistics can also be directly used to judge the data transmission quality of the communication link, which is not limited here.

[0036] Step 23: Calculate the frequency of link error occurrence based on the link error statistics to obtain a first error frequency.

[0037] The frequency of link error occurrence is calculated based on the link error statistics to obtain a first error frequency; specifically, the link error statistics can be divided by a preset period to obtain the first error frequency, that is, the frequency of link error occurrence.

[0038] Step 24: Calculate the frequency of occurrence of physical error situations based on the physical error statistics to obtain a second error frequency.

[0039] The frequency of occurrence of physical error situations is calculated based on the physical error statistics to obtain a second error frequency; specifically, the physical error statistics may be divided by a preset period to obtain the second error frequency, ie, the frequency of occurrence of physical error situations.

[0040] Step 25: Based on the first error frequency and the second error frequency, determine whether the error statistics value meets a preset adjustment condition.

[0041] Based on the first error frequency and the second error frequency, determine whether the error statistical value meets the preset adjustment condition; specifically, it can be determined whether the first error frequency is greater than the first preset threshold and / or whether the second error frequency is greater than the second preset threshold; if the first error frequency is greater than the first preset threshold and / or the second error frequency is greater than the second preset threshold, it is determined that the error statistical value meets the preset adjustment condition.

[0042] It can be understood that the first preset threshold is much smaller than the second preset threshold. In the actual test process, when an error occurs in the communication link, that is, when the communication quality is poor, the frequency of physical errors is much greater than the frequency of link errors. For example, the frequency of physical error statistics is thousands or tens of thousands of times per second, and the frequency of link errors may be only a few times per second. In this case, the first preset threshold can be set to 1, and the second preset threshold can be set to 1000. In other implementations, the specific values ​​of the first preset threshold and the second preset threshold can be set according to actual conditions and are not limited here.

[0043] Step 26: In response to the error statistics satisfying the preset adjustment condition, determining whether a strategy selection instruction is received.

[0044] When the error statistics meet the preset adjustment conditions, the initial hardware parameters can be optimized according to the preset adjustment strategy set to obtain optimized hardware parameters; specifically, the preset adjustment strategy set may include a first preset adjustment strategy and a second preset adjustment strategy, and the first preset adjustment strategy or the second preset adjustment strategy may be selected to optimize the initial hardware parameters through a strategy selection instruction input by the user. When the user does not make a strategy selection, that is, does not input a strategy selection instruction, the first preset strategy is used by default to optimize the initial hardware parameters; otherwise, the second preset strategy may be used to optimize the initial hardware parameters, wherein the specific contents of the first preset adjustment strategy and the second preset adjustment strategy may be customized by the user.

[0045] It can be understood that in other embodiments, the policy selection instruction may include a first policy selection instruction and a second policy selection instruction. When the user inputs the first policy selection instruction, the first preset adjustment strategy is used to optimize the initial hardware parameters; when the user inputs the second policy selection instruction, the second preset adjustment strategy is used to optimize the initial hardware parameters.

[0046] Step 27: If no strategy selection instruction is received, the first preset adjustment strategy is used to optimize the initial hardware parameters to obtain optimized hardware parameters.

[0047] When no strategy selection instruction is received, the first preset adjustment strategy is used to optimize the initial hardware parameters to obtain optimized hardware parameters, such as Figure 3As shown, the following describes the steps of optimizing the initial hardware parameters by using the first preset adjustment strategy to obtain the optimized hardware parameters.

[0048] Step 31: Determine the initial hardware parameters as current hardware parameters.

[0049] The current hardware parameters are the hardware parameters currently configured for the USB device to communicate with the receiving device. The hardware parameters of the USB device in this embodiment may include a differential voltage swing value and a de-emphasis level value. The hardware parameters of the USB device are initialized to obtain initial hardware parameters. The initial hardware parameters may include an initial differential voltage swing value and an initial de-emphasis level value.

[0050] Step 32: Adjust the current hardware parameters with the preset increments to obtain intermediate hardware parameters.

[0051] The current hardware parameters are adjusted with the preset increment to obtain the intermediate hardware parameters. The preset increment can be set by the user and is not limited here. The intermediate hardware parameters may include the intermediate differential voltage swing value and the intermediate de-emphasis level value. The preset increment may include the first preset increment and the second preset increment. The initial differential voltage swing value and the initial de-emphasis level value may be first determined as the current differential voltage swing value and the current de-emphasis level value respectively. Then, the current differential voltage swing value is adjusted with the first preset increment to obtain the intermediate differential voltage swing value. Then, the current de-emphasis level value is adjusted with the second preset increment to obtain the intermediate de-emphasis level value.

[0052] In a specific implementation, the differential voltage swing value and the de-emphasis level value correspond to their respective rated maximum values ​​and rated minimum values. In order to adjust the current differential voltage swing value, it can be first determined whether the current differential voltage swing value is less than the maximum differential voltage swing value (i.e., the rated maximum value of the differential voltage swing value); if the current differential voltage swing value is less than the maximum differential voltage swing value, the first preset increment is superimposed on the current differential voltage swing value to obtain an intermediate differential voltage swing value; if the current differential voltage swing value is greater than or equal to the maximum differential voltage swing value, the minimum differential voltage swing value (i.e., the rated minimum value of the differential voltage swing value) is used as the intermediate differential voltage swing value.

[0053] In order to adjust the current de-emphasis level value, it is possible to first determine whether the current de-emphasis level value is less than the maximum de-emphasis level value (i.e., the rated maximum value of the de-emphasis level value); if the current de-emphasis level value is less than the maximum de-emphasis level value, then the second preset value added is superimposed on the current de-emphasis level value to obtain an intermediate de-emphasis level value; if the current de-emphasis level value is greater than or equal to the maximum de-emphasis level value, then the minimum de-emphasis level value (i.e., the rated minimum value of the de-emphasis level value) is used as the intermediate de-emphasis level value.

[0054] Step 33: Restart the USB device to update the intermediate hardware parameters to the current hardware parameters of the USB device, so that the USB device communicates with the receiving device through the communication link based on the current hardware parameters.

[0055] After each parameter optimization, a restart operation is performed to update the intermediate hardware parameters to the current hardware parameters of the USB device, so that the USB device can communicate with the receiving device through the communication link according to the current hardware parameters; then the data transmission quality of the updated communication link is tested to determine whether the updated current hardware parameters can improve the data transmission quality.

[0056] Step 34: Count the number of times errors occur in the communication link to obtain an error statistical value.

[0057] Step 34 is the same as the above step 22 and will not be described again.

[0058] Step 35: Determine whether the error statistics value meets the preset adjustment condition.

[0059] Step 35 is the same as the above step 25 and will not be described again.

[0060] Step 36: If the error statistics do not meet the preset adjustment conditions, the current hardware parameters are determined as optimized hardware parameters.

[0061] When the error statistics value does not meet the preset adjustment conditions, it means that the current hardware parameters after this update can improve the data transmission quality. At this time, the current hardware parameters can be determined as optimized hardware parameters; if the error statistics value meets the preset adjustment conditions, it means that the current hardware parameters after this update still cannot improve the data transmission quality. At this time, return to the step of adjusting the current hardware parameters with the preset increment, and continue to adjust the current hardware parameters until the error statistics value does not meet the preset adjustment conditions, and the current hardware parameters are determined as optimized hardware parameters.

[0062] In a specific implementation manner, the initial differential voltage swing value and the initial de-emphasis level value may be first determined as the current differential voltage swing value and the current de-emphasis level value, respectively, and the value of the current de-emphasis level value may be fixed. The current differential voltage swing value may be adjusted. After searching for all differential voltage swing values ​​between the minimum differential voltage swing value and the maximum differential voltage swing value, if the error statistics value still does not meet the preset adjustment condition, the current de-emphasis level value may be adjusted again, and the second preset increment value may be superimposed on the current de-emphasis level value to obtain an intermediate de-emphasis level value, and the intermediate de-emphasis level value may be updated as the current de-emphasis level value; then, the process returns to the step of fixing the current de-emphasis level value and adjusting the current differential voltage swing value until the error statistics value does not meet the preset adjustment condition.

[0063] It can be understood that, considering that the differential voltage swing value has a greater impact on the communication quality of the communication link than the de-emphasis level value, the above-mentioned method of first fixing the de-emphasis level value and then adjusting the current differential voltage swing value can be adopted; in other implementations, the method of first fixing the current differential voltage swing value and then adjusting the current de-emphasis level value can also be adopted, which is not limited here.

[0064] Further, in order to adjust the current differential voltage swing value, the first preset increment may be superimposed on the current differential voltage swing value to obtain an intermediate differential voltage swing value; the USB device is restarted, and the intermediate differential voltage swing value is updated to the current differential voltage swing value of the USB device, so that the USB device communicates with the receiving device through the communication link based on the current differential voltage swing value and the current de-emphasis level value; the number of errors occurring in the communication link is counted to obtain an error statistical value; it is determined whether the error statistical value meets the preset adjustment condition; if the error statistical value meets the preset adjustment condition, the step of superimposing the first preset increment and the current differential voltage swing value is returned until the error statistical value does not meet the preset adjustment condition.

[0065] If the error statistics still meet the preset adjustment conditions, it is determined whether the current differential voltage swing value is the same as the initial differential voltage swing value; if the current differential voltage swing value is the same as the initial differential voltage swing value, it means that all differential voltage swing values ​​within the range of the maximum differential voltage swing value and the minimum differential voltage swing value have been traversed, then the second preset increment is superimposed on the current de-emphasis level value to obtain an intermediate de-emphasis level value, and then the process of superimposing the first preset increment on the current differential voltage swing value is returned until the error statistics do not meet the preset adjustment conditions.

[0066] For example, taking the maximum de-emphasis level value of 4.0db, the minimum de-emphasis level value of 3.0db, the initial de-emphasis level value of 3.5db, the second preset increment of 0.1db, the maximum differential voltage swing value of 1.2V, the minimum differential voltage swing value of 0.8V, the initial differential voltage swing value of 1V, and the first preset increment of 0.1V as an example, the above-mentioned first preset adjustment strategy is explained.

[0067] First, the current differential voltage swing value is set to 1V and the current de-emphasis level value is set to 3.5db, then the current de-emphasis level value is fixed to 3.5db, the current differential voltage swing value 1V is added to the first preset increment 0.1V, and the current differential voltage swing value is updated to 1.1V; then, until the current differential voltage swing value increases to the maximum differential voltage swing value of 1.2V, the current differential voltage swing value is updated to the minimum differential voltage swing value of 0.8V, and then the first preset increment 0.1V is added to the current differential voltage swing value of 0.8V The differential voltage swing value is added until the current differential voltage swing value returns to 1V, which is the same as the initial differential voltage swing value, indicating that under the premise of the current de-emphasis level value of 3.5db, all differential voltage swing values ​​have been traversed; and if the error statistics still meet the preset adjustment conditions at this time, the current de-emphasis level value of 3.5db is added to the second preset increment of 0.1db, the current de-emphasis level value is updated to 3.6db, and then the current de-emphasis level value is fixed, and the adjustment of the current differential voltage swing value is repeated until the error statistics do not meet the preset adjustment conditions, and the optimized hardware parameters are obtained.

[0068] Specifically, the scheme for adjusting the current differential voltage swing value may be shown in the following formula:

[0069]

[0070] Among them, V in the above formula n represents the current differential voltage swing value, V0 represents the initial differential voltage swing value, ΔV represents the first preset increment, n represents the number of adjustments, the value of n starts from 0, the step size is 1, 0.8 represents the minimum differential voltage swing value, 1.2 represents the maximum differential voltage swing value, the first occurrence of (V0+n*ΔV)>1.2 is called case 1, and the occurrence of (V0+(n-1)*ΔV)>1.2 is called case 2. Under the conditions of case 1 or case 2, if the calculated V n If V0 is greater than or equal to V0, the adjustment of the differential voltage swing value is completed.

[0071] It is understandable that the current differential voltage swing value may be fixed first, and then the current de-emphasis level value may be continuously adjusted to generate optimized hardware parameters. This solution is similar to the solution of first fixing the current de-emphasis level value and then continuously adjusting the current differential voltage swing value in the above embodiment, and will not be repeated here.

[0072] Step 28: If a strategy selection instruction is received, the second preset adjustment strategy is used to optimize the initial hardware parameters to obtain optimized hardware parameters.

[0073] Reference hardware parameters can be obtained and a parameter mapping table can be established based on the reference hardware parameters. The parameter mapping table can include at least one USB device model and the type of USB3.0 communication bus corresponding to the USB device model, the model of the receiving device, and the reference hardware parameters. The parameter mapping table can be stored in a non-volatile storage medium of the USB device, such as an Electrically Erasable Programmable read only memory (EEPROM) or a flash memory (FLASH), etc., to prevent data loss.

[0074] Further, the reference hardware parameters may be the optimized hardware parameters corresponding to different models of USB devices, different models of receiving devices or different types of USB3.0 communication buses obtained by previously adopting the first preset adjustment strategy, or the optimal hardware parameters corresponding to different models of USB devices, receiving devices or different types of USB3.0 communication buses obtained in advance through experimental tests, so that suitable optimized hardware parameters can be obtained according to the current hardware environment by matching in the parameter mapping table, wherein the hardware environment includes the model of the USB device and the type of the USB3.0 communication bus corresponding to the model of the USB device, and the model of the receiving device, such as Figure 4 As shown, the second preset adjustment strategy is described below.

[0075] Step 41: Select a reference hardware parameter from the parameter mapping table to obtain the current reference hardware parameter.

[0076] A reference hardware parameter is selected from the parameter mapping table to obtain the current reference hardware parameter; specifically, a reference hardware parameter can be selected from the parameter mapping table in sequence according to a preset order as the current reference hardware parameter until the parameter mapping table is traversed, and a suitable optimized reference parameter is selected from the current reference hardware parameter; in other implementations, the corresponding reference hardware parameter can be first filtered out from the parameter mapping table according to the model of the current USB device, the model of the receiving device or the type of the USB3.0 communication bus, and then the filtered reference hardware parameters are used as the current reference hardware parameters in sequence, and then the suitable optimized reference parameter is selected from the current reference hardware parameters.

[0077] Step 42: Update the current reference hardware parameters to the current hardware parameters of the USB device, and count the number of errors that occur in the communication link to obtain an error statistical value.

[0078] In order to verify the effect of the current reference hardware parameters on improving the data transmission quality of the communication link, the USB device can be restarted, the current reference hardware parameters can be updated to the current hardware parameters of the USB device, and the number of errors occurring in the communication link can be counted to obtain error statistics. The steps for obtaining the error statistics are the same as step 22 above and will not be repeated here.

[0079] Step 43: Determine whether the error statistics value meets the preset adjustment condition.

[0080] Step 43 is the same as the above step 25 and will not be described again.

[0081] Step 44: If the error statistics do not meet the preset adjustment conditions, the current hardware parameters are determined as optimized hardware parameters.

[0082] If the error statistics do not meet the preset adjustment conditions, it means that the current reference hardware parameters can improve the data transmission quality, and the current hardware parameters are used as optimized hardware parameters. If the error statistics meet the preset adjustment conditions, it means that the current reference hardware parameters cannot improve the data transmission quality, and then return to the step of selecting a reference hardware parameter from the parameter mapping table until the preset end condition is met to obtain the optimized hardware parameters, wherein the preset end condition is determined to be met when the error statistics do not meet the preset adjustment conditions or the parameter mapping table is traversed.

[0083] In one embodiment, when the parameter mapping table is traversed and the error statistics meet the preset adjustment conditions, that is, there are no hardware parameters suitable for the current hardware environment in the parameter mapping table, the step of optimizing the initial hardware parameters using the first preset adjustment strategy can be returned to obtain the optimized hardware parameters using the first preset adjustment strategy.

[0084] Step 29: Update the USB device using the optimized hardware parameters, and use the updated USB device to send the data to be transmitted to the receiving device through the communication link.

[0085] After the optimized hardware parameters are obtained using the first preset adjustment strategy or the second preset adjustment strategy, the USB device can be restarted to update the USB device using the optimized hardware parameters, and the updated USB device can be used to send the data to be transmitted to the receiving device through the communication link; it can be understood that when the hardware parameters of the USB device are updated, the receiving device can also automatically perform a restart operation at the same time, so that both the USB device and the receiving device enter a training state and jointly complete the update of the hardware parameters, thereby optimizing the communication link between the USB device and the receiving device.

[0086] This embodiment can adaptively adjust the hardware parameters of the USB device according to the error statistics, and select the current adjustment strategy from the preset adjustment strategy set according to the strategy selection instruction; the de-emphasis level value and the differential voltage swing value are traversed and debugged through the first preset adjustment strategy to obtain optimized hardware parameters, which can dynamically adapt to a variety of hardware environments, achieve high-quality data transmission under different hardware environments, improve data transmission quality, and have universal applicability; the second preset adjustment strategy is used to directly match through the parameter mapping table under different hardware environments to obtain optimized hardware parameters, which can achieve fast adaptive parameter matching and shorten the time spent on updating USB devices.

[0087] See also Figure 5 , Figure 5 It is a structural diagram of an embodiment of a USB device provided in the present application. The USB device 50 includes a memory 51 and a processor 52 connected to each other. The memory 51 is used to store a computer program. When the computer program is executed by the processor 52, it is used to implement the method for improving the data transmission quality in the above embodiment.

[0088] In one implementation, the memory 51 is further used to count the number of errors that occur in the communication link, obtain an error statistical value, and feed the error statistical value back to the processor 52, wherein the memory 51 may be a register.

[0089] See also Figure 6 , Figure 6 It is a structural diagram of an embodiment of a computer-readable storage medium provided in the present application. The computer-readable storage medium 60 is used to store a computer program 61. When the computer program 61 is executed by a processor, it is used to implement the method for improving the data transmission quality in the above embodiment.

[0090] The computer-readable storage medium 60 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other media that can store program codes.

[0091] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0093] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0094] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for improving data transmission quality, characterized in that: Applied to a USB device supporting the USB 3.0 protocol, the USB device is used to communicate with a receiving device via a communication link, and the method comprises: Initializing the hardware parameters of the USB device to obtain initial hardware parameters; Counting the number of times errors occur in the communication link to obtain an error statistical value; In response to the error statistics satisfying a preset adjustment condition, optimizing the initial hardware parameters based on a preset adjustment strategy set to obtain optimized hardware parameters; The USB device is updated using the optimized hardware parameters, and the updated USB device is used to send the data to be transmitted to the receiving device through the communication link; The step of optimizing the initial hardware parameters based on the preset adjustment strategy set to obtain optimized hardware parameters includes: In the process of optimizing the initial hardware parameters, the current hardware parameters of the USB device are updated, and statistical error values ​​of the communication link of the USB device to which the updated current hardware parameters are applied are counted, and when the statistical error values ​​of the communication link of the USB device to which the updated current hardware parameters are applied do not meet the preset adjustment conditions, the updated current hardware parameters are used as the optimized hardware parameters; Wherein, the hardware parameter includes a differential voltage swing value, the initial hardware parameter includes an initial differential voltage swing value, and the method further includes: Determining the initial differential voltage swing value as a current differential voltage swing value; Adding the first preset increment to the current differential voltage swing value to obtain an intermediate differential voltage swing value; The USB device is restarted to update the intermediate differential voltage swing value to a current differential voltage swing value of the USB device, so that the USB device communicates with the receiving device through the communication link based on the current differential voltage swing value.

2. The method for improving data transmission quality according to claim 1, characterized in that: The preset adjustment strategy set includes a first preset adjustment strategy and a second preset adjustment strategy. The step of optimizing the initial hardware parameters based on the preset adjustment strategy set to obtain optimized hardware parameters includes: Determine whether a strategy selection instruction is received; If not, the steps of determining the initial differential voltage swing value as the current differential voltage swing value; superimposing the first preset increment value with the current differential voltage swing value to obtain an intermediate differential voltage swing value; and restarting the USB device to update the intermediate differential voltage swing value to the current differential voltage swing value of the USB device, so that the USB device communicates with the receiving device through the communication link based on the current differential voltage swing value, are performed in sequence; If so, the second preset adjustment strategy is used to optimize the initial hardware parameters to obtain the optimized hardware parameters.

3. The method for improving data transmission quality according to claim 2, characterized in that: The step of restarting the USB device and updating the intermediate differential voltage swing value to the current differential voltage swing value of the USB device so that the USB device communicates with the receiving device through the communication link based on the current differential voltage swing value, then comprises: Counting the number of times errors occur in the communication link to obtain the error statistics value; Determining whether the error statistics value meets the preset adjustment condition; If so, the process returns to the step of superimposing the first preset increment value with the current differential voltage swing value until the error statistic value does not satisfy the preset adjustment condition.

4. The method for improving data transmission quality according to claim 3, characterized in that: The hardware parameters include a de-emphasis level value, the initial hardware parameters include an initial de-emphasis level value, The method further comprises: determining the initial de-emphasis level value as a current de-emphasis level value; The restarting the USB device and updating the intermediate differential voltage swing value to the current differential voltage swing value of the USB device so that the USB device communicates with the receiving device through the communication link based on the current differential voltage swing value comprises: restarting the USB device and updating the intermediate differential voltage swing value to the current differential voltage swing value of the USB device so that the USB device communicates with the receiving device through the communication link based on the current differential voltage swing value and the current de-emphasis level value.

5. The method for improving data transmission quality according to claim 4, characterized in that: The method further comprises: In response to the error statistics satisfying the preset adjustment condition, determining whether the current differential voltage swing value is less than a maximum differential voltage swing value; If yes, then superimposing the first preset increment and the current differential voltage swing value to obtain the intermediate differential voltage swing value; If not, the minimum differential voltage swing value is used as the intermediate differential voltage swing value.

6. The method for improving data transmission quality according to claim 5, characterized in that: The method further comprises: In response to the error statistics satisfying the preset adjustment condition, determining whether the current differential voltage swing value is the same as the initial differential voltage swing value; If so, the second preset increment is superimposed on the current de-emphasis level value to obtain an intermediate de-emphasis level value.

7. The method for improving data transmission quality according to claim 6, characterized in that: The step of superimposing the second preset increment value with the current de-emphasis level value to obtain the intermediate de-emphasis level value comprises: Determining whether the current de-emphasis level value is less than a maximum de-emphasis level value; If yes, then superimposing the second preset increment value and the current de-emphasis level value to obtain the intermediate de-emphasis level value; If not, the minimum de-emphasis level value is used as the intermediate de-emphasis level value.

8. The method for improving data transmission quality according to claim 2, characterized in that: The USB device is connected to the receiving device via a USB 3.0 communication bus, and the method further comprises: Acquire reference hardware parameters, and establish a parameter mapping table based on the reference hardware parameters, wherein the parameter mapping table includes at least one model of the USB device and the type of the USB3.0 communication bus corresponding to the model of the USB device, the model of the receiving device, and the reference hardware parameters; The second preset adjustment strategy includes: Selecting a reference hardware parameter from the parameter mapping table to obtain a current reference hardware parameter; Updating the current reference hardware parameters to the current hardware parameters of the USB device, and counting the number of errors occurring in the communication link to obtain the error statistics; Determining whether the error statistics value meets the preset adjustment condition; If so, return to the step of selecting a reference hardware parameter from the parameter mapping table until a preset end condition is met.

9. The method for improving data transmission quality according to claim 8, characterized in that: When the error statistics value does not satisfy the preset adjustment condition or the traversal of the parameter mapping table is completed, determining that the preset end condition is satisfied; When the parameter mapping table is traversed and the error statistics satisfy the preset adjustment condition, the first preset adjustment strategy is adopted to optimize the initial hardware parameters.

10. The method for improving data transmission quality according to claim 1, characterized in that: The communication link error situation includes a link error situation and a physical error situation, the error statistics include a link error statistics value and a physical error statistics value, and the method further includes: Calculate the frequency of occurrence of the link error situation based on the link error statistics to obtain a first error frequency; Calculate the frequency of occurrence of the physical error situation based on the physical error statistics to obtain a second error frequency; Based on the first error frequency and the second error frequency, it is determined whether the error statistic satisfies the preset adjustment condition.

11. The method for improving data transmission quality according to claim 10, characterized in that: The step of judging whether the error statistic meets the preset adjustment condition based on the first error frequency and the second error frequency includes: Determining whether the first error frequency is greater than a first preset threshold and / or whether the second error frequency is greater than a second preset threshold; If so, it is determined that the error statistics value satisfies the preset adjustment condition.

12. The method for improving data transmission quality according to claim 10, characterized in that: The method further comprises: Counting the number of times errors occur in the communication link at preset intervals to obtain the link error statistics and the physical error statistics; Dividing the link error statistic by the preset period to obtain the first error frequency; The physical error statistic is divided by the preset period to obtain the second error frequency.

13. A USB device, characterized in that: The invention comprises a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the method for improving data transmission quality according to any one of claims 1 to 12.

14. The USB device according to claim 13, characterized in that: The memory is also used to count the number of times errors occur in the communication link to obtain an error statistical value, and feed the error statistical value back to the processor.

15. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the method for improving data transmission quality according to any one of claims 1 to 12.