Vehicle and control method thereof
By dynamically determining the port status and voltage data after the controller is powered on and outputting control signals, the performance and adaptability problems caused by the fixed port configuration of the existing controller are solved, and more flexible and reliable vehicle control is achieved.
Patent Information
- Application Number
- CN202510380684.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-03-28
AI Technical Summary
The port configuration of the existing controller is fixed before leaving the factory, resulting in different vehicle manufacturers having different requirements for controller ports, resulting in the controller having to store multiple port configuration strategies, affecting its usage performance and adaptability, and thus affecting the control of the vehicle.
After the controller is powered on, it determines its current status and voltage data for each port, and outputs control signals based on these data, dynamically adjusts the port configuration, so as to achieve flexible control of different devices.
No need to store multiple port configuration strategies, which improves the performance and adaptability of the controller, can better control the vehicle, and improves the reliability of vehicle control.
Smart Images

Figure CN119975003A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle control, and in particular to a vehicle and a control method thereof. Background Art
[0002] With the continuous optimization of battery energy storage technology, production and price, industrial electric vehicles are also developing rapidly.
[0003] The motor controller, referred to as the controller, is the core control component of the electric vehicle. In addition to controlling the motor, it also needs to collect external signals from the vehicle, control the motor operation through calculation, and is responsible for controlling the corresponding output ports, driving the vehicle's peripheral devices, and realizing some necessary functions.
[0004] The ports of existing controllers are configured before leaving the factory, but different vehicle manufacturers have different port requirements for controllers, requiring the controller to store multiple port configuration strategies. This brings inconvenience to the maintenance, management, and debugging of the controller, resulting in poor performance and adaptability of the controller, thereby affecting vehicle control. Summary of the Invention
[0005] The present invention provides a vehicle and a control method thereof, so as to solve the problem that the poor performance and adaptability of a controller affect the control of the vehicle.
[0006] According to one aspect of the present invention, a method for controlling a vehicle is provided, wherein the vehicle includes a controller; the controller includes a plurality of first ports and a plurality of second ports; the method includes:
[0007] After the controller is powered on, for each of the first ports, in a current first determination cycle, current state data of the first port is determined based on a current state value of the first port and previous state data, and an actual state of the first port is determined based on the current state data; wherein the current state data includes a plurality of state values;
[0008] For each second port, in a current second determination cycle, current voltage data of the second port is determined based on the current voltage value of the second port and previous voltage data, and an actual voltage value is determined based on the current voltage data; wherein the current voltage data includes a plurality of voltage values;
[0009] After receiving a first mapping parameter corresponding to a first device, outputting a first control signal according to an actual state of a first port corresponding to the first mapping parameter; wherein the first mapping parameter is a correspondence between the first port and the first device;
[0010] After receiving a 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 a plurality of third ports; and the method further includes:
[0012] After receiving a third mapping parameter corresponding to a third device, output a signal to a third port corresponding to the third mapping parameter according to a port attribute corresponding to the third mapping parameter; wherein the third mapping parameter is a 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, in a current first determination cycle, determining current state data of the first port according to a current state value of the first port and previous state data, and before determining an actual state of the first port according to the current state data, the method further includes:
[0014] When the controller is powered on, an initial state of each of the first ports and an initial voltage value of each of the second ports are determined.
[0015] Optionally, when the controller is powered on, determining an initial state of each first port and an initial voltage value of each second port includes:
[0016] When the controller is powered on, for each first port, obtaining a first state value of the first port multiple times, and determining an initial state of the first port according to the multiple first state values;
[0017] When the controller is powered on, for each second port, the first voltage value of the second port is obtained multiple times, and an initial voltage value of the second port is determined according to the multiple first voltage values.
[0018] Optionally, the acquiring the first state value of the first port multiple times and determining the initial state of the first port according to the multiple first state values includes:
[0019] Acquiring the first state value of the first port a plurality of times according to a preset number of times, and determining that the initial state is the open state if the preset number of first state values is a state value corresponding to the open state; wherein the preset number of first state values is greater than half of the preset number of times;
[0020] If the preset number of first state values are state values corresponding to the closed state, determining that the initial state is the closed state;
[0021] The acquiring the first voltage value of the second port multiple times and determining the initial voltage value of the second port according to 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 middle 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 first port, in a current first determination cycle, determining current state data of the first port according to a current state value of the first port and previous state data, and determining an actual state of the first port according to the current state data includes:
[0024] After the controller is powered on, for each of the first ports, in a current first determination cycle, obtaining a current state value of the first port;
[0025] Sort the current state value and multiple state values in the previous state data according to 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 state values in the current state data are state values corresponding to the closed state, the actual state of the first port is the closed state;
[0027] If all state values in the current state data are state values corresponding to the open state, the actual state of the first port is the open state.
[0028] Optionally, after the controller is powered on, for each second port, in a current second determination cycle, determining current voltage data of the second port according to a current voltage value of the second port and previous voltage data, and determining an actual voltage value according to the current voltage data includes:
[0029] After the controller is powered on, for each second port, obtaining a current voltage value of the second port in a current second determination cycle;
[0030] Sort the current voltage value and multiple voltage values in the previous voltage data according to corresponding acquisition time, and remove the voltage value with the earliest acquisition time, to obtain current voltage data corresponding to the second port;
[0031] An average value of all voltage values in the current voltage data is used as the actual voltage value of the second port.
[0032] Optionally, after receiving a first mapping parameter corresponding to a first device, controlling a device corresponding to the first device according to an actual state of a first port corresponding to the first mapping parameter includes:
[0033] After receiving a first mapping parameter corresponding to a first device, controlling a device corresponding to the first device according to an actual state and level attribute of a first port corresponding to the first mapping parameter;
[0034] After receiving a second mapping parameter corresponding to a second device, controlling a device corresponding to the second device according to an actual voltage value of a second port corresponding to the second mapping parameter includes:
[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 property 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] Outputting the first device, the first port, the type of the controller, and the vehicle type corresponding to the controller corresponding to the first mapping parameter;
[0038] After receiving the second mapping parameter corresponding to the second device, the method further includes:
[0039] Outputting the second device, the second port, the type of the controller, and the vehicle type corresponding to the controller corresponding to the second mapping parameter;
[0040] After receiving the third mapping parameter corresponding to the third device, the method further includes:
[0041] The third device, the third port, the type of the controller, and the vehicle type corresponding to the controller corresponding to the third mapping parameter are output.
[0042] Optionally, the controller includes a storage module, and the storage module 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] updating, according to a first mapping parameter corresponding to the first device, first data corresponding to the first mapping parameter in the first storage unit;
[0045] After receiving the second mapping parameter corresponding to the second device, the method further includes:
[0046] updating, according to a second mapping parameter corresponding to the second device, second data corresponding to the second mapping parameter in the first storage unit;
[0047] After receiving the third mapping parameter corresponding to the third device, the method further includes:
[0048] updating, according to a third mapping parameter corresponding to the third device, third data corresponding to the third mapping parameter in the first storage unit;
[0049] The method further comprises:
[0050] After receiving the recovery instruction, 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, comprising a controller; the controller comprising a plurality of first ports and a plurality of second ports; the controller being configured to execute the vehicle control method according to any one of the embodiments of the present invention.
[0052] The technical solution of the embodiment of the present invention, after receiving the first mapping parameter corresponding to the first device, outputs a first control signal according to the actual state of the first port corresponding to the first mapping parameter, thereby controlling the device corresponding to the first device; after receiving the second mapping parameter corresponding to the second device, outputs a second control signal according to 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 the controller is in use, the port to which the first device is connected can be selected as needed, and the second port to which the second device is connected can be selected as needed, so that the device corresponding to the first device and the device corresponding to the second device can be controlled without storing multiple port configuration strategies, thereby improving the performance and adaptability of the controller and better controlling the vehicle. In addition, outputting the first control signal according to the actual state of the first port and outputting the second control signal according to the actual voltage value of the second port can improve the reliability of vehicle control.
[0053] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0055] Figure 1 is a flow chart of a vehicle control method provided by an embodiment of the present invention;
[0056] Figure 2 is a flow chart of another vehicle control method provided by an embodiment of the present invention;
[0057] Figure 3 is a flow chart of another vehicle control method provided by an embodiment of the present invention;
[0058] Figure 4 It is a structural schematic diagram of a vehicle provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0060] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0061] An embodiment of the present invention provides a vehicle control method, wherein the vehicle includes a controller. The vehicle may be an electric vehicle, including industrial electric vehicles and road electric vehicles. Industrial electric vehicles include electric forklifts and electric shovels, among others. The controller includes multiple first ports and multiple second ports. The first ports and second ports transmit different types of data. For example, the first ports transmit digital quantities (i.e., switching quantities), while the second ports transmit analog quantities. The controller port configuration method may be executed by the controller.
[0062] Figure 1 This is a flow chart of a vehicle control method provided by an embodiment of the present invention, with reference to Figure 1 , the vehicle control method includes:
[0063] S110. After the controller is powered on, for each first port, in the current first determination cycle, current state data of the first port is determined based on the current state value of the first port and previous state data, and an actual state of the first port is determined based on the current state data; wherein the current state data includes multiple state values.
[0064] In each first determination cycle, the controller can obtain the state value of the first port. The current first determination cycle corresponds to the current state value, meaning that the state value of the first port can be periodically obtained. The current 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. The previous state data includes multiple state values, meaning that the previous state data is multi-bit data, including multiple digits, each digit representing a state value. Similarly, the current state data is multi-bit data, including multiple digits, each digit representing a state value. If the number of first determination cycles executed is greater than or equal to the number of state values in the previous state data, the previous state data is a collection of state values determined in the previous multiple first determination cycles. If the first determination cycle has just been executed, the previous state data includes multiple first state values acquired when the controller was powered on. If the number of first determination cycles executed is less than the number of state values in the previous state data, the previous state data includes a portion of the first state values and a portion of the state values determined in the first determination cycle.
[0065] Specifically, by determining the current state data of the first port based on the current state value and previous state data of the first port, multiple state values can be obtained in the order of acquisition time. By determining the actual state of the first port based on the current state data, the actual state of the first port can be determined based on the multiple state values, thereby improving the accuracy of the actual state determination and avoiding misjudgment.
[0066] S120. For each second port, in the current second determination cycle, determine current voltage data of the second port according to the current voltage value of the second port and previous voltage data, and determine an actual voltage value according to the current voltage data; wherein the current voltage data includes multiple voltage values.
[0067] Among them, in each second determination cycle, the controller can obtain the voltage value of the second port, and the current second determination cycle corresponds to the current voltage value, that is, the voltage value of the second port can be periodically obtained. The previous voltage data includes multiple voltage values, that is, the previous voltage data is multi-bit data, and the value of each bit is a voltage value. Similarly, the current voltage data is multi-bit data, and the value of each bit is a voltage value. If the number of second determination cycles executed 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 determination cycles. If the second determination cycle has just been executed, the previous voltage data includes multiple first voltage values obtained when the controller is powered on; if the number of second determination cycles executed is less than the number of voltage values in the previous voltage data, then the previous voltage data includes a partial number of first voltage values and a partial number of voltage values determined by the second determination cycle.
[0068] Specifically, by determining the current voltage data of the second port based on the current voltage value of the second port and the previous voltage data, multiple voltage values can be obtained in the order of acquisition time. By determining the actual voltage value of the second port based on the current voltage data, the actual voltage value of the second port can be determined based on the multiple voltage values, thereby improving the accuracy of the actual voltage value determination and avoiding large errors in the voltage value obtained in a single time.
[0069] S130. After receiving a first mapping parameter corresponding to the first device, output a first control signal according to an actual state of the first port corresponding to the first mapping parameter; wherein the first mapping parameter is a 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. For example, if the first device is an accelerator, then the device corresponding to the first device is a motor. The controller outputs a first control signal based on the actual state of the accelerator to control whether the motor is running. When the accelerator is in the on state, the motor is controlled to run, and when the accelerator is in the off state, the motor is controlled to stop running.
[0072] Specifically, before the vehicle's host machine leaves the factory, a worker connects the first device to the first port and can then input the first port corresponding to the first device through an operation interface (e.g., an operation interface of a host computer), so that the controller can receive the first mapping parameters corresponding to the first device through the operation interface. Alternatively, after the vehicle leaves the factory, a user can connect the first device to the first port and can then input the first port corresponding to the first device through the vehicle's central controller or an external device (e.g., a host computer), so that the controller can receive the first mapping parameters corresponding to the first device.
[0073] The controller can determine the first port corresponding to each first device according to each first mapping parameter, and thus can 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, the enable switch of the accelerator is connected to the first port. For example, the controller includes 4 first ports, the first mapping parameter is 2, and the controller determines that the accelerator corresponds to the second first port. When the controller obtains the actual state of the second first port as the on state, the motor is controlled to run. When the controller obtains the actual state of the second first port as the off state, the motor is controlled to stop running. In this way, after determining the actual state of the first port in each first determination cycle, the first control signal can be output in real time according to the actual state of the first port (that is, the actual state of the first device) to control the device corresponding to the first device.
[0075] In some other embodiments, the first component may further include a vehicle interlock switch, such as a seat belt interlock switch, which closes when the seat belt plug is inserted into the receptacle. The component corresponding to the first component may be a motor. When the controller determines that the interlock switch and the accelerator are both in the closed state, it outputs a first control signal to the motor to control the motor's operation.
[0076] S140 . After receiving a second mapping parameter corresponding to the second device, output a second control signal according to an actual voltage value of the second port corresponding to the second mapping parameter; wherein the second mapping parameter is a correspondence between the second port and the second device.
[0077] The second device is a device that transmits analog quantities (i.e., analog signals) to and from the controller and can send analog quantities to or receive analog quantities from the controller. The actual voltage value of the second port is the actual voltage value output or received by the second device connected to the second port. The first device and the second device 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. 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 output by the accelerator to control the operation of the motor. The voltage output by the accelerator corresponds to the accelerator stroke, thereby controlling the motor speed and, in turn, the vehicle speed, based on the accelerator stroke.
[0079] Specifically, before the vehicle's host machine leaves the factory, a worker connects the second device to the second port and then, through the operation interface, inputs the second port corresponding to the second device, so that the controller can receive the second mapping parameters corresponding to the second device through the operation interface. Alternatively, after the vehicle leaves the factory, a user connects the second device to the second port and then, through the vehicle's central controller, inputs the second port corresponding to the second device, so that the controller can receive the second mapping parameters corresponding to the second device.
[0080] The controller can determine the second port corresponding to each second interval according to each second mapping parameter, and thus can output a second control signal according to 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, and the first mapping parameter is 3, the controller determines that the accelerator corresponds to the 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 thereby controls the speed of the motor 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 determination period, 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 port or second port can be selected based on actual needs. The controller can determine the first port corresponding to each first device based on the first mapping parameter, and determine the second port corresponding to each second device based on the second mapping parameter. This eliminates the need to store multiple port configuration strategies and allows control of the devices corresponding to the first and second devices. This improves the controller's usability and adaptability, enabling better vehicle control. Furthermore, by 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, the reliability of vehicle control can be improved.
[0083] Furthermore, for example, when the first mapping parameter is 0, indicating that the first device is not connected to the first port, i.e., there is no corresponding first port, the controller will not output the first control signal. When the second mapping parameter is 0, indicating that the second device is not connected to the second port, i.e., there is no corresponding second port, the controller will not output the second control signal.
[0084] The technical solution of this embodiment, after 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; after 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 the controller is in use, the port to which the first device is connected and the second port to which the second device is connected can be selected as needed. This eliminates the need to store multiple port configuration strategies to control the devices corresponding to the first device and the second device, thereby improving the controller's usability 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 can improve the reliability of vehicle control.
[0085] Based on the above technical solution, optionally, the controller further includes a plurality of third ports. The third ports may be ports for transmitting power, that is, the current of the electrical signal transmitted by the third ports is relatively large.
[0086] Optionally, the vehicle control method further includes:
[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 a device that transmits power to the controller, for example, receives a power signal from the controller. For example, the third device is an electromagnetic brake, and the controller outputs a signal to the third device to control whether the electromagnetic brake is engaged. The port attribute is a port control mode, for example, a port attribute can be level control or pulse width modulation (PWM) control.
[0089] Specifically, before the vehicle's host machine leaves the factory, a worker can connect the third device to the third port and then, through the operation interface, input the third port corresponding to the third device and the corresponding port attributes, so that the controller can receive the third mapping parameters and port attributes corresponding to the third device through the operation interface. Alternatively, after the vehicle leaves the factory, a user can connect the third device to the third port and, through the vehicle's central controller or an external device, input the third port corresponding to the third device, so that the controller can 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 according to the third mapping parameter, and can 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, if the third device is an electromagnetic brake, the controller includes four third ports, and the third mapping parameter is 2, the controller determines that the electromagnetic brake corresponds to the second third port. When the controller detects that the motor speed is zero, it outputs a control signal corresponding to the brake to the electromagnetic controller through the third port. In this way, the signal can be output to the corresponding third port.
[0092] On the basis of the above technical solutions, Figure 2 is a flow chart of another vehicle control method provided by an embodiment of the present invention. Optionally, refer to Figure 2 , the vehicle control method includes:
[0093] S210 : When the controller is powered on, determine an initial state of each first port and an initial voltage value of each second port.
[0094] Specifically, when the controller is powered on, it performs a power-on self-test and determines the initial state of each first port and the initial state value of each second port. Thus, the state of each first port and the initial state value of each second port can be determined at startup, facilitating real-time determination of the state of each first port and the initial state value of each second port.
[0095] S220. After the controller is powered on, for each first port, in the current first determination cycle, current state data of the first port is determined based on the current state value of the first port and previous state data, and an actual state of the first port is determined based on the current state data; wherein the current state data includes multiple state values.
[0096] S230. For each second port, in the current second determination cycle, determine the current voltage data of the second port according to the current voltage value of the second port and the previous voltage data, and determine the actual voltage value according to the current voltage data; wherein the current voltage data includes multiple voltage values.
[0097] S240. After receiving a first mapping parameter corresponding to the first device, output a first control signal according to an actual state of the first port corresponding to the first mapping parameter; wherein the first mapping parameter is a correspondence between the first port and the first device.
[0098] S250 . After receiving a second mapping parameter corresponding to the second device, output a second control signal according to an actual voltage value of the second port corresponding to the second mapping parameter; wherein the second mapping parameter is a correspondence between the second port and the second device.
[0099] Based on the above technical solution, optionally, when the controller is powered on, determining the initial state of each first port and the initial voltage value of each second port includes:
[0100] Step a1: When the controller is powered on, for each first port, obtain the first state value of the first port multiple times, and determine the initial state of the first port according to 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 obtained multiple times, and the initial state of the first port is determined based on the multiple first state values. For example, if the majority of the first state values among all the first state values are state values corresponding to the on state, the initial state is determined to be the on state; if the majority of the first state values among all the first state values are state values corresponding to the off state, the initial state is determined to be the off state. In this way, the accuracy of the initial state determination of the first port can be improved, avoiding the situation where the initial state is misjudged due to unstable voltage when the controller is just powered on.
[0102] Step a2: When the controller is powered on, for each second port, obtain the first voltage value of the second port multiple times, and determine the initial voltage value of the second port according to the multiple first voltage values.
[0103] Specifically, for example, within a predetermined time period, the first voltage value of the second port is obtained multiple times, and the initial voltage value of the second port is determined based on the multiple first voltage values. For example, the average of the multiple first voltage values is used as the initial voltage value of the second port, or the middle value of the multiple first voltage values after sorting is used as the initial voltage value of the second port. In this way, the accuracy of the initial voltage value determination can be improved, avoiding the situation where the initial voltage value determined is significantly inaccurate due to unstable voltage when the controller is first powered on.
[0104] Based on the above technical solution, optionally, obtaining the first state value of the first port multiple times and determining the initial state of the first port according to the multiple first state values includes:
[0105] Step b1: obtaining the first state value of the first port multiple times according to a preset number of times. If the preset number of first state values are state values corresponding to the open state, determining that the initial state is the open state; wherein the preset number is greater than half of the preset number of times.
[0106] Specifically, if a preset number of first state values are state values corresponding to the on state, that is, if the majority of the first state values are state values corresponding to the on state, then the initial state is determined to be the on state. This can improve the accuracy of determining the initial state of the first port and avoid situations where voltage instability upon powering on the controller leads to misjudgment of the initial state. Alternatively, among all 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, within a predetermined time period (e.g., 5 ms), the first state value of the first port is obtained 16 times in succession. If the number of state values corresponding to the open state is greater than 8, the initial state is determined to be the open state. Alternatively, if the number of state values corresponding to the open state is greater than the number of state values corresponding to the closed state, the initial state is determined to be the open state.
[0108] Step b2: If the preset number of first state values are state values corresponding to the closed state, the initial state is determined to be the closed state.
[0109] Specifically, if a preset number of first state values are state values corresponding to the closed state, that is, if the majority of the first state values are state values corresponding to the closed state, then the initial state is determined to be the closed state. This can improve the accuracy of the initial state determination of the first port and avoid the situation where the voltage is unstable when the controller is just powered on, resulting in a misjudgment of the initial state. Alternatively, among all first state values, the number of state values corresponding to the open state and the number of state values corresponding to the closed state are counted. If the number of state values corresponding to the closed state is greater than the number of state values corresponding to the open state, then the initial state is determined to be the closed state.
[0110] For example, within a predetermined time period (e.g., 5 ms), the first state value of the first port is obtained 16 times in succession. If the number of state 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 state values corresponding to the closed state is greater than the number of state values corresponding to the open state, then the initial state is determined to be the closed state.
[0111] Optionally, acquiring the first voltage value of the second port multiple times and determining the initial voltage value of the second port according to the multiple first voltage values includes:
[0112] The first voltage values of the second port are obtained multiple times according to a preset number of times, the multiple first voltage values are sorted, and the middle 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 an odd number, all first voltage values are sorted, and the first The first voltage value is the middle value of multiple first voltage values, then The first voltage value is used as the initial voltage value of the second port. If m is an even number, all the first voltage values are sorted and the first Hedi If the average value of the first voltage values is the middle value of the multiple first voltage values, then Hedi In this way, the first voltage values obtained when power is just turned on do not need to be used as the initial voltage value, thus avoiding the problem of inaccurate initial voltage value caused by unstable controller voltage when power is just turned on.
[0114] Exemplarily, for example, within a predetermined time (eg, 5 ms), the first voltage value of the second port is obtained 16 times in succession, the 16 first voltage values are sorted, and the average of the 8th first voltage value and the 9th first voltage value 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 a current first determination period, current state data of the first port is determined based on a current state value of the first port and previous state data, and an actual state of the first port is determined based on the current state data, including:
[0116] Step c1: After the controller is powered on, for each first port, obtain the current state value of the first port in the current first determination cycle.
[0117] Specifically, after the controller is powered on, that is, the controller completes the power-on self-test and operates normally, the state value of the first port is obtained once in each first determination period. Each first determination period corresponds to a state value, and the current first determination period corresponds to the current state value, thereby periodically obtaining the state value of the first port.
[0118] Step c2: Sort the current state value and multiple state values in the previous state data according to 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 corresponding acquisition time, and the state value with the earliest acquisition time is removed, so that the current state data obtained is more consistent with the state of the first port at the current moment.
[0120] For example, the previous state data is 16-bit data, that is, it includes 16 state values. The 16 state values are sorted in order of acquisition time. 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 (that is, the lowest bit state value), the current state value is used as the highest bit of the state data to obtain the current state data of the first port.
[0121] For example, the 16-bit previous state data can be sorted in chronological order, the 16-bit previous state data can be shifted, the 1st bit can be assigned to the 0th bit (lowest bit), the 2nd bit can be assigned to the 1st bit, the 3rd bit can be assigned to the 2nd bit... the 15th bit (highest bit) can be assigned to the 14th bit, and then the current state value can be assigned to the 15th bit (highest bit) to obtain the current state data of the first port.
[0122] If the current first determination cycle is the first first determination cycle, all state values in the previous state data are first state values; if the current first determination cycle is the 17th first determination cycle, all state values in the previous state data are state values obtained in the previous 16 first determination cycles. If the number of first determination cycles executed is less than 16, the previous state data includes a portion of the first state values and a portion of the state values obtained in the first determination cycles.
[0123] Step c3: If all the status values in the current status data are status values corresponding to the closed state, the actual state of the first port is the closed state.
[0124] Specifically, if all state values in the current state data are state values corresponding to the closed state, the actual state of the first port is determined to be the closed state, which can ensure the accuracy of state determination, avoid misjudgment, and avoid controlling the motor to stop running when the switch or accelerator is accidentally touched, thereby ensuring the accuracy and reliability of vehicle control.
[0125] Step c4: If all the status values in the current status data are status values corresponding to the open state, the actual state of the first port is the open state.
[0126] Specifically, if all state values in the current state data are state values corresponding to the on state, the actual state of the first port is determined to be the on state, which can ensure the accuracy of state determination, avoid misjudgment, and avoid controlling the motor operation when the switch or accelerator is accidentally touched, thereby ensuring 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 a current second determination cycle, current voltage data of the second port is determined based on the current voltage value of the second port and previous voltage data, and an actual voltage value is determined based on 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 determination cycle.
[0129] Specifically, after the controller is powered on, that is, the controller completes the power-on self-test and operates normally, the voltage value of the second port is obtained once in each second determination period. Each second determination period corresponds to a voltage value, and the current second determination period corresponds to the current voltage value, thereby periodically obtaining 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 the 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 corresponding acquisition time, and the voltage value with the earliest corresponding acquisition time is removed, so that the current voltage data obtained is more consistent with the voltage of the second port at the current moment.
[0132] For example, the previous voltage data is 16-bit data, that is, it includes 16 voltage values. The 16 voltage values are sorted in order of 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 (that is, the lowest bit voltage value), the current voltage value is used as the highest bit of the voltage data to obtain the current voltage data of the second port.
[0133] For example, the 16-bit previous voltage data can be sorted in chronological order, and the 16-bit previous voltage data can be shifted, the 1st bit is assigned to the 0th bit (the lowest bit), the 2nd bit is assigned to the 1st bit, the 3rd bit is assigned to the 2nd bit... the 15th bit (the highest bit) is assigned to the 14th bit, and then the current voltage value is assigned to the 15th bit (the highest bit) to obtain the current voltage data of the second port.
[0134] If the current second determination cycle is the first second determination cycle, all voltage values in the previous voltage data are first voltage values; if the current second determination cycle is the 17th second determination cycle, all voltage values in the previous voltage data are voltage values obtained in the previous 16 second determination cycles. If the number of executed second determination cycles is less than 16, the previous voltage data includes a portion of the first voltage values and a portion of the voltage values obtained in the second determination cycles.
[0135] Step d3: taking 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 can ensure the accuracy of the determined actual voltage value. For example, if the second device is an accelerator, this can avoid fluctuations in the voltage value of the second port caused by jitter when the driver presses 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, controlling the device corresponding to the first device according to the actual state of the first port corresponding to the first mapping parameter includes:
[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 host leaves the factory, after the staff connects the first device to the first port, they can input the first port corresponding to the first device through the operation interface (such as the operation interface of the host computer) and select the level attribute of the first port corresponding to the first device, that is, determine whether the first port is high level valid or low level valid, so that the controller can receive the first mapping parameter and level attribute corresponding to the first device through the operation interface. If the level attribute is high level valid, 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 low level valid, 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] Exemplarily, the controller may store the values corresponding to the actual states of all first ports in the first data, that is, each bit value of the first data corresponds to the actual state of one first port. For example, if the controller includes four first ports and the first mapping parameter is 2, then the corresponding bit value is the second bit value in the first data. If the level attribute is valid at a high level, the second bit value in the first data is input into the functional module of the controller corresponding to the first device. If the level attribute is valid at a low level, the second bit value of the first data is inverted and input into 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 parameter corresponding to the second device, the device corresponding to the second device is controlled according to the actual voltage value and electrical signal property of the second port corresponding to the second mapping parameter.
[0143] Specifically, before the vehicle's host leaves the factory, after the staff connects the second device to the second port, they can input the second port corresponding to the second device through the operation interface (such as the operation interface of the host computer) and select the electrical signal attribute of the second port corresponding to the second device, that is, determine whether the device corresponding to the second device is voltage-type control or current-type control, so that the controller can receive the second mapping parameter and electrical signal attribute corresponding to the second device through the operation interface. If the electrical signal attribute is voltage-type, the actual voltage value of the second port is directly input into the functional module of the controller corresponding to the second device, so that the controller controls the device corresponding to the second device according to the actual voltage value of the second port. If the electrical signal attribute is current-type, the value corresponding to the actual voltage value of the second port is converted into a current-type value and input into the functional module of the controller corresponding to the second device, so that the controller controls the device corresponding to the second device according to the actual voltage value of the second port.
[0144] Exemplarily, the controller may store the actual voltage values of all second ports in the second data, that is, each bit value of the second data corresponds to the actual voltage value of the corresponding second port. For example, if the controller includes four first ports and the second mapping parameter is 2, then the corresponding second bit value in the second data is input. If the electrical signal attribute is voltage type, the second bit value in the second data is input into the functional module of the controller corresponding to the second device. If the electrical signal attribute is current type, the second bit value in the second data is converted into current type and input into the functional module of the controller corresponding to the second device.
[0145] On the basis of the above technical solutions, Figure 3 This is a flow chart of another vehicle control method provided by an embodiment of the present invention. Optionally, refer to Figure 3 , the vehicle control method includes:
[0146] S310 : When the controller is powered on, determine an initial state of each first port and an initial voltage value of each second port.
[0147] S320. After the controller is powered on, for each first port, in the current first determination cycle, current state data of the first port is determined based on the current state value of the first port and previous state data, and an actual state of the first port is determined based on the current state data; wherein the current state data includes multiple state values.
[0148] S330. For each second port, in the current second determination cycle, determine the current voltage data of the second port according to the current voltage value of the second port and the previous voltage data, and determine the actual voltage value according to the current voltage data; wherein the current voltage data includes multiple voltage values.
[0149] S340: After receiving a first mapping parameter corresponding to the first device, output a first control signal according to an actual state of the first port corresponding to the first mapping parameter; wherein the first mapping parameter is a correspondence between the first port and the first device.
[0150] S350 . After receiving a second mapping parameter corresponding to the second device, output a second control signal according to an actual voltage value of the second port corresponding to the second mapping parameter; wherein the second mapping parameter is a 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, the first port, the type of the controller corresponding to the first mapping parameter, and the vehicle type corresponding to the controller.
[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 vehicle type corresponding to the first mapping parameter to the host computer or terminal device in the form of a file, that is, an output parameter file. To facilitate mass production, the controller obtains the parameter file corresponding to the controller type and vehicle type from the host computer or terminal device based on the controller type and vehicle type. In this way, the separation of firmware and parameters is achieved, and there is no need to set the correspondence between the first device and the first port multiple times.
[0154] S380: Output the second device, the second port, the type of the controller, and the vehicle type corresponding to the controller corresponding to the second mapping parameter.
[0155] Specifically, the controller can output the second device, second port, controller type, and corresponding vehicle type of the second mapping parameter to a host computer or terminal device in the form of a file, i.e., an output parameter file. For mass production, the controller retrieves the parameter file corresponding to the controller type and vehicle type from the host computer or terminal device based on the controller type and vehicle type. This achieves the separation of firmware and parameters, eliminating the need to repeatedly set the mapping between the second device and the second port.
[0156] S390: Output the third device, the third port, the type of the controller, and the vehicle type corresponding to the controller, corresponding to the third mapping parameter.
[0157] Specifically, the controller can output the third device, third port, controller type, and corresponding vehicle type of the third mapping parameter to a host computer or terminal device in the form of a file, i.e., an output parameter file. For mass production, the controller retrieves the parameter file corresponding to the controller type and vehicle type from the host computer or terminal device based on the controller type and vehicle type. This achieves the separation of firmware and parameters, eliminating the need to repeatedly set the mapping between the third device and the third port.
[0158] The parameter files corresponding to different ports may be independent files or integrated into one file, which is not limited in this embodiment.
[0159] Based on the above technical solutions, the controller may optionally include a storage module, which includes a first storage unit and a second storage unit. The storage module may be a flash memory module. The first storage unit may be a first sector, and the second storage unit may be a second sector. The storage space 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] According to the first mapping parameter corresponding to the first device, first data corresponding to the first mapping parameter in the first storage unit is updated.
[0162] Specifically, the controller can store the values corresponding to the actual states of all first ports in the first data. The first data is stored in both the first storage unit and the second storage unit. When the first port and the first device are just connected and before the first mapping parameters are updated, the first data in the first storage unit and the first data in the second storage unit are the same, and both are the first data written to the storage module for the first time. The first data is multi-bit data, and the number of bits in the first data is the same as 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 need to be updated, and the first data in the second storage unit remains unchanged.
[0163] Optionally, after receiving the second mapping parameter corresponding to the second device, the vehicle control method further includes:
[0164] According to the second mapping parameter corresponding to the second device, the second data corresponding to the second mapping parameter in the first storage unit is updated.
[0165] Specifically, the controller can store the actual voltage values of all second ports in the second data. The first storage unit and the second storage unit both store the second data. Immediately after the second port and the second device are connected and before the second mapping parameters are updated, the second data in the first storage unit and the second data in the second storage unit are identical, representing the first writing of the second data to the storage module. The second data is multi-bit data, and the number of bits in the second data is the same as 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 need to be updated; the second data in the second storage unit remains unchanged.
[0166] Optionally, after receiving the third mapping parameter corresponding to the third device, the vehicle control method further includes:
[0167] According to the third mapping parameter corresponding to the third device, the third data corresponding to the third mapping parameter in the first storage unit is updated.
[0168] Specifically, the controller can store the third mapping parameters corresponding to all third ports in the third data. The first storage unit and the second storage unit both store the third data. When the third port and the third device are just connected and before the third mapping parameters are updated, the third data in the first storage unit and the third data in the second storage unit are the same, and are both third data written to the storage module for the first time. After the third mapping parameters corresponding to the third device are changed, only the third data corresponding to the third mapping parameters in the first storage unit need to be updated, and the third data in the second storage unit remains unchanged.
[0169] Optionally, the vehicle control method further includes:
[0170] After receiving the recovery instruction, 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.
[0171] Specifically, the recovery instruction may be an instruction to restore factory settings. After receiving the recovery instruction, the first data is updated according to 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. The second data is updated according to 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. The third data is updated according to 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. In this way, there is no need to write the first mapping parameter, the second mapping parameter and the third mapping parameter again through the host computer, etc., which facilitates operation and helps to improve user experience.
[0172] An embodiment of the present invention further provides a vehicle, Figure 4 This is a schematic diagram of the structure of a vehicle provided by an embodiment of the present invention, with reference to Figure 4 , the vehicle includes a controller 410; the controller 410 includes a plurality of first ports A1 and a plurality of second ports A2. The controller 410 is used to execute the control method of the vehicle provided in any embodiment of the present invention. The vehicle may be an electric vehicle, such as an electric industrial vehicle, including an electric forklift and an electric shovel. The vehicle may further 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 control method of the vehicle provided in any embodiment of the present invention, the controller 410 has the same beneficial effects as the control method of the vehicle provided in any embodiment of the present invention, which will not be described in detail here.
[0173] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0174] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A vehicle control method, 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 a current first determination cycle, current state data of the first port is determined according to a current state value of the first port and previous state data, and an actual state of the first port is determined according to the current state data; wherein the current state data includes a plurality of state values; For each of the second ports, in the current second determination cycle, 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 an actual voltage value is determined according to the current voltage data; wherein the current voltage data includes a plurality of voltage values; After receiving a first mapping parameter corresponding to the first device, outputting a first control signal according to an actual state of the first port corresponding to the first mapping parameter; wherein the first mapping parameter is a corresponding relationship between the first port and the first device; After receiving a second mapping parameter corresponding to the second device, a second control signal is output according to an actual voltage value of the second port corresponding to the second mapping parameter; wherein the second mapping parameter is a correspondence between the second port and the second device.
2. The method according to claim 1, characterized in that The controller further includes a plurality of third ports; and the method further includes: After receiving a third mapping parameter corresponding to a third device, a signal is output to a third port corresponding to the third mapping parameter according to a port attribute corresponding to the third mapping parameter; wherein the third mapping parameter is a 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, in a current first determination cycle, current state data of the first port is determined according to a current state value of the first port and previous state data, and before an actual state of the first port is determined according to the current state data, the method further includes: When the controller is powered on, an initial state of each of the first ports and an 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, determining an initial state of each of the first ports and an initial voltage value of each of the second ports includes: When the controller is powered on, for each of the first ports, a first state value of the first port is obtained multiple times, and an initial state of the first port is determined according to the multiple first state values; When the controller is powered on, for each second port, the first voltage value of the second port is obtained multiple times, and an initial voltage value of the second port is determined according to the multiple first voltage values.
5. The method according to claim 4, characterized in that The acquiring the first state value of the first port multiple times and determining the initial state of the first port according to the multiple first state values includes: Acquire the first state value of the first port multiple times according to a preset number of times, and if the preset number of first state values is a state value corresponding to the open state, determine that the initial state is the open state; wherein the preset number is greater than half of the preset number of times; If the preset number of first state values are state values corresponding to the closed state, determining that the initial state is the closed state; The acquiring the first voltage value of the second port multiple times and determining the initial voltage value of the second port according to 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 middle value of the multiple first voltage values is used as the initial voltage value of the second port.
6. The method according to claim 1, characterized in that After the controller is powered on, for each of the first ports, in a current first determination cycle, current state data of the first port is determined according to a current state value of the first port and previous state data, and an actual state of the first port is determined according to the current state data, including: After the controller is powered on, for each of the first ports, in a current first determination cycle, obtaining a current state value of the first port; Sort the current state value and multiple state values in the previous state data according to corresponding acquisition time, and remove the state value with the earliest corresponding acquisition time to obtain the current state data of the first port; If all the status values in the current status data are status values corresponding to the closed state, the actual state of the first port is the closed state; If all the status values in the current status data are status values corresponding to the open state, the actual state of the first port is the open state.
7. The method according to claim 1, characterized in that After the controller is powered on, for each of the second ports, in a current second determination cycle, current voltage data of the second port is determined according to a current voltage value of the second port and previous voltage data, and an actual voltage value is determined according to the current voltage data, including: After the controller is powered on, for each of the second ports, in a current second determination cycle, obtaining a current voltage value of the second port; Sort the current voltage value and multiple voltage values in the previous voltage data according to corresponding acquisition time, and remove the voltage value with the earliest corresponding acquisition time, to obtain the current voltage data corresponding to the second port; An average value of all voltage values in the current voltage data is used as the actual voltage value of the second port.
8. The method according to any one of claims 1 to 7, characterized in that After receiving a first mapping parameter corresponding to a first device, controlling a device corresponding to the first device according to an actual state of a first port corresponding to the first mapping parameter includes: After receiving a first mapping parameter corresponding to a first device, controlling a device corresponding to the first device according to an actual state and level attribute of a first port corresponding to the first mapping parameter; After receiving a second mapping parameter corresponding to a second device, controlling a device corresponding to the second device according to an actual voltage value of a second port corresponding to the second mapping parameter includes: 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 the electrical signal property of the second port corresponding to the second mapping parameter.
9. The method according to claim 2, characterized in that: After receiving the first mapping parameter corresponding to the first device, the method further includes: Outputting a first device, a first port, a type of the controller, and a vehicle type corresponding to the controller corresponding to the first mapping parameter; After receiving the second mapping parameter corresponding to the second device, the method further includes: Outputting a second device, a second port, a type of the controller, and a vehicle type corresponding to the controller corresponding to the second mapping parameter; After receiving the third mapping parameter corresponding to the third device, the method further includes: The third device, the third port, the type of the controller, and the vehicle type corresponding to the controller corresponding to the third mapping parameter are output.
10. The method according to claim 2, characterized in that The controller includes a storage module, and the storage module 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: updating, according to a first mapping parameter corresponding to the first device, first data corresponding to the first mapping parameter in the first storage unit; After receiving the second mapping parameter corresponding to the second device, the method further includes: updating, according to a second mapping parameter corresponding to the second device, second data corresponding to the second mapping parameter in the first storage unit; After receiving the third mapping parameter corresponding to the third device, the method further includes: updating, according to a third mapping parameter corresponding to the third device, third data corresponding to the third mapping parameter in the first storage unit; The method further comprises: After receiving the recovery instruction, 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.
11. 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-9.
Citation Information
Patent Citations
Vehicle control method, device and system
CN116330995A
Tractor power system and heavy truck with same
CN210553939U
Battery pack locking state detection circuit and vehicle
CN222554769U
Smart vehicle control unit applying to method for controlling vehicle using common platform using to development of green environment vehicle
KR1020180044786A
Methods and systems for data collection, learning, and streaming of machine signals for analytics and maintenance using the industrial internet of things
US20190339688A1