Vehicle window position determination method and device and electronic equipment

By calculating the increase and decrease ratios of the motor target current data, the number of current ripples is determined, which solves the problem of low calculation accuracy in the prior art, and achieves higher accuracy in the calculation of window movement distance.

CN119434795APending Publication Date: 2025-02-14ZHEJIANG LEAPMOTOR TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411756533.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, the number of current ripple cannot be accurately calculated, resulting in a low accuracy in calculating the window movement distance.

Method used

By obtaining the target current data of the motor, calculate the rise and fall rate ratio, and combine the threshold comparison to determine the number of current ripple, and calculate the window movement distance based on the number of current ripple.

Benefits of technology

The calculation accuracy of the number of current ripple is improved, and the calculation accuracy of the window moving distance is improved, avoiding misjudgment of current jitter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119434795A_ABST
    Figure CN119434795A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle window position determining method and device and electronic equipment. The method comprises the following steps: acquiring target current data of a motor; the motor is used for driving the window to move; calculating an ascending amplitude ratio and a descending amplitude ratio corresponding to the target current data; determining the number of current ripples according to the ascending amplitude ratio and the descending amplitude ratio; and according to the number of the current ripples, determining the vehicle window moving distance. On the basis of the method, small waveforms generated by current jitter can be prevented from being recognized as the current ripples, the calculation accuracy of the number of the current ripples is improved, and then the calculation accuracy of the vehicle window moving distance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile control technology, and in particular to a method, device, and electronic device for determining a vehicle window position. Background Art

[0002] In the car structure, the motor rotates and drives the window to move. The motor consists of magnetic poles, rotor coils, and commutators. According to the right-hand rule, after the rotor coil is energized, it moves under the action of the magnetic field of the magnetic poles. When it moves to the edge of the magnetic field, the magnetic field weakens, the electromotive force decreases, and the current increases. The commutator changes the current direction of the rotor coil, and the rotor coil re-enters the magnetic field, the electromotive force increases, and the current decreases. The rotor coil keeps rotating, the electromotive force and current keep changing, and thus current ripples are constantly generated. Therefore, current ripples are an inherent characteristic of the motor. By counting the number of current ripples, the distance the window moves can be calculated.

[0003] In the prior art, the peak values ​​(or valley values) in the current are usually counted, and the data between two adjacent peak values ​​(or two adjacent valley values) are identified as a current ripple. This method is easy to identify current jitter as current ripple, so the calculation accuracy is low. Summary of the invention

[0004] The present application provides a method, device, and electronic device for determining a vehicle window position to solve the technical problem of being unable to accurately calculate the number of current ripples.

[0005] In a first aspect, the present application provides a method for determining a vehicle window position, the method comprising:

[0006] Acquiring target current data of a motor used to drive the vehicle window to move;

[0007] Calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data;

[0008] Determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio;

[0009] The moving distance of the vehicle window is determined according to the number of the current ripples.

[0010] In some embodiments, obtaining target current data of the motor includes:

[0011] Get the initial current data of the motor;

[0012] amplifying the initial current data to obtain first current data;

[0013] Performing analog-to-digital conversion on the first current data to obtain second current data;

[0014] The second current data is filtered to obtain target current data.

[0015] In some embodiments, calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data includes:

[0016] Determining a plurality of peak values ​​and a plurality of valley values ​​from the target current data;

[0017] Subtract two adjacent peak values ​​from valley values ​​to obtain a first current variation;

[0018] Subtract two adjacent valley values ​​from the peak value to obtain a second current variation;

[0019] Calculating the absolute value of the second current variation to obtain a third current variation;

[0020] Determine a maximum value from the first current variation and the third current variation as the overall amplitude;

[0021] Calculating a ratio of the first current change to the overall amplitude as a rising amplitude ratio;

[0022] The ratio of the third current change to the overall amplitude is calculated as the decrease amplitude ratio.

[0023] In some embodiments, determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio includes:

[0024] Comparing the rising amplitude ratio with a first threshold, and determining the number of rising amplitude ratios greater than or equal to the first threshold as a first target number;

[0025] Comparing the decrease amplitude ratio with a second threshold, and determining the number of decrease amplitude ratios greater than or equal to the second threshold as a second target number;

[0026] The number of current ripples is calculated according to the first target number and the second target number.

[0027] In some embodiments, the number of current ripples is obtained by averaging the first target number and the second target number and rounding up.

[0028] In some embodiments, determining the window movement distance according to the number of current ripples includes:

[0029] Get the motor running time;

[0030] Detect whether the motor running time is less than the time threshold;

[0031] When it is determined that the motor operation time is less than the time threshold, determining the current motor forward driving time;

[0032] Determining a distance compensation value according to the current motor forward driving time and the motor running speed;

[0033] Multiplying the number of current ripples by the proportionality coefficient to obtain an initial moving distance;

[0034] The distance compensation value is added to the initial moving distance to obtain the window moving distance.

[0035] In some embodiments, determining the current motor follow-up time includes:

[0036] Get current voltage data and current temperature data;

[0037] Input the current voltage data and the current temperature data into the target mapping function to obtain the current motor forward driving time;

[0038] The target mapping function is pre-constructed in the following manner:

[0039] Obtain historical voltage data, historical temperature data, and historical motor forward drive time;

[0040] The historical voltage data, historical temperature data, and historical motor follow-up time are curve fitted to construct the target mapping function.

[0041] In some embodiments, after detecting whether the motor operation time is less than a time threshold, the method further includes:

[0042] When it is determined that the motor running time is greater than or equal to the time threshold, the number of current ripples is multiplied by the proportionality coefficient to obtain an initial moving distance;

[0043] The initial moving distance is taken as the window moving distance.

[0044] In a second aspect, the present application proposes a device for determining a vehicle window position, comprising:

[0045] An acquisition module, used for acquiring target current data of a motor; the motor is used for driving the window to move;

[0046] A first calculation module, used for calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data;

[0047] A second calculation module, used for determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio;

[0048] The third calculation module is used to determine the moving distance of the vehicle window according to the number of current ripples.

[0049] In a third aspect, the present application proposes an electronic device, comprising a processor and a memory for storing instructions executable by the processor, wherein the processor implements the steps of any of the above-mentioned methods for determining the vehicle window position when executing the instructions.

[0050] In a fourth aspect, the present application further proposes a storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of any of the above-mentioned methods for determining the vehicle window position.

[0051] The present application can achieve the following beneficial effects: it can avoid identifying the tiny waveforms generated by current jitter as current ripples, improve the calculation accuracy of the number of current ripples, and thus improve the calculation accuracy of the window movement distance. Furthermore, error compensation is performed for the situation where the motor is closed prematurely, which can also improve the calculation accuracy of the window movement distance. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0053] Figure 1 A schematic flow chart of a method for determining a vehicle window position provided in an embodiment of the present application;

[0054] Figure 2 A schematic diagram of initial current data provided for an embodiment of the present application;

[0055] Figure 3 A schematic diagram of first current data provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of the structure of a device for determining a vehicle window position provided in an embodiment of the present application;

[0057] Figure 5 A schematic diagram of target current data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0059] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.

[0060] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0061] In the car structure, the motor rotates and drives the window to move. The motor consists of magnetic poles, rotor coils, and commutators. According to the right-hand rule, after the rotor coil is energized, it moves under the action of the magnetic field of the magnetic poles. When it moves to the edge of the magnetic field, the magnetic field weakens, the electromotive force decreases, and the current increases. The commutator changes the current direction of the rotor coil, and the rotor coil re-enters the magnetic field, the electromotive force increases, and the current decreases. The rotor coil keeps rotating, the electromotive force and current keep changing, and thus current ripples are constantly generated. Therefore, current ripples are an inherent characteristic of the motor. By counting the number of current ripples, the distance the window moves can be calculated.

[0062] In the prior art, the peak values ​​(or valley values) in the current are usually counted, and the data between two adjacent peak values ​​(or two adjacent valley values) are identified as a current ripple. This method is prone to identifying current jitter or depression as current ripple, resulting in misjudgment of current ripple, so the calculation accuracy is low. For details, please refer to Figure 5, A, C, E, G represent valley values, B, D, F represent peak values, but D is the peak value caused by current jitter, not the peak value of the current ripple. With the existing technology, the ABC segment data is identified as one current ripple, the CDE segment data is identified as one current ripple, and the EFG segment data is identified as one current ripple, and it is believed that there are 3 current ripples in this segment of current data. However, the actual situation is that the ABCDE segment data is regarded as a current ripple, the EFG segment data is regarded as a current ripple, and there are 2 current ripples in this segment of current data. Therefore, the existing technology will also identify the tiny waveform caused by current jitter as a current ripple, which will lead to misjudgment of the current ripple.

[0063] The present application proposes a method, device, and electronic device for determining a vehicle window position, which can improve the accuracy of current ripple recognition and thereby improve the accuracy of calculating the movement distance of the vehicle window.

[0064] A method, device, and electronic device for determining a vehicle window position provided by the present application are introduced below in conjunction with the accompanying drawings.

[0065] In some embodiments, please refer to Figure 1 , the present application proposes a method for determining the position of a vehicle window. When implemented specifically, the method may include the following contents.

[0066] S101: Acquire target current data of a motor; the motor is used to drive the vehicle window to move.

[0067] In some embodiments, obtaining target current data of the motor specifically includes:

[0068] S1: Get the initial current data of the motor;

[0069] S2: amplifying the initial current data to obtain first current data;

[0070] S3: performing analog-to-digital conversion on the first current data to obtain second current data;

[0071] S4: Filter the second current data to obtain target current data.

[0072] In some embodiments, initial current data at different sampling times are obtained by sampling, and it is ensured that there are more than 8 sampling points in each cycle, such as Figure 2 The initial current data is amplified to obtain the first current data. The first current data is shown in Figure 3 The first current data (analog signal) is converted into digital form to obtain the second current data (digital signal).

[0073] In some embodiments, the second current data may be subjected to mean filtering to obtain target current data. Mean filtering can reduce abnormal waveforms such as sudden changes and depressions generated in the second current data, making the waveform of the target current data after filtering closer to the real waveform and enhancing anti-interference capability.

[0074] In some embodiments, the formula for mean filtering is:

[0075]

[0076] Wherein, from t0 to t1 represents a filtering cycle, t0 represents the starting time of the filtering cycle, t1 represents the ending time of the filtering cycle, and there are num second current data in the filtering cycle, I represents the second current data, I 平均 Represents the target current data. By using the above formula, the target current data is obtained by averaging all the second current data within the filtering period.

[0077] In some embodiments, the total sampling time is divided into a plurality of filtering periods, and a mean filtering process is performed for each filtering period.

[0078] S102: Calculate the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data.

[0079] In some embodiments, calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data specifically includes:

[0080] S1: determining a plurality of peak values ​​and a plurality of valley values ​​from the target current data;

[0081] S2: Subtract two adjacent peak values ​​from the valley value to obtain a first current variation; the first current variation is a positive number; the sampling time of the peak value is greater than the sampling time of the valley value;

[0082] S3: Subtract two adjacent valley values ​​from the peak value to obtain a second current variation; the second current variation is a negative number; the sampling time of the valley value is greater than the sampling time of the peak value;

[0083] S4: Calculate the absolute value of the second current change to obtain a third current change;

[0084] S5: determining a maximum value from the first current variation and the third current variation as the overall amplitude;

[0085] S6: Calculate the ratio of the first current change to the overall amplitude as the rising amplitude ratio;

[0086] S7: Calculate the ratio of the third current change to the overall amplitude as the decrease amplitude ratio.

[0087] In some embodiments, Figure 5 The target current data shown is explained according to Figure 5 It can be seen that A, C, E, and G represent valley values, and B, D, and F represent peak values. Subtract B from A (B minus A) to obtain a first current change. Subtract C from B (C minus B) to obtain a second current change. Subtract D from C (D minus C) to obtain a first current change. Subtract E from D (E minus D) to obtain a second current change. Subtract F from E (F minus E) to obtain a first current change. Subtract G from F (G minus F) to obtain a second current change. Calculate the absolute value of each second current change to obtain the third current change. Determine the maximum value from the first current change and the third current change as the overall amplitude, and the overall amplitude represents the maximum value of the difference between adjacent peaks and valleys. Calculate the ratio of each first current change to the overall amplitude as the rising amplitude ratio. Calculate the ratio of each third current change to the overall amplitude as the falling amplitude ratio.

[0088] In some embodiments, all target current data may be taken as a whole to calculate the rising amplitude ratio and the falling amplitude ratio. In each filtering cycle, the overall amplitude in the filtering cycle may be determined, and then the rising amplitude ratio and the falling amplitude ratio in the filtering cycle may be determined.

[0089] S103: Determine the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio.

[0090] In some embodiments, determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio specifically includes:

[0091] S1: Compare the rising amplitude ratio with a first threshold value, and determine the number of rising amplitude ratios greater than or equal to the first threshold value as a first target number;

[0092] S2: comparing the decrease amplitude ratio with a second threshold, and determining the number of decrease amplitude ratios greater than or equal to the second threshold as a second target number;

[0093] S3: Calculate the number of current ripples according to the first target number and the second target number.

[0094] In some embodiments, the first threshold is set equal to 50%, and the second threshold is set equal to 50%.

[0095] In some embodiments, the number of current ripples is obtained by averaging the first target number and the second target number and rounding up.

[0096] Specifically, the formula for calculating the number of current ripples is:

[0097]

[0098] Wherein, N represents the number of current ripples, Int represents the rounding-up function, N1 represents the first target number, and N2 represents the second target number.

[0099] In some embodiments, the target current data corresponding to the adjacent rising amplitude ratios greater than or equal to the first threshold and the target current data corresponding to the falling amplitude ratios greater than or equal to the second threshold may be combined as a current ripple.

[0100] S104: Determine the window movement distance according to the number of current ripples.

[0101] In some embodiments, when the window moves from the bottom to the top, if the motor is turned off in advance, the rotor coil inside the motor will continue to rotate for a period of time before it stops completely due to load and inertia. This period of time (from turning off the motor to stopping completely) is called the motor follow-up time. During the motor follow-up time, the window will move a certain distance toward the top, so error compensation needs to be performed for this distance. The motor follow-up time will be affected by temperature and voltage.

[0102] In some embodiments, determining the window movement distance according to the number of current ripples specifically includes:

[0103] S1: Get the motor running time;

[0104] S2: Check whether the motor running time is less than the time threshold;

[0105] S3: When it is determined that the motor running time is less than the time threshold, determine the current motor forward driving time;

[0106] S4: determining a distance compensation value according to the current motor forward driving time and the motor running speed;

[0107] S5: multiplying the number of current ripples by the proportionality coefficient to obtain an initial moving distance;

[0108] S6: Add the distance compensation value to the initial moving distance to obtain the window moving distance.

[0109] In some embodiments, the duration threshold is equal to the time required for the motor to drive the window to move from the bottom to the top without shutting down the motor in advance. If the motor operation time is less than the duration threshold, it means that there is motor follow-up time and error compensation is required. If the motor operation time is greater than or equal to the duration threshold, it means that the motor is not shut down in advance and error compensation is not required.

[0110] In some embodiments, determining the current motor follow-up time includes:

[0111] S1: Get current voltage data and current temperature data;

[0112] S2: Input the current voltage data and the current temperature data into the target mapping function to obtain the current motor forward driving time;

[0113] The target mapping function is pre-constructed in the following manner:

[0114] S1: Obtain historical voltage data, historical temperature data, and historical motor forward driving time;

[0115] S2: Perform curve fitting on historical voltage data, historical temperature data, and historical motor follow-up time to construct a target mapping function.

[0116] In some embodiments, the load is kept unchanged, the voltage and temperature of the motor can be changed multiple times, and the motor follow-up time under different voltage and temperature conditions can be measured, thereby obtaining multiple sets of historical voltage data, historical temperature data, and historical motor follow-up time with corresponding relationships. The historical voltage data, historical temperature data, and historical motor follow-up time are curve fitted, and the historical voltage data and historical temperature data are used as independent variables, and the historical motor follow-up time is used as the dependent variable to construct a target mapping function. Then, the current voltage data and current temperature data collected this time are input into the target mapping function, and the current motor follow-up time is output, which is recorded as ΔT.

[0117] In some embodiments, the motor speed V can be represented by the number of current ripples passing through the filtering period (t0 to t1), n represents the number of current ripples passing through the filtering period. That is, the motor speed V is equal to the sum of the number of current ripples passing through the filtering period (t0 to t1).

[0118] In some embodiments, the distance compensation value L1 is determined by the following formula:

[0119]

[0120] Based on the above embodiments, the motor running speed and the motor follow-up time are used for compensation, which can adapt to the assembly differences of vehicle windows, different ambient temperatures and vehicle voltage changes, improve the robustness of vehicle window distance detection, and enhance the accuracy of vehicle window distance detection.

[0121] In some embodiments, the number of current ripples N is multiplied by the proportionality coefficient k to obtain the initial moving distance L0, ie, L0 = N × k.

[0122] In some embodiments, the motor is not turned off in advance, and the motor is used to drive the window to move from the bottom to the top. The distance the window moves is recorded as L2, and the number of current ripples generated is recorded as N3. The proportional coefficient k is expressed as

[0123]

[0124] In some embodiments, the sum of the initial moving distance L0 and the distance compensation value L1 is used as the window moving distance.

[0125] In some embodiments, after detecting whether the motor operation time is less than a time threshold, the method further includes:

[0126] S1: when it is determined that the motor running time is greater than or equal to the time threshold, multiply the number of current ripples by the proportionality coefficient to obtain an initial moving distance;

[0127] S2: taking the initial moving distance as the window moving distance.

[0128] In some embodiments, if the motor is not turned off in advance and error compensation is not required, the initial moving distance L0 is used as the window moving distance.

[0129] Based on the above embodiment, it is possible to avoid identifying the tiny waveform generated by current jitter as current ripples, thereby improving the calculation accuracy of the number of current ripples, and thus improving the calculation accuracy of the window movement distance. Furthermore, error compensation is performed for the situation where the motor is closed early, which can also improve the calculation accuracy of the window movement distance.

[0130] Based on the above-mentioned method for determining the position of a vehicle window, one or more embodiments of the present application further provide a device for determining the position of a vehicle window. Figure 4 It is a structural diagram of an embodiment of a device for determining a vehicle window position provided in the present application. The device for determining a vehicle window position provided in the present application may include: an acquisition module 401, a first calculation module 402, a second calculation module 403, and a third calculation module 404.

[0131] An acquisition module 401 is used to acquire target current data of a motor; the motor is used to drive the window to move;

[0132] A first calculation module 402, used to calculate the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data;

[0133] A second calculation module 403 is used to determine the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio;

[0134] The third calculation module 404 is used to determine the moving distance of the vehicle window according to the number of current ripples.

[0135] In some embodiments, the acquisition module 401 is specifically used to acquire initial current data of the motor; amplify the initial current data to obtain first current data; perform analog-to-digital conversion on the first current data to obtain second current data; and filter the second current data to obtain target current data.

[0136] In some embodiments, the first calculation module 402 is specifically used to determine multiple peak values ​​and multiple valley values ​​from the target current data; subtract two adjacent peak values ​​from the valley values ​​to obtain a first current change; subtract two adjacent valley values ​​from the peak value to obtain a second current change; calculate the absolute value of the second current change to obtain a third current change; determine the maximum value from the first current change and the third current change as the overall amplitude; calculate the ratio of the first current change to the overall amplitude as the rising amplitude ratio; calculate the ratio of the third current change to the overall amplitude as the falling amplitude ratio.

[0137] In some embodiments, the second calculation module 403 is specifically used to compare the rising amplitude ratio with the first threshold value, determine the number of rising amplitude ratios greater than or equal to the first threshold value as the first target number; compare the falling amplitude ratio with the second threshold value, determine the number of falling amplitude ratios greater than or equal to the second threshold value as the second target number; calculate the number of current ripples based on the first target number and the second target number.

[0138] In some embodiments, the third calculation module 404 is specifically used to obtain the motor running time; detect whether the motor running time is less than the time threshold; when it is determined that the motor running time is less than the time threshold, determine the current motor follow-up time; determine the distance compensation value according to the current motor follow-up time and the motor running speed; multiply the number of current ripples by the proportional coefficient to obtain the initial moving distance; add the distance compensation value to the initial moving distance to obtain the window moving distance.

[0139] It should be noted that the above-mentioned device may also include other implementation modes according to the description of the method embodiment. The specific implementation mode may refer to the description of the relevant method embodiment, which will not be described one by one here.

[0140] The present application also provides an electronic device, comprising at least one processor and a memory for storing processor executable instructions, wherein the processor can implement any one of the above method embodiments when executing the instructions. For example, when the instructions are executed by the processor, the following steps are implemented: obtaining target current data of the motor; the motor is used to drive the window to move; calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data; determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio; and determining the window movement distance according to the number of current ripples.

[0141] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0142] It should be noted that the electronic device described above may also include other implementations according to the description of the method or device embodiment. The specific implementation methods may refer to the description of the relevant method embodiment, which will not be described one by one here.

[0143] The present application also provides a storage medium, which is a computer-readable storage medium, and the storage medium stores computer program instructions, which, when executed, implement: obtaining target current data of the motor; the motor is used to drive the vehicle window to move; calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data; determining the number of current ripples based on the rising amplitude ratio and the falling amplitude ratio; and determining the movement distance of the vehicle window based on the number of current ripples.

[0144] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0146] In summary, although the present application has been disclosed as above with preferred embodiments, the above preferred embodiments are not intended to limit the present application. Ordinary technicians in this field can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined in the claims.

Claims

1. A method for determining a vehicle window position, characterized in that: include: Get the target current data of the motor; The motor is used to drive the vehicle window to move; Calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data; Determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio; The moving distance of the vehicle window is determined according to the number of the current ripples.

2. The method according to claim 1, characterized in that Get the target current data of the motor, including: Get the initial current data of the motor; amplifying the initial current data to obtain first current data; Performing analog-to-digital conversion on the first current data to obtain second current data; The second current data is filtered to obtain target current data.

3. The method according to claim 1, characterized in that Calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data includes: Determining a plurality of peak values ​​and a plurality of valley values ​​from the target current data; Subtract two adjacent peak values ​​from valley values ​​to obtain a first current variation; Subtract two adjacent valley values ​​from the peak value to obtain a second current variation; Calculating the absolute value of the second current variation to obtain a third current variation; Determine a maximum value from the first current variation and the third current variation as the overall amplitude; Calculating a ratio of the first current change to the overall amplitude as a rising amplitude ratio; The ratio of the third current change to the overall amplitude is calculated as the decrease amplitude ratio.

4. The method according to claim 1, characterized in that: Determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio includes: Comparing the rising amplitude ratio with a first threshold, and determining the number of rising amplitude ratios greater than or equal to the first threshold as a first target number; Comparing the decrease amplitude ratio with a second threshold, and determining the number of decrease amplitude ratios greater than or equal to the second threshold as a second target number; The number of current ripples is calculated according to the first target number and the second target number.

5. The method according to claim 4, characterized in that The number of current ripples is obtained by taking an average of the first target number and the second target number and rounding it up.

6. The method according to claim 1, characterized in that Determining the window movement distance according to the number of current ripples includes: Get the motor running time; Detect whether the motor running time is less than the time threshold; When it is determined that the motor operation time is less than the time threshold, determining the current motor forward driving time; Determining a distance compensation value according to the current motor forward driving time and the motor running speed; Multiplying the number of current ripples by the proportionality coefficient to obtain an initial moving distance; The distance compensation value is added to the initial moving distance to obtain the window moving distance.

7. The method according to claim 6, characterized in that Determine the current motor forward drive time, including: Get current voltage data and current temperature data; Input the current voltage data and the current temperature data into the target mapping function to obtain the current motor forward driving time; The target mapping function is pre-constructed in the following manner: Obtain historical voltage data, historical temperature data, and historical motor forward drive time; The historical voltage data, historical temperature data, and historical motor follow-up time are curve fitted to construct the target mapping function.

8. The method according to claim 6, characterized in that After detecting whether the motor operation time is less than a time threshold, the method further includes: When it is determined that the motor running time is greater than or equal to the time threshold, the number of current ripples is multiplied by the proportionality coefficient to obtain an initial moving distance; The initial moving distance is taken as the window moving distance.

9. A device for determining a vehicle window position, characterized in that: include: An acquisition module, used for acquiring target current data of the motor; The motor is used to drive the vehicle window to move; A first calculation module, used for calculating the rising amplitude ratio and the falling amplitude ratio corresponding to the target current data; A second calculation module, used for determining the number of current ripples according to the rising amplitude ratio and the falling amplitude ratio; The third calculation module is used to determine the moving distance of the vehicle window according to the number of current ripples.

10. An electronic device, comprising a processor and a memory for storing processor-executable instructions, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the instructions.

11. A storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.