A control method and device of a sunshade curtain, a vehicle and a storage medium

By acquiring the Hall pulse width time and current value of the motor, cluster analysis is used to determine the motion state of the sunshade curtain. Combined with anti-pinch conditions, anti-pinch control is implemented, which solves the problem of insufficient accuracy caused by fixed thresholds in the anti-pinch control of sunshade curtains and improves the accuracy of anti-pinch judgment.

CN123169631APending Publication Date: 2026-11-27CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611503062.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing sunshade curtain anti-pinch control systems, the fixed threshold setting leads to insufficient accuracy in anti-pinch judgment, which is prone to missed judgments or false judgments.

Method used

By acquiring the Hall pulse width time and current value of the motor, multiple cluster centers are determined using cluster analysis, forming feature vectors for identification. Anti-pinch control is then performed by combining the target cluster center and anti-pinch conditions, avoiding reliance on fixed thresholds.

Benefits of technology

It improves the accuracy of anti-pinch judgment of sunshade curtains, avoids missed judgments or false judgments, and realizes anti-pinch control that combines cluster state recognition and threshold comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123169631A_ABST
    Figure CN123169631A_ABST
Patent Text Reader

Abstract

The application relates to a control method and device of a sunshade curtain, a vehicle and a storage medium. The method comprises the following steps: in the process of driving the sunshade curtain to move by using a motor, a first Hall pulse width time and a first current value of the motor are acquired; a plurality of clustering centers are determined, each of which corresponds to a movement state of the sunshade curtain; the first Hall pulse width time and the first current value are used to form a first feature vector, so that a target clustering center to which the first feature vector belongs is determined from the plurality of clustering centers; the first Hall pulse width time and the first current value are compared with a target anti-pinch condition, so that an anti-pinch comparison result is obtained; and the sunshade curtain is controlled based on the movement state corresponding to the target clustering center and the anti-pinch comparison result. The application avoids the drawbacks of missed judgment or misjudgment caused by anti-pinch control depending on fixed threshold comparison only, and improves the accuracy of anti-pinch judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, specifically to a control method, device, vehicle, and storage medium for a sunshade. Background Technology

[0002] Car electric sunshades may trap passengers or objects during closing. To prevent personal injury or property damage, anti-pinch control is necessary. Currently, a threshold-based anti-pinch control method is commonly used. This involves comparing the operating parameters of the motor driving the sunshade with a preset fixed threshold during its movement. If the operating parameters exceed the fixed threshold, a pinch is detected, and anti-pinch control is executed. However, using a fixed threshold for anti-pinch detection has several drawbacks. If the fixed threshold is set too high, anti-pinch control may not be triggered promptly when pinching actually occurs. If the fixed threshold is set too low, the sunshade may be misjudged as pinching during normal operation, leading to insufficient accuracy in anti-pinch detection. Summary of the Invention

[0003] One objective of this application is to provide a control method for a sunshade curtain, which avoids the drawbacks of missed or false judgments caused by relying solely on fixed threshold comparisons for anti-pinch control, and improves the accuracy of anti-pinch judgment; a second objective of this application is to provide a control device for a sunshade curtain; a third objective of this application is to provide a vehicle; and a fourth objective of this application is to provide a storage medium.

[0004] To achieve the above objectives, firstly, this application provides a method for controlling a sunshade curtain, comprising: During the process of using a motor to drive the sunshade curtain to move, the first Hall pulse width time and the first current value of the motor are obtained; Multiple cluster centers are determined. These cluster centers are obtained by performing cluster analysis on the feature vectors formed by the Hall pulse width time and current value of the motor at each sampling time during the calibration of the sunshade. Each cluster center corresponds to the motion state of the sunshade. The first Hall pulse width time and the first current value are used to form a first feature vector to determine the target cluster center to which the first feature vector belongs from the plurality of cluster centers; The first Hall pulse width time and the first current value are compared with the target anti-pinch conditions to obtain the anti-pinch comparison result; Based on the motion state corresponding to the target cluster center and the anti-pinch comparison result, the sunshade curtain is subjected to anti-pinch control.

[0005] To achieve the above objectives, in a second aspect, this application provides a control device for a sunshade curtain, comprising: The acquisition module is used to acquire the first Hall pulse width time and the first current value of the motor during the process of driving the sunshade curtain to move using the motor; The determination module is used to determine multiple cluster centers. The multiple cluster centers are obtained by performing cluster analysis on the feature vector formed by the Hall pulse width time and current value of the motor at each sampling time during the calibration of the sunshade. Each cluster center corresponds to the motion state of the sunshade. The determining module is further configured to construct a first feature vector from the first Hall pulse width time and the first current value, so as to determine the target cluster center to which the first feature vector belongs from the plurality of cluster centers; The comparison module is used to compare the first Hall pulse width time, the first current value and the target anti-pinch condition to obtain the anti-pinch comparison result; The control module is used to perform anti-pinch control on the sunshade based on the motion state corresponding to the target cluster center and the anti-pinch comparison result.

[0006] To achieve the above objectives, in a third aspect, this application also provides a vehicle, including: a processor and a memory, wherein the processor is configured to execute a control program for a sunshade stored in the memory to implement the sunshade control method described above.

[0007] To achieve the above objectives, in a fourth aspect, this application also provides a storage medium storing one or more programs that can be executed by one or more processors to implement the sunshade control method described above.

[0008] The beneficial effects of this application are as follows: This application provides a control method for a sunshade curtain. During the process of driving the sunshade curtain to move using a motor, the first Hall pulse width time and the first current value of the motor are acquired; multiple cluster centers are determined, which are obtained by performing cluster analysis on the feature vectors formed by the Hall pulse width time and current value of the motor at each sampling time during the calibration of the sunshade curtain. Each cluster center corresponds to the motion state of the sunshade curtain; the first Hall pulse width time and the first current value are used to form a first feature vector to determine the target cluster center to which the first feature vector belongs from the multiple cluster centers; the first Hall pulse width time and the first current value are compared with the target anti-pinch condition to obtain the anti-pinch comparison result; based on the motion state corresponding to the target cluster center and the anti-pinch comparison result, the sunshade curtain is subjected to anti-pinch control. Through the above methods, this application acquires the first Hall pulse width time and the first current value of the motor during the movement of the sunshade curtain. Based on the calibrated cluster center corresponding to the movement state, it identifies the feature vector composed of the first Hall pulse width time and the first current value to determine the target cluster center and its corresponding movement state. At the same time, it compares the first Hall pulse width time and the first current value with the target anti-pinch conditions to obtain the anti-pinch comparison result. It then combines the movement state and the anti-pinch comparison result to perform anti-pinch control on the sunshade curtain. This achieves anti-pinch control that combines cluster state recognition with threshold comparison, avoiding the drawbacks of missed or false judgments caused by relying solely on fixed threshold comparison for anti-pinch control, and improving the accuracy of anti-pinch judgment. Attached Figure Description

[0009] Figure 1 This diagram illustrates a flow chart of a sunshade control method provided in an embodiment of this application. Figure 2 A flowchart illustrating another method for controlling a sunshade curtain provided in an embodiment of this application is shown. Figure 3 This diagram illustrates a calibration method for a sunshade curtain provided in an embodiment of this application. Figure 4 This diagram illustrates a flowchart of another calibration method for a sunshade curtain provided in an embodiment of this application. Figure 5 This diagram illustrates the distribution of calibration points for a sunshade curtain provided in an embodiment of this application. Figure 6 This is a top view of an automated calibration device for a sunshade provided in an embodiment of this application; Figure 7 This illustration shows a side view of another automated calibration device for a sunshade provided in an embodiment of this application; Figure 8 This diagram illustrates a system block diagram of the main control board in an automated calibration device for a sunshade provided in an embodiment of this application. Figure 9This diagram illustrates the structure of a control device for a sunshade curtain according to an embodiment of this application. Figure 10 This illustration shows a structural diagram of a vehicle provided in an embodiment of this application. Detailed Implementation

[0010] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.

[0011] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0012] To facilitate understanding of the embodiments of this application, the following will provide further explanation and description with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of this application.

[0013] refer to Figure 1 , Figure 1 This application provides a flowchart illustrating a method for controlling a sunshade curtain. The method includes the following steps: S101: During the process of using a motor to drive the sunshade curtain to move, the first Hall pulse width time and the first current value of the motor are obtained.

[0014] In this embodiment, a sunshade refers to a sunshade installed on a vehicle that can automatically open and close under the drive of a motor. This embodiment uses an electric car sunshade as an example. The motor refers to the driving component that drives the sunshade's movement; in this embodiment, the motor can be a DC brushed motor.

[0015] Hall pulse width duration refers to the duration of a single high or low level of a Hall pulse output by the Hall sensor on the motor. It reflects the motor speed; the faster the motor speed, the shorter the Hall pulse width duration, and vice versa. The first Hall pulse width duration refers to the real-time Hall pulse width duration acquired during the motor-driven movement of the sunshade, used to characterize the current motor speed.

[0016] The current value refers to the magnitude of the current flowing through the motor during operation, reflecting the magnitude of the resistance experienced by the motor. As the resistance increases, the current value rises. The first current value refers to the real-time current value obtained during the process of using the motor to drive the sunshade, used to characterize the current resistance experienced by the motor.

[0017] Specifically, a Hall sensor and a magnetic ring are installed on a DC brushed motor. The magnetic ring rotates with the motor shaft. The Hall sensor outputs a periodic square wave signal. During the movement of the sunshade driven by the motor, the microcontroller captures the Hall pulses through rising and falling edge interrupts to obtain the first Hall pulse width time of the motor. For example, the first Hall pulse width time is denoted as... The motor speed can be calculated by using multiple consecutive first Hall pulse width times. The formula for calculating the speed is: In the formula, Indicates the motor speed. This represents a constant related to the number of pole pairs. Since there is the aforementioned correspondence between the first Hall pulse width and the motor speed, the first Hall pulse width is used to characterize the motor speed. When the sunshade is obstructed, the motor speed decreases and the first Hall pulse width becomes longer; therefore, the first Hall pulse width can reflect whether the sunshade is obstructed. Simultaneously, the motor bus current is detected in real time using a current sensor (such as a sampling resistor combined with an operational amplifier or a Hall current sensor) to obtain the motor's first current value. Combining this with the motor voltage equation, we know that: In the formula, This indicates the applied voltage (unit: V). Represents back electromotive force (unit: V). Indicates current (unit: A). Represents armature resistance (unit: Ω); where back electromotive force... In the formula, It represents the back electromotive force constant (unit: V / (rad / s)). The motor speed is expressed in rad / s. According to the voltage equation above, the back electromotive force can be deduced from the detected motor bus current and the known applied voltage. The back electromotive force obtained can be cross-referenced with the speed calculated based on the first Hall pulse width time, thereby helping to verify the speed, improving the reliability of the speed measurement results, and avoiding misjudgment of speed caused by occasional interference of the Hall signal.

[0018] The output torque of a motor is approximately proportional to the current. The formula for the output torque of a motor is: In the formula, This indicates the motor's output torque (unit: N·m). This represents the torque constant (unit: N·m / A). The resistance experienced by the sunshade is transmitted to the motor through the transmission structure, ultimately resulting in an increase in the motor's output torque. Therefore, the initial current value reflects the magnitude of the resistance experienced by the sunshade, which is the theoretical basis for selecting the current value as the anti-pinch judgment characteristic. Thus, it can be concluded that as the resistance increases, the current rises, indicating that the sunshade may be pinched.

[0019] S102: Identify multiple cluster centers.

[0020] In this embodiment, multiple cluster centers are obtained by performing cluster analysis on the feature vector formed by the Hall pulse width time and current value of the motor at each sampling moment during the calibration of the sunshade. Each cluster center corresponds to the motion state of the sunshade.

[0021] Calibration refers to the process of determining the parameters required for anti-pinch control through testing and data processing before the sunshade is put into use.

[0022] The sampling time is the moment when data is collected during the calibration process. During the calibration of the sunshade, the sunshade moves under the drive of the motor, and the Hall pulse width time and current value of the motor are collected at each sampling time.

[0023] A feature vector is a data pair consisting of the Hall pulse width time and current value of the motor at each sampling moment. It is used to characterize the operating state of the motor at that sampling moment. The feature vector is located in a two-dimensional feature space with Hall pulse width time and current value as coordinate dimensions.

[0024] Cluster analysis can be understood as a data processing method that divides multiple feature vectors into several groups, such that the feature vectors within the same group have high similarity and the feature vectors between different groups have low similarity.

[0025] Cluster centers can be understood as representative points of each group obtained from cluster analysis, used to characterize the concentrated location of the group's feature vectors.

[0026] The motion state refers to the operating state of the sunshade during its movement, with each cluster center corresponding to one motion state of the sunshade. For example, the motion state can include a normal state, a critical abnormal state, and an abnormal state. A normal state refers to the sunshade operating smoothly without load, with the corresponding cluster center located in the low current value and short Hall pulse width time region of the two-dimensional feature space. A critical abnormal state refers to the sunshade operating with slight obstruction, with the corresponding cluster center located in the medium current value and medium Hall pulse width time region of the two-dimensional feature space. An abnormal state refers to the sunshade operating close to stall, with the corresponding cluster center located in the high current value and long Hall pulse width time region of the two-dimensional feature space.

[0027] Specifically, during the calibration of the sunshade curtain, a motor drives the curtain's movement, and the Hall pulse width time and current value of the motor are recorded in real time at each sampling moment. The data sampling frequency is no less than 1kHz to ensure data continuity. The motor bus current and Hall pulse width time are filtered (e.g., low-pass filtering, moving average filtering) to eliminate noise and transient interference. For example, the current values ​​at each sampling moment after filtering are used to construct a current value sequence. (n = 1, 2, ..., N), construct a Hall pulse width time series from the Hall pulse width times at each sampling time after filtering. (n = 1, 2, ..., N), where m represents the sequence number of the calibration test (1 to M), and n represents the sampling time (1 to N). The smoothed current value and Hall pulse width time at each sampling time are combined into a two-dimensional feature vector. For example, the two-dimensional feature vector corresponding to the nth sampling time in the m-th round of calibration tests can be expressed as: In the formula, This represents the smoothed motor bus current. The smoothed Hall pulse width time is represented by the two-dimensional feature vectors at each sampling time point, forming a feature vector dataset. Cluster analysis is performed on multiple feature vectors in the feature vector dataset to determine multiple cluster centers. Each cluster center corresponds to a movement state of the sunshade. After the sunshade is put into use, the determined multiple cluster centers serve as the basis for cluster identification in the anti-pinch control, and are used to classify and identify the real-time acquired first Hall pulse width time and first current value.

[0028] S103: The first Hall pulse width time and the first current value are used to form a first feature vector to determine the target cluster center to which the first feature vector belongs from multiple cluster centers.

[0029] In this embodiment, the first feature vector can be understood as a feature vector composed of the first Hall pulse width time and the first current value, which is used to characterize the current operating state of the sunshade curtain. The first feature vector and the feature vector in the calibration process are in the same two-dimensional feature space.

[0030] The target cluster center refers to the cluster center to which the first feature vector belongs among multiple cluster centers. The motion state corresponding to the target cluster center is the current motion state of the sunshade.

[0031] Specifically, the first Hall pulse width time and the first current value are used to construct a first feature vector. The first feature vector can be expressed in the form X = (I, T), where I represents the first current value and T represents the first Hall pulse width time. This is a coordinate point in a two-dimensional feature space with the current value on the horizontal axis and the Hall pulse width time on the vertical axis. For example, if the motor current is 0.5A and the Hall pulse width time is 800μs at a certain sampling moment, then the coordinate point (i.e., the feature vector) corresponding to that sampling moment is (0.5, 800). The first feature vector is compared with multiple cluster centers to determine the target cluster center to which the first feature vector belongs, thereby obtaining the current motion state of the sunshade.

[0032] It should be noted that, after determining multiple cluster centers, to avoid the influence of ambient temperature and motor bus voltage on the accuracy of the sunshade's anti-pinch control, the first ambient temperature and the first motor voltage value are obtained when acquiring the first Hall pulse width time and the first current value. For each cluster center, the first ambient temperature and the first voltage value are used to correct the cluster center, thereby updating each cluster center. After the update is completed, the first Hall pulse width time and the first current value are used to construct a first feature vector to determine the target cluster center to which the first feature vector belongs from the multiple cluster centers.

[0033] Specifically, the current value in the cluster centers is corrected using a first ambient temperature, and the Hall pulse width time in the cluster centers is corrected using a first voltage value. Since multiple cluster centers are calibrated under fixed operating conditions (i.e., fixed ambient temperature and fixed motor bus voltage), when correcting the current value in the cluster centers using the first ambient temperature, the temperature difference between the first ambient temperature and the fixed temperature can be calculated. The corrected current value is obtained by multiplying the product of a preset temperature coefficient and the temperature difference, and then adding this product to the current value in the cluster centers. Similarly, when correcting the Hall pulse width time in the cluster centers using the first voltage value, the voltage difference between the first voltage value and the fixed voltage value can be calculated. The corrected Hall pulse width time is obtained by multiplying the product of a preset voltage coefficient and the voltage difference, and then adding this product to the Hall pulse width time in the cluster centers.

[0034] S104: Compare the first Hall pulse width time, the first current value, and the target anti-pinch conditions to obtain the anti-pinch comparison result.

[0035] In this embodiment, the target anti-pinch condition refers to the preset condition used to determine whether the sunshade curtain is obstructed, and is used to measure whether the first Hall pulse width time and the first current value indicate that the movement of the sunshade curtain is obstructed.

[0036] The anti-pinch comparison result refers to the result obtained by comparing the first Hall pulse width time and the first current value with the target anti-pinch condition, and is used to indicate whether the first Hall pulse width time and the first current value meet the target anti-pinch condition.

[0037] Specifically, after obtaining the first Hall pulse width time and the first current value, the first Hall pulse width time and the first current value are compared with the target anti-pinch condition. If the comparison result indicates that the first Hall pulse width time and / or the first current value meet the target anti-pinch condition, the anti-pinch comparison result indicates that the target anti-pinch condition is met. If the comparison result indicates that neither the first Hall pulse width time nor the first current value meets the target anti-pinch condition, the anti-pinch comparison result indicates that the target anti-pinch condition is not met.

[0038] S105: Based on the motion state corresponding to the target cluster center and the anti-pinch comparison results, the sunshade curtain is subjected to anti-pinch control.

[0039] In this embodiment, anti-pinch control can be understood as the control operation performed on the sunshade when it is obstructed or clamped, used to protect the clamped object and the sunshade itself. For example, anti-pinch control may include an anti-pinch reversal action, which refers to the protective action after clamping is detected, including stopping the motor, reversing the movement a certain distance to release the clamping force, and reporting the clamping event.

[0040] Specifically, based on the motion state corresponding to the target cluster center and the anti-pinch comparison result, the sunshade curtain is subjected to anti-pinch control. That is, when the motion state indicates that the sunshade curtain is in an abnormal state, or when the anti-pinch comparison result indicates that the first Hall pulse width time and / or the first current value meet the target anti-pinch conditions, it is determined that the movement of the sunshade curtain is obstructed and the condition is met, and anti-pinch control is performed on the sunshade curtain.

[0041] This embodiment provides a control method for a sunshade curtain. By acquiring the first Hall pulse width time and first current value of the motor during the curtain's movement, and identifying the feature vector formed by the first Hall pulse width time and first current value based on the calibrated cluster centers corresponding to the movement state, the method determines the target cluster center and its corresponding movement state. Simultaneously, the first Hall pulse width time and first current value are compared with the target anti-pinch conditions to obtain an anti-pinch comparison result. The method then integrates the movement state and the anti-pinch comparison result to perform anti-pinch control on the sunshade curtain. This achieves anti-pinch control combining cluster state identification and threshold comparison, avoiding the drawbacks of missed or false judgments caused by relying solely on fixed threshold comparisons for anti-pinch control, and improving the accuracy of anti-pinch judgment.

[0042] refer to Figure 2 , Figure 2 This is a flowchart illustrating another method for controlling a sunshade curtain according to an embodiment of this application. The method for controlling a sunshade curtain provided in this embodiment includes the following steps: S201: During the process of using a motor to drive the sunshade curtain, the first Hall pulse width time and the first current value of the motor are obtained.

[0043] S202: Obtain the Hall pulse count of the motor.

[0044] S203: Determine the motor's travel distance based on Hall pulse count.

[0045] S204: Obtain the first mapping relationship.

[0046] S205: Use the motion distance to query the first mapping relationship to obtain multiple cluster centers corresponding to the motion distance.

[0047] Regarding steps S202 to S205 above, Hall pulse counting can be understood as the number of Hall pulses accumulated and counted by the Hall sensor output on the motor, which is used to reflect the number of rotations of the motor and then to calculate the movement displacement of the sunshade.

[0048] The travel distance can be understood as the displacement traversed by the motor-driven sunshade, used to determine the current position of the sunshade during its travel. There is a defined conversion relationship between the travel distance of the sunshade and the Hall pulse count of the motor; this conversion relationship is determined by the mechanical transmission structure between the motor and the sunshade.

[0049] The first mapping relationship includes multiple first correspondences. Each first correspondence represents the relationship between a preset movement distance and multiple cluster centers. That is, at a preset movement distance, the sunshade corresponds to a set of cluster centers. This set of cluster centers is used to cluster and identify the operating status of the sunshade near the preset movement distance. The preset movement distance refers to a pre-set movement distance used to represent a preset position in the sunshade's travel. For example, refer to... Figure 5 As shown, the preset movement distance corresponds to preset positions of 10 mm, 50 mm, 100 mm, and 200 mm from the fully closed point. The fully closed point refers to the position where the sunshade is completely closed, and the fully open point refers to the position where the sunshade is completely open. Since the operating characteristics of the sunshade differ at different positions, different preset movement distances correspond to different cluster centers. The first mapping relationship is determined during the sunshade calibration process and can be stored in the memory of the sunshade's electronic control unit (ECU). The ECU refers to the vehicle's electronic control module, and the parameters required for anti-pinch control are ultimately written into the ECU for operation. After the sunshade is put into use, when multiple cluster centers need to be determined, the first mapping relationship is retrieved from the ECU's memory.

[0050] Specifically, the magnetic ring rotates with the motor shaft. During the movement of the sunshade driven by the motor, a Hall sensor outputs a Hall pulse for each rotation of a magnetic pole pair. The microcontroller counts these Hall pulses to obtain the total Hall pulse count. A defined conversion relationship exists between the Hall pulse count and the sliding distance of the sunshade. For example, the movement distance of the sunshade... Hall pulse counting is possible. According to the formula The calculation yields the following result: The conversion factor is determined by the mechanical transmission structure between the motor and the sunshade.

[0051] Obtain the conversion factor between Hall pulse count and the movement distance of the sunshade curtain. Use the conversion factor to convert the Hall pulse count to obtain the movement distance of the motor, which is also the movement distance of the sunshade curtain.

[0052] After obtaining the movement distance of the sunshade, the determined movement distance is matched with the preset movement distance represented by each first correspondence in the first mapping relationship. From the first mapping relationship, the first correspondence corresponding to the movement distance is determined, and the multiple cluster centers corresponding to the first correspondence are determined as multiple cluster centers corresponding to the movement distance. For example, if the movement distance matches the preset movement distance corresponding to 10 mm from the fully closed point, then a set of cluster centers in the first correspondence corresponding to 10 mm from the fully closed point is determined as multiple cluster centers corresponding to the movement distance.

[0053] It should be noted that when querying the first mapping relationship using the determined movement distance, if the first mapping relationship does not store a first correspondence that matches the movement distance, the preset movement distance closest to the movement distance is determined from the first mapping relationship, the first correspondence corresponding to the closest movement distance is determined as the first correspondence corresponding to the movement distance, and the multiple cluster centers in the determined first correspondence are determined as the multiple cluster centers corresponding to the movement distance.

[0054] In this embodiment, by acquiring the Hall pulse count of the motor and determining the motor's movement distance, the movement distance is used to query the first mapping relationship, which includes multiple first correspondences, to obtain multiple cluster centers corresponding to the movement distance. This achieves dynamic determination of the cluster centers as the sunshade moves, enabling the sunshade to use cluster centers that match the operating characteristics of the location at different positions for cluster identification. This avoids the drawback of using fixed cluster centers, which cannot adapt to changes in the operating characteristics of the sunshade at different positions, and improves the accuracy of cluster identification.

[0055] Each of the above first correspondences is determined in the following way: The sunshade curtain is driven by a motor to move toward a preset calibration point; During the movement of the sunshade, the second Hall pulse width time and the second current value of the motor are acquired at each sampling moment; When the sunshade touches the anti-pinch force device to trigger the sunshade anti-pinch control, the second Hall pulse width time and the second current value corresponding to each sampling moment are used to form the second feature vector. The K-means clustering algorithm is used to perform cluster analysis on each second feature vector to obtain multiple cluster centers; The preset movement distance is associated with multiple cluster centers to obtain the first correspondence.

[0056] The preset calibration point is determined based on a preset movement distance, that is, the position point corresponding to the preset movement distance during the sunshade's travel. It is used to perform anti-pinch calibration tests on the sunshade at this position point. For example, the anti-pinch area refers to the range from 4 mm to 200 mm from the fully closed point. Within this range, the sunshade needs to be tested to see if pinching occurs. The preset calibration point is located within the anti-pinch area. For example, the preset calibration point can be a position point at 10 mm, 50 mm, 100 mm, or 200 mm from the fully closed point.

[0057] refer to Figure 6 and Figure 7 As shown, an anti-pinch force device is installed at the preset calibration point. The anti-pinch force device is a device used to simulate obstacles such as human bodies or objects and measure the force applied when the sunshade is closed. It is set at the preset calibration point to cause the sunshade to be obstructed at the preset calibration point during the calibration process, so as to simulate a clamping scenario.

[0058] The triggering of the anti-pinch control by the sunshade touching the anti-pinch force device can be understood as the sunshade moving to a preset calibration point and touching the device. The device creates resistance, hindering the sunshade's movement and triggering the anti-pinch control, such as triggering a reverse action, whereby the sunshade stops moving and moves a certain distance in the opposite direction. When the sunshade touches the anti-pinch force device and triggers the anti-pinch control, it indicates that the sunshade was indeed hindered at the preset calibration point during this calibration test, and the data collected in this test is valid data of the hindered sample.

[0059] The second feature vector is a feature vector composed of the second Hall pulse width time and the second current value corresponding to each sampling time, which is used for cluster analysis.

[0060] K-means clustering is a clustering algorithm that divides multiple data objects into K groups, such that data objects within the same group have high similarity and data objects between different groups have low similarity. It is used to perform cluster analysis on each second feature vector. The similarity can be calculated using Euclidean distance. For example, setting K=3, the K-means clustering algorithm divides each second feature vector into three groups, corresponding to the normal state, critical abnormal state, and abnormal state of the sunshade, respectively. Each group obtains a cluster center, thus obtaining multiple cluster centers corresponding to the preset calibration point, including the cluster centers corresponding to the normal state, the critical abnormal state, and the abnormal state.

[0061] Specifically, reference Figure 3 As shown, during the calibration of the sunshade curtain, an anti-pinch force device is set at the preset calibration point. The sunshade curtain is driven by a motor to move from the fully open point to the preset calibration point. When the sunshade curtain moves to the preset calibration point, it touches the anti-pinch force device, which creates resistance to the sunshade curtain.

[0062] During the movement of the sunshade curtain towards the preset calibration point, the Hall pulse count, sunshade curtain sliding distance, motor bus current, and Hall pulse width duration are recorded in real time at each sampling moment. The sunshade curtain sliding distance can be obtained by converting the Hall pulse count to the movement distance, or it can be acquired through an encoder or displacement sensor. The data sampling frequency is no less than 1kHz to ensure data continuity. For example, the Hall pulse count corresponding to the nth sampling moment in the m-th calibration test can be denoted as... The sliding distance of the sunshade curtain is recorded as The motor bus current is denoted as The Hall pulse width time is recorded as In the formula, m represents the sequence number (1 to M), n represents the sampling time (1 to N), and op represents the calibration test point (i.e., other test points that are not fully closed). The motor bus current and Hall pulse width time are filtered (e.g., low-pass filtering, moving average filtering) to eliminate noise and transient interference, resulting in the smoothed Hall pulse width time and smoothed current value at each sampling time. These represent the second Hall pulse width time and the second current value of the motor at each sampling time, respectively forming a current value sequence. (n = 1, 2, ..., N) and Hall pulse width time series (n = 1, 2, ..., N).

[0063] When the sunshade curtain touches the anti-pinch device to trigger the anti-pinch control, the second feature vector is constructed from the second Hall pulse width time and the second current value corresponding to each sampling moment during the sunshade curtain's movement toward the preset calibration point. That is, the second feature vector corresponding to the nth sampling moment in the m-th calibration test can be expressed as follows: In the formula, This represents the smoothed current value at that sampling moment. This represents the smoothed Hall pulse width time at that sampling moment, and the second feature vector dataset is constructed from the second feature vectors corresponding to each sampling moment. (n = 1, 2, ..., N). This second feature vector contains both the normal sliding segment data before the sunshade reaches the preset calibration point and the obstruction process data when the sunshade approaches and contacts the anti-pinch force device.

[0064] With each second feature vector As a two-dimensional coordinate point (the horizontal axis represents the current value and the vertical axis represents the Hall pulse width time), the K-means clustering algorithm is used to perform cluster analysis on each second feature vector. The specific process is as follows: Step 1 (initializing cluster centers): The K-means++ method is used to select 3 initial cluster centers from each second feature vector, so that the initial cluster centers are as dispersed as possible to avoid the algorithm getting stuck in poor partitioning results; Step 2 (assigning data points): The Euclidean distance from each second feature vector to the 3 cluster centers is calculated, and the second feature vector is assigned to the cluster represented by the nearest cluster center; Step 3 (updating cluster centers): After all the second feature vectors have been assigned, the average horizontal axis (current value) and average vertical axis (Hall pulse width time) of all second feature vectors in each cluster are recalculated, and the obtained average coordinates are used as the new cluster centers; Step 4 (iterative convergence): Steps 2 and 3 are repeated until the cluster centers no longer change significantly, the algorithm converges, and the final 3 cluster centers and the assignment of each second feature vector are obtained. For example, the cluster corresponding to the normal state can be denoted as Cluster7, the cluster corresponding to the critical abnormal state as Cluster8, and the cluster corresponding to the abnormal state as Cluster9. After cluster analysis, the cluster centers of Cluster7, Cluster8, and Cluster9 are obtained. That is... , , In the formula, and These represent the current value and Hall pulse width time of the cluster centers in Cluster7, respectively. , , , And so on; the affiliation of each second feature vector can be determined using cluster labels. express, In the formula, =7 indicates that the second feature vector is assigned to Cluster7. =8 indicates that it has been assigned to Cluster8. =9 indicates that it has been assigned to Cluster9, thus obtaining the cluster label sequence. (n = 1, 2, ..., N), the above cluster labels represent the motion states corresponding to each cluster center. For example, in the second feature vector, the normal gliding segment data before the sunshade comes into contact with the anti-pinch device is classified into the cluster corresponding to the normal state; the data of the process of increased friction, slight resistance, and gradual increase in resistance is classified into the cluster corresponding to the critical abnormal state; and the data of contacting the anti-pinch device, approaching the stop, and being in the clamping state are classified into the cluster corresponding to the abnormal state.

[0065] After obtaining multiple cluster centers corresponding to a preset calibration point through cluster analysis, the preset motion distance on which the preset calibration point is based is associated with the multiple cluster centers to obtain the first correspondence corresponding to the preset motion distance. For example, to ensure the reliability of the calibration data, the entire calibration process described above can be repeated M times (e.g., M=10 times, i.e., setting a maximum sequence number) for the same preset calibration point. Calibration data for the preset calibration point is collected from the M calibration tests. After obtaining multiple cluster centers corresponding to each calibration test, the mean is calculated for multiple cluster centers belonging to the same motion state to obtain the final cluster center corresponding to that motion state. This yields the cluster centers corresponding to different motion states of the preset calibration point, reducing the impact of random errors in a single calibration test. Each cluster center mentioned above is obtained by averaging all feature vectors belonging to the same cluster center during multiple calibration processes. After performing M calibration tests, the average value sequence of the motor bus current at each moment can be obtained. and And establish a sequence of average values ​​for all clustering results data based on Hall pulse counting and calibration test points: In the formula: Indicates the sequence number (1 to ); Indicates the sampling time (1 to 12). ); This indicates the calibration test point (other test points that are not fully closed).

[0066] Since the location of each preset calibration point is different and the travel length before reaching that location is different, the operating characteristics of the sunshade at each preset calibration point are different. Therefore, the above calibration process needs to be performed on each preset calibration point to obtain a set of cluster centers exclusive to each preset calibration point, thereby obtaining the first correspondence relationship corresponding to each preset movement distance, and then obtaining the first mapping relationship including multiple first correspondence relationships.

[0067] Furthermore, based on the above clustering analysis results, data identification can be performed, that is, to identify whether there are critical abnormal states or abnormal segments where abnormal states occur in clusters (such as entering high load immediately after startup), outputting a state consistency report, and judging whether there is premature entry into critical abnormal states or abnormal states, whether the cluster distribution is significantly shifted, and whether maintenance or calibration of the calibration equipment is required, thereby ensuring the reliability of subsequent calibration data.

[0068] In this embodiment, the sunshade is driven to move towards a preset calibration point equipped with an anti-pinch force device. The second Hall pulse width time and the second current value are collected at each sampling moment during the obstruction process to form a second feature vector. The K-means clustering algorithm is used to perform cluster analysis on each second feature vector to obtain multiple cluster centers. The preset movement distance is associated with multiple cluster centers to obtain a first correspondence. This realizes the determination of the cluster center corresponding to each preset movement distance based on real obstruction calibration data. The cluster centers obtained by calibration can truly reflect the obstruction operation characteristics of the sunshade at each preset calibration point, providing an accurate basis for cluster identification in subsequent anti-pinch control and improving the accuracy of anti-pinch judgment.

[0069] It should be noted that the motor-driven movement of the sunshade towards the preset calibration point can be achieved using an automated calibration device, which includes a main control board (see reference). Figure 8 (as shown) and motion device (reference) Figure 6 and Figure 7 (As shown). This automated calibration device is used to control the anti-pinch force equipment to run to a preset calibration point during the calibration of the sunshade to perform calibration tests.

[0070] The main control board is used to control the movement of three motors and communicate with external devices. The main control board can receive external control signals via Ethernet and then control the motors to move to the designated positions to complete the calibration task. For example, the three motors can be an X-axis motor, a Y-axis motor, and a Z-axis motor.

[0071] The motion device includes a fixed bracket (or suction cup), a fixing component, and a dual-axis motor. The bottom of the motion device is fixed inside the cabin by the bracket or suction cup, the upper end is used to fix the anti-pinch device, and the middle section consists of a motion plane formed by the dual-axis motors (X-axis motor and Y-axis motor), which can control the anti-pinch device to move to any position within the plane. The fixing component at the lower end of the anti-pinch device includes a motor (Z-axis motor) used to control the height of the anti-pinch device and also to quickly retract the anti-pinch device in case of abnormal situations (such as failure of the anti-pinch reversal function) to avoid damage to the sunshade or other equipment.

[0072] Use a mounting bracket or suction cup to fix the moving plane inside the cockpit, keeping it level with the sunshade; The anti-pinch force device is fixed on the fixing part of the Z-axis rail, and then the data cable of the device is connected to the computer outside the calibration environment chamber through the hole in the calibration environment chamber to read the anti-pinch force data. One end of a network cable is connected to the Ethernet interface of the main control board, and the other end is connected to a computer outside the calibration environment chamber through a hole. Calibration personnel use the host computer to communicate with the main control board. refer to Figure 4 As shown, the host computer performs a zero-return operation, and the main control board controls the XYZ three-axis motors to perform zero-return calibration and determine the coordinate zero point; The calibration test points for the electric sunshade curtain are shown in the distribution diagram below. Figure 5 As shown, point A is the leftmost position of the sunshade, point B is the center position of the sunshade, and point C is the rightmost position of the sunshade. Calibration test points are set at 10mm, 50mm, 100mm and 200mm away from the fully closed point, for a total of 12 calibration test points. The host computer controls the XYZ three-axis motor to move to point A, which is 10mm away from the fully closed point, and records its coordinates. Then, the host computer controls the XYZ three-axis motor to move to point B, which is recorded as point B_10mm, and records its coordinates. Finally, the host computer controls the XYZ three-axis motor to move to point C, which is recorded as point C_10mm, and records its coordinates. The host computer controls the XYZ three-axis motors to move to distances of 50mm, 100mm, and 200mm from the fully closed point, and records the coordinates of all calibration test points. During the calibration process, the calibration personnel first set the calibration environment chamber to the calibration conditions (high temperature / low temperature / normal temperature, variable voltage, etc.), and then control the anti-pinch force device through the host computer to run it to the designated calibration test point to perform the calibration task. The calibration task includes the following steps: The host computer sets the specified calibration test points and anti-pinch force abnormal threshold, and controls the anti-pinch force device to run to the specified calibration test points; The calibration personnel control the sunshade to close. Under normal circumstances, when the sunshade touches the anti-pinch force device, it will immediately trigger the anti-pinch reverse action. At this time, the value of the anti-pinch force device is read. Repeat the above steps a preset number of times (e.g., 10 times): "The calibration personnel control the sunshade to close. Under normal circumstances, when the sunshade touches the anti-pinch force device, it will immediately trigger the anti-pinch reverse action. At this time, the value of the anti-pinch force device is read." Calculate the maximum and average values ​​of the recorded anti-pinch force values. If both meet the condition that the anti-pinch force does not exceed 100N, the calibration test at this calibration test point is considered successful. If the anti-pinch force is greater than 100N, the anti-pinch parameters are readjusted, and the current steps are repeated until the calibration test is successful. If the anti-pinch force is greater than the anti-pinch force abnormal threshold, the current anti-pinch is considered abnormal. At this time, the anti-pinch force device will be quickly controlled to move down to prevent the sunshade motor from being blocked for a long time and causing damage or damage to the electric sunshade components.

[0073] In the above-described manner, before performing the step of associating the preset movement distance with multiple cluster centers to obtain the first correspondence, the method further includes: When the preset calibration point is not the target calibration point, obtain the first cluster center corresponding to the target calibration point; The second cluster center is determined from multiple cluster centers corresponding to the preset calibration point, and the motion state indicator motor corresponding to the second cluster center is in normal condition; The consistency of the second cluster center is verified using the first cluster center to obtain the verification result; If the verification result indicates that the consistency verification is successful, the step of associating the preset motion distance with multiple cluster centers is executed to obtain the first correspondence.

[0074] The target calibration point represents the calibration point corresponding to the sunshade curtain being in the fully closed state, that is, the location of the sunshade curtain when it is in the fully closed state. There is no anti-pinch force device at the target calibration point. The difference between the target calibration point and the preset calibration point is that the preset calibration point is equipped with an anti-pinch force device to simulate the clamping scenario; the target calibration point is not equipped with an anti-pinch force device, and the sunshade curtain slides unimpeded throughout the process of moving towards the target calibration point.

[0075] The first cluster center corresponds to the motion state indicator that the motor is in normal condition. The first cluster center is obtained by performing cluster analysis on the feature vector formed by the Hall pulse width time and current value of the motor at each sampling moment during the movement of the sunshade towards the target calibration point.

[0076] The second cluster center refers to the cluster center determined from multiple cluster centers corresponding to the preset calibration point. The motion state indicator corresponding to the second cluster center indicates that the motor is in a normal state. The difference between the second cluster center and the first cluster center is that the first cluster center is the normal state cluster center obtained by calibration at the target calibration point (i.e., the fully closed point), while the second cluster center is the normal state cluster center obtained by calibration at the preset calibration point.

[0077] Consistency verification can be understood as using the first cluster center to verify the second cluster center to determine its reliability. The verification is based on the following: during the sunshade's movement towards the preset calibration point, the travel distance before contacting the anti-pinch device constitutes normal gliding. The operating characteristics of this travel distance are consistent with the unobstructed gliding characteristics of the sunshade towards the target calibration point. Therefore, the normal state cluster center (second cluster center) calibrated at the preset calibration point should theoretically be consistent with the normal state cluster center (first cluster center) calibrated at the target calibration point. If the deviation exceeds the allowable range, it indicates that the environmental conditions of the two calibrations are inconsistent (such as temperature drift, equipment installation deviation, sensor aging, etc.), and the calibration data at the preset calibration point is unreliable, requiring recalibration or correction. The verification result refers to the result obtained from the consistency verification, used to indicate whether the consistency verification passed.

[0078] Specifically, when the preset calibration point is not the target calibration point, i.e., when an anti-pinch force device is installed at the preset calibration point and consistency verification is required, the first cluster center corresponding to the target calibration point is obtained. For example, during the calibration of the sunshade, without applying additional resistance, the sunshade is driven by a motor to move unimpeded from the fully open point to the target calibration point (i.e., the fully closed point). No anti-pinch force device is installed during the movement of the sunshade towards the target calibration point, and the sunshade slides normally throughout the entire process. The Hall pulse width time and current value of the motor are collected at each sampling moment during the movement of the sunshade towards the target calibration point. The Hall pulse width time and current value at each sampling moment are used to construct a feature vector and cluster analysis is performed. From the cluster analysis results, the cluster center indicating that the motor is in a normal state is determined, which is the first cluster center. The first cluster center is used as the benchmark for consistency verification. The specific calibration process for obtaining the first cluster center can be described in detail below.

[0079] After obtaining multiple cluster centers corresponding to the preset calibration point through cluster analysis, the cluster center indicating that the motion status indicator motor is in a normal state is determined from these multiple cluster centers, and this cluster center is designated as the second cluster center. Since the travel distance of the sunshade towards the preset calibration point before contacting the anti-pinch force device is considered normal sliding, this part of the data should fall into the cluster corresponding to the normal state after clustering. Therefore, there is a cluster center corresponding to the normal state among the multiple cluster centers corresponding to the preset calibration point.

[0080] The consistency of the second cluster center is verified by using the first cluster center to obtain the verification result, that is, to determine whether the second cluster center (exemplarily, the cluster center of Cluster7 corresponding to the normal state) is consistent with the first cluster center as a benchmark.

[0081] If the verification result indicates that the consistency verification has passed, the step of associating the preset movement distance with multiple cluster centers to obtain the first correspondence relationship is executed, and the first correspondence relationship obtained after association is written into the memory for querying after the sunshade curtain is put into use; if the verification result indicates that the consistency verification has failed, the preset movement distance is not associated with multiple cluster centers, and the consistency verification can be recalibrated or corrected before execution.

[0082] To elaborate further, refer to Figure 3 As shown, the specific process for identifying the first cluster center is as follows: Without applying additional resistance, the control motor drives the sunshade on the vehicle to be calibrated to slide from the fully open position to the fully closed position, keeping the ambient temperature, voltage and other conditions stable, and the motor runs at the standard speed to avoid human intervention.

[0083] During the sliding process of the sunshade, the Hall pulse count, sunshade sliding distance, motor bus current, and Hall pulse width time are recorded in real time at each sampling moment. The sunshade sliding distance can be calculated by converting the Hall pulse count with the mechanical travel, or it can be obtained through an encoder or displacement sensor. The data sampling frequency is no less than 1kHz to ensure data continuity. The motor bus current and Hall pulse width time are filtered (e.g., low-pass filtering, moving average filtering) to eliminate noise and transient interference, obtaining smoothed current values ​​and Hall pulse width times at each sampling moment.

[0084] Smoothed current values ​​at each sampling time Hall pulse width and time The feature vector, that is, the feature vector corresponding to the nth sampling time in the mth round of calibration test, can be expressed as: The feature vectors at each sampling time are used to construct a feature vector dataset. (n = 1, 2, ..., N) Representing the closed point, the K-means clustering algorithm is used to cluster the feature vectors in the feature vector dataset. The number of clusters is set to K=3. Initial cluster centers can be initialized using the K-means++ method. Euclidean distance is used as the similarity measure. The iteration converges until the cluster centers stabilize, resulting in three clusters corresponding to the normal state, critical abnormal state, and abnormal state of the sunshade curtain, namely Cluster4, Cluster5, and Cluster6, and their respective cluster centers. , , In the formula, , These represent the current value and Hall pulse width time of the cluster centers in Cluster4, respectively. , , , And so on; the affiliation of each feature vector can be determined using cluster labels. express, In the formula, =4 indicates that the feature vector is assigned to Cluster4. =5 indicates that it has been assigned to Cluster5. =6 indicates that it has been assigned to Cluster 6. Establish Hall pulse counting. The correspondence between the clustering results and the clustering result labels, i.e., the clustering result sequence. (n = 1, 2, ..., N), where, This represents the sliding distance of the sunshade curtain at time n in the m-th calibration process. The above correspondence is used to identify whether there are critical abnormal states or abnormal segments where abnormal states occur in clusters (such as entering high load immediately after startup). Abnormal data points are removed from the cluster analysis results, and only the feature vectors of normal states are retained for subsequent average value calculation to prevent abnormal data points from interfering with the modeling of benchmark parameters.

[0085] Repeat the above-mentioned calibration process of the fully closed point a preset number of times (e.g., 10 times, i.e., setting the maximum sequence number M=10) to obtain a preset number of sets of fully closed point calibration data.

[0086] Collect feature vectors belonging only to the normal state from a predetermined number of trials, that is, filter cluster labels from the clustering result sequence. The eigenvectors with a value of 4 constitute the normal region screening sequence. (n = 1, 2, ..., N); calculate the average current value sequence corresponding to each sampling time. (n = 1, 2, ..., N) and Hall pulse width time-averaged sequence Establish the correspondence between Hall pulse counts and the average value sequence of normal operation data, i.e., the normal operation reference curve sequence. (n = 1, 2, ..., N) to obtain the full-stroke normal operation baseline curve; at the same time, the cluster center corresponding to the normal state (i.e., cluster center C4 of Cluster4) is determined as the first cluster center, which serves as the first cluster center for consistency verification. The first cluster center and the full-stroke normal operation baseline curve are stored in the sunshade curtain anti-pinch parameter database for querying after the sunshade curtain is put into use.

[0087] In this embodiment, when the preset calibration point is not the target calibration point, the first cluster center of the normal state corresponding to the target calibration point is obtained as a benchmark. The second cluster center of the normal state is determined from the multiple cluster centers corresponding to the preset calibration point. The first cluster center is used to perform consistency verification on the second cluster center. Only when the verification passes is the preset movement distance associated with multiple cluster centers. This realizes the reliability verification of the calibration data of the preset calibration point, avoids the association and use of incorrect cluster centers caused by environmental drift or calibration error, ensures the reliability of subsequent anti-pinch control from the source, and improves the accuracy of anti-pinch judgment.

[0088] It should be noted that the multiple cluster centers of the first correspondence mentioned above are updated in the following way: When the preset update cycle is reached, for each cluster center in the first correspondence, obtain all feature vectors belonging to the cluster center within the current preset update cycle; The mean value of the Hall pulse width time in all eigenvectors is determined to obtain the third mean value of the Hall pulse width time, and the mean value of the current value in all eigenvectors is determined to obtain the third mean value of the current. Determine the number of updates corresponding to the cluster centers; The learning rate is determined based on the number of updates. The cluster centers are updated using the learning rate, the mean of the third Hall pulse width, and the mean of the third current.

[0089] The preset update cycle refers to the pre-set update period for cluster centers, used to periodically update the cluster centers online. The preset update cycle can be set according to actual needs, such as once a week or once a month. All feature vectors belonging to a cluster center refer to the feature vectors that are classified into that cluster center within the current preset update cycle, that is, the feature vectors whose clustering identification result is the target cluster center.

[0090] The update count refers to the number of times the cluster center has been updated, and it is used to determine the learning rate. For example, the update count is 1 when the cluster center is updated for the first time; the update count is incremented by 1 after each subsequent update of the cluster center.

[0091] The learning rate refers to the weight given to new data when cluster centers are updated, and it controls how closely cluster centers move towards the clusters containing the new data. The learning rate can be determined based on the number of updates. For example, the learning rate decreases as the number of updates increases; the more updates, the smaller the learning rate, and the more stable the cluster centers tend to be. For instance, the learning rate can be the reciprocal of the number of updates plus one; that is, the learning rate is 1 / 2 for 1 update, 1 / 3 for 2 updates, and so on.

[0092] Specifically, upon reaching a preset update cycle, for each cluster center in the first correspondence, all feature vectors collected during the operation of the sunshade within the current preset update cycle and classified into that cluster center are obtained. For example, an incremental update method can be used, which eliminates the need for retraining using all historical data. Instead, it fine-tunes the cluster centers using only the most recent small batch of data within the current preset update cycle. This incremental update method has extremely low computational requirements, making it suitable for operation under the limited computing resources of the vehicle ECU, while ensuring that the cluster centers continuously adapt to equipment aging and environmental changes.

[0093] For all feature vectors belonging to the cluster center, calculate the average value of the Hall pulse width time in all feature vectors to obtain the third average value of the Hall pulse width time, and calculate the average value of the current value in all feature vectors to obtain the third average value of the current.

[0094] After determining the number of updates performed on the cluster centers, the learning rate is determined based on this number of updates. For example, the reciprocal of the update count plus one can be used as the learning rate. For instance, let the number of updates be t, then the learning rate... The updated Hall pulse width time of the cluster center is equal to (1 - learning rate) multiplied by the original Hall pulse width time of the cluster center plus the learning rate multiplied by the average of the third Hall pulse width time. The updated current value of the cluster center is equal to (1 - learning rate) multiplied by the original current value of the cluster center plus the learning rate multiplied by the average of the third current value.

[0095] In this embodiment, by acquiring all feature vectors belonging to the cluster center within a preset update cycle, determining the average Hall pulse width and current, and determining the learning rate based on the number of updates, the cluster center is updated using the learning rate, the average Hall pulse width and current. This enables the cluster center to adapt to equipment aging and environmental changes, maintains the long-term accuracy of anti-pinch judgment, and improves the reliability of anti-pinch control.

[0096] In the above, the consistency of the second cluster center is checked using the first cluster center to obtain the check result, including: Determine the first distance between the first cluster center and the second cluster center; The first distance is compared with a preset distance threshold to verify the consistency of the second cluster centers; When the first distance is less than or equal to a preset distance threshold, the verification result indicates that the consistency verification has passed; When the first distance is greater than the preset distance threshold, the verification result indicates that the consistency verification has failed.

[0097] The first cluster center refers to the cluster center indicating that the motor is in a normal state, obtained by clustering the feature vectors formed by the Hall pulse width time and current value of the motor at each sampling moment during the movement of the sunshade towards the target calibration point. The first cluster center serves as a benchmark for consistency verification. The second cluster center refers to the cluster center that indicates the motor is in a normal state, determined from multiple cluster centers corresponding to the preset calibration point. The cluster center is the coordinate of the average value of all feature vectors within the cluster. That is, the horizontal coordinate of the cluster center is the average value of the current value of all feature vectors within the cluster, and the vertical coordinate is the average value of the Hall pulse width time of all feature vectors within the cluster. Therefore, the coordinates of the first cluster center are determined by all feature vectors belonging to the first cluster center, and the coordinates of the second cluster center are determined by all second feature vectors belonging to the second cluster center.

[0098] The first distance refers to the distance between the first cluster center and the second cluster center, which is used to measure the degree of deviation between the first cluster center and the second cluster center. Both the first cluster center and the second cluster center are located in a two-dimensional feature space. The first distance can be the Euclidean distance between the first cluster center and the second cluster center in the two-dimensional feature space. The smaller the first distance, the closer the second cluster center is to the first cluster center, and the more reliable the calibration data of the preset calibration point is.

[0099] The preset distance threshold refers to a pre-set distance threshold used to determine whether the deviation between the first cluster center and the second cluster center is within the allowable range. The preset distance threshold can be set according to actual needs, such as the allowable deviation range based on ambient temperature, voltage, and other conditions.

[0100] Specifically, the coordinates of the first cluster center and the second cluster center in the two-dimensional feature space are obtained, the Euclidean distance between the two coordinates is calculated, and the calculated Euclidean distance is determined as the first distance between the first cluster center and the second cluster center.

[0101] The determined first distance is compared with a preset distance threshold to perform a consistency check on the second cluster center. That is, whether the second cluster center is consistent with the first cluster center is determined by whether the first distance exceeds the preset distance threshold.

[0102] When the first distance is less than or equal to the preset distance threshold, it indicates that the deviation between the second cluster center and the first cluster center is within the allowable range, the second cluster center is consistent with the first cluster center, and the calibration data of the preset calibration point is reliable. At this time, the verification result indicates that the consistency verification has passed.

[0103] When the first distance is greater than the preset distance threshold, it indicates that the deviation between the second cluster center and the first cluster center exceeds the allowable range, the second cluster center and the first cluster center are inconsistent, and the calibration data of the preset calibration point is unreliable. At this time, the verification result indicates that the consistency verification has failed.

[0104] In this embodiment, by determining the first distance between the first cluster center and the second cluster center and comparing the first distance with a preset distance threshold, the verification result is determined to be successful when the first distance is less than or equal to the preset distance threshold, and unreliable calibration data is accurately identified, thereby improving the reliability of the anti-pinch control parameters.

[0105] S206: The first Hall pulse width time and the first current value are used to form a first feature vector to determine the target cluster center to which the first feature vector belongs from multiple cluster centers.

[0106] In this embodiment, step S206, determining the target cluster center to which the first feature vector belongs from multiple cluster centers, includes: Determine the second distance between the first feature vector and each cluster center; Determine the smallest second distance from among multiple second distances; The cluster center corresponding to the smallest second distance among multiple cluster centers is determined as the target cluster center to which the first feature vector belongs.

[0107] The second distance refers to the distance between the first feature vector and the cluster center, which is used to measure the closeness between the first feature vector and the cluster center. The second distance can be the Euclidean distance between the first feature vector and the cluster center in the two-dimensional feature space. The smaller the second distance, the closer the first feature vector is to the cluster center.

[0108] Specifically, the coordinates of the first feature vector in the two-dimensional feature space and the coordinates of each cluster center in the two-dimensional feature space are obtained. The Euclidean distance between the first feature vector and each cluster center is calculated to obtain multiple second distances between the first feature vector and each cluster center. For example, the multiple cluster centers include cluster center C1 corresponding to the normal state (corresponding to Cluster 7 in the calibration test point calibration), cluster center C2 corresponding to the critical abnormal state (corresponding to Cluster 8 in the calibration test point calibration), and cluster center C3 corresponding to the abnormal state (corresponding to Cluster 9 in the calibration test point calibration), i.e. , , In the formula, , These represent the current value and Hall pulse width time corresponding to C1, respectively. , , , And so on. The first feature vector X = (I, T), and the coordinates of the i-th cluster center are (C... i,I C i,T In the formula, I represents the first current value, T represents the first Hall pulse width time, and C... i,I C represents the current value corresponding to the i-th cluster center. i,T Let the first feature vector represent the Hall pulse width time corresponding to the i-th cluster center, and the second distance between the first feature vector and the i-th cluster center be... , that is In the formula, ‖·‖ represents calculating the Euclidean distance.

[0109] The smallest second distance is determined from multiple second distances, that is, the second distance with the smallest value is determined from multiple second distances between the first feature vector and each cluster center.

[0110] The cluster center corresponding to the smallest second distance is the cluster center that is closest to the first feature vector. The first feature vector belongs to the cluster corresponding to this cluster center. This cluster center is determined as the target cluster center to which the first feature vector belongs. The motion state corresponding to the target cluster center is the current motion state of the sunshade.

[0111] In this embodiment, by determining the second distance between the first feature vector and each cluster center, the smallest second distance is determined from multiple second distances, and the cluster center corresponding to the smallest second distance is determined as the target cluster center. This achieves target cluster center determination based on distance metric. The determination method is simple and reliable, accurately classifying the real-time feature vector to the cluster center closest to it, thus improving the accuracy of motion state recognition.

[0112] S207: Compare the first Hall pulse width time, the first current value, and the target anti-pinch conditions to obtain the anti-pinch comparison result.

[0113] S208: Based on the motion state corresponding to the target cluster center and the anti-pinch comparison result, the sunshade curtain is subjected to anti-pinch control.

[0114] In this embodiment, step S208 specifically includes: When the motion status indicator shows that the motor is in an abnormal state, the historical motion status corresponding to multiple consecutive historical moments before the current moment is obtained; When all historical motion states indicate that the motor is in a critical abnormal state, anti-pinch control is implemented for the sunshade; and / or, When the anti-pinch comparison result indicates that the first Hall pulse width time and / or the first current value meet the target anti-pinch conditions, the sunshade curtain is subjected to anti-pinch control.

[0115] Among them, the historical moment refers to the sampling moment before the current moment, and the historical motion state refers to the motion state corresponding to the historical moment, that is, the motion state corresponding to the target cluster center determined at the historical moment, which is used to determine whether the sunshade has experienced a period of obstruction before the current moment.

[0116] Specifically, when the motion state indicator motor corresponding to the target cluster center is in an abnormal state, the historical motion states corresponding to multiple consecutive historical moments before the current moment are obtained. For example, the historical motion states corresponding to three consecutive historical moments before the current moment are obtained. For example, a sliding window method can be used to obtain the historical motion states. The sliding window refers to a data window containing the most recent N sampling moments (e.g., N=100). Whenever a new sampling point is received, the window slides forward one position, discarding the oldest sampling point and including the latest sampling point. The historical motion states corresponding to multiple consecutive historical moments before the current moment are obtained from the sliding window.

[0117] When all historical motion states indicate that the motor is in a critical abnormal state, anti-pinch control is implemented on the sunshade. That is, when the current motion state is abnormal and the motion states of multiple consecutive historical moments before the current moment are all in a critical abnormal state, it indicates that the sunshade has first experienced a continuous process of gradually increasing resistance, and then deteriorated to the point of near stall. It can be determined that the sunshade has indeed pinched an object rather than being a momentary noise interference. At this time, anti-pinch control is implemented on the sunshade, such as executing an anti-pinch reverse action.

[0118] Simultaneously, when the anti-pinch comparison result indicates that the first Hall pulse width time and / or the first current value meet the target anti-pinch conditions, the sunshade curtain is subjected to anti-pinch control. That is, when the anti-pinch comparison result indicates that the first Hall pulse width time and / or the first current value meet the target anti-pinch conditions, it indicates that the movement of the sunshade curtain is obstructed and the conditions are met, and the sunshade curtain is subjected to anti-pinch control at this time.

[0119] The two paths described above are executed in parallel, and the sunshade curtain is controlled to prevent pinching if either path meets the conditions.

[0120] In this embodiment, anti-pinch control is implemented when the current motion state is abnormal and multiple consecutive historical motion states are critical abnormal states, and / or when the anti-pinch comparison result indicates that the target anti-pinch condition is met. This achieves dual-path anti-pinch control that combines timing criteria and threshold criteria. On the one hand, timing features are used to avoid false triggering caused by instantaneous noise, and on the other hand, threshold comparison is used to achieve immediate response. This balances the accuracy and timeliness of anti-pinch control and improves the safety and reliability of anti-pinch control.

[0121] The target anti-pinch conditions mentioned above are determined in the following way: Obtain the preset anti-pinch conditions; When the motion state indicator motor corresponding to the target cluster center is in a critical or abnormal state, the preset pulse width time threshold and preset current threshold in the preset anti-pinch condition are reduced to update the preset anti-pinch condition. The updated preset anti-pinch conditions are set as the target anti-pinch conditions.

[0122] The preset anti-pinch conditions include a first Hall pulse width time exceeding a preset pulse width time threshold and / or a first current value exceeding a preset current threshold. The preset pulse width time threshold refers to a pre-set Hall pulse width time threshold, and the preset current threshold refers to a pre-set current threshold. When the first Hall pulse width time exceeds the preset pulse width time threshold, it indicates a significant increase in the Hall pulse width and a noticeable decrease in motor speed; when the first current value exceeds the preset current threshold, it indicates a sudden increase in motor current. A first Hall pulse width time exceeding the preset pulse width time threshold and / or a first current value exceeding the preset current threshold indicate that the sunshade's movement is obstructed, thus meeting the conditions.

[0123] When the motion state indicator motor corresponding to the target cluster center is in a critical or abnormal state, it indicates that the sunshade curtain has been slightly obstructed or is close to stalling. At this time, the preset pulse width time threshold and preset current threshold are reduced, making it easier to meet the conditions that the first Hall pulse width time is greater than the preset pulse width time threshold and the first current value is greater than the preset current threshold. That is, the sensitivity of the anti-pinch judgment is improved, thereby triggering the anti-pinch control earlier when the obstruction of the sunshade curtain becomes more severe, realizing early intervention against clamping. Updating the preset anti-pinch conditions means replacing the original thresholds with the reduced preset pulse width time threshold and preset current threshold to obtain the updated preset anti-pinch conditions, and then determining the updated preset anti-pinch conditions as the target anti-pinch conditions.

[0124] It should be noted that if the motion status indicator motor corresponding to the target cluster center is in normal condition, it indicates that the sunshade is operating normally and there is no need to adjust the sensitivity. At this time, the preset anti-pinch condition can be directly set as the target anti-pinch condition.

[0125] Through the above methods, this embodiment obtains preset anti-pinch conditions including preset pulse width time threshold and preset current threshold. When the motion state indicates that the motor is in a critical or abnormal state, the preset pulse width time threshold and preset current threshold are reduced to update the preset anti-pinch conditions. The updated preset anti-pinch conditions are then determined as the target anti-pinch conditions. This achieves adaptive adjustment of the target anti-pinch conditions according to the motion state, improves the sensitivity of anti-pinch judgment when the sunshade shows signs of obstruction, realizes early intervention against clamping, and avoids false triggering caused by excessive sensitivity under normal conditions, thereby improving the accuracy and timeliness of anti-pinch control.

[0126] This embodiment provides a control method for a sunshade curtain. By acquiring the first Hall pulse width time and first current value of the motor during the curtain's movement, and identifying the feature vector formed by the first Hall pulse width time and first current value based on the calibrated cluster centers corresponding to the movement state, the method determines the target cluster center and its corresponding movement state. Simultaneously, the first Hall pulse width time and first current value are compared with the target anti-pinch conditions to obtain an anti-pinch comparison result. The method then integrates the movement state and the anti-pinch comparison result to perform anti-pinch control on the sunshade curtain. This achieves anti-pinch control combining cluster state identification and threshold comparison, avoiding the drawbacks of missed or false judgments caused by relying solely on fixed threshold comparisons for anti-pinch control, and improving the accuracy of anti-pinch judgment.

[0127] refer to Figure 9 , Figure 9 This is a schematic diagram of a control device for a sunshade curtain provided in an embodiment of this application. The control device for a sunshade curtain provided in this application includes: an acquisition module 10, a determination module 20, a comparison module 30, and a control module 40. The acquisition module 10 is used to acquire the first Hall pulse width time and the first current value of the motor during the process of driving the sunshade curtain to move. The determination module 20 is used to determine multiple cluster centers, which are obtained by performing cluster analysis on the feature vectors formed by the Hall pulse width time and current value of the motor at each sampling time during the calibration of the sunshade curtain. Each cluster center corresponds to the movement state of the sunshade curtain. The determination module 20 is further used to construct a first feature vector from the first Hall pulse width time and the first current value to determine the target cluster center to which the first feature vector belongs from the multiple cluster centers. The comparison module 30 is used to compare the first Hall pulse width time, the first current value, and the target anti-pinch condition to obtain an anti-pinch comparison result. The control module 40 is used to perform anti-pinch control on the sunshade curtain based on the movement state corresponding to the target cluster center and the anti-pinch comparison result.

[0128] In this embodiment, the determining module 20 is further configured to: Obtain the Hall pulse count of the motor; The movement distance of the motor is determined based on the Hall pulse count; Obtain a first mapping relationship, which includes multiple first correspondence relationships, each of which represents the relationship between a preset motion distance and multiple cluster centers; The first mapping relationship is queried using the motion distance to obtain multiple cluster centers corresponding to the motion distance.

[0129] In this embodiment, the determining module 20 is further configured to: The motor drives the sunshade curtain to move toward a preset calibration point, which is determined based on the preset movement distance. An anti-pinch device is installed at the preset calibration point. During the movement of the sunshade, the second Hall pulse width time and the second current value of the motor are acquired at each sampling moment; When the sunshade touches the anti-pinch force device to trigger the sunshade anti-pinch control, the second Hall pulse width time and the second current value corresponding to each sampling moment are used to form a second feature vector; The K-means clustering algorithm is used to perform cluster analysis on each of the second feature vectors to obtain multiple cluster centers; The preset movement distance is associated with multiple cluster centers to obtain the first correspondence.

[0130] In this embodiment, the determining module 20 is further configured to: When the preset calibration point is not the target calibration point, the first cluster center corresponding to the target calibration point is obtained. The target calibration point represents the calibration point corresponding to the sunshade being in a fully closed state. The anti-pinch force device is not installed at the target calibration point. The motion state corresponding to the first cluster center indicates that the motor is in a normal state. The first cluster center is obtained by performing cluster analysis on the feature vector composed of the Hall pulse width time and the current value of the motor at each sampling time during the process of the sunshade moving towards the target calibration point. A second cluster center is determined from the plurality of cluster centers corresponding to the preset calibration point, and the motion state corresponding to the second cluster center indicates that the motor is in a normal state; The consistency of the second cluster center is verified using the first cluster center to obtain the verification result; If the verification result indicates that the consistency verification has passed, the preset movement distance is associated with multiple cluster centers to obtain the first correspondence.

[0131] In this embodiment, the determining module 20 is further configured to: Determine the first distance between the first cluster center and the second cluster center; The first distance is compared with a preset distance threshold to perform a consistency check on the second cluster center; When the first distance is less than or equal to a preset distance threshold, the verification result indicates that the consistency verification has passed; When the first distance is greater than a preset distance threshold, the verification result indicates that the consistency verification has failed.

[0132] In this embodiment, the control module 40 is further configured to: When the motion state indicates that the motor is in an abnormal state, the historical motion states corresponding to multiple consecutive historical moments before the current moment are obtained; When all the aforementioned historical motion states indicate that the motor is in a critical abnormal state, the sunshade is subjected to anti-pinch control; and / or, When the anti-pinch comparison result indicates that the first Hall pulse width time and / or the first current value meet the target anti-pinch condition, the sunshade is subjected to anti-pinch control.

[0133] In this embodiment, the determining module 20 is further configured to: Obtain preset anti-pinch conditions, wherein the preset anti-pinch conditions include the first Hall pulse width time being greater than a preset pulse width time threshold and / or the first current value being greater than a preset current threshold. When the motion state corresponding to the target cluster center indicates that the motor is in a critical abnormal state or an abnormal state, the preset pulse width time threshold and the preset current threshold in the preset anti-pinch condition are reduced to complete the update of the preset anti-pinch condition. The updated preset anti-pinch conditions are determined as the target anti-pinch conditions.

[0134] In this embodiment, the determining module 20 is further configured to: Determine the second distance between the first feature vector and each of the cluster centers; The smallest second distance is determined from a plurality of second distances; The cluster center corresponding to the smallest second distance among the multiple cluster centers is determined as the target cluster center to which the first feature vector belongs.

[0135] In this embodiment, the determining module 20 is further configured to: When a preset update cycle is reached, for each cluster center in the first correspondence, obtain all feature vectors belonging to the cluster center within the current preset update cycle; The mean value of the Hall pulse width time in all the feature vectors is determined to obtain the third Hall pulse width time mean value, and the mean value of the current value in all the feature vectors is determined to obtain the third current mean value. Determine the number of updates corresponding to the cluster centers; The learning rate is determined based on the number of updates. The cluster centers are updated using the learning rate, the average third Hall pulse width time, and the average third current.

[0136] This embodiment provides a control device for a sunshade curtain. During the movement of the sunshade curtain, the device acquires the first Hall pulse width time and the first current value of the motor. Based on the calibrated cluster centers corresponding to the movement state, it identifies the feature vector formed by the first Hall pulse width time and the first current value to determine the target cluster center and its corresponding movement state. Simultaneously, it compares the first Hall pulse width time and the first current value with the target anti-pinch conditions to obtain an anti-pinch comparison result. The device then integrates the movement state and the anti-pinch comparison result to perform anti-pinch control on the sunshade curtain. This achieves anti-pinch control that combines cluster state recognition with threshold comparison, avoiding the drawbacks of missed or false judgments caused by relying solely on fixed threshold comparisons for anti-pinch control, and improving the accuracy of anti-pinch judgment.

[0137] refer to Figure 10 As shown, Figure 10 This is a schematic diagram of a vehicle structure provided in an embodiment of this application. The vehicle 1000 in this embodiment may include: at least one processor 1001, a memory 1002, at least one network interface 1004, and other user interfaces 1003. Various components in the electronic device 1000 are coupled together via a bus system 1005. It is understood that the bus system 1005 is used to implement communication between these components. In addition to a data bus, the bus system 1005 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are referred to as bus system 1005.

[0138] The user interface 1003 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).

[0139] It is understood that the memory 1002 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1002 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0140] In some implementations, memory 1002 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 10021 and application programs 10022.

[0141] The operating system 10021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 10022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this application embodiment can be included in the application program 10022.

[0142] In this embodiment of the application, the processor 1001 executes the methods provided in each method embodiment by calling the program or instructions stored in the memory 1002, specifically the program or instructions stored in the application program 10022.

[0143] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1001. The processor 1001 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the processor 1001. The processor 1001 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1002. Processor 1001 reads the information in memory 1002 and completes the above method in conjunction with its hardware.

[0144] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0145] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0146] This application also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; it may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and it may also include combinations of the above types of memory.

[0147] When a storage medium contains one or more programs that can be executed by one or more processors, and when the storage medium is used in a vehicle, the method described above for execution in the vehicle can be implemented. The processor executes the vehicle program stored in the memory to implement the method described above for execution in the vehicle.

[0148] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0149] It should be noted that the terms "one implementation," "embodiment," "exemplary embodiment," and "some embodiments" used in the specification indicate that the described embodiment may include a specific feature, structure, or characteristic, but not every embodiment necessarily includes that specific feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same embodiment. Moreover, when a specific feature, structure, or characteristic is described in connection with an embodiment, implementing such a feature, structure, or characteristic in conjunction with other embodiments, whether explicitly described or not, is within the knowledge scope of those skilled in the art.

[0150] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, or article that comprises a list of elements, or not only those elements, but also other elements not expressly listed, or elements inherent to such a process, method, article, or vehicle. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or vehicle that includes said element.

[0151] The above embodiments are merely preferred embodiments provided to fully illustrate this application, and the scope of protection of this application is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on this application are all within the scope of protection of this application.

Claims

1. A method for controlling a sunshade curtain, characterized in that, include: During the process of using a motor to drive the sunshade curtain to move, the first Hall pulse width time and the first current value of the motor are obtained; Multiple cluster centers are determined. These cluster centers are obtained by performing cluster analysis on the feature vectors formed by the Hall pulse width time and current value of the motor at each sampling time during the calibration of the sunshade. Each cluster center corresponds to the motion state of the sunshade. The first Hall pulse width time and the first current value are used to form a first feature vector to determine the target cluster center to which the first feature vector belongs from the plurality of cluster centers; The first Hall pulse width time and the first current value are compared with the target anti-pinch conditions to obtain the anti-pinch comparison result; Based on the motion state corresponding to the target cluster center and the anti-pinch comparison result, the sunshade curtain is subjected to anti-pinch control.

2. The control method for the sunshade curtain according to claim 1, characterized in that, The determination of multiple cluster centers includes: Obtain the Hall pulse count of the motor; The movement distance of the motor is determined based on the Hall pulse count; Obtain a first mapping relationship, which includes multiple first correspondence relationships, each of which represents the relationship between a preset motion distance and multiple cluster centers; The first mapping relationship is queried using the motion distance to obtain multiple cluster centers corresponding to the motion distance.

3. The control method for the sunshade curtain according to claim 2, characterized in that, Each of the first correspondences is determined in the following manner: The motor drives the sunshade curtain to move toward a preset calibration point, which is determined based on the preset movement distance. An anti-pinch device is installed at the preset calibration point. During the movement of the sunshade, the second Hall pulse width time and the second current value of the motor are acquired at each sampling moment; When the sunshade touches the anti-pinch force device to trigger the sunshade anti-pinch control, the second Hall pulse width time and the second current value corresponding to each sampling moment are used to form a second feature vector; The K-means clustering algorithm is used to perform cluster analysis on each of the second feature vectors to obtain multiple cluster centers; The preset movement distance is associated with multiple cluster centers to obtain the first correspondence.

4. The control method for the sunshade curtain according to claim 3, characterized in that, Before performing the step of associating the preset movement distance with multiple cluster centers to obtain the first correspondence, the method further includes: When the preset calibration point is not the target calibration point, the first cluster center corresponding to the target calibration point is obtained. The target calibration point represents the calibration point corresponding to the sunshade being in a fully closed state. The anti-pinch force device is not installed at the target calibration point. The motion state corresponding to the first cluster center indicates that the motor is in a normal state. The first cluster center is obtained by performing cluster analysis on the feature vector composed of the Hall pulse width time and the current value of the motor at each sampling time during the process of the sunshade moving towards the target calibration point. A second cluster center is determined from the plurality of cluster centers corresponding to the preset calibration point, and the motion state corresponding to the second cluster center indicates that the motor is in a normal state; The consistency of the second cluster center is verified using the first cluster center to obtain the verification result; If the verification result indicates that the consistency verification has passed, the step of associating the preset movement distance with multiple cluster centers to obtain the first correspondence relationship is executed.

5. The control method for the sunshade curtain according to claim 4, characterized in that, The step of using the first cluster center to perform a consistency check on the second cluster center to obtain a check result includes: Determine the first distance between the first cluster center and the second cluster center; The first distance is compared with a preset distance threshold to perform a consistency check on the second cluster center; When the first distance is less than or equal to a preset distance threshold, the verification result indicates that the consistency verification has passed; When the first distance is greater than a preset distance threshold, the verification result indicates that the consistency verification has failed.

6. The control method for the sunshade curtain according to claim 1, characterized in that, The step of controlling the sunshade curtain against pinching based on the motion state corresponding to the target cluster center and the anti-pinch comparison result includes: When the motion state indicates that the motor is in an abnormal state, the historical motion states corresponding to multiple consecutive historical moments before the current moment are obtained; When all the aforementioned historical motion states indicate that the motor is in a critical abnormal state, the sunshade is subjected to anti-pinch control; and / or, When the anti-pinch comparison result indicates that the first Hall pulse width time and / or the first current value meet the target anti-pinch condition, the sunshade is subjected to anti-pinch control.

7. The control method for a sunshade curtain according to claim 1 or 6, characterized in that, The target anti-pinch conditions are determined in the following manner: Obtain preset anti-pinch conditions, wherein the preset anti-pinch conditions include the first Hall pulse width time being greater than a preset pulse width time threshold and / or the first current value being greater than a preset current threshold. When the motion state corresponding to the target cluster center indicates that the motor is in a critical abnormal state or an abnormal state, the preset pulse width time threshold and the preset current threshold in the preset anti-pinch condition are reduced to complete the update of the preset anti-pinch condition. The updated preset anti-pinch conditions are determined as the target anti-pinch conditions.

8. The control method for the sunshade curtain according to claim 1, characterized in that, Determining the target cluster center to which the first feature vector belongs from the plurality of cluster centers includes: Determine the second distance between the first feature vector and each of the cluster centers; The smallest second distance is determined from a plurality of second distances; The cluster center corresponding to the smallest second distance among the multiple cluster centers is determined as the target cluster center to which the first feature vector belongs.

9. The control method for the sunshade curtain according to claim 2, characterized in that, The multiple cluster centers of the first correspondence are updated in the following manner: When a preset update cycle is reached, for each cluster center in the first correspondence, obtain all feature vectors belonging to the cluster center within the current preset update cycle; The mean value of the Hall pulse width time in all the feature vectors is determined to obtain the third Hall pulse width time mean value, and the mean value of the current value in all the feature vectors is determined to obtain the third current mean value. Determine the number of updates corresponding to the cluster centers; The learning rate is determined based on the number of updates. The cluster centers are updated using the learning rate, the average third Hall pulse width time, and the average third current.

10. A control device for a sunshade curtain, characterized in that, include: The acquisition module is used to acquire the first Hall pulse width time and the first current value of the motor during the process of driving the sunshade curtain to move using the motor; The determination module is used to determine multiple cluster centers. The multiple cluster centers are obtained by performing cluster analysis on the feature vector formed by the Hall pulse width time and current value of the motor at each sampling time during the calibration of the sunshade. Each cluster center corresponds to the motion state of the sunshade. The determining module is further configured to construct a first feature vector from the first Hall pulse width time and the first current value, so as to determine the target cluster center to which the first feature vector belongs from the plurality of cluster centers; The comparison module is used to compare the first Hall pulse width time, the first current value and the target anti-pinch condition to obtain the anti-pinch comparison result; The control module is used to perform anti-pinch control on the sunshade based on the motion state corresponding to the target cluster center and the anti-pinch comparison result.

11. A vehicle, characterized in that, include: A processor and a memory, wherein the processor is used to execute a control program for the sunshade stored in the memory to implement the control method for the sunshade according to any one of claims 1 to 9.

12. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the control method of the sunshade curtain according to any one of claims 1 to 9.