Vehicle power supply control methods, devices, equipment and storage media
By introducing a first state machine and a second state machine into the vehicle power management system, the monitoring of the voltage status of vehicle components and the decoupling of power control are realized, solving the problem of insufficient power control flexibility in the prior art and improving the adaptability and flexibility of power management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AVATR CO LTD
- Filing Date
- 2023-08-02
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies for vehicle power control have low flexibility, require the writing of complex and lengthy power control programs, and necessitate frequent modifications when control operations change.
Power control is achieved by using two state machines (a first state machine and a second state machine). The first state machine monitors the voltage status of the components, and the second state machine executes power control operations based on the status of the first state machine, thus decoupling the status monitoring and control operations.
This improves the flexibility of the state machine in power control, enabling it to adapt to various voltage status monitoring and control operations of multiple components, thus enhancing the flexibility of power management.
Smart Images

Figure CN116729128B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of vehicle power management, specifically relating to vehicle power control methods, devices, equipment, and storage media. Background Technology
[0002] Vehicles typically have a power supply that can be controlled as needed. For example, when the system voltage is below a threshold, the power supply can be put into a sleep state.
[0003] In related technologies, vehicles are equipped with voltage acquisition devices and power control programs. The voltage acquisition device can collect the component voltages of vehicle components, and the power control program processes these voltages to determine the control operations that need to be performed on the power supply. The power control program then executes these control operations. However, when complex control operations are required, complex and lengthy power control programs need to be written, and these programs need to be modified when the control operations change.
[0004] As can be seen from the above, the flexibility of power supply control is relatively low in related technologies. Summary of the Invention
[0005] This application relates to a method, apparatus, device, and storage medium for controlling vehicle power supply, which addresses the shortcomings of the state machine in power supply control in related technologies, which has low flexibility.
[0006] In a first aspect, embodiments of this application provide a vehicle power supply control method, applied to a vehicle power management system, the power management system including a first state machine and a second state machine corresponding to vehicle components, the method comprising:
[0007] The component voltage of the vehicle component is obtained through the first state machine;
[0008] The state of the first state machine is updated according to the component voltage and the first configuration file corresponding to the first state machine. The state of the first state machine is used to indicate the voltage state of the vehicle component.
[0009] Based on the state of the first state machine and the second configuration file corresponding to the second state machine, update the state of the second state machine and execute the corresponding power control operation.
[0010] In one possible implementation, updating the state of the first state machine based on the component voltage and the first configuration file corresponding to the first state machine includes:
[0011] Based on the first configuration file, determine the first voltage range corresponding to the current voltage state of the first state machine;
[0012] If the voltage of the component is not within the first voltage range, then the state of the first state machine is updated according to the first configuration file.
[0013] In one possible implementation, the first configuration file includes multiple voltage thresholds and descriptive information corresponding to each voltage threshold.
[0014] The step of determining the first voltage range corresponding to the current voltage state of the first state machine according to the first configuration file includes:
[0015] Based on the multiple voltage thresholds and the description information corresponding to each voltage threshold, state information is determined, wherein the state information includes multiple states and the voltage range corresponding to each state;
[0016] The first voltage range is determined based on the current voltage state and the state information.
[0017] In one possible implementation, the first configuration file includes the duration of multiple state transition information; updating the state of the first state machine according to the first configuration file includes:
[0018] Determine the target duration during which the component voltage is not within the first voltage range;
[0019] Based on the component voltage and the current voltage state, target state switching information is determined, wherein the target state switching information includes the target state;
[0020] Obtain the duration corresponding to the target state switching information from the first configuration file;
[0021] If the duration of the target is greater than or equal to the duration corresponding to the target state switching information, then the state of the first state machine is updated to the target state.
[0022] In one possible implementation, the second configuration file includes the correspondence between the states of the first state machine and the states of the second state machine;
[0023] The step of updating the state of the second state machine and executing corresponding power control operations based on the state of the first state machine and the second configuration file corresponding to the second state machine includes:
[0024] Based on the state of the first state machine and the corresponding relationship, determine the target state of the second state machine;
[0025] Obtain the current state of the second state machine;
[0026] Update the state of the second state machine based on the target state and the current state;
[0027] Based on the target state and the second configuration file, perform power control operations.
[0028] In one possible implementation, updating the state of the second state machine based on the target state and the current state includes:
[0029] If the target state is different from the current state, then the state of the second state machine is updated to the target state;
[0030] If the target state is the same as the current state, then the state of the second state machine remains unchanged.
[0031] In one possible implementation, the second configuration file includes control information, which includes multiple states and control instructions corresponding to each state;
[0032] The step of performing power control operations based on the target state and the second configuration file includes:
[0033] Based on the target state and the control information, determine the target control command;
[0034] The target control command is executed to perform the power control operation.
[0035] Secondly, embodiments of this application provide a vehicle power supply control device, applied to a vehicle power management system, the power management system including a first state machine and a second state machine corresponding to vehicle components, the device comprising:
[0036] The acquisition module is used to acquire the component voltage of the vehicle component through the first state machine;
[0037] The first state module is used to update the state of the first state machine according to the voltage of the component and the first configuration file corresponding to the first state machine. The state of the first state machine is used to indicate the voltage state of the vehicle component.
[0038] The second state module is used to update the state of the second state machine and perform corresponding power control operations based on the state of the first state machine and the second configuration file corresponding to the second state machine.
[0039] In one possible implementation, the first state module is specifically used for:
[0040] Based on the first configuration file, determine the first voltage range corresponding to the current voltage state of the first state machine;
[0041] If the voltage of the component is not within the first voltage range, then the state of the first state machine is updated according to the first configuration file.
[0042] In one possible implementation, the first configuration file includes multiple voltage thresholds and descriptive information corresponding to each voltage threshold; the first state module is specifically used for:
[0043] Based on the multiple voltage thresholds and the description information corresponding to each voltage threshold, state information is determined, wherein the state information includes multiple states and the voltage range corresponding to each state;
[0044] The first voltage range is determined based on the current voltage state and the state information.
[0045] In one possible implementation, the first configuration file includes the duration corresponding to multiple state transition information; the first state module is specifically used for:
[0046] Determine the target duration during which the component voltage is not within the first voltage range;
[0047] Based on the component voltage and the current voltage state, target state switching information is determined, wherein the target state switching information includes the target state;
[0048] Obtain the duration corresponding to the target state switching information from the first configuration file;
[0049] If the duration of the target is greater than or equal to the duration corresponding to the target state switching information, then the state of the first state machine is updated to the target state.
[0050] In one possible implementation, the second configuration file includes a correspondence between the states of the first state machine and the states of the second state machine; the second state module is specifically used for:
[0051] Based on the state of the first state machine and the corresponding relationship, determine the target state of the second state machine;
[0052] Obtain the current state of the second state machine;
[0053] Update the state of the second state machine based on the target state and the current state;
[0054] Based on the target state and the second configuration file, perform power control operations.
[0055] In one possible implementation, the second state module is specifically used for:
[0056] If the target state is different from the current state, then the state of the second state machine is updated to the target state;
[0057] If the target state is the same as the current state, then the state of the second state machine remains unchanged.
[0058] In one possible implementation, the second configuration file includes control information, which includes multiple states and control instructions corresponding to each state; the second state module is specifically used for:
[0059] Based on the target state and the control information, determine the target control command;
[0060] The target control command is executed to perform the power control operation.
[0061] Thirdly, embodiments of this application provide a control device for a vehicle power supply, including: a memory and a processor;
[0062] The memory stores computer-executed instructions;
[0063] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.
[0064] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in any one of the first aspects.
[0065] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any one of the first aspects.
[0066] This application provides a method, apparatus, device, and storage medium for controlling vehicle power supply, applied to a vehicle power management system. The power management system includes a first state machine and a second state machine corresponding to vehicle components. The first state machine acquires the component voltages of the vehicle components. Based on the component voltages and a first configuration file corresponding to the first state machine, the state of the first state machine is updated. Based on the state of the first state machine and a second configuration file corresponding to the second state machine, the state of the second state machine is updated, and corresponding power control operations are executed. In this way, the state monitoring and power control operations are decoupled through the first and second state machines, enabling monitoring of various voltage states of different components and corresponding power control operations for different voltage states of different components. Furthermore, it can adapt to multiple components, improving the flexibility of the state machine in power control. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0069] Figure 2 A flowchart illustrating a vehicle power supply control method provided in an embodiment of this application;
[0070] Figure 3 A flowchart illustrating another vehicle power supply control method provided in an embodiment of this application;
[0071] Figure 4 A schematic diagram of the state update process of a state machine provided in an embodiment of this application;
[0072] Figure 5 A flowchart illustrating the state update process of a state machine provided in an embodiment of this application;
[0073] Figure 6 A flowchart illustrating another vehicle power supply control method provided in this application embodiment;
[0074] Figure 7 A flowchart illustrating another state machine state update process provided in an embodiment of this application;
[0075] Figure 8 This is a schematic diagram of the structure of a vehicle power supply control device provided in an embodiment of this application;
[0076] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0077] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0078] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0079] It should be noted that although the terms "first," "second," etc., are used to describe various types of information in the embodiments of this application, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. Optionally, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information.
[0080] It should be understood that the terms "comprising" or "including" indicate the presence of the previously mentioned features, steps, or operations, but do not preclude the presence, occurrence, or addition of one or more other features, steps, or operations. The terms "and / or," etc., used in this application can be interpreted as inclusive, or mean any one or any combination thereof. Optionally, "A and / or B" means "any one of the following: A; B; A and B." Additionally, the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0081] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. Please refer to [link / reference]. Figure 1 , Figure 1 It includes vehicle 100, and vehicle 100 includes power management system 101.
[0082] In related technologies, the power management system 101 includes a voltage acquisition component and a power control program. The voltage acquisition component acquires the component voltage of the vehicle components and processes the component voltage through the power control program to determine the control operation that needs to be performed on the power supply. The power control program then executes the control operation on the power supply. However, when complex control operations on the power supply are required, complex and lengthy power control programs need to be written, and the power control program needs to be modified when the control operations on the power supply change.
[0083] As can be seen from the above, the flexibility of power supply control is relatively low in related technologies.
[0084] To solve this technical problem, two state machines can be set in the power management system 101 (such as...). Figure 1 The first state machine 102 and the second state machine 103 are shown in the figure. The state machine can be composed of a state register and combinational logic circuits.
[0085] This application provides a method for controlling a vehicle power supply. A first configuration file is configured for a first state machine 102, and a second configuration file is configured for a second state machine 103. The first state machine 102 can determine the voltage state of different components based on the first configuration file, enabling monitoring of various voltage states of different components. The second state machine 103 can perform power control operations corresponding to various voltage states of different components based on the state of the first state machine 102 and the second configuration file. By decoupling state monitoring from power control operations through the first state machine 102 and the second state machine 103, adaptation to multiple components is achieved, improving the flexibility of the state machine in power control.
[0086] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for the same or similar content, the description will not be repeated in different embodiments.
[0087] Figure 2 This is a flowchart illustrating a vehicle power supply control method provided in an embodiment of this application. This embodiment applies to a vehicle power management system, which includes a first state machine and a second state machine corresponding to vehicle components. The state machine can be implemented through a combination of software and hardware. See also... Figure 2 The method includes:
[0088] S201. Obtain the component voltage of the vehicle component through the first state machine.
[0089] The vehicle component can be either the vehicle system bus or the Controller Area Network (CAN) bus; there is no limitation on this. The component voltage can be the bus voltage value of the vehicle component, such as the bus voltage value of the system voltage, the bus voltage value of the CAN bus, etc.; there is no limitation on this.
[0090] Optionally, the first state machine can acquire the component voltage of the vehicle components according to a preset cycle.
[0091] For example, the preset period can be 10 milliseconds or 100 milliseconds, and there is no limitation here.
[0092] S202. Update the state of the first state machine according to the component voltage and the first configuration file corresponding to the first state machine.
[0093] The first configuration file can be a pre-configured configuration file based on actual needs. The first configuration file includes multiple component objects and corresponding detection parameters for each component object. For any one of the component objects, the detection parameters include multiple voltage thresholds and descriptive information for each voltage threshold. For example, the content of the first configuration file can be as shown in Table 1 and stored in the power management system in the form of code.
[0094] Table 1
[0095]
[0096] The state of the first state machine can be used to indicate the voltage state of vehicle components. The state of the first state machine can be one of the following: normal state, low voltage state, high voltage state, or one of the following: normal state, low voltage state, high voltage state, overvoltage state, undervoltage state. No limitation is made here.
[0097] Specifically, the corresponding detection parameters can be determined from the first configuration file based on the vehicle component, and the state of the first state machine can be updated based on the component voltage and the detection parameters, so that the first state machine can determine the corresponding detection parameters from the first configuration file based on different vehicle components, and update the state of the first state machine based on the component voltage and the corresponding detection parameters.
[0098] Optionally, the state of the first state machine can be updated in the following feasible manner: determine the first voltage range corresponding to the current voltage state of the first state machine according to the first configuration file; if the component voltage is not in the first voltage range, update the state of the first state machine according to the first configuration file.
[0099] Since the first voltage range is the voltage range corresponding to the current voltage state, if the component voltage is within the first voltage range, it means that the state of the first state machine does not need to be updated; if the component voltage is not within the first voltage range, it means that the state of the first state machine needs to be updated.
[0100] For example, the current voltage state can be the normal state, and the first voltage range can be the voltage range corresponding to the normal state (e.g., greater than 8.5V and less than 18V).
[0101] S203. Based on the state of the first state machine and the second configuration file corresponding to the second state machine, update the state of the second state machine and execute the corresponding power control operation.
[0102] The second configuration file can be a configuration file that is pre-configured according to actual needs. The second configuration file includes the states of multiple second state machines and the power control operations corresponding to the states of multiple second state machines.
[0103] The state of the second state machine can be one of the following: normal state, low voltage state, high voltage state, or one of the following: normal state, low voltage state, high voltage state, overvoltage state, undervoltage state. No limitation is made here.
[0104] Optionally, the state of the second state machine can be updated and power control operations can be performed in the following feasible manner: determine the target state of the second state machine based on the state and correspondence of the first state machine; obtain the current state of the second state machine; update the state of the second state machine based on the target state and the current state; and perform power control operations on the second state machine based on the target state and the second configuration file.
[0105] The correspondence can be between the state of the first state machine and the target state of the second state machine. For example, assuming the state of the first state machine is low voltage, the target state of the corresponding second state machine is determined to be low voltage based on the correspondence.
[0106] The vehicle power control method provided in this embodiment is applied to a vehicle power management system. The power management system includes a first state machine and a second state machine corresponding to vehicle components. The first state machine acquires the component voltages of the vehicle components. Based on the component voltages and a first configuration file corresponding to the first state machine, the state of the first state machine is updated. Based on the state of the first state machine and a second configuration file corresponding to the second state machine, the state of the second state machine is updated, and corresponding power control operations are executed. In this way, by decoupling state monitoring and power control operations through the first and second state machines, it achieves monitoring of various voltage states of different components and corresponding power control operations for various voltage states of different components. Furthermore, it can adapt to multiple components, improving the flexibility of the state machine in power control.
[0107] Below, in conjunction with Figure 3 The illustrated embodiment provides a further detailed description of the state update process (S202) of the first state machine.
[0108] Figure 3 This is a flowchart illustrating another vehicle power supply control method provided in an embodiment of this application. This embodiment can be applied to a first state machine. See also... Figure 3 The method includes:
[0109] S301. Determine the status information based on multiple voltage thresholds and the description information corresponding to each voltage threshold.
[0110] The status information can include multiple states and the voltage range corresponding to each state. For example, the status information can be as shown in Table 2.
[0111] Table 2
[0112] state voltage range Normal state <![CDATA[8.5V≤V 部件 ≤18V]]> low pressure state <![CDATA[V 部件 <8.5V]]> High pressure state <![CDATA[V 部件 >18V]]>
[0113] S302. Determine the first voltage range based on the current voltage state and state information.
[0114] The current voltage state can be the current state of the first state machine. For example, it can be one of the following: normal state, low voltage state, or high voltage state.
[0115] If the component is being powered on for the first time, the current voltage state can be initialized to the normal state or to other states; no restrictions are imposed here.
[0116] For example, if the current voltage state is normal, based on the state information, the first voltage range is determined to be 8.5V ≤ V. 部件 ≤18V.
[0117] S303. Determine whether the component voltage is within the first voltage range.
[0118] If so, then execute S304.
[0119] If not, then execute S305.
[0120] For example, assume the first voltage range is 8.5V ≤ V 部件 ≤18V, determine if the component voltage is within 8.5V≤V 部件 ≤18V.
[0121] Below, in conjunction with Figure 4 The state update process of the first state machine will be explained.
[0122] Figure 4 This is a schematic diagram illustrating the state update process of a state machine as provided in an embodiment of this application. See also... Figure 4 The first state machine includes at least a normal state, a high-voltage state, and a low-voltage state. Each state includes a transition state, which includes entering and exiting the state. The transitions between states can include the following seven cases:
[0123] Case 1: The first state machine remains in the normal state.
[0124] Case 2: The first state machine switches from the normal state to the low-voltage state.
[0125] Case 3: The first state machine switches from the normal state to the high-voltage state.
[0126] Case 4: The first state machine remains in a low-voltage state.
[0127] Case 5: The first state machine switches from the low-voltage state to the normal state.
[0128] Case 6: The first state machine remains in a high-voltage state.
[0129] Case 7: The first state machine switches from the high-voltage state to the normal state.
[0130] S304, keep the state of the first state machine unchanged.
[0131] For example, Figure 4 The cases are shown in cases 1, 4, and 6.
[0132] S305. Determine the duration for which the component voltage is not in the first voltage range.
[0133] The target duration can represent the duration for which the voltage of the component is maintained near a certain voltage value, where the voltage value and its surrounding values are not within the first voltage range.
[0134] By determining the duration of the target voltage fluctuation, the influence of the component's voltage jitter on the first state machine's state can be eliminated. The jitter value can be a sudden increase or decrease in voltage within a short period. The first state machine's state will not change due to variations in this jitter value, ensuring the stability of the first state machine.
[0135] S306. Determine the target state switching information based on the component voltage and the current voltage status.
[0136] The target state transition information may include the target state. The target state transition information can be determined from multiple state transition information. For example, multiple state transition information may be as shown in Table 3.
[0137] Table 3
[0138] Component voltage Current voltage state State transition information <![CDATA[V 部件 ≥18V]]> Normal state Switching from normal state to high voltage state <![CDATA[V 部件 ≤8.5V]]> Normal state Switching from normal state to low pressure state <![CDATA[V 部件 ≥9V]]> low pressure state Switching from low pressure to normal pressure <![CDATA[V 部件 ≤16.5V]]> High pressure state Switching from high-voltage state to normal state
[0139] The high-pressure state and the low-pressure state cannot be directly switched.
[0140] S307. Obtain the duration corresponding to the target state switching information from the first configuration file.
[0141] The first configuration file includes a mapping between multiple state transition information and their duration. For example, this mapping can be shown in Table 4.
[0142] Table 4
[0143] State transition information Duration Switching from normal state to high voltage state 25 preset cycles Switching from normal state to low pressure state 25 preset cycles Switching from low-pressure state to normal state 20 preset cycles Switching from high-voltage state to normal state 20 preset cycles
[0144] Based on the correspondence between multiple state transition information and their duration, and the target state transition information, determine the duration corresponding to the target state transition information.
[0145] S308. Determine whether the duration of the target is greater than or equal to the duration corresponding to the target state switching information.
[0146] If so, execute S309.
[0147] If not, execute S304.
[0148] For example, suppose the target state switching information is switching from a high-pressure state to a normal state, and the corresponding duration is 20 preset cycles. Determine whether the target duration is greater than or equal to 20 preset cycles.
[0149] S309. Update the state of the first state machine to the target state.
[0150] Specifically, the state of the first state machine can be updated to the target state in the following ways:
[0151] Method 1: If the current voltage state is normal and the target state is low voltage, then update the state of the first state machine from normal to low voltage. (See also...) Figure 4 As shown in case 2.
[0152] Method 2: If the current voltage state is normal and the target state is high voltage, then update the state of the first state machine from normal to high voltage. (See also...) Figure 4 As shown in case 3.
[0153] Method 3: If the current voltage state is low voltage and the target state is normal, then update the state of the first state machine from low voltage to normal. (See also...) Figure 4 As shown in case 5.
[0154] Method 4: If the current voltage state is high voltage and the target state is normal, then update the state of the first state machine from high voltage to normal. (See also...) Figure 4 As shown in case 7.
[0155] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.
[0156] The vehicle power supply control method provided in this embodiment determines state information based on multiple voltage thresholds and corresponding descriptive information. The state information includes multiple states and voltage ranges corresponding to each state. Based on the current voltage state and the state information, a first voltage range is determined. If a component voltage is not within the first voltage range, a target duration for the component voltage not being within the voltage range is determined. Based on the component voltage and the current voltage state, target state switching information is determined. The duration corresponding to the target state switching information is obtained from a first configuration file. If the target duration is greater than or equal to the duration corresponding to the target state switching information, the state of the first state machine is updated to the target state. Thus, through the first state machine and the first configuration file, monitoring of various voltage states is achieved, and adaptation to multiple components is possible, improving the flexibility of the state machine in power supply control.
[0157] Below, based on any of the above embodiments, combined with Figure 5 The state update process of the first state machine (S202) will be illustrated with an example.
[0158] Figure 5 A flowchart illustrating the state update process of a state machine provided in this application embodiment can be found here. Figure 5 Assume the current state of the first state machine is the normal state.
[0159] Determine if the component is being powered on for the first time. If yes, initialize the current state to the normal state; otherwise, obtain the current state of the first state machine, which is the normal state. Obtain the voltage of the first component. Determine if the voltage of the first component is within the voltage range corresponding to the normal state. If yes, maintain the normal state; otherwise, determine if the voltage of the first component is within the voltage range corresponding to the low-voltage state.
[0160] If the voltage of the first component is in the voltage range corresponding to the low voltage state, determine whether the duration of the low voltage range is greater than or equal to the preset duration. If not, maintain the normal state.
[0161] If yes, switch to low voltage mode. Obtain the voltage of the second component. The voltage of the second component is one or more voltages following the voltage of the first component. Determine whether the voltage of the second component is within the voltage range corresponding to the low voltage mode. If yes, maintain the low voltage mode. If no, determine whether the duration of the voltage range corresponding to the normal mode is greater than or equal to a preset duration. If yes, switch to the normal mode. If no, maintain the low voltage mode.
[0162] If the voltage of the first component is not in the voltage range corresponding to the low voltage state, determine whether the duration of the voltage range corresponding to the high voltage state is greater than or equal to the preset duration. If not, the normal state will remain unchanged.
[0163] If yes, switch to high voltage mode. Obtain the voltage of the second component. Determine if the voltage of the second component is within the voltage range corresponding to the high voltage mode. If yes, maintain the high voltage mode. If no, determine if the duration of the voltage range corresponding to the normal mode is greater than or equal to the preset duration. If yes, switch to the normal mode. If no, maintain the high voltage mode.
[0164] We can continue to acquire component voltages and determine the state of the first state machine based on those voltages, which will not be elaborated further here.
[0165] Below, in conjunction with Figure 6 The illustrated embodiment provides a more detailed description of the state update process of the second state machine and the process of controlling the power supply (S203).
[0166] Figure 6 This is a flowchart illustrating another vehicle power supply control method provided in an embodiment of this application. This embodiment can be applied to a second state machine. See also... Figure 5 The method includes:
[0167] S601. Determine the target state of the second state machine based on the state and correspondence of the first state machine.
[0168] The correspondence can be between the state of the first state machine and the target state of the second state machine. For example, this correspondence can be shown in Table 5.
[0169] Table 5
[0170] The state of the first state machine The target state of the second state machine Normal state Normal state low pressure state low pressure state High pressure state High pressure state
[0171] For example, the target state of the second state machine can also be an energy-saving state or an alarm state. In the energy-saving state, the microcontroller unit (MCU) can be put into sleep mode. In the alarm state, preset external devices can be shut down and an alarm signal can be issued.
[0172] S602. Obtain the current state of the second state machine.
[0173] The current state can be one of the following: normal state, low pressure state, high pressure state, or one of the following: normal state, energy saving state, and warning state. No specific restrictions are imposed here.
[0174] S603. Update the state of the second state machine based on the target state and the current state.
[0175] If the target state is different from the current state, the second state machine updates its state to the target state; if the target state is the same as the current state, the second state machine keeps its state unchanged.
[0176] S604. Perform power control operations according to the target status and the second configuration file.
[0177] The second configuration file includes control information, which includes multiple states and the corresponding control commands for each state. For example, the contents of the second configuration file can be as shown in Table 6, and stored in the power management system in the form of code.
[0178] Table 6
[0179] The state of the second state machine Control commands Normal state Execute preset functions High pressure state Send an alarm signal and shut down external devices. low pressure state Send a sleep signal to enter sleep mode.
[0180] Optionally, power control operations can be performed based on the target state and the second configuration file in the following feasible ways:
[0181] Based on the target status and control information, determine the target control command; execute the target control command to perform power control operations.
[0182] For example, if the target state is a low-voltage state, the target control instruction is determined to be to send a sleep signal to enter the sleep state. Executing this target control instruction will cause the MCU to enter the sleep state.
[0183] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.
[0184] The vehicle power supply control method provided in this embodiment determines the target state of the second state machine based on the state and corresponding relationships of the first state machine, obtains the current state of the second state machine, updates the state of the second state machine based on the target state and the current state, and executes power control operations based on the target state and the second configuration file. In this way, through the second state machine and the second configuration file, power control operations corresponding to various voltage states of different components can be implemented, and it can be adapted to multiple components, improving the flexibility of the state machine in power control.
[0185] Below, based on any of the above embodiments, combined with Figure 7 The process of updating the state of the second state machine and controlling the power supply (S203) will be illustrated with examples.
[0186] Figure 7 A flowchart illustrating another state machine state update process provided in this application embodiment can be found here. Figure 7 Assume the current state of the second state machine is the normal state.
[0187] Determine if the component is being powered on for the first time. If yes, initialize the current state to the normal state. If not, obtain the current state of the second state machine, which is the normal state. Obtain the first target state, which is the target state corresponding to the state of the first state machine. Determine if the first target state is the same as the normal state. If yes, maintain the normal state and execute the corresponding power control operation. If not, determine if the first target state is the same as the low-voltage state.
[0188] If the first target state is the same as the low-voltage state, switch to the low-voltage state and execute the corresponding power control operation.
[0189] Obtain the second target state. Determine if the second target state is the same as the low-voltage state. If so, maintain the low-voltage state and perform the corresponding power control operation; otherwise, switch to the normal state and perform the corresponding power control operation.
[0190] If the first target state is different from the low-voltage state, switch to the high-voltage state and execute the corresponding power control operation.
[0191] Obtain the second target state. Determine if the second target state is the same as the high-voltage state. If so, maintain the high-voltage state and execute the corresponding power control operation; otherwise, switch to the normal state and execute the corresponding power control operation.
[0192] The target state can be acquired, and based on the target state, the state of the second state machine can be determined, and the corresponding power control operation can be executed. This will not be elaborated further here.
[0193] Figure 8 This is a schematic diagram of a vehicle power supply control device provided in an embodiment of this application. Please refer to... Figure 8 This device is applied to the vehicle's power management system, which includes a vehicle component acquisition module 801, a first state module 802, and a second state module 803.
[0194] The acquisition module 801 is used to acquire the component voltage of the vehicle component through the first state machine;
[0195] The first state module 802 is used to update the state of the first state machine according to the component voltage and the first configuration file corresponding to the first state machine. The state of the first state machine is used to indicate the voltage state of the vehicle component.
[0196] The second state module 803 is used to update the state of the second state machine and perform corresponding power control operations based on the state of the first state machine and the second configuration file corresponding to the second state machine.
[0197] In one possible implementation, the first state module 802 is specifically used for:
[0198] Based on the first configuration file, determine the first voltage range corresponding to the current voltage state of the first state machine;
[0199] If the voltage of the component is not within the first voltage range, then the state of the first state machine is updated according to the first configuration file.
[0200] In one possible implementation, the first configuration file includes multiple voltage thresholds and descriptive information corresponding to each voltage threshold; the first state module 802 is specifically used for:
[0201] Based on the multiple voltage thresholds and the description information corresponding to each voltage threshold, state information is determined, wherein the state information includes multiple states and the voltage range corresponding to each state;
[0202] The first voltage range is determined based on the current voltage state and the state information.
[0203] In one possible implementation, the first configuration file includes the duration corresponding to multiple state transition information; the first state module 802 is specifically used for:
[0204] Determine the target duration during which the component voltage is not within the first voltage range;
[0205] Based on the component voltage and the current voltage state, target state switching information is determined, wherein the target state switching information includes the target state;
[0206] Obtain the duration corresponding to the target state switching information from the first configuration file;
[0207] If the duration of the target is greater than or equal to the duration corresponding to the target state switching information, then the state of the first state machine is updated to the target state.
[0208] In one possible implementation, the second configuration file includes a correspondence between the states of the first state machine and the states of the second state machine; the second state module 803 is specifically used for:
[0209] Based on the state of the first state machine and the corresponding relationship, determine the target state of the second state machine;
[0210] Obtain the current state of the second state machine;
[0211] Update the state of the second state machine based on the target state and the current state;
[0212] Based on the target state and the second configuration file, perform power control operations.
[0213] In one possible implementation, the second state module 803 is specifically used for:
[0214] If the target state is different from the current state, then the state of the second state machine is updated to the target state;
[0215] If the target state is the same as the current state, then the state of the second state machine remains unchanged.
[0216] In one possible implementation, the second configuration file includes control information, which includes multiple states and control instructions corresponding to each state; the second state module 803 is specifically used for:
[0217] Based on the target state and the control information, determine the target control command;
[0218] The target control command is executed to perform the power control operation.
[0219] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to... Figure 9 The electronic device 900 may include: a memory 901, a processor 902, and a transceiver 903.
[0220] Memory 901 is used to store program instructions;
[0221] The processor 902 is used to execute the program instructions stored in the memory so that the electronic device 20 performs the above-described method.
[0222] Transceiver 903 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, transmitter port, or transmitter interface, and the receiver may also be referred to as a receiver port, receiver interface, or similar descriptions. Exemplarily, memory 901, processor 902, and transceiver 903 are interconnected via bus 904.
[0223] This application also provides a computer program product that can be executed by a processor, and when the computer program product is executed, the above-described method can be implemented.
[0224] The vehicle power supply control device, electronic device, computer-readable storage medium, and computer program product of the embodiments of this application can execute the technical solutions shown in the above-described vehicle power supply control method embodiments. Their implementation principles and beneficial effects are similar and will not be described again here.
[0225] All or part of the steps in the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-described method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.
[0226] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0227] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0228] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0229] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. A method for controlling a vehicle power supply, characterized in that, A power management system for vehicles includes a first state machine and a second state machine corresponding to vehicle components. The first state machine corresponds to a first configuration file, which is used to determine the voltage range corresponding to the current voltage state of the first state machine. The second state machine corresponds to a second configuration file, the second configuration file including the correspondence between the states of the first state machine and the states of the second state machine; the method includes: The component voltage of the vehicle component is obtained through the first state machine; The state of the first state machine is updated based on the component voltage and the first configuration file corresponding to the first state machine. The state of the first state machine is used to indicate the voltage state of the vehicle component. Based on the state of the first state machine and the corresponding relationship, determine the target state of the second state machine; Obtain the current state of the second state machine; Update the state of the second state machine based on the target state and the current state; Based on the target state and the second configuration file, perform the corresponding power control operation.
2. The method according to claim 1, characterized in that, The step of updating the state of the first state machine according to the component voltage and the first configuration file corresponding to the first state machine includes: Based on the first configuration file, determine the first voltage range corresponding to the current voltage state of the first state machine; If the voltage of the component is not within the first voltage range, then the state of the first state machine is updated according to the first configuration file.
3. The method according to claim 2, characterized in that, The first configuration file includes multiple voltage thresholds and descriptions of each voltage threshold. The step of determining the first voltage range corresponding to the current voltage state of the first state machine according to the first configuration file includes: Based on the multiple voltage thresholds and the description information corresponding to each voltage threshold, state information is determined, wherein the state information includes multiple states and the voltage range corresponding to each state; The first voltage range is determined based on the current voltage state and the state information.
4. The method according to claim 2 or 3, characterized in that, The first configuration file includes the duration of multiple state transition information; The step of updating the state of the first state machine according to the first configuration file includes: Determine the target duration during which the component voltage is not within the first voltage range; Based on the component voltage and the current voltage state, target state switching information is determined, wherein the target state switching information includes the target state; Obtain the duration corresponding to the target state switching information from the first configuration file; If the duration of the target is greater than or equal to the duration corresponding to the target state switching information, then the state of the first state machine is updated to the target state.
5. The method according to claim 1, characterized in that, The step of updating the state of the second state machine based on the target state and the current state includes: If the target state is different from the current state, then the state of the second state machine is updated to the target state; If the target state is the same as the current state, then the state of the second state machine remains unchanged.
6. The method according to claim 1 or 5, characterized in that, The second configuration file also includes control information, which includes multiple states and control instructions corresponding to each state; The step of performing corresponding power control operations based on the target state and the second configuration file includes: Based on the target state and the control information, determine the target control command; The target control command is executed to perform the power control operation.
7. A control device for a vehicle power supply, characterized in that, A power management system for vehicles includes a first state machine and a second state machine corresponding to vehicle components. The first state machine corresponds to a first configuration file, which is used to determine the voltage range corresponding to the current voltage state of the first state machine. The second state machine corresponds to a second configuration file, the second configuration file including the correspondence between the states of the first state machine and the states of the second state machine; the device includes: The acquisition module is used to acquire the component voltage of the vehicle component through the first state machine; The first state module is used to update the state of the first state machine according to the voltage of the component and the first configuration file corresponding to the first state machine. The state of the first state machine is used to indicate the voltage state of the vehicle component. The second state module is used to determine the target state of the second state machine based on the state of the first state machine and the correspondence. Obtain the current state of the second state machine; Update the state of the second state machine based on the target state and the current state; Based on the target state and the second configuration file, perform the corresponding power control operation.
8. A control device for a vehicle power supply, characterized in that, include: Memory, processor, and transceiver; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, is used to implement the method as described in any one of claims 1-6.