CP voltage detection method, device, electronic device and storage medium
By continuously obtaining multiple measured voltage values in the CCS system using ADC, calculating the initial voltage value and calculating the reference voltage value in the sliding window, the problem of inaccurate CP voltage detection in the prior art is solved, and a more accurate charging state judgment is achieved.
Patent Information
- Application Number
- CN202510015751.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2045-01-06
AI Technical Summary
When detecting the Control Pilot voltage in the prior art, due to the influence of hardware and environment, the voltage cannot accurately reach the set value. The software makes an error in judgment and cannot enter the correct charging state. In addition, there is a jump in the CP voltage, causing an error state to enter.
The ADC continuously obtains multiple measured voltage values within the preset time period, calculates the initial voltage value, and cyclically calculates the reference voltage value in a sliding window, corrects the voltage value, and determines the CP state corresponding to each voltage value.
By eliminating noise and errors, the accuracy of CP voltage detection is improved, the correctness of the charging state judgment is ensured, and the error state entry is avoided due to voltage jumps.
Smart Images

Figure CN119414079B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data measurement technology, and in particular to a CP voltage detection method, device, electronic device, and storage medium. Background Art
[0002] The European electric vehicle charging standard (CCS) requires monitoring the Control Pilot voltage to determine the charging status. Different Control Pilot voltages represent different charging states. A CP amplitude of +12V indicates the charging gun is not connected; a CP amplitude of +9V indicates the charging gun is connected but the charging station and vehicle are not ready; CP amplitudes of +6V and +3V indicate normal charging; a CP amplitude of 0V indicates a CP signal short circuit; and a CP amplitude of -12V indicates the charging station is unavailable.
[0003] As the guiding signal of the CCS system, the detection of CP voltage is of great importance. Currently, the most common method is to read the pin voltage of the CP signal line through ADC, and then compare it with the set value after conversion. If the comparison is successful, the corresponding state is entered.
[0004] Currently, there are two issues with directly reading the CP voltage through an ADC and then comparing it. First, due to hardware and environmental factors, the CP voltage may not accurately reach the set value, causing software errors and preventing the correct state from being entered. Second, the CP voltage fluctuates. In some cases, the fluctuation range may exactly match the set value of a certain state, causing the system to enter the wrong state. Summary of the Invention
[0005] The present application provides a CP voltage detection method, device, electronic device and storage medium, which can process the data of ADC measurement values to eliminate noise and errors, and then determine the states corresponding to different voltages, making the CP voltage detection more accurate.
[0006] This application provides a CP voltage detection method, including:
[0007] Continuously acquiring a plurality of measured voltage values within a preset time period through the ADC to obtain a first voltage value set;
[0008] calculating an initial voltage value according to the first voltage value set, and cyclically calculating a plurality of reference voltage values by moving on the first voltage value set in a sliding window manner based on the initial voltage value to obtain a second voltage value set;
[0009] modifying the second voltage value set according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set;
[0010] The CP state corresponding to each voltage value in the corrected second voltage value set is determined.
[0011] Optionally, calculating the initial voltage value according to the first voltage value set includes:
[0012] determining a target position within a first set of voltage values;
[0013] The initial voltage value is calculated according to a preset convolution kernel and a measured voltage value at a target position.
[0014] Optionally, after obtaining the multiple reference voltage values, the method further includes:
[0015] Calculating a first preset number and a second preset number according to the width of the sliding window and the number of measured voltage values;
[0016] adding a first preset number of first filling values before the plurality of reference voltage values;
[0017] A second preset number of second filling values are added after the plurality of reference voltage values.
[0018] Optionally, the second voltage value set is corrected according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set, including:
[0019] Calculating a first deviation value according to a maximum value in the first voltage value set and a maximum value in the second voltage value set;
[0020] Calculating a second deviation value according to a minimum value in the first voltage value set and a minimum value in the second voltage value set;
[0021] If the first deviation value or the second deviation value is greater than a preset value, the maximum value or the minimum value in the first voltage value set is eliminated, and the second voltage value set is updated;
[0022] The step of updating the second voltage value set is repeated until the updated first deviation value and the updated second deviation value are both smaller than the preset value, thereby completing the correction of the second voltage value set.
[0023] Optionally, determining a CP state corresponding to each voltage value in the corrected second voltage value set includes:
[0024] Determining a preset interval corresponding to each voltage value in the corrected second voltage value set;
[0025] The state parameter corresponding to the preset interval is obtained as the current CP state.
[0026] Optionally, the specific process of calculating the initial voltage value includes:
[0027] The calculation formula of the preset convolution kernel C is:
[0028] C=(c1,c2,……,c n )=(1 / n, 1 / n,……, 1 / n),
[0029] Among them, c1, c2, ..., c n is the element in the convolution kernel, n is the width of the sliding window, and n<m-1, m is the number of measured voltage values;
[0030] The initial voltage value vb i The calculation formula is:
[0031] vb i =C×V n / 2
[0032] Where i=n / 2, n / 2 is the starting bit in the first voltage value set V, V n / 2 are n elements extracted from the start bit in the first voltage value set V.
[0033] Optionally, the specific process of calculating multiple reference voltage values includes:
[0034] Set n / 2+p again as the starting bit in the first voltage value set V, where n / 2<p<mn / 2, to obtain V n / 2+p are n elements extracted from the starting bit in the first voltage value set V;
[0035] The reference voltage value vb i+p The calculation formula is:
[0036] vb i+p =C×V n / 2+p .
[0037] The present application also provides a CP voltage detection device, comprising:
[0038] an acquisition module, configured to continuously acquire a plurality of measured voltage values within a preset time period through the ADC to obtain a first voltage value set;
[0039] a calculation module, configured to calculate an initial voltage value according to the first voltage value set, and cyclically calculate a plurality of reference voltage values by moving on the first voltage value set in a sliding window manner based on the initial voltage value, so as to obtain a second voltage value set;
[0040] a correction module, configured to correct the second voltage value set according to a maximum value and a minimum value in the first voltage value set and a maximum value and a minimum value in the second voltage value set;
[0041] The determination module is configured to determine a CP state corresponding to each voltage value in the corrected second voltage value set.
[0042] The present application also provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the steps of any one of the CP voltage detection methods provided in the present application by calling the computer program stored in the memory.
[0043] The present application also provides a storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor to execute the steps in any one of the CP voltage detection methods provided in the present application.
[0044] The CP voltage detection method provided in the present application can continuously acquire multiple measured voltage values within a preset time period through an ADC to obtain a first voltage value set, calculate an initial voltage value based on the first voltage value set, and move on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate multiple reference voltage values to obtain a second voltage value set. Based on the maximum and minimum values in the first voltage value set and the maximum and minimum values in the second voltage value set, the second voltage value set is corrected to determine the CP state corresponding to each voltage value in the corrected second voltage value set. The embodiment of the present application can process the data of the ADC measurement value to eliminate noise and error, and then determine the state corresponding to different voltages, making the detection of the CP voltage more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in this application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 This is a flow chart of a CP voltage detection method provided in an embodiment of the present application;
[0047] Figure 2 is another flow chart of the CP voltage detection method provided in an embodiment of the present application;
[0048] Figure 3 This is a structural diagram of a CP voltage detection device provided in an embodiment of the present application;
[0049] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0051] It should be noted that, in this document, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0052] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0053] It should be noted that in this article, step codes such as 101 and 102 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When technical personnel in this field implement the specific steps, they may execute 102 first and then 101, etc., but these should all be within the scope of protection of this application.
[0054] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0055] An embodiment of the present application provides a CP voltage detection method. The executor of the CP voltage detection method can be the CP voltage detection device provided in the embodiment of the present application, or a server integrated with the CP voltage detection device, wherein the CP voltage detection device can be implemented in hardware or software.
[0056] like Figure 1 As shown, Figure 1 : This is a schematic diagram of the first process of the CP voltage detection method provided in an embodiment of the present application. The specific process of the CP voltage detection method can be as follows:
[0057] 101. Continuously acquire multiple measured voltage values within a preset time period through an ADC to obtain a first voltage value set.
[0058] In one embodiment, the aforementioned CP (Control Pilot) voltage detection method can be applied to a CCS (Combined Charging System) system. The CCS standard integrates AC and DC charging into a unified system, enabling multiple charging modes through a combined socket, including single-phase AC charging, three-phase AC charging, and DC charging. In the CCS system, the CP interface transmits PWM signals for AC charging control and communication. The CP interface uses the upper half of the interface for AC charging and the lower DC interface for energy transmission during DC charging, while the upper half of the pins are used for communication. This design enables the CCS system to be compatible with different charging modes and provides more flexible charging options.
[0059] Furthermore, the preset time period can be determined based on system requirements and factors such as voltage detection accuracy and stability. During this time period, the ADC (analog-to-digital converter) continuously samples and measures the CP voltage. Due to various factors such as the hardware environment and electromagnetic interference, a single measured voltage value may have significant errors or fluctuations. Therefore, multiple measurements are performed to obtain multiple measured voltage values. These measured values collectively constitute a first voltage value set, which can be defined as V.
[0060] For example, in actual operation, the preset time period may be set to 10 milliseconds. During this 10 millisecond period, the ADC performs measurements at a certain frequency (e.g., sampling once every microsecond). Assuming that 100 measured voltage values are ultimately obtained, these 100 values constitute the first voltage value set. This provides a rich data foundation for subsequent data processing. By performing a series of operations on this data, such as sorting, convolution calculation, boundary filling, and outlier removal, the true value of the Control Pilot voltage can be more accurately determined, thereby accurately judging the charging status.
[0061] 102. Calculate an initial voltage value according to the first voltage value set, and move on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate multiple reference voltage values to obtain a second voltage value set.
[0062] In one embodiment, the initial voltage value is first calculated. Specifically, several voltage values starting from a specific position can be selected from the first voltage value set and calculated in combination with a set convolution kernel. For example, according to the scheme setting, the first voltage value set is first sorted, and then, based on the set sliding window width n and reading window width m, n elements are extracted from n / 2 as the starting position. Then, the preset convolution kernel C is used to calculate these n elements, and the result is the initial voltage value. This initial voltage value is the basis for subsequent calculations. It reflects the comprehensive characteristics of this part of the voltage value to a certain extent, and the convolution calculation can perform preliminary smoothing on local voltage fluctuations.
[0063] Furthermore, based on this initial voltage value, a sliding window is moved across the first voltage value set to cyclically calculate multiple reference voltage values. Starting from the starting position, the window moves by a fixed step size (for example, 1). After each move, the same method used to calculate the initial voltage value is used: n elements starting at the new position are extracted and calculated with the convolution kernel to obtain a new reference voltage value. This cycle repeats until the sliding window moves to a position near the end of the read window, for example, from n / 2 to mn / 2. In this way, a series of reference voltage values are obtained, which together constitute the second voltage value set.
[0064] For example, assuming the first voltage value set has m = 100 voltage values and a sliding window width of n = 10, after calculating the initial voltage value, 10 elements are extracted starting from the 10 / 2 + 1 = 6th position to calculate the next reference voltage value. This process is then repeated starting from the 7th position until the 100-10 / 2 = 95th position. This results in multiple reference voltage values, forming the second voltage value set. Compared to the first voltage value set, this second voltage value set has undergone a combination of convolution smoothing and sliding window processing, which can better reflect the actual voltage situation, reduce the impact of noise and outliers, and provide a more reliable data foundation for subsequent accurate judgment of the charging status.
[0065] 103. Modify the second voltage value set according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set.
[0066] In one embodiment, the maximum value v in the first voltage value set is max and the minimum value vmin It reflects the extreme value of the original measurement data. The second voltage value set is a reference voltage value set obtained through a series of processing (such as convolution calculation and sliding window operation), and its maximum value can be expressed as vb max , the minimum value is vb min Furthermore, a first deviation value may be calculated based on the maximum value in the first voltage value set and the maximum value in the second voltage value set, and a second deviation value may be calculated based on the minimum value in the first voltage value set and the minimum value in the second voltage value set. If the first deviation value or the second deviation value is greater than a preset value, the maximum value or the minimum value in the first voltage value set is discarded, and the second voltage value set is recalculated. The above steps are repeated until the updated first deviation value and the second deviation value are both less than the preset value, thereby completing the correction of the second voltage value set.
[0067] Specifically, in the above correction process, two deviation values need to be decomposed and calculated, namely the first deviation value w max =v max -vb max , and the second deviation value w min =vb min -v min , these two differences represent the degree of deviation between the extreme value of the original data and the extreme value of the processed data. max >w (w is the preset interference filter value) or w min >w, it means that the second voltage value set may be affected by a large interference or abnormal value. In this case, the second voltage value set needs to be adjusted. For example, if v max and VB max If the difference is too large, it may mean that the maximum value in the original data is an abnormally high value, which may be caused by factors such as instantaneous electromagnetic interference. Then it is necessary to eliminate the maximum value v in the first voltage value set. max , and then repeat the previous series of calculation steps (including calculating the new first voltage value set, initial voltage value, second voltage value set, etc.) until w max and w min All meet the requirements, that is, are less than the preset value. This embodiment, through this judgment and adjustment mechanism based on the difference between the two sets of extreme values, can effectively eliminate abnormal reference voltage values caused by factors such as noise and interference, so that the second voltage value set can more accurately reflect the actual situation of the CP voltage, thereby improving the reliability and accuracy of the entire voltage detection solution, ensuring that the charging status can be correctly judged in the CCS system, and ensuring the smooth progress of the charging process.
[0068] 104. Determine a CP state corresponding to each voltage value in the corrected second voltage value set.
[0069] In one embodiment, different CP voltage amplitudes in the CCS system correspond to different charging states. After obtaining the corrected second voltage value set, each voltage value needs to be analyzed to determine its corresponding CP state. The states represented by different CP amplitudes can be determined according to the CCS charging standard. For example, a CP amplitude of +12V indicates that the charging gun is not connected, a CP amplitude of +9V indicates that the charging gun is connected but the charging pile and the vehicle are not ready, a CP amplitude of +6V and +3V indicates that normal charging is possible, a CP amplitude of 0V indicates that the CP signal is short-circuited, and a CP amplitude of -12V indicates that the charging pile is unavailable.
[0070] In one embodiment, the step of determining the CP state corresponding to each voltage value in the revised second voltage value set may include determining a preset interval corresponding to each voltage value in the revised second voltage value set, and obtaining a state parameter corresponding to the preset interval as the current CP state. For example, if a voltage value is between 11V and 13V (a range for determining the +12V state, taking into account voltage fluctuations caused by hardware or other interference in a real environment), then the corresponding CP state can be determined to be charging plug disconnected. Similarly, if the voltage value is between 8V and 10V (assuming a reasonable range for determining the +9V state), then the corresponding CP state is charging plug connected, but the charging pile and vehicle are not ready. This one-by-one comparison process accurately determines the CP state corresponding to each voltage value in the revised second voltage value set, providing a key basis for charging control throughout the CCS system. This ensures that the system can perform corresponding operations based on the correct charging state, such as starting charging, pausing charging, and displaying an error message, thereby ensuring a safe, efficient, and accurate charging process.
[0071] As described above, the CP voltage detection method proposed in the embodiment of the present application can continuously obtain multiple measured voltage values through the ADC within a preset time period to obtain a first voltage value set, calculate an initial voltage value based on the first voltage value set, and move on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate multiple reference voltage values to obtain a second voltage value set, correct the second voltage value set based on the maximum and minimum values in the first voltage value set and the maximum and minimum values in the second voltage value set, and determine the CP state corresponding to each voltage value in the corrected second voltage value set. The embodiment of the present application can process the data of the ADC measurement value to eliminate noise and error, and then determine the state corresponding to different voltages, so that the detection of the CP voltage is more accurate.
[0072] The method described in the above embodiment will be further described below.
[0073] See also Figure 2 , Figure 2 This is a second flow chart of the CP voltage detection method provided in an embodiment of the present application. The method includes:
[0074] 201. Continuously acquire multiple measured voltage values within a preset time period through an ADC to obtain a first voltage value set.
[0075] Specifically, within a preset time period, the ADC continuously samples and measures the Control Pilot voltage. For example, the ADC continuously reads m measured voltage values V=(v1, v2, ..., v m ) is the first voltage value set, where m is the set reading window width, that is, the number of measured voltage values. Then the first voltage value set V can be further sorted to obtain the maximum value v max and the minimum value v min .
[0076] 202. Determine a target position in a first voltage value set.
[0077] 203. Calculate an initial voltage value according to a preset convolution kernel and a measured voltage value at a target position.
[0078] Furthermore, we can set the sliding window width to n, and n<m-1, and then set the convolution kernel C=(c1,c2,……,c n )=(1 / n, 1 / n,……, 1 / n). Then set n / 2 in V as the starting point and extract n elements as V n / 2 Next, calculate the reference voltage value V BM Elements in vb i (i=n / 2), the calculation formula is vb i =C×V n / 2 This is the first step of the convolution calculation. By multiplying the convolution kernel with the corresponding element of the extracted voltage value sequence and summing them, an initial element of the reference voltage value sequence, that is, the initial voltage value, is obtained.
[0079] 204 . Move on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate a plurality of reference voltage values.
[0080] Furthermore, this embodiment can continue to cyclically calculate other elements of the reference voltage value. For example, the starting position n / 2+p in V can be used (n / 2<p<mn / 2), and the n elements extracted are Vn / 2+p, and then the reference voltage value V can be calculated. BM Each element in vb i+p =C×V n / 2+pIn this loop, the read voltage value sequence is continuously moved in a sliding window manner. Each movement updates the elements in the reference voltage value sequence according to the same convolution calculation method, thereby gradually constructing a complete reference voltage value V BM .
[0081] 205. Fill before and after the plurality of reference voltage values respectively to obtain a second voltage value set.
[0082] In one embodiment, considering that the reference voltage values are a series of values obtained through sliding window and convolution calculations in the previous calculation process, the integrity of the data may be affected at the beginning and end of the sliding window. For example, the calculation method at the first and last positions is different from the sliding window calculation in the middle. Therefore, padding can be performed before and after the multiple reference voltage values. Specifically, a first preset number and a second preset number can be calculated based on the width of the sliding window and the number of measured voltage values. The first preset number of first padding values are added before the multiple reference voltage values, and the second preset number of second padding values are added after the multiple reference voltage values.
[0083] The boundary filling operation is to make the data at these boundary positions more reasonable and consistent in subsequent processing. Specifically, each element from 1 to n / 2 can be filled with vb n / 2 This is because there is no complete sliding window to calculate the convolution value before these positions, so the vb calculated at the starting position of the sliding window is used. n / 2 To fill it, so that its data characteristics are consistent with the values calculated based on the complete sliding window. Similarly, each element from mn / 2 to m can be filled with vb m-n / 2 , so that the entire V BM When performing operations such as sorting, boundary data will not have an unreasonable impact on the results due to differences in calculation methods, thereby ensuring the accuracy and stability of the entire data processing process and further improving the reliability of Control Pilot voltage detection.
[0084] 206 . Modify the second voltage value set according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set.
[0085] V BM Get the maximum value after sorting vb max and minimum value vb min , calculate the first deviation value w max =v max -vb max , and the second deviation value w min =vbmin -v min , if w max >w (w is the preset interference filter value) or w min >w, indicating that the second voltage value set may be affected by a large interference or abnormal value. In this case, the second voltage value set needs to be adjusted. For example, the maximum value v in the first voltage value set V can be eliminated. max or minimum value v min , and then repeat the previous series of calculation steps (including calculating the new first voltage value set, initial voltage value, second voltage value set, etc.) until w max and w min All meet the requirements, that is, are less than the preset value.
[0086] 207. Determine a CP state corresponding to each voltage value in the corrected second voltage value set.
[0087] In one embodiment, different CP voltage amplitudes in the CCS system correspond to different charging states. After obtaining the corrected second voltage value set, each voltage value is analyzed to determine its corresponding CP state. For example, after obtaining the ADC reading, a range is established for each charging state. For example, a CP amplitude of +12 represents state A, and the range is set to 11V to 13V to eliminate voltage fluctuations caused by hardware or other interference in real environments.
[0088] In this embodiment, by calculating the convolution sequence of ADC values for each channel over a period of time, a smoothed value can be calculated for that period, which is more accurate than direct measurement readings. Furthermore, by tracking maximum and minimum values, outliers or extreme readings can be discarded, helping to reduce errors caused by noise and interference. Furthermore, convolution can smooth out unusually sharp data, further facilitating noise reduction.
[0089] As described above, the CP voltage detection method proposed in the embodiment of the present application can continuously obtain multiple measured voltage values through ADC within a preset time period to obtain a first voltage value set, determine the target position in the first voltage value set, calculate the initial voltage value based on the preset convolution kernel and the measured voltage value of the target position, move on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate multiple reference voltage values, fill the front and back of the multiple reference voltage values respectively to obtain a second voltage value set, correct the second voltage value set according to the maximum and minimum values in the first voltage value set and the maximum and minimum values in the second voltage value set, and determine the CP state corresponding to each voltage value in the corrected second voltage value set. The embodiment of the present application can process the data of the ADC measurement value to eliminate noise and error, and then determine the state corresponding to different voltages, so that the detection of the CP voltage is more accurate.
[0090] In order to implement the above method, an embodiment of the present application further provides a CP voltage detection device, which can be integrated into a terminal device such as a mobile phone, a tablet computer, or the like.
[0091] For example, Figure 3 FIG. 1 is a schematic diagram of a structure of a CP voltage detection device provided in an embodiment of the present application. The CP voltage detection device may include:
[0092] An acquisition module 301 is configured to continuously acquire a plurality of measured voltage values within a preset time period through an ADC to obtain a first voltage value set;
[0093] a calculation module 302 configured to calculate an initial voltage value based on the first voltage value set, and cyclically calculate a plurality of reference voltage values by moving on the first voltage value set in a sliding window manner based on the initial voltage value, so as to obtain a second voltage value set;
[0094] a correction module 303, configured to correct the second voltage value set according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set;
[0095] The determination module 304 is configured to determine the CP state corresponding to each voltage value in the corrected second voltage value set.
[0096] As can be seen from the above, the CP voltage detection device proposed in the embodiment of the present application can continuously obtain multiple measured voltage values within a preset time period through the ADC to obtain a first voltage value set, calculate an initial voltage value based on the first voltage value set, and move on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate multiple reference voltage values to obtain a second voltage value set, and correct the second voltage value set based on the maximum and minimum values in the first voltage value set and the maximum and minimum values in the second voltage value set, and determine the CP state corresponding to each voltage value in the corrected second voltage value set. The embodiment of the present application can process the data of the ADC measurement value to eliminate noise and error, and then determine the state corresponding to different voltages, so that the detection of the CP voltage is more accurate.
[0097] All of the above technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.
[0098] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0099] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of computer programs, which can be loaded by a processor to execute the steps of any of the CP voltage detection methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0100] Continuously acquiring a plurality of measured voltage values within a preset time period through the ADC to obtain a first voltage value set;
[0101] calculating an initial voltage value according to the first voltage value set, and cyclically calculating a plurality of reference voltage values by moving on the first voltage value set in a sliding window manner based on the initial voltage value to obtain a second voltage value set;
[0102] modifying the second voltage value set according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set;
[0103] The CP state corresponding to each voltage value in the corrected second voltage value set is determined.
[0104] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0105] The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0106] Since the computer program stored in the storage medium can execute the steps of any CP voltage detection method provided in the embodiments of the present application, the beneficial effects that can be achieved by any CP voltage detection method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0107] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the device equipped with the chip executes the methods in the various possible implementation modes as described above.
[0108] For example, the computer device mentioned above can be a terminal device with corresponding functions such as a mobile phone, tablet computer, personal computer, cloud computer, etc. Figure 4 , Figure 4 A schematic diagram of the structure of a computer provided in an embodiment of the present application.
[0109] The computer device 400 may include components such as a memory 401 and a processor 402. Those skilled in the art will appreciate that Figure 4 The computer device structure shown in the figure does not constitute a limitation to the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0110] Memory 401 can be used to store applications and data. The applications stored in memory 401 include executable code. Applications can be composed of various functional modules. Processor 402 executes various functional applications and data processing by running the applications stored in memory 401.
[0111] The processor 402 is the control center of the computer device. It uses various interfaces and lines to connect the various parts of the entire computer device. By running or executing applications stored in the memory 401 and calling data stored in the memory 401, it performs various functions of the computer device and processes data, thereby monitoring the computer device as a whole.
[0112] In this embodiment, the processor 402 in the computer device loads the executable code corresponding to one or more application processes into the memory 401 according to the following instructions, and the processor 402 runs the application stored in the memory 401 to execute:
[0113] Continuously acquiring a plurality of measured voltage values within a preset time period through the ADC to obtain a first voltage value set;
[0114] calculating an initial voltage value according to the first voltage value set, and cyclically calculating a plurality of reference voltage values by moving on the first voltage value set in a sliding window manner based on the initial voltage value to obtain a second voltage value set;
[0115] modifying the second voltage value set according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set;
[0116] The CP state corresponding to each voltage value in the corrected second voltage value set is determined.
[0117] It is understood that the above scenarios are merely examples and do not limit the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, those skilled in the art will appreciate that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application will also be applicable to similar technical problems.
[0118] The steps in the method of the embodiment of the present application can be adjusted in order, combined, or deleted according to actual needs. The modules in the device of the embodiment of the present application can be combined, divided, or deleted according to actual needs.
[0119] In this application, the same or similar terminology, technical solutions and / or application scenario descriptions are generally only described in detail the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of this application, for the same or similar terminology, technical solutions and / or application scenario descriptions that are not described in detail later, you can refer to the previous relevant detailed descriptions.
[0120] In this application, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0121] The various technical features of the technical solution of this application can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0122] The above embodiments can be implemented in whole or in part through software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. A computer program product comprises one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. Available media can include magnetic media (e.g., floppy disks, storage disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks).
[0123] The above is a detailed introduction to a CP voltage detection method, device, electronic device, and storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, based on the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A CP voltage detection method, characterized in that: include: Continuously acquiring a plurality of measured voltage values within a preset time period through the ADC to obtain a first voltage value set; calculating an initial voltage value according to the first voltage value set, and moving on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate a plurality of reference voltage values to obtain a second voltage value set; According to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set, the second voltage value set is corrected, wherein a first deviation value is calculated according to the maximum value in the first voltage value set and the maximum value in the second voltage value set, and a second deviation value is calculated according to the minimum value in the first voltage value set and the minimum value in the second voltage value set, if the first deviation value or the second deviation value is greater than a preset value, the maximum value or the minimum value in the first voltage value set is eliminated, and the second voltage value set is updated, and the step of updating the second voltage value set is repeatedly executed until the updated first deviation value and the second deviation value are both less than the preset value, so as to complete the correction of the second voltage value set; A CP state corresponding to each voltage value in the corrected second voltage value set is determined.
2. The CP voltage detection method according to claim 1, characterized in that: Calculating an initial voltage value according to the first voltage value set includes: determining a target position in a first set of voltage values; The initial voltage value is calculated according to a preset convolution kernel and a measured voltage value at a target position.
3. The CP voltage detection method according to claim 2, characterized in that: After obtaining a plurality of reference voltage values, the method further includes: Calculating a first preset number and a second preset number according to the width of the sliding window and the number of measured voltage values; Adding a first preset number of first filling values before the plurality of reference voltage values; A second preset number of second filling values are added after the plurality of reference voltage values.
4. The CP voltage detection method according to claim 1, characterized in that: Determining a CP state corresponding to each voltage value in the corrected second voltage value set includes: Determine a preset interval corresponding to each voltage value in the corrected second voltage value set; The state parameter corresponding to the preset interval is obtained as the current CP state.
5. The CP voltage detection method according to claim 2, characterized in that: The specific process of calculating the initial voltage value includes: The calculation formula of the preset convolution kernel C is: C=(c1,c2,……,c n )=(1 / n, 1 / n,……, 1 / n), Among them, c1, c2, ..., c n is the element in the convolution kernel, n is the width of the sliding window, and n<m-1, m is the number of measured voltage values; The initial voltage value vb i The calculation formula is: vb i =C×V n / 2 Where i=n / 2, n / 2 is the starting bit in the first voltage value set V, V n / 2 are n elements extracted from the start bit in the first voltage value set V.
6. The CP voltage detection method according to claim 5, characterized in that: The specific process of calculating multiple reference voltage values includes: Set n / 2+p again as the starting bit in the first voltage value set V, where n / 2<p<mn / 2, to obtain V n / 2+p are n elements extracted from the starting position in the first voltage value set V; The reference voltage value vb i+p The calculation formula is: vb i+p =C×V n / 2+p 。 7. A CP voltage detection device, characterized in that: include: An acquisition module, configured to continuously acquire a plurality of measured voltage values within a preset time period through the ADC to obtain a first voltage value set; a calculation module, configured to calculate an initial voltage value according to the first voltage value set, and to move on the first voltage value set in a sliding window manner based on the initial voltage value to cyclically calculate a plurality of reference voltage values, so as to obtain a second voltage value set; a correction module, configured to correct the second voltage value set according to the maximum value and the minimum value in the first voltage value set and the maximum value and the minimum value in the second voltage value set, wherein a first deviation value is calculated according to the maximum value in the first voltage value set and the maximum value in the second voltage value set, and a second deviation value is calculated according to the minimum value in the first voltage value set and the minimum value in the second voltage value set, and if the first deviation value or the second deviation value is greater than a preset value, the maximum value or the minimum value in the first voltage value set is eliminated, and the second voltage value set is updated, and the step of updating the second voltage value set is repeatedly executed until the updated first deviation value and the second deviation value are both less than the preset value, so as to complete the correction of the second voltage value set; The determination module is used to determine the CP state corresponding to each voltage value in the corrected second voltage value set.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor executes the steps in the CP voltage detection method according to any one of claims 1 to 6 by calling the computer program stored in the memory.
9. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the CP voltage detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Charging pile CP signal voltage detection method and device
CN113655268A
Insulation resistance value detection method during connection of power battery of electric vehicle
CN113655278A