USB Flash Drive Hot Plugging Protection Adaptive Current Regulation System
Through the USB disk hot-swap protection adaptive current control system, the current and voltage are monitored in real time, and the current and reverse current are dynamically adjusted, which solves the problems of increasing resistance and heat accumulation caused by wear of the USB disk connector, extends the service life of the USB disk and prevents current surges, achieving more reliable data transmission.
Patent Information
- Application Number
- CN202510480024.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-04-17
AI Technical Summary
During the use of the USB flash drive, as the number of times is used, the connector position will wear and increase resistance, which will accelerate heat oxidation, affect the dynamic recognition mechanism driven by the operating system, and shorten the service life of the USB flash drive.
The U disk hot-swap protection adaptive current control system is adopted. The detection module monitors the current and voltage in real time. The analysis module calculates the wear coefficient based on historical usage data and the slope of the current curve, dynamically adjusts the maximum current, and calculates the release value of the reverse current based on the resistance change rate and capacitance charge, to avoid heat accumulation and current surge caused by excessive current or rapid increase in resistance.
Extend the service life of the USB disk, avoid accelerated aging of the interface, protect the USB disk from excessive current or instantaneous current surge, and ensure the integrity and safety of data transmission.
Smart Images

Figure CN119994816B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of USB flash drives, and particularly to a hot plug protection adaptive current regulation system for USB flash drives. Background Art
[0002] The hot plugging ability of Universal Serial Bus (USB) storage devices (such as USB flash drives) is a key feature of modern computer systems, allowing users to freely plug and unplug devices without turning off the host power or restarting the system.
[0003] In the prior art, the implementation of hot plugging relies on the electrical isolation design at the hardware level and the dynamic recognition mechanism of the operating system driver. However, during the use of a USB flash drive, as the number of uses increases, the connector position will wear, resulting in an increase in resistance, which will cause the connector position to generate heat and accelerate oxidation, thus affecting the dynamic recognition mechanism of the operating system driver, and leading to a short service life of the USB flash drive. Summary of the Invention
[0004] The purpose of the present invention is to provide a hot plug protection adaptive current regulation system for USB flash drives to solve the problem that during the use of a USB flash drive in the prior art, as the number of uses increases, the connector position will wear, resulting in an increase in resistance, which will cause the connector position to generate heat and accelerate oxidation, thus affecting the dynamic recognition mechanism of the operating system driver, and leading to a short service life of the USB flash drive.
[0005] The present invention provides a hot plug protection adaptive current regulation system for USB flash drives, including:
[0006] A USB flash drive configured with a hot plug protection unit;
[0007] A detection module connected to the USB flash drive for real-time detecting the current and voltage during the operation of the USB flash drive;
[0008] An analysis module connected to the detection module and the USB flash drive, configured with an analysis unit and a storage unit, wherein:
[0009] The storage unit is used for storing the historical usage data of the USB flash drive, including: USB flash drive information and its corresponding historical connection times, contact resistance, and threshold criteria for determination;
[0010] The analysis unit is used for comparing the slope of the current curve with the slope threshold when the USB flash drive is just plugged in. In response to the slope being less than the slope threshold, the maximum current is corrected according to the wear coefficient; wherein: the wear coefficient is determined according to the historical connection times, the slope, and the contact resistance;
[0011] During data transmission, calculate the overall resistance change rate and compare it with the change rate threshold. In response to the overall resistance change rate being greater than the change rate threshold, determine the maximum value of the reverse current based on the overall resistance change rate, the maximum current that the USB flash drive can withstand, and the charge quantity of the USB flash drive capacitor.
[0012] As an optimal technical solution of the USB flash drive hot plug protection adaptive current regulation system, the wear coefficient is positively correlated with the historical connection times and the contact resistance, and negatively correlated with the slope.
[0013] As an optimal technical solution of the USB flash drive hot plug protection adaptive current regulation system, compare the slope of the current curve with the slope threshold to determine that the contact resistance meets the standard. In response to the slope being less than the slope threshold, correct the maximum current according to the wear coefficient, and the value of the corrected maximum current is negatively correlated with the wear coefficient;
[0014] Or, in response to the slope being greater than or equal to the slope threshold, determine that the contact resistance meets the standard.
[0015] As an optimal technical solution of the USB flash drive hot plug protection adaptive current regulation system, in response to correcting the maximum current according to the wear coefficient, pause data transmission and wait until all cached data is stored in the USB flash drive storage medium, then correct the maximum current and resume data transmission.
[0016] As an optimal technical solution of the USB flash drive hot plug protection adaptive current regulation system, calculate the overall resistance change rate and compare it with the change rate threshold, and determine the reason for the increase in the overall resistance according to the comparison result, including:
[0017] In response to the overall resistance change rate being greater than the change rate threshold, determine that the reason for the increase in the overall resistance is that the contact resistance increases due to the USB flash drive being unplugged;
[0018] In response to the overall resistance change rate being less than or equal to the change rate threshold, determine that the reason for the increase in the overall resistance is that the overall resistance increases due to the temperature rise.
[0019] As an optimal technical solution of the USB flash drive hot plug protection adaptive current regulation system, in response to the reason for the increase in the overall resistance being that the contact resistance increases due to the USB flash drive being unplugged, determine the release time of the USB flash drive reverse current according to the overall resistance change rate, including:
[0020] Obtain the overall resistance change rate;
[0021] Determine the complete detachment time of the USB flash drive according to the overall resistance change rate;
[0022] Determine the release time of the reverse current according to the complete detachment time;
[0023] Calculate the value of the reverse current according to the charge quantity of the U disk capacitor and the release time.
[0024] As a preferred technical solution of the U disk hot plug - and - play protection adaptive current regulation system, the maximum current is corrected and data transmission is restarted. The storage unit stores the configuration information of the U disk and the corrected current, and the corrected current is directly used for data transmission when the U disk is inserted next time.
[0025] As a preferred technical solution of the U disk hot plug - and - play protection adaptive current regulation system, determine the complete detachment time of the U disk according to the overall resistance change rate, and obtain it by establishing a calibration database through a limited number of plug - and - unplug experiments or establishing a mathematical model.
[0026] As a preferred technical solution of the U disk hot plug - and - play protection adaptive current regulation system, in response to the absence of historical data corresponding to the U disk in the analysis module, read the VID / PID and create an independent configuration file, obtain relevant data of the same type of U disk, initialize the current parameters based on the bMaxPower field and preset safety rules, and enter the learning mode in the first N connections to calibrate the threshold.
[0027] As a preferred technical solution of the U disk hot plug - and - play protection adaptive current regulation system, the complete detachment time is: the time length between when the U disk starts to be pulled out and when the contact area decreases to a level where electrical conduction cannot be maintained.
[0028] Compared with the prior art, the beneficial effects of the present invention are as follows. On the one hand, at the moment when the U disk is connected, the slope of the current curve is compared with a preset slope threshold. When the slope is lower than the threshold, calculate the wear coefficient according to the historical connection times, contact resistance, and slope, and dynamically adjust the allowed maximum working current, so as to ensure that when the U disk interface is worn, the temperature of the U disk interface will not rise rapidly due to excessive current, avoiding the accelerated aging of the U disk interface and thus prolonging the service life of the U disk. On the other hand, during data transmission, if the overall change rate exceeds the change rate threshold, it indicates that the current resistance change has exceeded the range that can be affected by the wear of the U disk interface or the increase in resistance due to the temperature rise of the U disk. It is determined that the U disk is in a state of being gradually pulled out. By combining the charge quantity of the U disk capacitor and the maximum withstand current, calculate the release value of the reverse current, so that the residual charge of the capacitor during disk removal is quickly discharged through the controllable switch circuit, avoiding the damage to the U disk caused by the reverse current surge generated at the moment when the U disk is pulled out, and thus further prolonging the service life of the U disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a structural block diagram of the U disk hot plug - and - play protection adaptive current regulation system in an embodiment of the present invention;
[0030] Figure 2 The flowchart shows the steps of the embodiment of the present invention for determining the release time of the reverse current of the USB flash drive according to the overall resistance change rate. Detailed implementation manners
[0031] The features of various aspects and exemplary embodiments of the present application will be described in detail below. To make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application and not to limit the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only intended to provide a better understanding of the present application by showing examples of the present application.
[0032] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0033] Please refer to Figure 1 as shown, which is a structural block diagram of the hot plug protection adaptive current regulation system of the USB flash drive according to the embodiment of the present invention, including:
[0034] A USB flash drive configured with a hot plug protection unit;
[0035] A detection module connected to the USB flash drive for real-time detection of the current and voltage of the USB flash drive during operation;
[0036] An analysis module connected to the detection module and the USB flash drive, configured with an analysis unit and a storage unit, wherein:
[0037] The storage unit is used to store the historical usage data of the USB flash drive, including: USB flash drive information and its corresponding historical connection times, contact resistance, and threshold criteria for determination;
[0038] The analysis unit is used to compare the slope of the current curve with a slope threshold when the USB flash drive is just plugged in. In response to the slope being less than the slope threshold, the maximum current is corrected according to the wear coefficient; where: the wear coefficient is determined according to the historical connection times, the slope, and the contact resistance;
[0039] During data transmission, calculate the overall resistance change rate and compare it with a change rate threshold. In response to the overall resistance change rate being greater than the change rate threshold, determine the maximum value of the reverse current according to the overall resistance change rate, the maximum current that the USB flash drive can withstand, and the charge quantity of the USB flash drive capacitor.
[0040] Furthermore, the current curve is: a curve about the current value plotted in a coordinate system with the ordinate being current and the abscissa being time.
[0041] In implementation, the detection module real-time collects the current and voltage signals when the USB flash drive is working through a high-precision analog-to-digital converter, and the sampling frequency is not less than 1 kHz; the storage unit uses a non-volatile memory to record the information of the USB flash drive. Each USB flash drive information corresponds to the historical connection times, the contact resistance, and the threshold standard for determination. Different USB flash drives have different values of the determination standard.
[0042] Specifically, on the one hand, at the moment when the USB flash drive is plugged in, the analysis unit real-time calculates the slope of the current curve (the current change amount per unit time) through a microprocessor, and compares it with a preset slope threshold. If the slope is lower than the threshold, calculate the wear coefficient according to the historical connection times, the contact resistance, and the slope, and dynamically adjust the allowed maximum working current, so as to ensure that when the USB flash drive interface is worn, it will not cause rapid heat accumulation at the interface in a short time due to the too fast rising speed of the current, thus avoiding the accelerated aging of the USB flash drive interface and prolonging the service life of the USB flash drive. On the other hand, during data transmission, the analysis unit continuously calculates the overall resistance change rate (ΔR / R). If the overall change rate exceeds the change rate threshold, it indicates that the degree of resistance change at this time has exceeded the degree of resistance change during normal use (such as the resistance increase caused by the wear of the USB flash drive interface, or the resistance increase caused by the temperature rise of the USB flash drive), and it is determined that the USB flash drive is in the state of being gradually pulled out. By combining the charge quantity of the USB flash drive capacitor and the maximum withstand current, calculate the release value of the reverse current, so that the residual charge of the capacitor during unplugging is quickly discharged through a controllable switch circuit, avoiding the damage to the USB flash drive caused by the reverse current surge generated at the moment when the USB flash drive is unplugged, and further prolonging the service life of the USB flash drive.
[0043] Specifically, the wear coefficient is directly proportional to the historical connection times and the contact resistance, and inversely proportional to the slope.
[0044] In implementation, set the wear coefficient , where: C is the number of historical connections, R is the value of the contact resistance after maximum-minimum normalization, and S is the value of the slope of the current curve after maximum-minimum normalization. Among them, S + 0.1 is to avoid division by zero error in the calculation caused by the denominator being zero; the contact resistance can be calculated by measuring the voltage and current at both ends of the USB flash drive interface and using Ohm's law. The calculation process belongs to the prior art and will not be elaborated here.
[0045] Furthermore, after the contact resistance and the slope of the current curve are normalized, they have no units, and the number of connections also has a unit. Therefore, the wear coefficient can be used as a dimension to evaluate the degree of wear. By calculating the wear coefficient, the wear condition of the USB flash drive connector can be quantified. It can be understood that the greater the wear of the USB flash drive connector, the smaller the contact area, the greater the resistance. At this time, more heat will be generated by the original current, resulting in accelerated aging of the USB flash drive connector. Calculating the wear coefficient provides a basis for subsequent current adjustment, thereby further extending the service life of the USB flash drive.
[0046] Specifically, compare the slope of the current curve with the slope threshold to determine whether the contact resistance meets the standard. In response to the slope being less than the slope threshold, correct the maximum current according to the wear coefficient, and the value of the corrected maximum current is negatively correlated with the wear coefficient;
[0047] Or, in response to the slope being greater than or equal to the slope threshold, determine that the contact resistance meets the standard.
[0048] In implementation, the slope of the current curve should be preferably controlled between 0.5 A / ms and 1 A / ms, and preferably, the value of the slope threshold is 0.7 A / ms.
[0049] Specifically, correct the maximum current according to the wear coefficient, and the value of the corrected maximum current is negatively correlated with the wear coefficient. The embodiment of the present invention provides a method for correcting the maximum current, including:
[0050] If the wear coefficient is greater than the preset wear coefficient, use the first correction coefficient to correct the maximum current to the corresponding value;
[0051] If the wear coefficient is less than or equal to the preset wear coefficient, use the second correction coefficient to correct the maximum current to the corresponding value;
[0052] In implementation, the value standard of the preset wear coefficient is: the wear coefficient corresponding to the case where the oxidation rate of the connector meets the standard at the operating temperature of the USB flash drive in the normal operating state; preferably, the value of the preset wear coefficient is 400. Except for some high-performance USB flash drives, the operating current of ordinary USB flash drives is generally between 50 mA and 100 mA. In the embodiment of the present invention, the value of the maximum current is 80 mA, then the value range of the correction coefficient is between 0.625 and 1. The values of the first correction coefficient and the second correction coefficient also need to meet the premise that the corrected maximum current value is negatively correlated with the wear coefficient. Preferably, the first correction coefficient is 0.7 and the second correction coefficient is 0.8.
[0053] Specifically, the present invention adjusts the maximum current through the wear coefficient, so as to ensure that while ensuring data transmission, no excessive heat is generated when the maximum current flows through the USB flash drive interface, thereby protecting the USB flash drive connector and further extending the service life of the USB flash drive.
[0054] In detail, in response to correcting the maximum current according to the wear coefficient, suspend data transmission and wait until all cached data is stored in the USB flash drive storage medium, then correct the maximum current and restart data transmission.
[0055] Specifically, when the current correction is triggered, the microprocessor sends a pause instruction to the USB controller, waits for the cached data to be written into the USB flash drive storage chip, then adjusts the maximum current value of the current limiting circuit through a digital-to-analog converter (DAC), and then resumes data transmission, which can ensure that the current is reduced after all cached data is completely written, thereby avoiding data loss caused by a sudden drop in current during storage and protecting the interface circuit, and further extending the service life of the USB flash drive.
[0056] Specifically, calculate the overall resistance change rate and compare it with the change rate threshold, and determine the reason for the increase in the overall resistance according to the comparison result, including:
[0057] In response to the overall resistance change rate being greater than the change rate threshold, it is determined that the reason for the increase in the overall resistance is that the USB flash drive is unplugged, resulting in an increase in the contact resistance;
[0058] In response to the overall resistance change rate being less than or equal to the change rate threshold, it is determined that the reason for the increase in the overall resistance is that the overall resistance increases due to temperature rise.
[0059] Specifically, during the operation of a USB flash drive, the resistance will slightly increase due to heat generation. The selection of the change rate threshold can be measured through a limited number of experiments or directly calculated based on physical principles. For example, according to electrical principles and the physical structure of the USB flash drive, a theoretical model of the resistance change of the USB flash drive during the plugging and unplugging process and temperature change is established, and the change of the resistance is calculated according to the temperature coefficient formula of the resistance. The maximum value of the resistance increase caused by temperature change is preferably selected. In practical applications, the change rate of the resistance caused by material and temperature fluctuations is usually between 10% and 15%. Preferably, the selection standard of the change rate threshold is 13%.
[0060] Specifically, during the physical unplugging process of the USB flash drive, the contact area at the USB flash drive connector rapidly decreases, resulting in a rapid increase in the contact resistance, and further causing a rapid increase in the overall resistance. The speed of this resistance increase is much greater than the speed of the resistance increase caused by heat generation during the storage process of the USB flash drive. Based on this principle, the present invention determines the cause of the resistance increase by calculating the overall resistance change rate and comparing it with the change rate threshold. When the determination result is that the USB flash drive is in the unplugging process, the USB flash drive circuit is protected by restricting the reverse current in the subsequent process, thereby further extending the service life of the USB flash drive.
[0061] Specifically, in response to the reason for the increase in the overall resistance being that the contact resistance increases due to the USB flash drive being unplugged, please refer to Figure 2 As shown, it is a flowchart of the steps for the embodiment of the present invention to determine the release time of the reverse current of the USB flash drive according to the overall resistance change rate, including:
[0062] Step S1, obtain the overall resistance change rate;
[0063] Step S2, determine the complete detachment time of the USB flash drive according to the overall resistance change rate;
[0064] Step S3, determine the release time of the reverse current according to the complete detachment time;
[0065] Step S4, calculate the value of the reverse current according to the charge quantity of the USB flash drive capacitor and the release time.
[0066] It can be understood that the complete detachment time of the USB flash drive is proportional to the unplugging speed. During the unplugging process, the USB flash drive is gradually unplugged, the contact area gradually decreases, and the resistance of the contact part gradually increases. Therefore, the unplugging speed is also proportional to the overall resistance change rate. Therefore, the complete detachment time of the USB flash drive can be obtained by establishing a pre-established calibration database or establishing a mathematical model. The analysis unit inputs the value of the current overall resistance change rate to obtain the corresponding complete detachment time of the USB flash drive. The establishment processes of the modeling or calibration database are all prior arts and will not be elaborated here.
[0067] In the above technical solution, it can be understood that the release time of the reverse current is less than or equal to the complete detachment time, so as to ensure that the current can be completely exported before the USB flash drive is completely detached. Preferably, the release time of the reverse current is 60% of the complete detachment time. On the premise that the charge amount of the reverse current and the release time of the reverse current are both determined, the value of the reverse current can be calculated according to the formula: charge amount = current × time.
[0068] Specifically, in response to the absence of historical data corresponding to the USB flash drive in the analysis module, the VID / PID is read and an independent configuration file is created, the relevant data of the same type of USB flash drive is obtained, and the current parameters are initialized based on the bMaxPower field and the preset safety rules. Preferably, the initialized current parameter is set to 80% of bMaxPower. The data generated in the first N connections is input into the learning model to calibrate the corresponding threshold standard. The use of the learning model and the training of data are both prior arts and will not be elaborated here. Preferably, the value of N is 5.
[0069] Furthermore, the complete detachment time is: the time length between when the USB flash drive starts to be pulled out and when the contact area decreases to a level where electrical conduction cannot be maintained.
[0070] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, rather than limitations on the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or variations can be made based on the above description. It is not necessary and impossible to enumerate all the implementation manners here. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. The hot-plug protection and adaptive current regulation system for USB flash drives is characterized in that Including: A USB flash drive configured with a hot plug protection unit; A detection module connected to the USB flash drive for real-time detection of the current and voltage during the operation of the USB flash drive; An analysis module connected to the detection module and the USB flash drive, configured with an analysis unit and a storage unit, where: The storage unit is used to store the historical usage data of the USB flash drive, including: USB flash drive information and its corresponding historical connection times, contact resistance, and threshold criteria for determination; The analysis unit is used to compare the slope of the current curve with the slope threshold when the USB flash drive is just connected. In response to the slope being less than the slope threshold, the maximum current is corrected according to the wear coefficient; where: the wear coefficient is determined according to the historical connection times, the slope, and the contact resistance; During data transmission, calculate the overall resistance change rate and compare it with the change rate threshold. In response to the overall resistance change rate being greater than the change rate threshold, determine the maximum value of the reverse current according to the overall resistance change rate, the maximum current that the USB flash drive can withstand, and the charge quantity of the USB flash drive capacitor; The wear coefficient is positively correlated with the historical connection times and the contact resistance, and negatively correlated with the slope; Compare the slope of the current curve with the slope threshold, determine that the contact resistance meets the standard. In response to the slope being less than the slope threshold, correct the maximum current according to the wear coefficient, and the value of the corrected maximum current is negatively correlated with the wear coefficient; Or, in response to the slope being greater than or equal to the slope threshold, determine that the contact resistance meets the standard; In response to correcting the maximum current according to the wear coefficient, suspend data transmission and wait until all buffered data is stored in the USB flash drive storage medium, then correct the maximum current and restart data transmission.
2. The hot-pluggable protection adaptive current regulation system for USB flash drive according to claim 1, wherein Calculate the overall resistance change rate and compare it with the change rate threshold, and determine the reason for the increase in the overall resistance according to the comparison result, including: In response to the overall resistance change rate being greater than the change rate threshold, determine that the reason for the increase in the overall resistance is that the contact resistance increases due to the USB flash drive being pulled out; In response to the overall resistance change rate being less than or equal to the change rate threshold, determine that the reason for the increase in the overall resistance is that the overall resistance increases due to temperature rise.
3. The hot-pluggable protection adaptive current regulation system for USB flash drive according to claim 2, characterized in that, In response to the reason for the increase in the overall resistance being that the contact resistance increases due to the USB flash drive being pulled out, determine the release time of the reverse current of the USB flash drive according to the overall resistance change rate, including: Obtain the overall resistance change rate; Determine the complete detachment time of the USB flash drive according to the overall resistance change rate; Determine the release time of the reverse current according to the complete detachment time; Calculate the value of the reverse current according to the charge quantity of the USB flash drive capacitor and the release time.
4. The hot-pluggable protection adaptive current regulation system for USB flash drive according to claim 1, wherein Correct the maximum current and restart data transmission. The storage unit stores the configuration information of the USB flash drive and the corrected current, and directly uses the corrected current for data transmission when the USB flash drive is inserted next time.
5. The hot-pluggable protection adaptive current regulation system for USB flash drive according to claim 3, characterized in that Determine the complete detachment time of the USB flash drive according to the overall resistance change rate, and obtain it by establishing a calibration database or establishing a mathematical model through a limited number of plug-and-play experiments.
6. The hot-pluggable protection adaptive current regulation system for USB flash drive according to claim 3, wherein The complete detachment time is: the time length between when the USB flash drive starts to be unplugged and when the contact area decreases to a level where electrical conduction cannot be maintained.
7. The hot-pluggable protection adaptive current regulation system for USB flash drive according to claim 1, wherein In response to the absence of historical data corresponding to the USB flash drive in the analysis module, read the VID / PID and create an independent configuration file, obtain relevant data of the same type of USB flash drive, initialize the current parameters based on the bMaxPower field and the preset safety rules, and enter the learning mode in the first N connections to calibrate the corresponding threshold standards.
Citation Information
Patent Citations
PLC controller function module with hot plug function
CN118760049A
Current value obtaining method and device, and non-volatile readable storage medium
WO2023134315A1