A vehicle and a control method thereof
By dynamically determining the port status and voltage value after the controller is powered on, and combining the output control signal with the mapping parameters, the problem of poor adaptability of the controller port configuration strategy is solved, and more efficient vehicle control is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FANJI TECH (SUZHOU) CO LTD
- Filing Date
- 2025-03-28
- Publication Date
- 2026-06-02
AI Technical Summary
Existing controller port configuration strategies cannot adapt to the needs of different vehicle manufacturers, resulting in poor performance and adaptability, which affects the effectiveness of vehicle control.
By dynamically determining the actual state and voltage value of each port after the controller is powered on, and outputting corresponding control signals according to the mapping parameters, flexible control of the device is achieved, avoiding the need to store multiple port configuration strategies.
This improves the performance and adaptability of the controller, ensures the reliability and accuracy of vehicle control, and reduces the complexity of maintenance and debugging.
Smart Images

Figure CN119975003B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle control technology, and in particular to a vehicle and its control method. Background Technology
[0002] With the continuous optimization of battery energy storage technology, production capacity, and price, industrial electric vehicles are also developing rapidly.
[0003] The motor controller, or controller for short, is the core control component of an electric vehicle. In addition to controlling the motor, it also needs to collect external signals from the vehicle, calculate and control the motor's operation, and control the corresponding output ports to drive the vehicle's peripheral devices and achieve some necessary functions.
[0004] The ports of existing controllers are configured before leaving the factory. However, different vehicle manufacturers have different port requirements for controllers, which requires the controller to store multiple port configuration strategies. This causes inconvenience to the maintenance, management and debugging of the controller, resulting in poor performance and adaptability of the controller, thus affecting the control of the vehicle. Summary of the Invention
[0005] This invention provides a vehicle and its control method to solve the problem that poor performance and adaptability of the controller affect the control of the vehicle.
[0006] According to one aspect of the present invention, a method for controlling a vehicle is provided, the vehicle including a controller; the controller including a plurality of first ports and a plurality of second ports; the method comprising:
[0007] After the controller is powered on, for each of the first ports, in the current first determined cycle, the current state data of the first port is determined based on the current state value of the first port and the previous state data, and the actual state of the first port is determined based on the current state data; wherein, the current state data includes multiple state values;
[0008] For each of the second ports, in the current second determined period, the current voltage data of the second port is determined based on the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined based on the current voltage data; wherein, the current voltage data includes multiple voltage values;
[0009] After receiving the first mapping parameter corresponding to the first device, a first control signal is output according to the actual state of the first port corresponding to the first mapping parameter; wherein, the first mapping parameter is the correspondence between the first port and the first device;
[0010] After receiving the second mapping parameter corresponding to the second device, a second control signal is output according to the actual voltage value of the second port corresponding to the second mapping parameter; wherein, the second mapping parameter is the correspondence between the second port and the second device.
[0011] Optionally, the controller further includes multiple third ports; the method further includes:
[0012] After receiving the third mapping parameter corresponding to the third device, a signal is output to the third port corresponding to the third mapping parameter according to the port attribute corresponding to the third mapping parameter; wherein, the third mapping parameter is the correspondence between the third device and the third port; wherein, the first port is used to transmit digital signals, the second port is used to transmit analog signals, and the third port is used to transmit power signals.
[0013] Optionally, after the controller is powered on, for each of the first ports, before determining the current state data of the first port based on the current state value and the previous state data in the current first determination cycle, and before determining the actual state of the first port based on the current state data, the method further includes:
[0014] When the controller is powered on, the initial state of each of the first ports and the initial voltage value of each of the second ports are determined.
[0015] Optionally, when the controller is powered on, determining the initial state of each of the first ports and the initial voltage value of each of the second ports includes:
[0016] When the controller is powered on, for each first port, the first state value of the first port is acquired multiple times, and the initial state of the first port is determined based on the multiple first state values.
[0017] When the controller is powered on, for each of the second ports, the first voltage value of the second port is acquired multiple times, and the initial voltage value of the second port is determined based on the multiple first voltage values.
[0018] Optionally, the step of repeatedly acquiring the first state value of the first port and determining the initial state of the first port based on the multiple first state values includes:
[0019] The first state value of the first port is obtained multiple times according to a preset number of times. If the first state value of the preset number of times is the state value corresponding to the open state, then the initial state is determined to be the open state; wherein, the preset number of times is greater than half of the preset number of times.
[0020] If the first state value of the preset number is the state value corresponding to the closed state, then the initial state is determined to be the closed state;
[0021] The process of repeatedly acquiring the first voltage value of the second port and determining the initial voltage value of the second port based on the multiple first voltage values includes:
[0022] The first voltage value of the second port is obtained multiple times according to the preset number of times, the multiple first voltage values are sorted, and the median value of the multiple first voltage values is used as the initial voltage value of the second port.
[0023] Optionally, after the controller is powered on, for each of the first ports, in the current first determined cycle, the current state data of the first port is determined based on the current state value of the first port and the previous state data, and the actual state of the first port is determined based on the current state data, including:
[0024] After the controller is powered on, for each of the first ports, the current state value of the first port is obtained in the current first determined period.
[0025] Sort the current state value and multiple state values in the previous state data according to their corresponding acquisition time, and remove the state value with the earliest acquisition time to obtain the current state data of the first port.
[0026] If all the status values in the current status data are the status values corresponding to the closed state, then the actual state of the first port is the closed state;
[0027] If all the status values in the current status data are the status values corresponding to the open state, then the actual state of the first port is the open state.
[0028] Optionally, after the controller is powered on, for each of the second ports, in the current second determined cycle, the current voltage data of the second port is determined based on the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined based on the current voltage data, including:
[0029] After the controller is powered on, for each of the second ports, the current voltage value of the second port is obtained in the current second determined period;
[0030] Sort the current voltage value and multiple voltage values in the previous voltage data according to their corresponding acquisition time, and remove the voltage value with the earliest acquisition time to obtain the current voltage data corresponding to the second port.
[0031] The average value of all voltage values in the current voltage data is taken as the actual voltage value of the second port.
[0032] Optionally, after receiving the first mapping parameter corresponding to the first device, controlling the device corresponding to the first device according to the actual state of the first port corresponding to the first mapping parameter includes:
[0033] After receiving the first mapping parameter corresponding to the first device, the device corresponding to the first device is controlled according to the actual state and level attribute of the first port corresponding to the first mapping parameter.
[0034] After receiving the second mapping parameter corresponding to the second device, the device corresponding to the second device is controlled according to the actual voltage value of the second port corresponding to the second mapping parameter, including:
[0035] After receiving the second mapping parameter corresponding to the second device, the device corresponding to the second device is controlled according to the actual voltage value and electrical signal attribute of the second port corresponding to the second mapping parameter.
[0036] Optionally, after receiving the first mapping parameter corresponding to the first device, the method further includes:
[0037] Output the first device, the first port, the type of the controller, and the vehicle type corresponding to the first mapping parameter;
[0038] After receiving the second mapping parameters corresponding to the second device, the method further includes:
[0039] Output the second device, the second port, the type of the controller, and the vehicle type corresponding to the controller, which are the second mapping parameters;
[0040] After receiving the third mapping parameter corresponding to the third device, the method further includes:
[0041] Output the third device, the third port, the type of the controller, and the vehicle type corresponding to the third mapping parameter.
[0042] Optionally, the controller includes a storage module, which includes a first storage unit and a second storage unit;
[0043] After receiving the first mapping parameter corresponding to the first device, the method further includes:
[0044] Update the first data in the first storage unit corresponding to the first mapping parameter according to the first device;
[0045] After receiving the second mapping parameters corresponding to the second device, the method further includes:
[0046] Update the second data in the first storage unit corresponding to the second mapping parameter according to the second device;
[0047] After receiving the third mapping parameter corresponding to the third device, the method further includes:
[0048] Update the third data in the first storage unit corresponding to the third mapping parameter according to the third device;
[0049] The method further includes:
[0050] Upon receiving a recovery command, the first data is updated according to the first initial data of the first device stored in the second storage unit, the second data is updated according to the second initial data of the second device stored in the second storage unit, and the third data is updated according to the third initial data of the third device stored in the second storage unit.
[0051] According to another aspect of the present invention, a vehicle is provided, the vehicle including a controller; the controller including a plurality of first ports and a plurality of second ports; the controller being configured to perform a vehicle control method according to any embodiment of the present invention.
[0052] The technical solution of this invention, upon receiving the first mapping parameter corresponding to the first device, outputs a first control signal based on the actual state of the first port corresponding to the first mapping parameter, thereby controlling the device corresponding to the first device; upon receiving the second mapping parameter corresponding to the second device, outputs a second control signal based on the actual voltage value of the second port corresponding to the second mapping parameter, thereby controlling the device corresponding to the second device. Therefore, when using the controller, the port connected to the first device and the second port connected to the second device can be selected according to requirements, thus eliminating the need to store multiple port configuration strategies to control the devices corresponding to the first and second devices, improving the controller's performance and adaptability, and enabling better vehicle control. Furthermore, outputting the first control signal based on the actual state of the first port and the second control signal based on the actual voltage value of the second port improves the reliability of vehicle control.
[0053] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart of a vehicle control method provided in an embodiment of the present invention;
[0056] Figure 2 This is a flowchart of another vehicle control method provided in an embodiment of the present invention;
[0057] Figure 3 This is a flowchart of another vehicle control method provided in an embodiment of the present invention;
[0058] Figure 4 This is a structural schematic diagram of a vehicle provided in an embodiment of the present invention. Detailed Implementation
[0059] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0060] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0061] This invention provides a vehicle control method, wherein the vehicle includes a controller. The vehicle can be an electric vehicle, including industrial electric vehicles and road electric vehicles, with industrial electric vehicles including electric forklifts and electric loaders, etc. The controller includes multiple first ports and multiple second ports, wherein the first ports and second ports transmit different data types; for example, the first ports are for transmitting digital quantities (i.e., switching quantities), and the second ports are for transmitting analog quantities. The controller can configure its ports.
[0062] Figure 1 This is a flowchart of a vehicle control method provided in an embodiment of the present invention, see reference. Figure 1 The vehicle control methods include:
[0063] S110. After the controller is powered on, for each first port, in the current first determined cycle, the current state data of the first port is determined according to the current state value of the first port and the previous state data, and the actual state of the first port is determined according to the current state data; wherein, the current state data includes multiple state values.
[0064] In each first defined cycle, the controller can acquire the status value of the first port. The current first defined cycle corresponds to the current status value, meaning the status value of the first port can be acquired periodically. The current status value can be 0 or 1, for example, 0 represents the on state and 1 represents the off state; or, 0 represents the off state and 1 represents the on state. The previous status data includes multiple status values, meaning the previous status data is multi-digit data, including multiple numerical values, with each digit representing a status value. Similarly, the current status data is multi-digit data, including multiple numerical values, with each digit representing a status value. If the number of executed first defined cycles is greater than or equal to the number of status values in the previous status data, then the previous status data is a set of status values determined in the previous multiple first defined cycles. If the first defined cycle has just started, then the previous status data includes multiple first status values acquired when the controller powers on. If the number of executed first defined cycles is less than the number of status values in the previous status data, then the previous status data includes a portion of the first status values and a portion of the status values determined in the first defined cycle.
[0065] Specifically, by determining the current state data of the first port based on its current state value and the previous state data, multiple state values can be obtained in chronological order. Determining the actual state of the first port based on the current state data allows for the determination of the actual state based on multiple state values, thereby improving the accuracy of the actual state determination and avoiding misjudgments.
[0066] S120. For each second port, in the current second determined period, the current voltage data of the second port is determined according to the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined according to the current voltage data; wherein, the current voltage data includes multiple voltage values.
[0067] In each second defined cycle, the controller can acquire the voltage value of the second port. The current second defined cycle corresponds to the current voltage value, meaning the voltage value of the second port can be acquired periodically. The previous voltage data includes multiple voltage values; that is, the previous voltage data is multi-bit data, with each bit representing a voltage value. Similarly, the current voltage data is multi-bit data, with each bit representing a voltage value. If the number of executed second defined cycles is greater than or equal to the number of voltage values in the previous voltage data, then the previous voltage data is a set of voltage values determined by the previous multiple second defined cycles. If the second defined cycle has just started, then the previous voltage data includes multiple first voltage values acquired when the controller is powered on. If the number of executed second defined cycles is less than the number of voltage values in the previous voltage data, then the previous voltage data includes a portion of the first voltage values and a portion of the voltage values determined by the second defined cycles.
[0068] Specifically, by determining the current voltage value of the second port based on the current voltage value and the previous voltage data, multiple voltage values can be obtained in the order of acquisition time. Determining the actual voltage value of the second port based on the current voltage data allows for the determination of the actual voltage value from multiple values, thereby improving the accuracy of the actual voltage value determination and avoiding large errors in a single voltage value acquisition.
[0069] S130. After receiving the first mapping parameter corresponding to the first device, output the first control signal according to the actual state of the first port corresponding to the first mapping parameter; wherein, the first mapping parameter is the correspondence between the first port and the first device.
[0070] The first device is a device that transmits digital quantities (i.e., digital signals) to and from the controller. It can send digital quantities to and receive digital quantities from the controller. The actual state of the first port is the actual state of the first device connected to the first port. Each first device corresponds to a first mapping parameter.
[0071] The first device can be an accelerator (accelerator pedal) or a power switch, etc. For example, if the first device is an accelerator, then the corresponding device is a motor. The controller outputs a first control signal based on the actual state of the accelerator to control whether the motor runs. When the accelerator is in the on state, the motor runs; when the accelerator is in the off state, the motor stops running.
[0072] Specifically, before the vehicle's main unit leaves the factory, the operator connects the first device to the first port and inputs the corresponding first port through the operating interface (e.g., the host computer's operating interface), allowing the controller to receive the corresponding first mapping parameters. Alternatively, after the vehicle leaves the factory, the user can connect the first device to the first port and input the corresponding first port through the vehicle's central controller or an external device (e.g., a host computer), allowing the controller to receive the corresponding first mapping parameters.
[0073] The controller can determine the first port corresponding to each first device based on each first mapping parameter, and thus output the first control signal according to the actual state of the first port corresponding to the first mapping parameter.
[0074] For example, if the first device is an accelerator, then the accelerator's enable switch is connected to the first port. For instance, the controller includes four first ports, with a first mapping parameter of 2. The controller determines that the accelerator corresponds to the second first port. When the controller obtains that the actual state of the second first port is "on," it controls the motor to run; when the controller obtains that the actual state of the second first port is "off," it controls the motor to stop running. Thus, after determining the actual state of the first port in each first determining cycle, a first control signal can be output in real time based on the actual state of the first port (i.e., the actual state of the first device) to control the device corresponding to the first device.
[0075] In some other embodiments, the first device may also include a vehicle interlock switch, such as a seatbelt interlock switch, which closes after the seatbelt plug is inserted into the socket. The corresponding device for the first device may be a motor. When the controller determines that both the interlock switch and the accelerator are closed, it outputs a first control signal to the motor to control its operation.
[0076] S140. After receiving the second mapping parameter corresponding to the second device, output the second control signal according to the actual voltage value of the second port corresponding to the second mapping parameter; wherein, the second mapping parameter is the correspondence between the second port and the second device.
[0077] The second device is used to transmit analog signals (i.e., analog quantities) to and from the controller. It can send analog signals to or receive analog signals from the controller. The actual voltage value at the second port is the actual voltage value output or received by the second device connected to that port. The first and second devices can be the same device or different devices. Each second device corresponds to a second mapping parameter.
[0078] The second device can be an accelerator or an air conditioning control knob, etc. For example, if the second device is an accelerator, then the corresponding device is a motor. The controller outputs a second control signal based on the actual voltage value output by the accelerator to control the operation of the motor. The voltage value output by the accelerator corresponds to the stroke of the accelerator, thereby controlling the motor speed based on the stroke of the accelerator, and thus controlling the vehicle speed.
[0079] Specifically, before the vehicle's main unit leaves the factory, staff connect the second device to the second port and input the corresponding second port information through the operating interface, allowing the controller to receive the corresponding second mapping parameters. Alternatively, after the vehicle leaves the factory, users can connect the second device to the second port and input the corresponding second port information through the vehicle's central controller, enabling the controller to receive the corresponding second mapping parameters.
[0080] The controller can determine the second port corresponding to each second interval based on each second mapping parameter, and then output a second control signal based on the actual voltage value of the second port corresponding to the second mapping parameter to control the device corresponding to the second device.
[0081] For example, if the second device is an accelerator, the controller includes four second ports, with a first mapping parameter of 3. The controller determines that the accelerator corresponds to a third second port. The controller obtains the actual voltage value of the third second port, that is, the actual voltage value output by the accelerator, and thus controls the motor speed based on the actual voltage value of the accelerator. In this way, after determining the actual voltage value of the second port in each second determining cycle, the corresponding device of the second device can be controlled in real time based on the actual voltage value of the second port.
[0082] In this way, the required first or second port can be selected according to actual needs. The controller can determine the first port corresponding to each first device based on the first mapping parameters, and the second port corresponding to each second device based on the second mapping parameters. This eliminates the need to store multiple port configuration strategies, allowing control of both the devices corresponding to the first and second devices, improving the controller's performance and adaptability, and enabling better vehicle control. Furthermore, outputting a first control signal based on the actual state of the first port and a second control signal based on the actual voltage value of the second port enhances the reliability of vehicle control.
[0083] Furthermore, for example, when the first mapping parameter is 0, it indicates that the first device is not connected to the first port, that is, there is no corresponding first port, and the controller will not output the first control signal. When the second mapping parameter is 0, it indicates that the second device is not connected to the second port, that is, there is no corresponding second port, and the controller will not output the second control signal.
[0084] The technical solution of this embodiment, upon receiving the first mapping parameter corresponding to the first device, outputs a first control signal based on the actual state of the first port corresponding to the first mapping parameter, thereby controlling the device corresponding to the first device; upon receiving the second mapping parameter corresponding to the second device, outputs a second control signal based on the actual voltage value of the second port corresponding to the second mapping parameter, thereby controlling the device corresponding to the second device. Therefore, when using the controller, the port connected to the first device can be selected according to requirements, and the second port connected to the second device can be selected according to requirements. This eliminates the need to store multiple port configuration strategies, allowing control of both the devices corresponding to the first and second devices, improving the controller's performance and adaptability, and enabling better vehicle control. Furthermore, outputting the first control signal based on the actual state of the first port and the second control signal based on the actual voltage value of the second port improves the reliability of vehicle control.
[0085] Optionally, based on the above technical solution, the controller may also include multiple third ports. These third ports can be ports for transmitting power, meaning the electrical signal transmitted through the third port carries a relatively large current.
[0086] Alternatively, the vehicle control method may also include:
[0087] After receiving the third mapping parameter corresponding to the third device, a signal is output to the third port corresponding to the third mapping parameter according to the port attribute corresponding to the third mapping parameter; wherein, the third mapping parameter is the correspondence between the third device and the third port; wherein, the first port is used to transmit digital signals, the second port is used to transmit analog signals, and the third port is used to transmit power signals.
[0088] Each third device corresponds to a third mapping parameter. The third device is used to transmit power to the controller, for example, receiving power signals from the controller. For instance, if the third device is an electromagnetic brake, the controller outputs a signal to the third device to control whether the electromagnetic brake engages. Port attributes represent the port control mode; for example, the port attribute can be level control or pulse width modulation (PWM) control.
[0089] Specifically, before the vehicle's main unit leaves the factory, staff connect the third device to the third port and input the corresponding third port and port attributes through the operating interface. This allows the controller to receive the third mapping parameters and port attributes corresponding to the third device through the operating interface. Alternatively, after the vehicle leaves the factory, users can connect the third device to the third port and input the corresponding third port through the vehicle's central controller or external devices, enabling the controller to receive the third mapping parameters and port attributes corresponding to the third device.
[0090] The controller can determine the third port corresponding to each third device based on the third mapping parameter, and then output a signal to the corresponding third port according to the port attribute of the third port corresponding to the third mapping parameter, thereby controlling the third device.
[0091] For example, the third device may be an electromagnetic brake. The controller includes four third ports, with a third mapping parameter of 2. The controller determines the second third port corresponding to the electromagnetic brake. When the controller detects that the motor speed is zero, it outputs the corresponding braking control signal to the electromagnetic controller through the third port. In this way, a signal can be output to the corresponding third port.
[0092] Based on the above technical solutions, Figure 2 This is a flowchart of another vehicle control method provided in an embodiment of the present invention. Optionally, refer to... Figure 2 The vehicle control methods include:
[0093] S210. When the controller is powered on, determine the initial state of each first port and the initial voltage value of each second port.
[0094] Specifically, when the controller is powered on, it performs a power-on self-test, determining the initial state of each first port and the initial state value of each second port. This allows the state of each first port and the initial state value of each second port to be determined at power-on, facilitating real-time determination of these parameters.
[0095] S220. After the controller is powered on, for each first port, in the current first determined cycle, the current state data of the first port is determined according to the current state value of the first port and the previous state data, and the actual state of the first port is determined according to the current state data; wherein, the current state data includes multiple state values.
[0096] S230. For each second port, in the current second determined period, the current voltage data of the second port is determined according to the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined according to the current voltage data; wherein, the current voltage data includes multiple voltage values.
[0097] S240. After receiving the first mapping parameter corresponding to the first device, output a first control signal according to the actual state of the first port corresponding to the first mapping parameter; wherein, the first mapping parameter is the correspondence between the first port and the first device.
[0098] S250. After receiving the second mapping parameter corresponding to the second device, output the second control signal according to the actual voltage value of the second port corresponding to the second mapping parameter; wherein, the second mapping parameter is the correspondence between the second port and the second device.
[0099] Based on the above technical solution, optionally, when the controller is powered on, the initial state of each first port and the initial voltage value of each second port are determined, including:
[0100] Step a1: When the controller is powered on, for each first port, the first state value of the first port is acquired multiple times, and the initial state of the first port is determined based on the multiple first state values.
[0101] Specifically, the first state value can be 0 or 1, for example, 0 represents the on state and 1 represents the off state; or, 0 represents the off state and 1 represents the on state. For example, within a predetermined time period, the first state value of the first port is acquired multiple times, and the initial state of the first port is determined based on these multiple first state values. For instance, if most of the first state values are the state values corresponding to the on state, then the initial state is determined to be the on state; if most of the first state values are the state values corresponding to the off state, then the initial state is determined to be the off state. This improves the accuracy of determining the initial state of the first port and avoids misjudgments of the initial state caused by voltage instability when the controller is first powered on.
[0102] Step a2: When the controller is powered on, for each second port, the first voltage value of the second port is acquired multiple times, and the initial voltage value of the second port is determined based on the multiple first voltage values.
[0103] Specifically, for example, within a predetermined time period, the first voltage value of the second port is acquired multiple times, and the initial voltage value of the second port is determined based on these multiple first voltage values. For instance, the average of the multiple first voltage values can be used as the initial voltage value of the second port, or the median value after sorting the multiple first voltage values can be used as the initial voltage value of the second port. This improves the accuracy of the initial voltage value determination and avoids situations where voltage instability occurs when the controller is first powered on, leading to large errors in the determined initial voltage value.
[0104] Based on the above technical solution, optionally, the first state value of the first port is acquired multiple times, and the initial state of the first port is determined based on the multiple first state values, including:
[0105] Step b1: Obtain the first state value of the first port multiple times according to a preset number of times. If the first state value of the preset number of times is the state value corresponding to the open state, then determine the initial state as the open state; wherein, the preset number of times is greater than half of the preset number of times.
[0106] Specifically, if a preset number of first state values are the state values corresponding to the "on" state, meaning that most of the first state values are the state values corresponding to the "on" state, then the initial state is determined to be the "on" state. This improves the accuracy of determining the initial state of the first port and avoids misjudgment of the initial state due to unstable voltage when the controller is first powered on. Alternatively, among all the first state values, the number of state values corresponding to the "on" state and the number of state values corresponding to the "off" state are counted. If the number of state values corresponding to the "on" state is greater than the number of state values corresponding to the "off" state, then the initial state is determined to be the "on" state.
[0107] For example, if the first status value of the first port is obtained 16 times consecutively within a predetermined time period (e.g., 5ms), and the number of status values corresponding to the open state is greater than 8, then the initial state is determined to be the open state. Alternatively, if the number of status values corresponding to the open state is greater than the number of status values corresponding to the closed state, then the initial state is determined to be the open state.
[0108] Step b2: If the first state value of the preset number is the state value corresponding to the closed state, then the initial state is determined to be the closed state.
[0109] Specifically, if a preset number of first state values are the state values corresponding to the off state, meaning that most of the first state values are the state values corresponding to the off state, then the initial state is determined to be the off state. This can improve the accuracy of determining the initial state of the first port and avoid misjudgment of the initial state due to voltage instability when the controller is first powered on. Alternatively, among all the first state values, the number of state values corresponding to the on state and the number of state values corresponding to the off state are counted. If the number of state values corresponding to the off state is greater than the number of state values corresponding to the on state, then the initial state is determined to be the off state.
[0110] For example, if the first status value of the first port is obtained 16 times consecutively within a predetermined time period (e.g., 5ms), and the number of status values corresponding to the closed state is greater than 8, then the initial state is determined to be the closed state. Alternatively, if the number of status values corresponding to the closed state is greater than the number of status values corresponding to the open state, then the initial state is determined to be the closed state.
[0111] Optionally, the first voltage value of the second port is acquired multiple times, and an initial voltage value of the second port is determined based on the multiple first voltage values, including:
[0112] The first voltage value of the second port is obtained multiple times according to a preset number of times. The multiple first voltage values are sorted, and the median value of the multiple first voltage values is used as the initial voltage value of the second port.
[0113] Specifically, for example, the preset number of times is m, where m is an integer greater than 1. If m is odd, then after sorting all the first voltage values, the th... If the first voltage value is the median of multiple first voltage values, then the first voltage value will be... The first voltage value is used as the initial voltage value of the second port. If m is an even number, then after sorting all the first voltage values, the first... and the If the average of the first voltage values is the median of the multiple first voltage values, then the first... and the The average of the first voltage values is used as the initial voltage value of the second port. In this way, the first voltage values obtained at the moment of power-on are not used as the initial voltage value, avoiding the problem of inaccurate initial voltage values caused by the unstable controller voltage at the moment of power-on.
[0114] For example, within a predetermined time period (e.g., 5ms), the first voltage value of the second port is acquired 16 times consecutively, the 16 first voltage values are sorted, and the average of the 8th and 9th first voltage values is taken as the initial voltage value of the second port.
[0115] Based on the above technical solutions, optionally, after the controller is powered on, for each first port, in the current first determined cycle, the current state data of the first port is determined according to the current state value of the first port and the previous state data, and the actual state of the first port is determined according to the current state data, including:
[0116] Step c1: After the controller is powered on, for each first port, in the current first determined cycle, obtain the current status value of the first port.
[0117] Specifically, after the controller is powered on, i.e., after the controller completes its power-on self-test and is operating normally, the status value of the first port is acquired once every first determined cycle. Each first determined cycle corresponds to a status value, and the current first determined cycle corresponds to the current status value, thus periodically acquiring the status value of the first port.
[0118] Step c2: Sort the current state value and multiple state values in the previous state data according to their corresponding acquisition time, and remove the state value with the earliest acquisition time to obtain the current state data of the first port.
[0119] Specifically, each state value corresponds to an acquisition time. The current state value and multiple state values in the previous state data are sorted according to the order of their corresponding acquisition times, and the state value with the earliest acquisition time is removed, so that the current state data is more consistent with the state of the first port at the current moment.
[0120] For example, if the previous state data is 16 bits, that is, it includes 16 state values. The 16 state values are sorted according to the time of acquisition. The earliest acquisition time corresponds to the lowest bit of the previous state data. After removing the state value corresponding to the earliest acquisition time (i.e. the lowest bit state value), the current state value is taken as the highest bit of the state data, and the current state data of the first port can be obtained.
[0121] For example, the 16-bit previous state data can be sorted according to time sequence, and the 16-bit previous state data can be shifted by assigning the 1st bit to the 0th bit (least significant bit), the 2nd bit to the 1st bit, the 3rd bit to the 2nd bit, and so on, assigning the 15th bit (most significant bit) to the 14th bit, and then assigning the current state value to the 15th bit (most significant bit) to obtain the current state data of the first port.
[0122] Specifically, if the current first determined period is the first first determined period, then all state values in the previous state data are first state values; if the current first determined period is 17 first determined periods, then all state values in the previous state data are state values obtained in the first 16 first determined periods. If the number of first determined periods executed is less than 16, then the previous state data includes a portion of the first state values and a portion of the state values obtained in the first determined periods.
[0123] Step c3: If all the status values in the current status data are the status values corresponding to the closed state, then the actual state of the first port is the closed state.
[0124] Specifically, if all the status values in the current status data are the status values corresponding to the closed state, then the actual state of the first port is determined to be closed. This ensures the accuracy of the status determination, avoids misjudgment, and prevents the motor from stopping when the switch or accelerator is accidentally touched, thus ensuring the accuracy and reliability of vehicle control.
[0125] Step c4: If all the status values in the current status data are the status values corresponding to the open state, then the actual state of the first port is the open state.
[0126] Specifically, if all the status values in the current status data are the status values corresponding to the open state, then the actual state of the first port is determined to be the open state. This can ensure the accuracy of the status determination, avoid misjudgment, and prevent the motor from being controlled to run when the switch or accelerator is accidentally touched. This can ensure the accuracy and reliability of vehicle control.
[0127] Based on the above technical solutions, optionally, after the controller is powered on, for each second port, in the current second determined cycle, the current voltage data of the second port is determined according to the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined according to the current voltage data, including:
[0128] Step d1: After the controller is powered on, for each second port, obtain the current voltage value of the second port in the current second defined cycle.
[0129] Specifically, after the controller is powered on, i.e., after the controller completes its power-on self-test and is operating normally, the voltage value of the second port is acquired once every second determined cycle. Each second determined cycle corresponds to a voltage value, and the current second determined cycle corresponds to the current voltage value, thus periodically acquiring the voltage value of the second port.
[0130] Step d2: Sort the current voltage value and multiple voltage values in the previous voltage data according to their corresponding acquisition time, and remove the voltage value with the earliest acquisition time to obtain the current voltage data corresponding to the second port.
[0131] Specifically, each voltage value corresponds to an acquisition time. The current voltage value and multiple voltage values in the previous voltage data are sorted according to the order of their corresponding acquisition times, and the voltage value with the earliest acquisition time is removed, so that the obtained current voltage data is more consistent with the voltage of the second port at the current moment.
[0132] For example, if the previous voltage data is 16 bits, that is, it includes 16 voltage values. The 16 voltage values are sorted according to the acquisition time. The earliest acquisition time corresponds to the lowest bit of the previous voltage data. After removing the voltage value corresponding to the earliest acquisition time (i.e. the lowest bit voltage value), the current voltage value is taken as the highest bit of the voltage data, and the current voltage data of the second port can be obtained.
[0133] For example, the 16-bit previous voltage data can be sorted according to time sequence, and the 16-bit previous voltage data can be shifted. The first bit is assigned to the 0th bit (least significant bit), the second bit is assigned to the 1st bit, the 3rd bit is assigned to the 2nd bit, and so on. The 15th bit (most significant bit) is assigned to the 14th bit, and the current voltage value is assigned to the 15th bit (most significant bit) to obtain the current voltage data of the second port.
[0134] Specifically, if the current second determination period is the first second determination period, then all voltage values in the previous voltage data are the first voltage values; if the current second determination period is 17 second determination periods, then all voltage values in the previous voltage data are voltage values obtained in the first 16 second determination periods. If the number of executed second determination periods is less than 16, then the previous voltage data includes a portion of the first voltage values and a portion of the voltage values obtained in the second determination periods.
[0135] Step d3: Take the average value of all voltage values in the current voltage data as the actual voltage value of the second port.
[0136] Specifically, using the average of all voltage values in the current voltage data as the actual voltage value of the second port ensures the accuracy of the determined actual voltage value. For example, if the second device is an accelerator, this avoids voltage fluctuations at the second port caused by the driver's jolts when pressing the accelerator, which could lead to inaccurate actual voltage values. This improves the accuracy and reliability of vehicle control.
[0137] Based on the above technical solutions, optionally, after receiving the first mapping parameter corresponding to the first device, the device corresponding to the first device is controlled according to the actual state of the first port corresponding to the first mapping parameter, including:
[0138] After receiving the first mapping parameter corresponding to the first device, the device corresponding to the first device is controlled according to the actual state and level attribute of the first port corresponding to the first mapping parameter.
[0139] Specifically, before the vehicle's main unit leaves the factory, after connecting the first device to the first port, the operator can input the first port corresponding to the first device through an operating interface (such as the host computer's operating interface) and select the level attribute of the first port corresponding to the first device, that is, determine whether the first port is active high or active low. This allows the controller to receive the first mapping parameter and level attribute corresponding to the first device through the operating interface. If the level attribute is active high, the value corresponding to the actual state of the first port is directly input into the functional module of the controller corresponding to the first device, so that the controller controls the device corresponding to the first device according to the actual state of the first port. If the level attribute is active low, the value corresponding to the actual state of the first port is inverted and input into the functional module of the controller corresponding to the first device, so that the controller controls the device corresponding to the first device according to the actual state of the first port.
[0140] For example, the controller can store the values corresponding to the actual states of all first ports in the first data, meaning each bit of the first data corresponds to the actual state of one first port. For instance, if the controller has four first ports and the first mapping parameter is 2, then the second bit of the first data corresponds to this value. If the level attribute is active high, the second bit of the first data is input to the functional module of the controller corresponding to the first device. If the level attribute is active low, the second bit of the first data is inverted and then input to the functional module of the controller corresponding to the first device.
[0141] Optionally, after receiving the second mapping parameter corresponding to the second device, controlling the device corresponding to the second device according to the actual voltage value of the second port corresponding to the second mapping parameter includes:
[0142] After receiving the second mapping parameters corresponding to the second device, the device corresponding to the second device is controlled according to the actual voltage value and electrical signal attributes of the second port corresponding to the second mapping parameters.
[0143] Specifically, before the vehicle's main unit leaves the factory, after connecting the second device to the second port, the operator can input the second port corresponding to the second device through an operating interface (such as a host computer's operating interface) and select the electrical signal attribute of the second port corresponding to the second device. This determines whether the device is controlled by voltage or current, allowing the controller to receive the second mapping parameters and electrical signal attribute corresponding to the second device through the operating interface. If the electrical signal attribute is voltage-type, the actual voltage value of the second port is directly input to the functional module of the controller corresponding to the second device, enabling the controller to control the device based on the actual voltage value of the second port. If the electrical signal attribute is current-type, the actual voltage value of the second port is converted to a current-type value and then input to the functional module of the controller corresponding to the second device, enabling the controller to control the device based on the actual voltage value of the second port.
[0144] For example, the controller can store the actual voltage values of all second ports in the second data, meaning each bit of the second data corresponds to the actual voltage value of the second port. For instance, if the controller has four first ports and the second mapping parameter is 2, then the second bit in the second data corresponds to that value. If the electrical signal is voltage-type, the second bit of the second data is input to the functional module of the controller corresponding to the second device. If the electrical signal is current-type, the second bit of the second data is converted to current type and then input to the functional module of the controller corresponding to the second device.
[0145] Based on the above technical solutions, Figure 3 This is a flowchart of another vehicle control method provided in an embodiment of the present invention. Optionally, refer to... Figure 3 The vehicle control methods include:
[0146] S310. When the controller is powered on, determine the initial state of each first port and the initial voltage value of each second port.
[0147] S320. After the controller is powered on, for each first port, in the current first determined cycle, the current state data of the first port is determined according to the current state value of the first port and the previous state data, and the actual state of the first port is determined according to the current state data; wherein, the current state data includes multiple state values.
[0148] S330. For each second port, in the current second determined period, the current voltage data of the second port is determined according to the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined according to the current voltage data; wherein, the current voltage data includes multiple voltage values.
[0149] S340. After receiving the first mapping parameter corresponding to the first device, output a first control signal according to the actual state of the first port corresponding to the first mapping parameter; wherein, the first mapping parameter is the correspondence between the first port and the first device.
[0150] S350. After receiving the second mapping parameter corresponding to the second device, output the second control signal according to the actual voltage value of the second port corresponding to the second mapping parameter; wherein, the second mapping parameter is the correspondence between the second port and the second device.
[0151] S360. After receiving the third mapping parameter corresponding to the third device, output a signal to the third port corresponding to the third mapping parameter according to the port attribute corresponding to the third mapping parameter; wherein, the third mapping parameter is the correspondence between the third device and the third port; wherein, the first port is used to transmit digital signals, the second port is used to transmit analog signals, and the third port is used to transmit power signals.
[0152] S370, Output the first device, first port, controller type and vehicle type corresponding to the first mapping parameter.
[0153] Specifically, the controller can communicate with a host computer or terminal device (such as a mobile phone). The controller can output the first device, first port, controller type, and corresponding vehicle type corresponding to the first mapping parameters to the host computer or terminal device in the form of a file, i.e., an output parameter file. For mass production, the controller retrieves the corresponding parameter file from the host computer or terminal device based on the controller type and vehicle type. This achieves separation of firmware and parameters, eliminating the need to repeatedly set the mapping relationship between the first device and the first port.
[0154] S380: Output the second device, second port, controller type, and vehicle type corresponding to the second mapping parameter.
[0155] Specifically, the controller can output the second device, second port, controller type, and vehicle type corresponding to the second mapping parameters to a host computer or terminal device in the form of a file, i.e., an output parameter file. This facilitates mass production by allowing the controller to retrieve the corresponding parameter file from the host computer or terminal device based on the controller type and vehicle type. This achieves separation of firmware and parameters, eliminating the need to repeatedly configure the mapping between the second device and the second port.
[0156] S390, Output the third device, third port, controller type, and vehicle type corresponding to the third mapping parameter.
[0157] Specifically, the controller can output the third device, third port, controller type, and corresponding vehicle type corresponding to the third mapping parameters to the host computer or terminal device in the form of a file, i.e., an output parameter file. This facilitates mass production by allowing the controller to retrieve the corresponding parameter file from the host computer or terminal device based on the controller type and vehicle type. This achieves separation of firmware and parameters, eliminating the need to repeatedly configure the mapping between the third device and the third port.
[0158] The parameter files corresponding to different ports can be independent files or integrated into one file; this embodiment does not impose any limitations.
[0159] Based on the above technical solutions, optionally, the controller includes a storage module, which includes a first storage unit and a second storage unit; wherein the storage module can be a flash memory module. The first storage unit is a first sector, and the second storage unit can be a second sector. The storage spaces of the first storage unit and the second storage unit may be the same or different.
[0160] Optionally, after receiving the first mapping parameter corresponding to the first device, the vehicle control method further includes:
[0161] Update the first data in the first storage unit corresponding to the first mapping parameter according to the first mapping parameter corresponding to the first device.
[0162] Specifically, the controller can store the values corresponding to the actual states of all first ports into the first data. Both the first and second storage units store the first data. Immediately after connecting the first port to the first device and before updating the first mapping parameters, the first data in the first and second storage units is the same—both are the first data written to the storage module for the first time. The first data is multi-bit data, with the number of bits matching the number of first ports. After changing the first mapping parameters corresponding to the first device, only the first data corresponding to the first mapping parameters in the first storage unit needs to be updated; the first data in the second storage unit remains unchanged.
[0163] Optionally, after receiving the second mapping parameters corresponding to the second device, the vehicle control method further includes:
[0164] Update the second data corresponding to the second mapping parameter in the first storage unit according to the second mapping parameter corresponding to the second device.
[0165] Specifically, the controller can store the actual voltage values of all second ports into the second data. Both the first and second storage units store the second data. Immediately after connecting the second port to the second device, before updating the second mapping parameters, the second data in the first and second storage units is identical, both being the second data written to the storage module for the first time. The second data is multi-bit data, with the number of bits matching the number of second ports. After changing the second mapping parameters corresponding to the second device, only the second data corresponding to the second mapping parameters in the first storage unit needs to be updated; the second data in the second storage unit remains unchanged.
[0166] Optionally, after receiving the third mapping parameters corresponding to the third device, the vehicle control method further includes:
[0167] Update the third data corresponding to the third mapping parameter in the first storage unit according to the third mapping parameter corresponding to the third device.
[0168] Specifically, the controller can store all third mapping parameters corresponding to the third port into the third data. Both the first and second storage units store the third data. When the third port is first connected to the third device, before the third mapping parameters are updated, the third data in the first and second storage units are identical, both being the third data written to the storage module for the first time. After changing the third mapping parameters corresponding to the third device, only the third data corresponding to the third mapping parameters in the first storage unit needs to be updated; the third data in the second storage unit remains unchanged.
[0169] Alternatively, the vehicle control method may also include:
[0170] Upon receiving the recovery command, the first data is updated based on the first initial data of the first device stored in the second storage unit, the second data is updated based on the second initial data of the second device stored in the second storage unit, and the third data is updated based on the third initial data of the third device stored in the second storage unit.
[0171] Specifically, the recovery command can be a factory reset command. Upon receiving the recovery command, the first data is updated based on the first initial data of the first device stored in the second storage unit; that is, the first data in the second storage unit is imported into the first storage unit, replacing the first data in the first storage unit. Similarly, the second data is updated based on the second initial data of the second device stored in the second storage unit; that is, the second data in the second storage unit is imported into the first storage unit, replacing the second data in the first storage unit. Finally, the third data is updated based on the third initial data of the third device stored in the second storage unit; that is, the third data in the second storage unit is imported into the first storage unit, replacing the third data in the first storage unit. This eliminates the need to rewrite the first, second, and third mapping parameters through a host computer, simplifying operation and improving the user experience.
[0172] This invention also provides a vehicle. Figure 4 This is a structural schematic diagram of a vehicle provided in an embodiment of the present invention, for reference. Figure 4 The vehicle includes a controller 410; the controller 410 includes multiple first ports A1 and multiple second ports A2. The controller 410 is used to execute the vehicle control method provided in any embodiment of the present invention. The vehicle can be an electric vehicle, such as an electric industrial vehicle, including electric forklifts and electric loaders. The vehicle may also include a motor 420, and the controller 410 is connected to the motor 420 to control the operation of the motor 420. Since the controller 410 is used to execute the vehicle control method provided in any embodiment of the present invention, the controller 410 has the same beneficial effects as the vehicle control method provided in any embodiment of the present invention, and will not be described further here.
[0173] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0174] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for controlling a vehicle, characterized in that, The vehicle includes a controller; the controller includes a plurality of first ports and a plurality of second ports; the method includes: After the controller is powered on, for each of the first ports, in the current first determined cycle, the current state data of the first port is determined based on the current state value of the first port and the previous state data, and the actual state of the first port is determined based on the current state data; wherein, the current state data includes multiple state values; For each of the second ports, in the current second determined period, the current voltage data of the second port is determined based on the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined based on the current voltage data; wherein, the current voltage data includes multiple voltage values; After receiving the first mapping parameter corresponding to the first device, a first control signal is output according to the actual state of the first port corresponding to the first mapping parameter; wherein, the first mapping parameter is the correspondence between the first port and the first device; After receiving the second mapping parameter corresponding to the second device, a second control signal is output according to the actual voltage value of the second port corresponding to the second mapping parameter; wherein, the second mapping parameter is the correspondence between the second port and the second device; After the controller is powered on, for each of the first ports, in the current first determined cycle, the current state data of the first port is determined based on the current state value of the first port and the previous state data, and the actual state of the first port is determined based on the current state data, including: After the controller is powered on, for each of the first ports, the current state value of the first port is obtained in the current first determined period. Sort the current state value and multiple state values in the previous state data according to their corresponding acquisition time, and remove the state value with the earliest acquisition time to obtain the current state data of the first port. If all the status values in the current status data are the status values corresponding to the closed state, then the actual state of the first port is the closed state; If all the status values in the current status data are the status values corresponding to the open state, then the actual state of the first port is the open state; After the controller is powered on, for each of the second ports, in the current second determined cycle, the current voltage data of the second port is determined based on the current voltage value of the second port and the previous voltage data, and the actual voltage value is determined based on the current voltage data, including: After the controller is powered on, for each of the second ports, the current voltage value of the second port is obtained in the current second determined period; Sort the current voltage value and multiple voltage values in the previous voltage data according to their corresponding acquisition time, and remove the voltage value with the earliest acquisition time to obtain the current voltage data corresponding to the second port. The average value of all voltage values in the current voltage data is taken as the actual voltage value of the second port.
2. The method according to claim 1, characterized in that, The controller also includes multiple third ports; the method further includes: After receiving the third mapping parameter corresponding to the third device, a signal is output to the third port corresponding to the third mapping parameter according to the port attribute corresponding to the third mapping parameter; wherein, the third mapping parameter is the correspondence between the third device and the third port; wherein, the first port is used to transmit digital signals, the second port is used to transmit analog signals, and the third port is used to transmit power signals.
3. The method according to claim 1, characterized in that, After the controller is powered on, for each of the first ports, before determining the current state data of the first port based on the current state value and the previous state data in the current first determined cycle, and before determining the actual state of the first port based on the current state data, the method further includes: When the controller is powered on, the initial state of each of the first ports and the initial voltage value of each of the second ports are determined.
4. The method according to claim 3, characterized in that, When the controller is powered on, the initial state of each of the first ports and the initial voltage value of each of the second ports are determined, including: When the controller is powered on, for each first port, the first state value of the first port is acquired multiple times, and the initial state of the first port is determined based on the multiple first state values. When the controller is powered on, for each of the second ports, the first voltage value of the second port is acquired multiple times, and the initial voltage value of the second port is determined based on the multiple first voltage values.
5. The method according to claim 4, characterized in that, The step of repeatedly acquiring the first state value of the first port and determining the initial state of the first port based on the multiple first state values includes: The first state value of the first port is obtained multiple times according to a preset number of times. If the first state value of the preset number of times is the state value corresponding to the open state, then the initial state is determined to be the open state; wherein, the preset number of times is greater than half of the preset number of times. If the first state value of the preset number is the state value corresponding to the closed state, then the initial state is determined to be the closed state; The process of repeatedly acquiring the first voltage value of the second port and determining the initial voltage value of the second port based on the multiple first voltage values includes: The first voltage value of the second port is obtained multiple times according to the preset number of times, the multiple first voltage values are sorted, and the median value of the multiple first voltage values is used as the initial voltage value of the second port.
6. The method according to any one of claims 1-5, characterized in that, After receiving the first mapping parameter corresponding to the first device, the device corresponding to the first device is controlled according to the actual state of the first port corresponding to the first mapping parameter, including: After receiving the first mapping parameter corresponding to the first device, the device corresponding to the first device is controlled according to the actual state and level attribute of the first port corresponding to the first mapping parameter. After receiving the second mapping parameter corresponding to the second device, the device corresponding to the second device is controlled according to the actual voltage value of the second port corresponding to the second mapping parameter, including: After receiving the second mapping parameter corresponding to the second device, the device corresponding to the second device is controlled according to the actual voltage value and electrical signal attribute of the second port corresponding to the second mapping parameter.
7. The method according to claim 2, characterized in that, After receiving the first mapping parameter corresponding to the first device, the method further includes: Output the first device, the first port, the type of the controller, and the vehicle type corresponding to the first mapping parameter; After receiving the second mapping parameters corresponding to the second device, the method further includes: Output the second device, the second port, the type of the controller, and the vehicle type corresponding to the controller, which are the second mapping parameters; After receiving the third mapping parameter corresponding to the third device, the method further includes: Output the third device, the third port, the type of the controller, and the vehicle type corresponding to the third mapping parameter.
8. The method according to claim 2, characterized in that, The controller includes a storage module, which includes a first storage unit and a second storage unit. After receiving the first mapping parameter corresponding to the first device, the method further includes: Update the first data in the first storage unit corresponding to the first mapping parameter according to the first device; After receiving the second mapping parameters corresponding to the second device, the method further includes: Update the second data in the first storage unit corresponding to the second mapping parameter according to the second device; After receiving the third mapping parameter corresponding to the third device, the method further includes: Update the third data in the first storage unit corresponding to the third mapping parameter according to the third device; The method further includes: Upon receiving a recovery command, the first data is updated according to the first initial data of the first device stored in the second storage unit, the second data is updated according to the second initial data of the second device stored in the second storage unit, and the third data is updated according to the third initial data of the third device stored in the second storage unit.
9. A vehicle, characterized in that, The vehicle includes a controller; the controller includes a plurality of first ports and a plurality of second ports; the controller is used to execute the vehicle control method according to any one of claims 1-7.