Capacitance detection method, device and equipment, program product and readable storage medium

By sampling voltage during the capacitor discharge process and determining the slope of the linear discharge model using a linear regression method, the problem of poor accuracy of capacitance value detection in the prior art is solved, and a higher accuracy of capacitance value detection is achieved.

CN119986153APending Publication Date: 2025-05-13SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510199429.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

There is a lack of a mature capacitance detection method in the prior art, resulting in poor accuracy of capacitance detection.

Method used

During the process of discharge of the capacitor to be measured from the rated voltage through the constant current load, several voltage samples are performed to obtain the sampled voltage value and its sampling time. Based on these data, the slope of the capacitor linear discharge model is determined by a linear regression method, and the current capacitance value of the capacitor to be measured is calculated.

Benefits of technology

The capacitance value detection accuracy of the capacitor is improved, and the current capacitance value of the capacitor to be tested can be obtained more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119986153A_ABST
    Figure CN119986153A_ABST
Patent Text Reader

Abstract

The invention discloses a capacitor detection method, device and equipment, a program product and a readable storage medium, belongs to the field of capacitor detection, is used for detecting the capacitance value of a capacitor, and solves the problem that the accuracy of capacitor capacitance value detection is poor. According to the method, voltage sampling is carried out for several times in the process that a capacitor to be measured discharges through a constant current load from rated voltage, sampling voltage values and sampling time are obtained, then the slope of a capacitor linear discharge model is determined through a linear regression method based on the sampling voltage values and the sampling time, and finally the capacitor linear discharge model is calculated based on the slope. Through the capacitance expression about the slope, the current capacitance of the to-be-detected capacitor is determined, the accurate current capacitance of the to-be-detected capacitor can be obtained through the slope of the capacitor linear discharge model, and the capacitance detection precision of the capacitor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of capacitance detection, and in particular to a capacitance detection method, device, equipment, program product and readable storage medium. Background Art

[0002] Capacitors can store electrical energy, and the capacitance (electrical energy storage capacity) of a capacitor will decrease with the increase of usage time. Many scenarios are sensitive to the capacitance of the capacitor, so there is a need to detect the capacitance of the capacitor. However, the related technology lacks a mature capacitance detection method, resulting in poor accuracy of capacitance detection.

[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention

[0004] The purpose of the present invention is to provide a capacitance detection method, device, equipment, program product and readable storage medium. In the process of discharging the capacitor to be tested from the rated voltage through a constant current load, several voltage samplings are performed to obtain the sampled voltage value and its sampling time, and then based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a linear regression method. Finally, based on the slope, the current capacitance of the capacitor to be tested is determined through a capacitance expression related to the slope. The slope of the capacitor linear discharge model can be used to obtain the accurate current capacitance of the capacitor to be tested, thereby improving the capacitance detection accuracy of the capacitor.

[0005] In order to solve the above technical problems, the present invention provides a capacitance detection method, comprising:

[0006] When the capacitor to be tested is discharged from the rated voltage through the constant current load, voltage sampling is performed several times to obtain the sampled voltage value and its sampling time;

[0007] Based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a linear regression method;

[0008] Based on the slope, the current capacitance of the capacitor to be measured is determined by a capacitance expression related to the slope.

[0009] On the other hand, based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a linear regression method, including:

[0010] Based on each sampled voltage value and its sampling time, the slope and constant value of the capacitor linear discharge model are determined by a linear regression method;

[0011] Among them, the capacitor linear discharge model includes V=kt+b, V is the voltage value of the capacitor, k is the slope, t is the time, and b is the constant value;

[0012] The capacitance detection method further includes:

[0013] The current equivalent resistance of the capacitor to be measured is determined according to a capacitor linear discharge model with known slope and constant values, a discharge start time, a rated voltage of the capacitor to be measured, and an expression for equivalent resistance of the capacitor.

[0014] On the other hand, according to the capacitor linear discharge model with known slope and constant value, discharge start time, rated voltage of the capacitor to be measured and capacitor equivalent resistance expression, the current equivalent resistance of the capacitor to be measured is determined to include:

[0015] The voltage corresponding to the discharge start time in the capacitor linear discharge model with known slope and constant value is taken as the first voltage;

[0016] Based on the rated voltage of the capacitor to be measured, the first voltage and the current value of the constant current load, the current equivalent resistance of the capacitor to be measured is determined by using a capacitor equivalent resistance expression.

[0017] On the other hand, the capacitance equivalent resistance expression includes:

[0018] ESR = (V[A] - V[B]) / I;

[0019] Where ESR is the equivalent resistance, V[A] is the rated voltage, V[B] is the voltage value of the capacitor after a sudden drop in discharge, and I is the discharge current.

[0020] On the other hand, based on each sampled voltage value and its sampling time, the slope and constant value of the capacitor linear discharge model are determined by linear regression method, including:

[0021] Based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a preset slope expression about the sampled voltage and its sampling time;

[0022] Based on each sampled voltage value and its sampling time, a constant value of a capacitor linear discharge model is determined by a preset constant value expression about the sampled voltage and its sampling time;

[0023] Wherein, the slope expression and the constant value expression are both: expressions determined in advance by a linear regression method.

[0024] On the other hand, the process of determining the slope expression and the constant value expression includes:

[0025] Determine a target loss function for fitting a capacitor linear discharge model by sampling voltage values ​​and sampling times;

[0026] The slope and the constant value that minimize the function value of the target loss function in the capacitor linear discharge model are determined.

[0027] On the other hand, the objective loss function includes:

[0028] ;

[0029] ;

[0030] in, is the target loss function, t i is the sampling time of the i-th sampled voltage value, t i The corresponding predicted voltage value, V i is the i-th sampled voltage value, i is the voltage sampling order, N is the total number of samplings, k is the slope, and b is a constant value.

[0031] On the other hand, after determining the equivalent resistance of the capacitor to be measured according to the capacitor linear discharge model with known slope and constant value, the discharge start time, the rated voltage of the capacitor to be measured and the capacitor equivalent resistance expression, the capacitor detection method further includes:

[0032] Add one to the current number of cycles and determine whether the current number of cycles reaches a preset number of cycles, wherein the initial value of the current number of cycles is zero;

[0033] If not, the step of performing voltage sampling several times to obtain the sampled voltage value and its sampling time is performed during the process of discharging the capacitor to be tested from the rated voltage through the constant current load;

[0034] If it is reached, the actual capacitance of the capacitor to be measured is determined according to the preset number of current capacitances, and the actual equivalent resistance of the capacitor to be measured is determined according to the preset number of current equivalent resistances.

[0035] On the other hand, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0036] Determining the actual capacitance of the capacitor to be measured according to the current capacitance values ​​of the preset number of times, and determining the actual equivalent resistance of the capacitor to be measured according to the current equivalent resistances of the preset number of times includes:

[0037] When the computer system where the capacitor to be measured is located is in the startup stage, the average of the current capacitance values ​​of the preset number of times is used as the actual capacitance value of the capacitor to be measured, and the average of the current equivalent resistance values ​​of the preset number of times is used as the actual equivalent resistance of the capacitor to be measured;

[0038] When the computer system where the capacitor to be tested is located is in the operation stage, the maximum value and the minimum value among the current capacitance values ​​of a preset number of times are removed, and the maximum value and the minimum value among the current equivalent resistance values ​​of a preset number of times are removed;

[0039] When the computer system where the capacitor to be measured is located is in the running stage, the average of each current capacitance after removing the maximum value and the minimum value is used as the actual capacitance of the capacitor to be measured, and the average of each current equivalent resistance after removing the maximum value and the minimum value is used as the actual equivalent resistance of the capacitor to be measured.

[0040] On the other hand, after determining the actual capacitance of the capacitor to be measured according to the preset number of current capacitance values, the capacitance detection method further includes:

[0041] When the actual capacitance is greater than or lower than the preset warning value and greater than the preset risk value, the control prompter prompts that the capacitance of the capacitor to be tested is abnormal;

[0042] When the actual capacitance is lower than the preset risk value, the alarm is controlled to sound an alarm.

[0043] On the other hand, after determining the current equivalent resistance of the capacitor to be measured according to the capacitor linear discharge model with known slope and constant value, the discharge start time, the rated voltage of the capacitor to be measured and the capacitor equivalent resistance expression, the capacitor detection method further includes:

[0044] The control prompter prompts the current capacitance and the current equivalent resistance of the capacitor to be measured.

[0045] On the other hand, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0046] The capacitance detection method is applied to an existing microcontroller in the computer system.

[0047] On the other hand, the capacitance detection method further includes:

[0048] Detecting the real-time temperature value of the capacitor to be tested;

[0049] When the real-time temperature value is higher than the preset temperature value, the control prompter prompts the capacitor temperature risk.

[0050] On the other hand, when the capacitor to be tested is discharged from the rated voltage through the constant current load, several voltage samples are taken to obtain the sampled voltage values ​​and their sampling times, including:

[0051] Charge the capacitor to be tested to the rated voltage through the power supply;

[0052] Controlling the capacitor to be tested to start discharging through a constant current load;

[0053] During the discharge process of the capacitor to be measured, the voltage of the capacitor to be measured is sampled a preset number of times in a preset sampling period to obtain a sampled voltage value and a sampling time thereof.

[0054] On the other hand, charging the capacitor to be tested to the rated voltage through the power supply includes:

[0055] Based on the charging strategy of decreasing current value, the capacitor to be tested is charged to the rated voltage through the power supply.

[0056] On the other hand, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0057] During the discharge process of the capacitor to be tested, the voltage of the capacitor to be tested is sampled a preset number of times at a preset sampling period to obtain a sampled voltage value and a sampling time thereof, including:

[0058] If the computer system is in the startup stage, the voltage of the capacitor to be tested is sampled for a first preset number of times in a first preset sampling period to obtain a sampled voltage value and a sampling time thereof;

[0059] If the computer system is in the running stage, the voltage of the capacitor to be tested is sampled a second preset number of times in a second preset sampling period to obtain a sampled voltage value and a sampling time thereof;

[0060] Among them, the first preset sampling period is greater than the second preset sampling period, and the first preset number of times is greater than the second preset number of times.

[0061] In order to solve the above technical problems, the present invention further provides a capacitance detection device, comprising:

[0062] The voltage sampling module is used to perform voltage sampling several times during the process of the capacitor to be tested being discharged from the rated voltage through the constant current load to obtain the sampled voltage value and its sampling time;

[0063] A first determination module, used to determine the slope of the capacitor linear discharge model by a linear regression method based on each sampled voltage value and its sampling time;

[0064] The second determination module is used to determine the current capacitance of the capacitor to be measured based on the slope by using a capacitance expression related to the slope.

[0065] In order to solve the above technical problems, the present invention further provides a capacitance detection device, comprising:

[0066] Memory for storing computer programs;

[0067] A processor is used to implement the steps of the capacitance detection method described above when executing the computer program.

[0068] In order to solve the above technical problem, the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the capacitance detection method described above when executed by a processor.

[0069] In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the capacitance detection method described above are implemented.

[0070] Beneficial effect: The present invention provides a capacitance detection method. Considering that (1) the slope of the fitted capacitor linear discharge model can more accurately characterize the voltage change of the capacitor to be tested during the discharge process, and (2) discharging from the rated voltage is conducive to more voltage sampling, the present invention first performs a number of voltage samplings during the discharge of the capacitor to be tested from the rated voltage through a constant current load to obtain the sampled voltage value and its sampling time, and then determines the slope of the capacitor linear discharge model based on each sampled voltage value and its sampling time through a linear regression method. Finally, based on the slope, the current capacitance of the capacitor to be tested is determined through a capacitance expression related to the slope. The current capacitance of the capacitor to be tested can be accurately obtained through the slope of the capacitor linear discharge model, thereby improving the capacitance detection accuracy of the capacitor.

[0071] The present invention also provides a capacitance detection device, equipment, computer program product and computer readable storage medium, which have the same beneficial effects as the above capacitance detection method. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0073] Figure 1 A flow chart of a capacitance detection method provided by the present invention;

[0074] Figure 2 The waveform diagram of voltage and current during the capacitor charging and discharging process provided by the present invention;

[0075] Figure 3 A linear model diagram of voltage and time of the capacitor discharge process provided by the present invention;

[0076] Figure 4 A schematic diagram of a flow chart of another capacitance detection method provided by the present invention;

[0077] Figure 5 A schematic diagram of the structure of a capacitance detection device provided by the present invention;

[0078] Figure 6 A schematic diagram of the structure of a capacitance detection device provided by the present invention;

[0079] Figure 7 A schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0080] The core of the present invention is to provide a capacitance detection method, device, equipment, program product and readable storage medium. In the process of discharging the capacitor to be tested from the rated voltage through a constant current load, several voltage samplings are performed to obtain the sampled voltage value and its sampling time. Then, based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a linear regression method. Finally, based on the slope, the current capacitance of the capacitor to be tested is determined through a capacitance expression related to the slope. The slope of the capacitor linear discharge model can be used to obtain the accurate current capacitance of the capacitor to be tested, thereby improving the capacitance detection accuracy of the capacitor.

[0081] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0082] Please refer to Figure 1 , Figure 1 A flow chart of a capacitance detection method provided by the present invention, the capacitance detection method comprising:

[0083] S101: When the capacitor to be tested is discharged from the rated voltage through the constant current load, voltage sampling is performed several times to obtain a sampled voltage value and a sampling time;

[0084] Specifically, considering the technical problems in the above background technology, and in combination with considering that (1) the slope of the fitted capacitor linear discharge model can more accurately characterize the voltage change of the capacitor to be tested during the discharge process, and (2) discharging from the rated voltage is conducive to more voltage sampling, the embodiment of the present invention performs several voltage samplings during the process of discharging the capacitor to be tested from the rated voltage through a constant current load to obtain the sampled voltage value and its sampling time, so that the subsequent steps can determine the slope of the capacitor current discharge model through the sampled voltage value and its sampled voltage.

[0085] The capacitor to be tested may be of various types, which is not limited in the embodiment of the present invention.

[0086] Specifically, the reason for using a constant current load is to make the discharge current of the capacitor more stable. However, even under the action of a constant current load, the discharge current of the capacitor to be measured will fluctuate. Therefore, in an embodiment of the present invention, the slope of the capacitor linear discharge model is fitted based on the sampled voltage value and its sampling time.

[0087] S102: determining the slope of the capacitor linear discharge model by a linear regression method based on each sampled voltage value and its sampling time;

[0088] Specifically, after determining each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model can be determined by a linear regression method based on each sampled voltage value and its sampling time, so as to serve as a data basis for subsequent steps.

[0089] S103: Based on the slope, determine the current capacitance of the capacitor to be measured by using a capacitance expression related to the slope.

[0090] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 2 , Figure 2 The waveform diagram of voltage and current during the capacitor charging and discharging process provided by the present invention is as follows: Figure 2 The upper part of the figure shows that the capacitor starts from the idle stage, and passes through the charging stage, the full charging stage and the constant current discharge stage in sequence. In the early stage of discharge, the capacitor voltage drops sharply from point A to point B, and then starts to drop linearly from point B, passes through point C and point D, and in the linear drop stage from point B to point D, the capacitor voltage actually sampled is realized, and the dotted line represents the straight line corresponding to the linear regression capacitor linear discharge model; among them, the voltage change of the capacitor voltage from point A to point B can be used to calculate the equivalent resistance (ESR, Equivalent Series Resistance) of the capacitor, so it is marked "equivalent resistance voltage change"; the "capacitor voltage change" from point C to point D and its corresponding "time change" can be used to calculate the capacitance value, and the current change curve in the charging stage is represented by a solid line segment.

[0091] Among them, Figure 2 The lower part shows the Figure 2 The capacitor current corresponding to each stage of "idle, charging, fully charged and constant current discharge" in the upper part, the charging current gradually decreases from 1024mA, and the discharge current is 250mA.

[0092] Specifically, since the discharge stage is a constant current discharge, during the discharge process of the capacitor to be measured, the voltage value V and the time t are in a linear relationship, and the slope of the capacitor discharge model is k=(V[C]-V[D]) / (t[C]-t[D]). The capacitance expression derived from the capacitance formula may include: C=I×((t[D]-t[C])) / ((V[C]-V[D]))=I×-1 / k, wherein V[C] is the sampled voltage value of the sampling point C, V[D] is the sampled voltage value of the sampling point D, t[C] is the sampling time of the sampling point C, t[D] is the sampling time of the sampling point D, C is the capacitance of the capacitor, and I is the discharge current.

[0093] Specifically, after determining the slope of the capacitor linear discharge model, this step can determine the current capacitance of the capacitor to be tested based on the slope through the capacitance expression related to the slope. Since the slope determined by the linear regression method can more accurately characterize the change of the capacitor voltage over time, the current capacitance determined by the capacitance expression related to the slope will be more accurate.

[0094] The present invention provides a capacitance detection method. Considering that (1) the slope of the fitted capacitor linear discharge model can more accurately characterize the voltage change of the capacitor to be tested during the discharge process, and (2) discharging from the rated voltage is conducive to more voltage sampling, the present invention first performs a number of voltage samplings during the discharge of the capacitor to be tested from the rated voltage through a constant current load to obtain the sampled voltage value and the sampling time, and then determines the slope of the capacitor linear discharge model based on each sampled voltage value and the sampling time through a linear regression method. Finally, based on the slope, the current capacitance of the capacitor to be tested is determined through a capacitance expression related to the slope. The current capacitance of the capacitor to be tested can be accurately obtained through the slope of the capacitor linear discharge model, thereby improving the capacitance detection accuracy of the capacitor.

[0095] Based on the above embodiments:

[0096] As an optional embodiment, based on each sampled voltage value and its sampling time, determining the slope of the capacitor linear discharge model by a linear regression method includes:

[0097] Based on each sampled voltage value and its sampling time, the slope and constant value of the capacitor linear discharge model are determined by a linear regression method;

[0098] Among them, the capacitor linear discharge model includes V=kt+b, V is the voltage value of the capacitor, k is the slope, t is the time, and b is the constant value;

[0099] The capacitance detection method further includes:

[0100] The current equivalent resistance of the capacitor to be measured is determined according to a capacitor linear discharge model with known slope and constant values, a discharge start time, a rated voltage of the capacitor to be measured, and an expression for equivalent resistance of the capacitor.

[0101] Specifically, the linear model of capacitance can be expressed as V=kt+b, where the constant value b is also an unknown quantity. Only after k and b are determined can the expression of the linear model of capacitance be fully obtained. On the other hand, combined with Figure 2 It can be seen intuitively that if one wants to calculate the accurate equivalent resistance of the capacitor, then one needs to know the capacitor voltage change at the moment of discharge, that is, one needs to know the voltage value at point B. However, since the voltage drop occurs instantly, the voltage value at point B cannot be accurately captured. Therefore, in the embodiment of the present invention, the voltage value at point B is determined by assisting in determining the voltage value of point B through a capacitor linear discharge model, so as to facilitate further determination of the current equivalent resistance of the capacitor to be measured through the capacitor equivalent resistance expression. Therefore, in the embodiment of the present invention, the slope and constant value of the capacitor linear discharge model can be determined by a linear regression method based on each sampled voltage value and its sampling time, thereby determining a complete capacitor linear discharge model. After determining the capacitor linear discharge model with known slope and constant values, the current equivalent resistance of the capacitor to be measured can be determined based on the capacitor linear discharge model with known slope and constant values, the discharge start time, the rated voltage of the capacitor to be measured, and the capacitor equivalent resistance expression.

[0102] As an optional embodiment, according to a capacitor linear discharge model with known slope and constant value, a discharge start time, a rated voltage of the capacitor to be measured, and a capacitor equivalent resistance expression, determining the current equivalent resistance of the capacitor to be measured includes:

[0103] The voltage corresponding to the discharge start time in the capacitor linear discharge model with known slope and constant value is taken as the first voltage;

[0104] Based on the rated voltage of the capacitor to be measured, the first voltage and the current value of the constant current load, the current equivalent resistance of the capacitor to be measured is determined through a capacitor equivalent resistance expression.

[0105] Specifically, by Figure 2 It can be seen intuitively that at the start of discharge, the capacitor voltage drops from V[A] to V[B]. Therefore, the embodiment of the present invention can use the voltage corresponding to the start of discharge in the capacitor linear discharge model with known slope and constant value as the first voltage (ie, V[B]), and then determine the current equivalent resistance of the capacitor to be measured based on the rated voltage of the capacitor to be measured (ie, V[A]), the first voltage (ie, V[B]) and the current value of the constant current load through the capacitor equivalent resistance expression.

[0106] Among them, V[B] can be accurately determined in this way, which is conducive to obtaining a more accurate current equivalent resistance of the capacitor to be tested. The loss and performance of the capacitor can also be evaluated through the current equivalent resistance.

[0107] As an optional embodiment, the capacitance equivalent resistance expression includes:

[0108] ESR = (V[A] - V[B]) / I;

[0109] Where ESR is the equivalent resistance, V[A] is the rated voltage, V[B] is the voltage value of the capacitor after a sudden drop in discharge, and I is the discharge current.

[0110] Specifically, the above capacitor equivalent resistance has the advantages of simplicity and accuracy.

[0111] Of course, in addition to this specific form, the capacitor equivalent resistance may also be of many other types, which is not limited in the embodiment of the present invention.

[0112] As an optional embodiment, based on each sampled voltage value and its sampling time, the slope and constant value of the capacitor linear discharge model are determined by a linear regression method, including:

[0113] Based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a preset slope expression about the sampled voltage and its sampling time;

[0114] Based on each sampled voltage value and its sampling time, a constant value of a capacitor linear discharge model is determined by a preset constant value expression about the sampled voltage and its sampling time;

[0115] Among them, the slope expression and the constant value expression are both: expressions determined in advance by a linear regression method.

[0116] Specifically, considering that by pre-setting the "slope expression about the sampling voltage and its sampling time and the constant value expression about the sampling voltage and its sampling time", the slope and constant value of the capacitor linear discharge model can be quickly and accurately determined in combination with the "each sampling voltage value and its sampling time" during the determination process, the slope expression and the constant value expression can be determined in advance by a linear regression method in an embodiment of the present invention, and then after determining each sampling voltage value and its sampling time, it can be based on each sampling voltage value and its sampling time. On the one hand, the slope of the capacitor linear discharge model can be determined by the preset slope expression about the sampling voltage and its sampling time, and on the other hand, the constant value of the capacitor linear discharge model can be determined by the preset constant value expression about the sampling voltage and its sampling time, which is conducive to improving work efficiency.

[0117] As an optional embodiment, the process of determining the slope expression and the constant value expression includes:

[0118] Determine a target loss function for fitting a capacitor linear discharge model by sampling voltage values ​​and sampling times;

[0119] Determine the slope and constant value that minimize the function value of the target loss function in the capacitor linear discharge model.

[0120] Specifically, in the process of determining the slope expression and the constant value expression, we can first determine the target loss function for fitting the capacitor linear discharge model by sampling the voltage value and its sampling time, and then determine the slope and constant value that minimizes the function value of the target loss function in the capacitor linear discharge model, so that we can obtain the slope expression and the constant value expression efficiently and accurately.

[0121] To better illustrate the embodiments of the present invention, please refer to Figure 3 , Figure 3 A linear model diagram of voltage and time of the capacitor discharge process provided by the present invention, Figure 3 In t i The corresponding predicted voltage value, t i is the sampling time of the i-th sampling voltage value, V i is the i-th sampling voltage value, and the determination process of the slope expression and the constant value expression may include:

[0122] According to the linear regression concept, the capacitor discharge line is modeled as a univariate linear equation V=kt+b. The linear regression process is to find the optimal parameter k given N data pairs (t, V). * and b * , so that the model can better fit the data. In order to find the best way to fit the data, it is necessary to introduce a cost (loss) function to calculate. As shown in the figure above, the model predicts the value , the true value of this point is V i , a simple and practical loss function is the square of the error between the predicted value and the true value, To represent the loss function, then:

[0123] ; (1)

[0124] Formula (1) represents the difference between the predicted value and the true value at a single sample point.

[0125] ; (2)

[0126] ; (3)

[0127] Formula (2) means that all errors of the data set (the sampled voltage value and the predicted voltage value at each sampling point) are summed and averaged, and then substituted into the formula , and we get formula (3).

[0128] ; (4)

[0129] In formula (4), argmin means finding the parameter k that minimizes the target loss function. * and b * . Derivative k and b in the formula are taken separately. When the derivative is 0, the loss function is minimized.

[0130] ; (5)

[0131] ; (6)

[0132] Formulas (5) and (6) are partial derivatives of the loss function with respect to k and b. Let:

[0133] ; ; ; ; (7)

[0134] in, is the mean value of each sampling time, is the mean value of each sampled voltage value, s 2 and can be regarded as intermediate parameters.

[0135] When the partial derivative is 0, the minimum mean square error can be obtained, that is:

[0136] ; (8)

[0137] ; (9)

[0138] ; (10)

[0139] From formula (10), we can get: ;

[0140] Substituting the k value into formula (9), we can obtain: ;

[0141] Thus we can get:

[0142] ;

[0143] .

[0144] Specifically, the above objective loss function utilizes the idea of ​​least squares method. Least squares method and linear regression have good noise resistance and can effectively suppress random noise in the measurement process.

[0145] As an optional embodiment, the target loss function includes:

[0146] ;

[0147] ;

[0148] in, is the target loss function, t i is the sampling time of the i-th sampling voltage value, is the predicted voltage value corresponding to ti, V i is the i-th sampled voltage value, i is the voltage sampling order, N is the total number of samplings, k is the slope, and b is a constant value.

[0149] Specifically, the above-mentioned target loss function is conducive to efficient and accurate linear regression to obtain a capacitor linear discharge model.

[0150] Of course, in addition to the above form, the target loss function can also be of many other types, which are not limited in the embodiments of the present invention.

[0151] As an optional embodiment, after determining the equivalent resistance of the capacitor to be measured according to the capacitor linear discharge model with known slope and constant value, the discharge start time, the rated voltage of the capacitor to be measured and the capacitor equivalent resistance expression, the capacitance detection method further includes:

[0152] Add one to the current number of cycles and determine whether the current number of cycles reaches a preset number of cycles, wherein the initial value of the current number of cycles is zero;

[0153] If not, the step of performing voltage sampling several times to obtain the sampled voltage value and its sampling time is performed during the process of discharging the capacitor to be tested from the rated voltage through the constant current load;

[0154] If it is reached, the actual capacitance of the capacitor to be measured is determined according to the preset number of current capacitances, and the actual equivalent resistance of the capacitor to be measured is determined according to the preset number of current equivalent resistances.

[0155] Specifically, in order to further improve the accuracy of the capacitance and equivalent resistance of the capacitor to be measured, in an embodiment of the present invention, the current capacitance and the current equivalent resistance of a preset number of times can be obtained by cyclic detection, and then the actual capacitance of the capacitor to be measured can be determined according to the preset number of current capacitances, and the actual equivalent resistance of the capacitor to be measured can be determined according to the preset number of current equivalent resistances. Multiple detection data are helpful in determining more accurate target data (capacitance and equivalent resistance of the capacitor to be measured).

[0156] The preset number of times may be set independently, for example, it may be 100, etc., and the embodiment of the present invention does not limit this.

[0157] As an optional embodiment, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0158] Determining the actual capacitance of the capacitor to be measured according to the current capacitance values ​​of the preset number of times, and determining the actual equivalent resistance of the capacitor to be measured according to the current equivalent resistance of the preset number of times includes:

[0159] When the computer system where the capacitor to be measured is located is in the startup stage, the average of the current capacitance values ​​of the preset number of times is used as the actual capacitance value of the capacitor to be measured, and the average of the current equivalent resistance values ​​of the preset number of times is used as the actual equivalent resistance of the capacitor to be measured;

[0160] When the computer system where the capacitor to be tested is located is in the operation stage, the maximum value and the minimum value among the current capacitance values ​​of a preset number of times are removed, and the maximum value and the minimum value among the current equivalent resistance values ​​of a preset number of times are removed;

[0161] When the computer system where the capacitor to be measured is located is in the running stage, the average of the current capacitance values ​​after removing the maximum value and the minimum value is taken as the actual capacitance of the capacitor to be measured, and the average of the current equivalent resistance values ​​after removing the maximum value and the minimum value is taken as the actual equivalent resistance of the capacitor to be measured.

[0162] Specifically, the capacitor to be tested may include a capacitor used as a backup power supply in a computer system, that is, it can provide backup power in the event of an abnormal power outage in the computer system. Considering that there is no IO (Input / Output) data in the startup phase of the computer system, the capacitor to be tested can be appropriately discharged for a longer time during the discharge process. The computer system has IO data in the running phase. Therefore, in order to prevent a large discharge from having a greater impact on the "backup power function of the capacitor to be tested", the discharge time can be appropriately shortened during the discharge process of the capacitor to be tested. Based on the above measures, during the startup phase of the computer system, since the discharge time of the capacitor to be tested is relatively long and the discharge voltage is relatively stable during the test, the capacitor to be tested can be used as the starting point of the computer system. When the computer system is in the startup stage, the average of the current capacitance values ​​of the preset number of times is used as the actual capacitance of the capacitor to be measured, and the average of the current equivalent resistance values ​​of the preset number of times is used as the actual equivalent resistance of the capacitor to be measured; while in the operation stage of the computer system, since the discharge time of the capacitor to be measured is short, the discharge voltage may fluctuate greatly. Therefore, when the computer system where the capacitor to be measured is located is in the operation stage, the average of the current capacitance values ​​after removing the maximum value and the minimum value is used as the actual capacitance of the capacitor to be measured, and the average of the current equivalent resistance values ​​after removing the maximum value and the minimum value is used as the actual equivalent resistance of the capacitor to be measured, thereby improving the detection accuracy of the "capacitance and equivalent resistance" of the capacitor to be measured in the "computer system operation stage".

[0163] As an optional embodiment, after determining the actual capacitance of the capacitor to be measured according to the preset number of current capacitances, the capacitance detection method further includes:

[0164] When the actual capacitance is greater than or lower than the preset warning value and greater than the preset risk value, the control prompter prompts that the capacitance of the capacitor to be tested is abnormal;

[0165] When the actual capacitance is lower than the preset risk value, the control alarm will sound.

[0166] Specifically, in order to provide an early warning when the capacitance of the capacitor to be tested is low but can still be barely used, a preset warning value and a preset risk value are set in an embodiment of the present invention. When the actual capacitance of the capacitor to be tested is greater than or lower than the preset warning value and greater than the preset risk value, the control prompter can prompt that the capacitance of the capacitor to be tested is abnormal, so that the staff can take maintenance measures in time. In order to let the staff know in time when the capacitor to be tested can no longer support its related functions (such as the backup power function), the alarm can be controlled to sound an alarm when the actual capacitance is lower than the preset risk value in an embodiment of the present invention.

[0167] Among them, the preset warning value and the preset risk value can be set independently, and the embodiment of the present invention does not limit this.

[0168] Specifically, the prompter and the alarm may be of various types, for example, a display may be used as a prompter, an audible and visual alarm may be used as an alarm, etc., which is not limited in the embodiment of the present invention.

[0169] As an optional embodiment, after determining the current equivalent resistance of the capacitor to be measured according to the capacitor linear discharge model with known slope and constant value, the discharge start time, the rated voltage of the capacitor to be measured and the capacitor equivalent resistance expression, the capacitance detection method further includes:

[0170] The control prompter prompts the current capacitance value and the current equivalent resistance of the capacitor to be tested.

[0171] Specifically, in order to facilitate the staff to promptly know the current capacitance and the current equivalent resistance of the capacitor to be measured, the embodiment of the present invention also deliberately controls the prompter to prompt the current capacitance and the current equivalent resistance of the capacitor to be measured.

[0172] As an optional embodiment, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0173] The capacitance detection method is applied to the original microcontroller in the computer system.

[0174] Specifically, considering that in the embodiment of the present invention, the original microcontroller in the computer system can realize voltage sampling of the discharge process of the capacitor to be tested and determine the sampling time through its internal analog-to-digital converter and timer, the capacitance detection method in the embodiment of the present invention can be applied to the original microcontroller in the computer system, thereby eliminating the need to use a dedicated capacitance management chip for capacitance detection and reducing costs.

[0175] The capacitor used as a backup power source may be used in various specific locations in a computer system, for example, it may be used in a RAID (Redundant Arrays of Independent Disks) card, etc., which is not limited in the embodiment of the present invention.

[0176] As an optional embodiment, the capacitance detection method further includes:

[0177] Detect the real-time temperature value of the capacitor to be tested;

[0178] When the real-time temperature value is higher than the preset temperature value, the control prompter prompts the capacitor temperature risk.

[0179] Specifically, considering that too high a temperature of the capacitor to be tested will cause great harm to the health of the capacitor to be tested, the real-time temperature value of the capacitor to be tested can be detected in the embodiment of the present invention, and when the real-time temperature value is higher than the preset temperature value, the control prompter can prompt the capacitor temperature risk, so that the staff can take timely measures.

[0180] The preset temperature value may be set independently, and the embodiment of the present invention does not limit this.

[0181] As an optional embodiment, during the process of discharging the capacitor to be tested from the rated voltage through the constant current load, voltage sampling is performed several times to obtain the sampled voltage value and its sampling time, including:

[0182] Charge the capacitor to be tested to the rated voltage through the power supply;

[0183] Control the capacitor to be tested to start discharging through a constant current load;

[0184] During the discharge process of the capacitor to be measured, the voltage of the capacitor to be measured is sampled a preset number of times in a preset sampling period to obtain a sampled voltage value and a sampling time thereof.

[0185] Specifically, in an embodiment of the present invention, a capacitance detection system can be set for the capacitor to be tested, including a microcontroller, and also including: a power supply, a charging switch connected to the power supply and the capacitor to be tested respectively, a discharge switch connected to the capacitor to be tested and a constant current load respectively, and a constant current load. Then, the start and stop of the charging action can be controlled by controlling the charging switch, and the start and stop of the discharging action can be controlled by controlling the discharge switch.

[0186] Specifically, in the process of discharging the capacitor to be tested from the rated voltage through the constant current load, the specific process of performing several voltage samplings may include: charging the capacitor to be tested to the rated voltage through the power supply; controlling the capacitor to be tested to start discharging through the constant current load; in the process of discharging the capacitor to be tested, performing a preset number of voltage samplings on the capacitor to be tested with a preset sampling period to obtain a sampled voltage value and a sampling time thereof. Since both the charging action and the discharging action are actively controlled, it is beneficial to accurately control the charging of the capacitor to be tested to the rated voltage, and the capacitor to be tested can be controlled to discharge with a constant current.

[0187] Of course, in addition to this specific process, "in the process of discharging the capacitor to be tested from the rated voltage through a constant current load, performing several voltage samplings to obtain the sampled voltage value and its sampling time" is also intentionally other specific forms, which are not limited in the embodiments of the present invention.

[0188] To better illustrate the embodiments of the present invention, please refer to Figure 4 , Figure 4A flow chart of another capacitance detection method provided by the present invention is provided. First, the machine is powered on and the switches (charging switch and discharging switch) are initialized. The microcontroller controls the analog-to-digital converter to monitor the capacitor voltage, turns on the capacitor charging switch, and determines whether the rated voltage is reached. If the rated voltage is not reached, the "determination of whether the rated voltage is reached" is continued. If the rated voltage is reached, the charging switch can be turned off and the discharging switch can be turned on. The sampled voltage value and its sampling time are obtained, and the discharging switch is turned off. The capacitance value and the equivalent resistance of the capacitor are determined according to the sampled voltage value and its sampling time. It is determined whether the number of cycles reaches the preset number. If the number is not reached, the step of "turning on the capacitor charging switch" can be returned. If the number is reached, the actual capacitance value and the actual equivalent resistance can be obtained by "taking an average" to determine whether the (actual capacitance) meets the availability (for example, whether it meets the electric energy required for a single backup power process). If so, the machine can be turned on normally. If not, a capacitance abnormality alarm is reported. In addition, if it is not met, the computer system is deliberately notified to modify the cache strategy directly to prevent data loss.

[0189] As an optional embodiment, charging the capacitor to be tested to a rated voltage through a power supply includes:

[0190] Based on the charging strategy of decreasing current value, the capacitor to be tested is charged to the rated voltage through the power supply.

[0191] Specifically, considering that the charging speed of the capacitor will decrease as the charging process proceeds (especially when it is close to the rated voltage), in order to adapt to this characteristic of the capacitor, in an embodiment of the present invention, a charging strategy with decreasing current value can be used to charge the capacitor to the rated voltage through the power supply, thereby optimizing the charging efficiency and the life of the capacitor to be tested.

[0192] Among them, the charging strategy with decreasing current value can be set independently, for example, charging with a first current before charging to 90% of the rated voltage, and charging with a smaller second current after the capacitor voltage reaches 90% of the rated voltage. The embodiment of the present invention is not limited here.

[0193] As an optional embodiment, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0194] During the discharge process of the capacitor to be measured, the voltage of the capacitor to be measured is sampled a preset number of times in a preset sampling period, and the sampled voltage value and its sampling time are obtained, including:

[0195] If the computer system is in the startup stage, voltage sampling is performed on the capacitor to be measured for a first preset number of times in a first preset sampling period to obtain a sampled voltage value and a sampling time thereof;

[0196] If the computer system is in the running stage, the voltage of the capacitor to be measured is sampled a second preset number of times in a second preset sampling period to obtain a sampled voltage value and a sampling time thereof;

[0197] The first preset sampling period is greater than the second preset sampling period, and the first preset number of times is greater than the second preset number of times.

[0198] Specifically, considering that there is no IO data in the startup phase of the computer system, the capacitor of the backup power supply does not need to immediately assume the role of "providing backup power for IO data recovery", and can be appropriately discharged for a longer time during the discharge process of the capacitor to be tested. The computer system has IO data in the running phase. Therefore, in order to prevent the discharge from having a greater impact on the "backup power function of the capacitor to be tested", the discharge time can be appropriately shortened during the discharge process of the capacitor to be tested. Therefore, in the embodiment of the present invention, different sampling cycles and sampling times are set in the process of controlling the discharge of the capacitor in the startup phase and the running phase of the computer system, specifically: if the computer system is in the startup phase, the voltage of the capacitor to be tested is sampled a first preset number of times with a first preset sampling cycle to obtain a sampled voltage value and its sampling time; if the computer system is in the running phase, the voltage of the capacitor to be tested is sampled a second preset number of times with a second preset sampling cycle to obtain a sampled voltage value and its sampling time; wherein the first preset sampling cycle is greater than the second preset sampling cycle, and the first preset number of times is greater than the second preset number of times, that is, the voltage sampling is performed with a higher preset sampling cycle and preset number of times in the startup phase of the computer system, and the voltage sampling is performed with a lower preset sampling cycle and preset number of times in the running phase of the computer system, which is conducive to further improving the accuracy of voltage sampling.

[0199] Among them, the first preset sampling period (for example, 500 milliseconds), the second preset sampling period (for example, 20 milliseconds), the first preset number of times (for example, 100 times) and the second preset number of times (for example, 50 times) can all be set independently, and the embodiments of the present invention are not limited here.

[0200] Please refer to Figure 5 , Figure 5 A schematic diagram of the structure of a capacitance detection device provided by the present invention, the capacitance detection device comprises:

[0201] The voltage sampling module 51 is used to perform voltage sampling several times to obtain a sampled voltage value and a sampling time when the capacitor to be tested is discharged from the rated voltage through the constant current load;

[0202] A first determination module 52, configured to determine the slope of the capacitor linear discharge model by a linear regression method based on each sampled voltage value and its sampling time;

[0203] The second determination module 53 is used to determine the current capacitance of the capacitor to be measured based on the slope by using a capacitance expression related to the slope.

[0204] As an optional embodiment, the first determining module 52 is specifically configured to:

[0205] Based on each sampled voltage value and its sampling time, the slope and constant value of the capacitor linear discharge model are determined by a linear regression method;

[0206] Among them, the capacitor linear discharge model includes V=kt+b, V is the voltage value of the capacitor, k is the slope, t is the time, and b is the constant value;

[0207] The capacitance detection device also includes:

[0208] The third determination module is used to determine the current equivalent resistance of the capacitor to be measured according to the capacitor linear discharge model with known slope and constant value, the discharge start time, the rated voltage of the capacitor to be measured and the capacitor equivalent resistance expression.

[0209] As an optional embodiment, the third determining module includes:

[0210] A first action module, used for taking a voltage corresponding to a discharge start time in a capacitor linear discharge model with a known slope and a constant value as a first voltage;

[0211] The fourth determination module is used to determine the current equivalent resistance of the capacitor to be measured based on the rated voltage of the capacitor to be measured, the first voltage and the current value of the constant current load through the capacitor equivalent resistance expression.

[0212] As an optional embodiment, the first determining module 52 includes:

[0213] A first determination submodule, configured to determine the slope of the capacitor linear discharge model based on each sampled voltage value and its sampling time by using a preset slope expression for the sampled voltage and its sampling time;

[0214] A second determination submodule, for determining a constant value of a capacitor linear discharge model based on each sampled voltage value and its sampling time by using a preset constant value expression about the sampled voltage and its sampling time;

[0215] Among them, the slope expression and the constant value expression are both: expressions determined in advance by a linear regression method.

[0216] As an optional embodiment, the capacitance detection device further includes:

[0217] The second action module is used to increase the current cycle number by one and determine whether the current cycle number reaches a preset number, wherein the initial value of the current cycle number is zero. If it is not reached, the third action module is triggered; if it is reached, the fourth action module is triggered;

[0218] The third action module is used to execute the step of performing voltage sampling several times to obtain the sampled voltage value and its sampling time during the process of discharging the capacitor to be tested from the rated voltage through the constant current load;

[0219] The fourth action module is used to determine the actual capacitance of the capacitor to be measured according to the preset number of current capacitances, and to determine the actual equivalent resistance of the capacitor to be measured according to the preset number of current equivalent resistances.

[0220] As an optional embodiment, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0221] The fourth action module includes:

[0222] The first action submodule is used to, when the computer system where the capacitor to be measured is located is in the startup stage, use the average of the current capacitance values ​​of the preset number of times as the actual capacitance value of the capacitor to be measured, and use the average of the current equivalent resistance values ​​of the preset number of times as the actual equivalent resistance of the capacitor to be measured;

[0223] The second action submodule is used to remove the maximum value and the minimum value of the current capacitance values ​​of a preset number of times, and to remove the maximum value and the minimum value of the current equivalent resistance values ​​of a preset number of times when the computer system where the capacitor to be tested is located is in the running stage;

[0224] The third action submodule is used to, when the computer system where the capacitor to be measured is located is in the running stage, use the average of each current capacitance after removing the maximum value and the minimum value as the actual capacitance of the capacitor to be measured, and use the average of each current equivalent resistance after removing the maximum value and the minimum value as the actual equivalent resistance of the capacitor to be measured.

[0225] As an optional embodiment, the capacitance detection device further includes:

[0226] A first prompt module is used to control the prompter to prompt that the capacitance of the capacitor to be tested is abnormal when the actual capacitance is greater than or lower than a preset warning value and greater than a preset risk value;

[0227] The first alarm module is used to control the alarm to sound an alarm when the actual capacitance is lower than a preset risk value.

[0228] As an optional embodiment, the capacitance detection device further includes:

[0229] The second prompting module is used to control the prompter to prompt the current capacitance and the current equivalent resistance of the capacitor to be measured.

[0230] As an optional embodiment, the capacitance detection device further includes:

[0231] A temperature detection module is used to detect the real-time temperature value of the capacitor to be tested;

[0232] The third prompt module is used to control the prompter to prompt the capacitor temperature risk when the real-time temperature value is higher than the preset temperature value.

[0233] As an optional embodiment, the voltage sampling module 51 includes:

[0234] A first control module, used for charging the capacitor to be tested to a rated voltage through a power supply;

[0235] The second control module is used to control the capacitor to be tested to start discharging through a constant current load;

[0236] The voltage sampling submodule is used to perform voltage sampling of the capacitor to be tested for a preset number of times with a preset sampling period during the discharge process of the capacitor to be tested, so as to obtain a sampled voltage value and a sampling time thereof.

[0237] As an optional embodiment, the first control module is specifically used for:

[0238] Based on the charging strategy of decreasing current value, the capacitor to be tested is charged to the rated voltage through the power supply.

[0239] As an optional embodiment, the capacitor to be tested includes a capacitor used as a backup power supply in a computer system;

[0240] The voltage sampling submodule includes:

[0241] A fifth action module is used for, if the computer system is in the startup stage, performing voltage sampling of the capacitor to be measured for a first preset number of times in a first preset sampling period to obtain a sampled voltage value and a sampling time thereof;

[0242] A sixth action module is used for, if the computer system is in the running stage, performing voltage sampling of the capacitor to be measured for a second preset number of times with a second preset sampling period to obtain a sampled voltage value and a sampling time thereof;

[0243] The first preset sampling period is greater than the second preset sampling period, and the first preset number of times is greater than the second preset number of times.

[0244] For an introduction to the capacitance detection device provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the capacitance detection method, and the embodiment of the present invention will not be described in detail here.

[0245] Please refer to Figure 6 , Figure 6 A schematic diagram of the structure of a capacitance detection device provided by the present invention, the capacitance detection device comprises:

[0246] A memory 61, used for storing computer programs;

[0247] The processor 62 is used to implement the steps of the capacitance detection method in the above-mentioned embodiment when executing the computer program.

[0248] For an introduction to the capacitance detection device provided in the embodiment of the present invention, please refer to the embodiment of the capacitance detection method described above, and the embodiment of the present invention will not be described in detail here.

[0249] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the capacitance detection method in the above-mentioned embodiment when executed by a processor.

[0250] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the capacitance detection method, and the embodiment of the present invention will not be described in detail here.

[0251] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. A computer program 72 is stored on the computer-readable storage medium 71. When the computer program 72 is executed by a processor, the steps of the capacitance detection method in the aforementioned embodiment are implemented.

[0252] For an introduction to the computer-readable storage medium provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the capacitance detection method, and the embodiment of the present invention will not be described in detail here.

[0253] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should also be noted that in this specification, 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 that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the element.

[0254] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A capacitance detection method, characterized in that: include: When the capacitor to be tested is discharged from the rated voltage through the constant current load, voltage sampling is performed several times to obtain the sampled voltage value and its sampling time; Based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a linear regression method; Based on the slope, the current capacitance of the capacitor to be measured is determined by a capacitance expression related to the slope.

2. The capacitance detection method according to claim 1, characterized in that: Based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by linear regression method, including: Based on each sampled voltage value and its sampling time, the slope and constant value of the capacitor linear discharge model are determined by a linear regression method; Among them, the capacitor linear discharge model includes V=kt+b, V is the voltage value of the capacitor, k is the slope, t is the time, and b is the constant value; The capacitance detection method further includes: The current equivalent resistance of the capacitor to be measured is determined according to a capacitor linear discharge model with known slope and constant values, a discharge start time, a rated voltage of the capacitor to be measured, and an expression for equivalent resistance of the capacitor.

3. The capacitance detection method according to claim 2, characterized in that: According to the capacitor linear discharge model with known slope and constant value, discharge start time, rated voltage of the capacitor to be tested and the equivalent resistance expression of the capacitor, the current equivalent resistance of the capacitor to be tested is determined to include: The voltage corresponding to the discharge start time in the capacitor linear discharge model with known slope and constant value is taken as the first voltage; Based on the rated voltage of the capacitor to be measured, the first voltage and the current value of the constant current load, the current equivalent resistance of the capacitor to be measured is determined by using a capacitor equivalent resistance expression.

4. The capacitance detection method according to claim 3, characterized in that: The capacitance equivalent resistance expression includes: ESR = (V[A] - V[B]) / I; Where ESR is the equivalent resistance, V[A] is the rated voltage, V[B] is the voltage value of the capacitor after a sudden drop in discharge, and I is the discharge current.

5. The capacitance detection method according to claim 2, characterized in that: Based on each sampled voltage value and its sampling time, the slope and constant values ​​of the capacitor linear discharge model are determined by linear regression method, including: Based on each sampled voltage value and its sampling time, the slope of the capacitor linear discharge model is determined by a preset slope expression about the sampled voltage and its sampling time; Based on each sampled voltage value and its sampling time, a constant value of a capacitor linear discharge model is determined by a preset constant value expression about the sampled voltage and its sampling time; Wherein, the slope expression and the constant value expression are both: expressions determined in advance by a linear regression method.

6. The capacitance detection method according to claim 5, characterized in that: The process of determining the slope expression and the constant value expression includes: Determine a target loss function for fitting a capacitor linear discharge model by sampling voltage values ​​and sampling times; The slope and the constant value that minimize the function value of the target loss function in the capacitor linear discharge model are determined.

7. The capacitance detection method according to claim 6, characterized in that: The objective loss function includes: ; ; in, is the target loss function, t i is the sampling time of the i-th sampled voltage value, t i The corresponding predicted voltage value, V i is the i-th sampled voltage value, i is the voltage sampling order, N is the total number of samplings, k is the slope, and b is a constant value.

8. The capacitance detection method according to claim 2, characterized in that: After determining the equivalent resistance of the capacitor to be measured according to the capacitor linear discharge model with known slope and constant value, the discharge start time, the rated voltage of the capacitor to be measured and the capacitor equivalent resistance expression, the capacitor detection method further includes: Add one to the current number of cycles and determine whether the current number of cycles reaches a preset number of cycles, wherein the initial value of the current number of cycles is zero; If not, the step of performing voltage sampling several times to obtain the sampled voltage value and its sampling time is performed during the process of discharging the capacitor to be tested from the rated voltage through the constant current load; If it is reached, the actual capacitance of the capacitor to be measured is determined according to the preset number of current capacitances, and the actual equivalent resistance of the capacitor to be measured is determined according to the preset number of current equivalent resistances.

9. The capacitance detection method according to claim 8, characterized in that: The capacitor to be tested includes a capacitor used as a backup power supply in a computer system; Determining the actual capacitance of the capacitor to be measured according to the current capacitance values ​​of the preset number of times, and determining the actual equivalent resistance of the capacitor to be measured according to the current equivalent resistances of the preset number of times includes: When the computer system where the capacitor to be measured is located is in the startup stage, the average of the current capacitance values ​​of the preset number of times is used as the actual capacitance value of the capacitor to be measured, and the average of the current equivalent resistance values ​​of the preset number of times is used as the actual equivalent resistance of the capacitor to be measured; When the computer system where the capacitor to be tested is located is in the operation stage, the maximum value and the minimum value among the current capacitance values ​​of a preset number of times are removed, and the maximum value and the minimum value among the current equivalent resistance values ​​of a preset number of times are removed; When the computer system where the capacitor to be measured is located is in the running stage, the average of each current capacitance after removing the maximum value and the minimum value is used as the actual capacitance of the capacitor to be measured, and the average of each current equivalent resistance after removing the maximum value and the minimum value is used as the actual equivalent resistance of the capacitor to be measured.

10. The capacitance detection method according to claim 8, characterized in that: After determining the actual capacitance of the capacitor to be measured according to the preset number of current capacitance values, the capacitance detection method further includes: When the actual capacitance is greater than or lower than the preset warning value and greater than the preset risk value, the control prompter prompts that the capacitance of the capacitor to be tested is abnormal; When the actual capacitance is lower than the preset risk value, the alarm is controlled to sound an alarm.

11. The capacitance detection method according to claim 2, characterized in that: After determining the current equivalent resistance of the capacitor to be measured according to the capacitor linear discharge model with known slope and constant value, the discharge start time, the rated voltage of the capacitor to be measured and the capacitor equivalent resistance expression, the capacitor detection method further includes: The control prompter prompts the current capacitance and the current equivalent resistance of the capacitor to be measured.

12. The capacitance detection method according to claim 1, characterized in that: The capacitor to be tested includes a capacitor used as a backup power supply in a computer system; The capacitance detection method is applied to an existing microcontroller in the computer system.

13. The capacitance detection method according to claim 1, characterized in that: The capacitance detection method further includes: Detecting the real-time temperature value of the capacitor to be tested; When the real-time temperature value is higher than the preset temperature value, the control prompter prompts the capacitor temperature risk.

14. The capacitance detection method according to any one of claims 1 to 13, characterized in that: When the capacitor to be tested is discharged from the rated voltage through the constant current load, several voltage samples are taken to obtain the sampled voltage values ​​and their sampling times, including: Charge the capacitor to be tested to the rated voltage through the power supply; Controlling the capacitor to be tested to start discharging through a constant current load; During the discharge process of the capacitor to be measured, the voltage of the capacitor to be measured is sampled a preset number of times in a preset sampling period to obtain a sampled voltage value and a sampling time thereof.

15. The capacitance detection method according to claim 14, characterized in that: Charging the capacitor under test to the rated voltage through the power supply includes: Based on the charging strategy of decreasing current value, the capacitor to be tested is charged to the rated voltage through the power supply.

16. The capacitance detection method according to claim 14, characterized in that: The capacitor to be tested includes a capacitor used as a backup power supply in a computer system; During the discharge process of the capacitor to be tested, the voltage of the capacitor to be tested is sampled a preset number of times at a preset sampling period to obtain a sampled voltage value and a sampling time thereof, including: If the computer system is in the startup stage, the voltage of the capacitor to be tested is sampled for a first preset number of times in a first preset sampling period to obtain a sampled voltage value and a sampling time thereof; If the computer system is in the running stage, the voltage of the capacitor to be tested is sampled a second preset number of times in a second preset sampling period to obtain a sampled voltage value and a sampling time thereof; Among them, the first preset sampling period is greater than the second preset sampling period, and the first preset number of times is greater than the second preset number of times.

17. A capacitance detection device, characterized in that: include: The voltage sampling module is used to perform voltage sampling several times during the process of the capacitor to be tested being discharged from the rated voltage through the constant current load to obtain the sampled voltage value and its sampling time; A first determination module, used to determine the slope of the capacitor linear discharge model by a linear regression method based on each sampled voltage value and its sampling time; The second determination module is used to determine the current capacitance of the capacitor to be measured based on the slope by using a capacitance expression related to the slope.

18. A capacitance detection device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the capacitance detection method according to any one of claims 1 to 16 when executing the computer program.

19. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the capacitance detection method according to any one of claims 1 to 16 are implemented.

20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the capacitance detection method according to any one of claims 1 to 16 are implemented.