A vehicle control method and a vehicle

By acquiring vehicle status data, the state machine and coroutine interface are used to control the vehicle's sentry mode to switch to a working state that matches the current state, and only the necessary functional modules are activated. This solves the problem of high vehicle energy consumption in sentry mode and achieves efficient resource utilization and rapid response.

CN119749439BActive Publication Date: 2025-10-21GREAT WALL MOTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411968474.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-10-21
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

The current Sentinel mode has high vehicle energy consumption, mainly due to the continuous resource consumption caused by the long-term operation of the monitoring function module.

Method used

By acquiring vehicle status data, the state machine and coroutine interface are used to control the vehicle's sentry mode to switch to a working state that matches the current state, and only the necessary functional modules are enabled to asynchronously execute the target task.

Benefits of technology

It reduces unnecessary task execution, lowers vehicle energy consumption, improves resource utilization efficiency, and ensures that vehicles can quickly respond to safety monitoring needs when necessary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119749439B_ABST
    Figure CN119749439B_ABST
Patent Text Reader

Abstract

The application provides a vehicle control method and a vehicle, and the method is applied to the technical field of vehicles and comprises the following steps: acquiring state data of the vehicle, wherein the state data of the vehicle is used for representing a current state of the vehicle; determining a target working state of a sentry mode of the vehicle based on the state data of the vehicle, wherein the target working state is a working state matched with the current state of the vehicle; determining a target task corresponding to the target working state based on a state machine, wherein the target task is a task for enabling the sentry mode to be in the target working state, and different target tasks are used for instructing to start and / or stop different function modules of the sentry mode; and controlling the vehicle to execute the target task, so that the energy consumption of the vehicle can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and more particularly, to a vehicle control method and a vehicle in the field of vehicle technology. Background Art

[0002] As cars become increasingly common in households, their intelligence is also developing, and Sentry Mode plays a crucial role in this. Sentry Mode allows the vehicle to activate parking monitoring after the owner leaves the vehicle to monitor its safety. If the vehicle sustains damage (e.g., a collision or scratch), the system uses a camera module such as an external panoramic camera or a dashcam to record the damage, notifying the owner of the incident and documenting the incident.

[0003] However, currently, Sentry Mode usually adopts a long-term background service mode to monitor the safety of the vehicle. In other words, after the owner leaves the vehicle, the vehicle will continue to turn on all the functional modules of Sentry Mode to monitor the safety of the vehicle, resulting in higher energy consumption of the vehicle.

[0004] Therefore, how to reduce the energy consumption of vehicles is an urgent problem that needs to be solved. Summary of the Invention

[0005] The present application provides a vehicle control method and a vehicle, which can reduce the energy consumption of the vehicle.

[0006] In a first aspect, a vehicle control method is provided, the method comprising: acquiring status data of the vehicle, the status data of the vehicle being used to represent the current status of the vehicle; determining a target operating state of a sentry mode of the vehicle based on the status data of the vehicle, the target operating state being an operating state that matches the current status of the vehicle; determining a target task corresponding to the target operating state based on a state machine, the target task being a task that puts the sentry mode in the target operating state, and different target tasks being used to indicate turning on and / or off different functional modules of the sentry mode; and controlling the vehicle to perform the target task.

[0007] In the above technical solution, the target working state of the vehicle's sentry mode can be determined by acquiring the vehicle's status data, and the target task corresponding to the target working state can be determined based on the state machine. Since the state machine can quickly respond to the switching of the sentry mode's working state and quickly determine the task that the vehicle currently needs to perform (i.e., the target task) based on the target working state of the sentry mode, the vehicle's waiting time can be reduced, that is, the vehicle can quickly execute the target task, avoiding unnecessary tasks being continuously executed by the vehicle, reducing unnecessary resource consumption, and thus reducing the vehicle's energy consumption; in addition, since different target tasks are used to indicate the opening and / or closing of different sentry mode functional modules, in each target working state of the sentry mode, the vehicle only needs to turn on some functional modules of the sentry mode indicated by the target task, without turning on other functional modules of the sentry mode, thereby further reducing the vehicle's energy consumption.

[0008] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the vehicle's status data includes the vehicle's power status and the switch status of the vehicle's sentry mode; the target operating state includes at least one of an on state and an off state; based on the vehicle's status data, determining the target operating state of the vehicle's sentry mode includes: when the vehicle's power is in a powered-on state or the vehicle's sentry mode switch is in a turned-off state, determining the turned-off state as the target operating state of the sentry mode; or, when the vehicle's power is in a powered-off state and the vehicle's sentry mode switch is in a turned-off state, determining the turned-off state as the target operating state of the sentry mode; when the vehicle's power is in a powered-off state and the vehicle's sentry mode switch is in a turned-off state, determining the turned-on state as the target operating state of the sentry mode.

[0009] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the vehicle's status data also includes whether the vehicle triggers an arming signal; the on state includes at least one of a first pre-on state, a second pre-on state, an on-low power state, and an on-monitoring state; when the vehicle's power supply is in a power-off state and the vehicle's sentry mode switch is in an on state, the on state is determined as the target working state of the sentry mode, including: when the vehicle's power supply is in a power-off state, the vehicle triggers an arming signal, and the vehicle's sentry mode switch is in an on state, the first pre-on state, the second pre-on state, and the on-monitoring state are determined as the target working states of the sentry mode in sequence; when the vehicle's power supply is in a power-off state, the vehicle does not trigger an arming signal, and the vehicle's sentry mode switch is in an on state, the on-low power state is determined as the target working state of the sentry mode.

[0010] In the above technical solution, the vehicle status data also includes whether the vehicle has triggered an arming signal. The on state may include at least one of a first pre-on state, a second pre-on state, an on-low power state, and an on-monitoring state. When the vehicle is in the on state and the arming signal is triggered, the first pre-on state, the second pre-on state, and the on-monitoring state may be sequentially determined as the target operating state of the sentry mode. In this way, when the vehicle is in the on state of the sentry mode and the arming signal is triggered, the target tasks corresponding to the first pre-on state, the second pre-on state, and the on-monitoring state may be sequentially executed. That is, if the target task corresponding to the first pre-on state is not completed, the target tasks corresponding to the second pre-on state and the on-monitoring state will not be executed. This allows the vehicle to quickly respond to the switching of the sentry mode operating state and reduce delays. In addition, when the vehicle is in the on state and the arming signal is not triggered, it indicates that the user may be in the vehicle at this time, that is, the user is still using the vehicle. Therefore, in this case, the on-low power state may be determined as the target operating state of the sentry mode, thereby reducing the vehicle's energy consumption.

[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the state machine predefines the mapping relationship between different target working states of the sentinel mode and the target tasks; determining the target task corresponding to the target working state based on the state machine includes: determining the target task corresponding to the target working state based on the mapping relationship and the target working state predefined in the state machine.

[0012] In the above technical solution, the mapping relationship between different target working states of the sentry mode and the target tasks can be predefined in the state machine, so that after determining the target working state of the sentry mode of the vehicle, the target task corresponding to the target working state can be determined based on the state machine, thereby ensuring the accuracy of the determined target task and avoiding unnecessary resource consumption.

[0013] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, when the target working state of the sentinel mode is the off state, the target task corresponding to the target working state includes turning off the monitoring module and video recording module of the sentinel mode; when the target working state is the first pre-on state, the target task corresponding to the first pre-on state includes turning on the delay detection module of the sentinel mode, and the delay detection module is used to perform delay detection on the power stability of the vehicle; when the target working state is the second pre-on state, the target task corresponding to the second pre-on state includes turning off the delay detection module, and turning on the monitoring module and video recording module for initializing the sentinel mode; when the target working state is the on-monitoring state, the target task corresponding to the on-monitoring state includes turning off the monitoring module and video recording module for initializing the sentinel mode, and turning on the monitoring module and video recording module of the sentinel mode; when the target working state is the on-low power consumption state, the target task corresponding to the on-low power consumption state includes turning off the monitoring module and video recording module of the sentinel mode, and turning on the arming detection module of the sentinel mode, and the arming detection module is used to detect whether the vehicle triggers the arming signal.

[0014] In the above technical solution, the target tasks corresponding to different target working states include turning on different sentry mode submodules and turning off different sentry mode submodules. For example, when the sentry mode is in the second pre-turn-on state, the target tasks corresponding to the second pre-turn-on state include turning off the delay detection module and turning on the monitoring module and video recording module for initializing the sentry mode; when the sentry mode is in the monitoring state, the target tasks corresponding to the monitoring state include turning off the delay detection module and turning on the monitoring module and video recording module for initializing the sentry mode, etc. It should be noted that when the sentry mode is in the low-power-on state, the target tasks corresponding to the low-power-on state may include turning off the monitoring module and video recording module of the sentry mode and turning on the arming detection module of the sentry mode, so that when the arming detection module detects that the vehicle triggers the arming signal, the monitoring state is determined to be the target working state of the sentry mode to ensure the safety of the vehicle.

[0015] In combination with the first aspect and the above-mentioned implementation manner, in some possible implementation manners, controlling the vehicle to perform the target task includes: asynchronously controlling the vehicle to perform the target task based on a state machine and a corresponding coroutine interface.

[0016] In the above technical solution, the vehicle can be asynchronously controlled to execute the target task based on the state machine and the corresponding coroutine interface. Since the coroutine interface enables the vehicle to execute the target task asynchronously, it can avoid long-running tasks (for example, turning off the delay detection module, turning on the monitoring module and video recording module that initialize the sentinel mode) blocking the main thread or other tasks; in addition, the coroutine interface can also avoid interference between multiple tasks when the vehicle executes each task in the target task, so that the vehicle can quickly respond to the switching of the sentinel mode working state.

[0017] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the state machine and the corresponding coroutine interface asynchronously control the vehicle to perform the target task, including: the state machine sends a task instruction to the coroutine interface to switch the working state of the sentinel mode to the target working state, and the task instruction includes the target task corresponding to the target working state; when the coroutine interface receives the task instruction, the coroutine interface asynchronously controls the vehicle to perform the target task, generates a response instruction, and sends the response instruction to the state machine, and the response instruction is used to indicate that the working state of the sentinel mode has been switched to the target working state; when the state machine receives the response instruction sent by the coroutine interface, it determines that the sentinel mode is in the target working state.

[0018] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the coroutine interface asynchronously controls the vehicle to perform the target task when receiving a task instruction, including: when receiving a task instruction, the coroutine interface creates a coroutine task instance based on the task instruction, and the coroutine task instance is a task unit that can be executed asynchronously; calling the target function corresponding to the target task in the coroutine task instance to enable the vehicle to perform the target task.

[0019] In the above technical solution, when the coroutine interface receives a task instruction, it can first create a coroutine task instance based on the task instruction, and then call the target function corresponding to the target task in the coroutine task instance to enable the vehicle to perform the target task. Since the coroutine task instance is an asynchronously executable task unit, it can ensure that each task in the target task can run in an independent execution environment and will not block the main thread or other tasks, so that the vehicle can quickly respond to the switching of the sentry mode working state.

[0020] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, before obtaining the vehicle status data, the method also includes: receiving at least one broadcast event generated by the vehicle based on a preset receiving component; when the broadcast event is a broadcast event generated when the vehicle is started, controlling the sentry mode to enter a working state.

[0021] In the above technical solution, before obtaining the vehicle status data, at least one broadcast event generated by the vehicle can be received based on a preset receiving component, so that when the broadcast event is a broadcast event generated when the vehicle is started, the sentry mode is controlled to enter the working state, so as to reduce the delay time of the sentry mode entering the working state and increase the speed of the sentry mode entering the working state.

[0022] In a second aspect, a vehicle control device is provided, the device comprising:

[0023] An acquisition module is used to acquire vehicle status data, where the vehicle status data is used to represent the current status of the vehicle;

[0024] a determination module, configured to determine a target operating state of the sentry mode of the vehicle based on the vehicle state data, the target operating state being an operating state that matches the current state of the vehicle;

[0025] The determination module is further configured to determine a target task corresponding to a target working state based on the state machine, wherein the target task is a task for placing the sentry mode in the target working state, and different target tasks are used to instruct to turn on and / or turn off different sentry mode function modules;

[0026] The control module is used to control the vehicle to perform the target task.

[0027] In a third aspect, a vehicle is provided, comprising a memory and a processor. The memory is configured to store executable program code, and the processor is configured to retrieve and execute the executable program code from the memory, so that the vehicle executes the vehicle control method of the first aspect or any possible implementation of the first aspect.

[0028] In a fourth aspect, a computer program product is provided, which includes: computer program code, which, when running on a computer, enables the computer to execute the vehicle control method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0029] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the vehicle control method in the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a schematic diagram of an implementation environment of a vehicle control method provided in an embodiment of the present application;

[0031] Figure 2 is a schematic flow chart of a vehicle control method provided in an embodiment of the present application;

[0032] Figure 3 is a schematic flow chart of another vehicle control method provided in an embodiment of the present application;

[0033] Figure 4 This is a schematic structural diagram of a vehicle control device provided in an embodiment of the present application;

[0034] Figure 5 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The following will clearly and thoroughly describe the technical solutions in this application in conjunction with the accompanying drawings. In the description of the embodiments of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more than two.

[0036] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0037] Before introducing the solutions of the embodiments of the present application, the professional terms that may be involved in the embodiments of the present application are first explained.

[0038] Coroutine is a concurrent programming tool that is lighter than threads. It allows functions to be paused during execution and resumed later without losing their state. Compared with traditional threads, coroutines have the following characteristics: (1) Lightweight: Coroutines are usually lighter than threads, with lower creation and destruction costs, making them suitable for a large number of concurrent tasks. (2) State preservation: Coroutines can save their execution state (such as local variables, instruction pointers, etc.) when they are paused and restore these states when they are resumed. (3) Asynchronous programming model: Coroutines are often used to implement asynchronous programming models, especially in I / O-intensive applications, and can efficiently handle a large number of concurrent tasks without occupying too many resources.

[0039] A state machine is an abstraction of the operating rules of real-world systems and a mathematical model. It receives a series of inputs and, through internal processing, transitions its system state and generates certain outputs. A state machine system can be described using a directed graph, where the vertices represent the states of the state machine system and the edges represent the inputs and outputs required to transition from one state to another.

[0040] A "state" is a point in a state machine system where the system is stable and awaiting input to transition. A state transition occurs when the state the state machine system is waiting for is satisfied or the event it is awaiting occurs, triggering a series of actions. A state machine system consists of a set of states, one and only one of which is the starting state of the state machine system, also referred to as the initial state. The state machine system also consists of a set of input symbols, an input symbol set, and a transition function that transitions from the current state to the next state. When the system starts, it is in the initial state. When the system receives a certain set of inputs, it transitions to the next state.

[0041] Figure 1 This is a schematic diagram of an implementation environment of a vehicle control method provided in an embodiment of the present application.

[0042] For example, Figure 1 As shown, the implementation environment includes a vehicle 110 and a vehicle control unit (VCU) 120 .

[0043] Among them, VCU120 is an important control unit of the vehicle 110. VCU120 can communicate with other electronic control units in the vehicle 110 through the network, obtain relevant data of the vehicle 110, and control the vehicle 110 to perform corresponding operations based on the relevant data.

[0044] In one possible embodiment, the VCU 120 is capable of acquiring status data representing the current status of the vehicle 110, and determining the target operating state of the sentry mode of the vehicle 110 based on the status data, and then determining the target task corresponding to the target operating state based on the state machine, and finally controlling the vehicle 110 to perform the target task, wherein the target task is a task for putting the sentry mode in the target operating state.

[0045] The following is based on Figure 2 The method of the embodiment of the present application is described in detail.

[0046] Figure 2 This is a schematic flowchart of a vehicle control method provided in an embodiment of the present application.

[0047] For example, Figure 2As shown, the execution subject is Figure 1 Taking the VCU 120 in FIG. 2 as an example, the method 200 includes the following steps 201 to 204:

[0048] Step 201: Acquire vehicle status data, where the vehicle status data is used to represent the current status of the vehicle.

[0049] The vehicle status data may include the vehicle's power status, the vehicle's sentry mode switch status, and whether the vehicle has triggered an arming signal.

[0050] It can be understood that the power status of the vehicle includes a power-on state and a power-off state. It should be noted that a vehicle equipped with sentry mode will be equipped with a main battery and an auxiliary battery. The power status of the vehicle usually refers to the power supply status of the vehicle's main battery. When the vehicle's power is in a power-off state (it can also be understood that the vehicle's main battery stops supplying power), the operating power of the sentry mode is provided by the auxiliary battery; the switch state of the vehicle's sentry mode includes the sentry mode switch being in the on state and the sentry mode switch being in the off state.

[0051] In one possible implementation, the VCU may obtain the voltage of the vehicle's main battery via a voltage sensor and, based on the voltage of the vehicle's main battery, determine the vehicle's power state, i.e., determine whether the vehicle's power is in a powered-on state or a powered-off state. For example, when the obtained main battery voltage is less than or equal to a voltage threshold, the vehicle's power is determined to be in a powered-off state; when the obtained main battery voltage is greater than the voltage threshold, the vehicle's power is determined to be in a powered-off state.

[0052] In one possible implementation, the VCU may read the sentinel mode switch identifier from a dedicated register through a communication protocol, such as a two-wire serial communication protocol (Inter-Integrated Circuit, I2C), a four-wire serial communication protocol (Serial Peripheral Interface, SPI), an asynchronous serial communication protocol (Universal Asynchronous Receiver / Transmitter, UART), etc., and determine the switch state of the sentinel mode based on the sentinel mode switch identifier.

[0053] Optionally, the sentry mode switch flag can be a Boolean value (i.e., True or False) or a status code (0 or 1), which is not limited in the present embodiment. Among them, True and 1 are used to indicate that the sentry mode switch is in the on state, and False and 0 are used to indicate that the sentry mode switch is in the off state.

[0054] For example, when the read sentinel mode switch flag is 1, it is determined that the sentinel mode switch is in the on state; when the read sentinel mode switch flag is 0, it is determined that the sentinel mode switch is in the off state.

[0055] It is understood that the arming signal is typically used to indicate that the vehicle has entered a warning or protection mode, namely, sentry mode. In one possible implementation, the VCU can communicate internally via the Controller Area Network (CAN) bus and monitor messages from other control units (e.g., door locks, engine status, etc.) to determine whether the vehicle has triggered the arming signal. For example, if all vehicle door locks are locked and the engine is off, the vehicle is determined to have triggered the arming signal; if only one door lock is unlocked or the engine is started, the vehicle is determined to have not triggered the arming signal.

[0056] Step 202 : determining a target operating state of the sentry mode of the vehicle based on the vehicle status data, where the target operating state is an operating state that matches the current state of the vehicle.

[0057] Specifically, after the VCU obtains the vehicle status data, it can determine the target working state of the vehicle's sentry mode based on the status data, so that the state machine determines the target task corresponding to the target working state based on the target working state.

[0058] The following describes in detail how to determine the target operating state of the vehicle's sentry mode based on the vehicle's status data.

[0059] In a possible implementation, the target working state of the sentry mode may include at least one of an on state and an off state.

[0060] As can be seen from the above embodiments, the vehicle's status data may include the vehicle's power status and the vehicle's sentry mode switch status; wherein the vehicle's power status includes a power-on state and a power-off state, and the vehicle's sentry mode switch status includes the sentry mode switch being in the on state and the sentry mode switch being in the off state. Correspondingly, in one possible implementation, based on the vehicle's status data, determining the target operating state of the vehicle's sentry mode includes: when the vehicle's power is in the on state or the vehicle's sentry mode switch is in the off state, determining the off state as the target operating state of the sentry mode; or, when the vehicle's power is in the off state and the vehicle's sentry mode switch is in the off state, determining the off state as the target operating state of the sentry mode; and when the vehicle's power is in the off state and the vehicle's sentry mode switch is in the on state, determining the on state as the target operating state of the sentry mode.

[0061] It should be noted that, since when the vehicle's power is on, it indicates that the user is currently using the vehicle and can monitor the vehicle's condition, and therefore does not need to monitor the vehicle's safety through Sentry Mode, in this case, the off state can be determined as the target operating state of Sentry Mode. When the vehicle's Sentry Mode switch is off, it indicates that the user has manually disabled Sentry Mode, and therefore does not need to monitor the vehicle's safety through Sentry Mode, and therefore, in this case, the off state can also be determined as the target operating state of Sentry Mode. In other words, when the vehicle's power is on or the Sentry Mode switch is off, or when the vehicle's power is off and the Sentry Mode switch is off, the off state can be determined as the target operating state of Sentry Mode. Furthermore, since when the vehicle's power is off and the Sentry Mode switch is on, it indicates that the user has enabled Sentry Mode while not in use, and therefore, the user may need Sentry Mode, in this case, the on state can be determined as the target operating state of Sentry Mode to monitor the vehicle's safety.

[0062] In order to control the vehicle more precisely, in one possible implementation, the on state may include at least one of a first pre-on state, a second pre-on state, an on low power state, and an on monitoring state. Correspondingly, in one possible implementation, when the power supply of the vehicle is in a power-off state and the switch of the sentry mode of the vehicle is in an on state, the on state is determined as the target working state of the sentry mode, including: when the power supply of the vehicle is in a power-off state, the vehicle triggers an arming signal, and the switch of the sentry mode of the vehicle is in an on state, the first pre-on state, the second pre-on state, and the on monitoring state are determined as the target working states of the sentry mode in sequence; when the power supply of the vehicle is in a power-off state, the vehicle does not trigger an arming signal, and the switch of the sentry mode of the vehicle is in an on state, the on low power state is determined as the target working state of the sentry mode.

[0063] It should be noted that when the vehicle's power supply is in the off state, the vehicle triggers the arming signal and the vehicle's sentry mode switch is in the on state, in order to ensure stability when the on-monitoring state is determined as the target working state, that is, to ensure stability when switching the working state of the sentry mode, before determining the on-monitoring state as the target working state of the sentry mode, it is necessary to first check the external conditions of the vehicle system (for example, it is necessary to perform delayed detection of the vehicle's power supply stability). Therefore, before determining the on-monitoring state as the target working state of the sentry mode, it is necessary to first determine the first pre-on state as the target working state of the sentry mode, so that the vehicle turns on the delayed detection module of the sentry mode to complete the delayed detection of the power supply stability, thereby ensuring the stability of the working state of the sentry mode.

[0064] Among them, the delayed detection of the vehicle's power supply stability means that when the first pre-start state is determined as the target operating state of the sentry mode, the power supply stability detection will not be started immediately. Instead, the power supply stability detection will be started after waiting for a preset period of time, that is, after the vehicle's power supply (it can be understood that the vehicle's power supply is provided by the auxiliary battery at this time) has recovered from a fluctuating state to a stable state. Specifically, after waiting for the preset period of time, the voltage or current of the vehicle's power supply can be obtained at fixed intervals, and the threshold value (voltage threshold / current threshold) is subtracted from each obtained voltage or current of the vehicle's power supply to obtain multiple deviations between the voltage or current of the vehicle's power supply and the threshold value. If the multiple deviations are all less than the preset deviation, it is determined that the vehicle's power supply is in a stable state.

[0065] It should be noted that when the vehicle's power supply is in a stable state, it means that the battery voltage and current are maintained within a reasonable range and will not fluctuate violently. This stable power supply can ensure that the electronic equipment and sensors required for the Sentry Mode have sufficient power support, that is, it can ensure that the electronic equipment and sensors required for the Sentry Mode can continue to work normally, thereby ensuring the stability of the Sentry Mode when it is working.

[0066] Furthermore, after the vehicle completes the power supply stability test, in order to ensure that the vehicle can normally start the sentry mode monitoring module and video recording module when the sentry mode is in the on-monitoring state, that is, the sentry mode monitoring module and video recording module can work normally, after the vehicle completes the power supply stability test, the sentry mode monitoring module and video recording module need to be initialized. Therefore, after the vehicle completes the power supply stability test, it is necessary to determine the second pre-start-up state as the target working state of the sentry mode, so that the vehicle completes the initialization of the sentry mode monitoring module and video recording module, thereby ensuring that the sentry mode monitoring module and video recording module can work normally when the sentry mode is in the on-monitoring state.

[0067] It can be understood that after the vehicle completes the power supply stability detection and the initialization of the sentry mode monitoring module and video recording module, that is, when it is determined that the vehicle's power supply is in a stable state and the sentry mode monitoring module and video recording module can work normally, the monitoring state can be turned on as the target working state of the sentry mode to monitor the safety of the vehicle.

[0068] As can be seen from the above, when the vehicle's power supply is in the off state, the vehicle triggers the arming signal, and the vehicle's sentry mode switch is in the on state, the first pre-on state, the second pre-on state, and the on-monitoring state can be determined in sequence as the target working states of the sentry mode, so that when the sentry mode is in the on state and the vehicle triggers the arming signal, the target tasks corresponding to the first pre-on state, the second pre-on state, and the on-monitoring state can be executed in sequence, that is, if the target tasks corresponding to the first pre-on state and the second pre-on state are not completed, the target task corresponding to the on-monitoring state will not be executed, thereby ensuring that when the working state of the sentry mode is in the on-monitoring state, the vehicle's power supply can provide stable power to the sentry mode monitoring module and the video recording module, and the sentry mode monitoring module and the video recording module can work normally; in addition, executing the target tasks corresponding to the first pre-on state, the second pre-on state, and the on-monitoring state in sequence can enable the VCU to allocate resources more effectively, ensure that each target task can be completed under optimal conditions, avoid resource conflicts caused by multiple target tasks being carried out simultaneously, and thus enable the vehicle to quickly respond to the switching of the sentry mode working state and reduce delays.

[0069] It should be noted that in the prior art, after the sentry module is in the turned-on state, the sentry mode monitoring module will be directly turned on to monitor the safety of the vehicle. Therefore, it is easy for the user to pay attention to the safety of the vehicle, but the vehicle still turns on the sentry mode monitoring module at this time. That is, in this case, it is unnecessary for the vehicle to turn on the sentry mode monitoring module, which will lead to a meaningless increase in the vehicle's energy consumption. In order to avoid the above situation, in an embodiment of the present application, when the power supply of the vehicle is in the off state, the vehicle has not triggered the arming signal, and the sentry mode switch of the vehicle is in the turned-on state, the low-power state can be determined as the target working state of the sentry mode, so that in this case, only the arming detection module of the sentry mode is turned on, so that when the arming detection module detects that the vehicle has triggered the arming signal, the turned-on monitoring state is determined as the target working state of the sentry mode to monitor the safety of the vehicle. It can be understood that when the vehicle's power supply is in the off state, the vehicle has not triggered the arming signal and the vehicle's sentry mode switch is in the on state, it indicates that the vehicle's door locks are not locked or the engine is in the started state, that is, the user may be active in the vehicle or around the vehicle at this time. In other words, the user can pay attention to the safety of the vehicle at this time, that is, it is unnecessary for the sentry mode to be in the on-monitoring state at this time. Therefore, in order to reduce the vehicle's energy consumption, the low-power state will be determined as the target working state of the sentry mode.

[0070] Step 203: determining a target task corresponding to the target working state based on the state machine. The target task is a task for making the sentry mode in the target working state, and different target tasks are used to instruct to turn on and / or turn off different sentry mode function modules.

[0071] A state machine is an abstraction of the operational rules of real-world entities and a mathematical model. It receives a series of inputs and, through internal processing, transitions its system state and generates specific outputs. For example, when the target operating state of Sentinel Mode is input into the state machine, the state machine can output the target task corresponding to the target operating state.

[0072] Specifically, after determining the target working state of the sentry mode of the vehicle based on the vehicle status data, a target task corresponding to the target working state can be determined based on the state machine, so as to ultimately control the vehicle to perform the target task.

[0073] The following describes in detail how to determine the target task corresponding to the target working state based on the state machine.

[0074] In one possible implementation, developers can predefine the mapping relationship between different target operating states of the sentry mode and target tasks in a state machine, so that after determining the target operating state of the vehicle's sentry mode, the target task corresponding to the target operating state can be determined based on the state machine.

[0075] It should be noted that since the state machine can quickly respond to the switching of the working state of the sentry mode, it can quickly determine the task that the vehicle needs to perform as the target task corresponding to the current working state based on the mapping relationship between the target working state of the sentry mode and the target task. Therefore, it can reduce the waiting time of the vehicle, thereby avoiding unnecessary tasks being continuously executed by the vehicle and reducing unnecessary resource consumption; in addition, in the prior art, when the working state of the sentry mode is switched to the on state, the vehicle will be controlled to perform all tasks corresponding to the on state at the same time (for example, when the sentry mode is in the on state, the vehicle will be controlled to delay detection of the power state and initialize the monitoring module and video recording module, etc.), so that multiple tasks are carried out at the same time, resulting in resource conflicts, thereby increasing the response time of switching the working state of the sentry mode to the on state. As can be seen from the above embodiments, when the vehicle's power supply is in the off state, the vehicle triggers the arming signal and the vehicle's sentry mode switch is in the on state, the present application will sequentially determine the first pre-on state, the second pre-on state and the on-monitoring state as the target working states of the sentry mode, so that the vehicle can be subsequently controlled to execute the target tasks corresponding to the first pre-on state, the second pre-on state and the on-monitoring state, so that the VCU can allocate resources more effectively, ensure that each target task can be completed under the best conditions, avoid resource conflicts caused by multiple target tasks being carried out at the same time, and enable the vehicle to quickly respond to the switching of the sentry mode working state and reduce delays.

[0076] In one possible implementation, developers can first determine the framework of the state machine, for example, using an existing state machine framework (such as a transitions library), and then write the mapping relationship between different target working states of the sentinel mode and the target tasks in the state machine through a configuration file or code.

[0077] In one possible implementation, developers can use enumeration types to define the mapping relationship between different target working states and target tasks of the sentry mode, so as to ensure the consistency and readability of the code.

[0078] Among them, the mapping relationship between different target working states and target tasks of the sentry mode is as follows: when the target working state of the sentry mode is the off state, the target task corresponding to the target working state includes turning off the monitoring module and video recording module of the sentry mode; when the target working state is the first pre-on state, the target task corresponding to the first pre-on state includes turning on the delay detection module of the sentry mode, and the delay detection module is used to perform delay detection on the power stability of the vehicle; when the target working state is the second pre-on state, the target task corresponding to the second pre-on state includes turning off the delay detection module, and turning on the monitoring module and video recording module for initializing the sentry mode; when the target working state is the on monitoring state, the target task corresponding to the on monitoring state includes turning off the monitoring module and video recording module for initializing the sentry mode, and turning on the monitoring module and video recording module for the sentry mode; when the target working state is the on low power consumption state, the target task corresponding to the on low power consumption state includes turning off the monitoring module and video recording module of the sentry mode, and turning on the arming detection module of the sentry mode, and the arming detection module is used to detect whether the vehicle triggers the arming signal.

[0079] The monitoring module is used to collect real-time environmental data around the vehicle through various devices configured on the vehicle (such as cameras, ultrasonic sensors, accelerometers, gyroscopes, etc.), and use algorithms or machine learning models to process the collected data to determine whether there are any abnormal conditions in the vehicle (for example, whether there are any abnormal sounds in the vehicle, whether the windows or doors are damaged, etc.), so as to trigger corresponding response measures in the event of an abnormality, such as activating an alarm, notifying the user, etc.

[0080] Among them, the video recording module is used to record the environment around the vehicle through a driving recorder and / or a camera configured outside the vehicle when an abnormal situation is detected in the vehicle, and send the recorded video to a mobile terminal connected to the vehicle (for example, a mobile phone, tablet computer, etc.).

[0081] In a possible implementation, the recorded video data may be encrypted to prevent the recorded video data from being illegally tampered with during transmission, thereby ensuring the security of the recorded video data during transmission.

[0082] The delay detection module is used to perform delay detection on the vehicle's power supply stability. For details on the delay detection on the vehicle's power supply stability, please refer to the above embodiment and will not be repeated here.

[0083] It can be seen from the above mapping relationship that the target tasks corresponding to different target working states include turning on different sentinel mode sub-modules, and / or turning off different sentinel mode sub-modules. For example, when the sentinel mode is in the second pre-turn-on state, the target tasks corresponding to the second pre-turn-on state include turning off the delay detection module, and turning on the monitoring module and video recording module for initializing the sentinel mode; when the sentinel mode is in the turned-on monitoring state, the target tasks corresponding to the monitoring state include turning off the delay detection module, and turning on the monitoring module and video recording module for initializing the sentinel mode. That is, when the sentinel mode is in different target working states, the vehicle will automatically turn off unnecessary tasks, and automatically resume the task (that is, execute the task) when needed, thereby effectively reducing resource waste and thus reducing the vehicle's energy consumption. In addition, when the sentry mode is in the low-power state, the target tasks corresponding to the low-power state may include turning off the monitoring module and video recording module of the sentry mode, and turning on the defense detection module of the sentry mode. It can be understood that when the sentry mode is in the low-power state, turning on the defense detection module of the sentry mode can make the monitoring state on as the target working state of the sentry mode when the defense detection module detects that the vehicle triggers the defense signal, so as to ensure the safety of the vehicle.

[0084] It should be noted that when the target working state is the second pre-opening state, if the initialization of the sentry mode monitoring module or video recording module fails, it indicates that the sentry mode monitoring module or video recording module cannot work normally when the sentry mode is in the open monitoring state, that is, it cannot normally determine whether there is an abnormality in the vehicle and cannot record the environment around the vehicle. Therefore, in order to avoid meaningless control of the vehicle, in this case, the closed state can be determined as the target working state, so that the vehicle performs the target task corresponding to the closed state, that is, the sentry mode monitoring module and video recording module are turned off. Similarly, when the target working state is the first pre-opening state, if it is detected that the power supply of the vehicle is in an unstable state, it indicates that the power supply of the vehicle at this time cannot support the vehicle to perform the subsequent target task corresponding to the second pre-opening state, that is, it cannot support the vehicle to initialize the sentry mode monitoring module or video recording module, that is, in this case, the closed state can also be determined as the target working state.

[0085] Step 204: Control the vehicle to perform the target task.

[0086] Specifically, after determining a target task corresponding to a target working state based on the state machine, the VCU may control the vehicle to execute the target task.

[0087] Exemplarily, when the target task is to shut down the delay detection module and start the monitoring module and video recording module in initialization sentinel mode, the VCU will control the vehicle to execute the shutdown of the delay detection module and start the monitoring module and video recording module in initialization sentinel mode.

[0088] In one possible implementation, the VCU may asynchronously control the vehicle to execute a target task based on a state machine and a corresponding coroutine interface.

[0089] Asynchronous control refers to a programming mode that allows each task in a target task to be executed in parallel or concurrently without blocking the main thread. That is, in this programming mode, each task can be carried out simultaneously without interfering with each other.

[0090] It should be noted that since the coroutine interface allows the vehicle to execute the target task asynchronously, it can avoid long-running tasks (for example, turning off the delay detection module, turning on the monitoring module and video recording module that initialize the sentinel mode) blocking the main thread; in addition, the coroutine interface can also avoid interference between multiple tasks when the vehicle executes each task in the target task, so that the vehicle can quickly respond to the switching of the sentinel mode working state.

[0091] The following details how to asynchronously control the vehicle to perform the target task based on the state machine and the corresponding coroutine interface.

[0092] In one possible implementation, the state machine may send a task instruction to the coroutine interface to switch the working state of the sentinel mode to the target working state, where the task instruction includes a target task corresponding to the target working state, so that upon receiving the task instruction, the coroutine interface asynchronously controls the vehicle to perform the target task, generates a response instruction, and sends the response instruction to the state machine. The response instruction is used to indicate that the working state of the sentinel mode has been switched to the target working state, and ultimately enables the state machine to determine that the sentinel mode is in the target working state upon receiving the response instruction sent by the coroutine interface.

[0093] In one possible implementation, the state machine can send a task instruction to switch the working state of sentry mode to the target working state to the coroutine interface through a message queue, thereby decoupling the state machine and the coroutine interface. Specifically, the state machine can put the task instruction for switching the working state of sentry mode to the target working state into a queue, and the coroutine interface processes each request in the order received, that is, asynchronously controls the vehicle to perform the corresponding target task in turn. It should be noted that if the task instructions sent by the state machine to the coroutine interface are divided into different levels of urgency, a priority queue can be used to ensure that important task instructions are processed first.

[0094] In another possible implementation, when the state machine is initialized, the developer can set a corresponding callback function for different target working states, so that when the state machine sends a task instruction to the coroutine interface to switch the sentinel mode working state to the target working state, it can directly call the callback function corresponding to the target working state to pass the task instruction.

[0095] In one possible implementation, after receiving the task instruction sent by the state machine, the coroutine interface will parse the task instruction, and then use the asyncio library to ensure that all tasks can be executed asynchronously without blocking the main thread. After the vehicle completes all tasks, it generates a response instruction indicating that the working state of the sentinel mode has been switched to the target working state, and encapsulates the response instruction into a message and sends it to the message queue subscribed by the state machine (i.e., the message queue in the above embodiment), so that when the state machine receives the instruction, it determines that the sentinel mode is in the target working state.

[0096] The following is a two-step introduction to the specific implementation of the coroutine interface to asynchronously control the vehicle to perform the target task when receiving the task instruction.

[0097] Step (1): When the coroutine interface receives a task instruction, it creates a coroutine task instance based on the task instruction. The coroutine task instance is a task unit that can be executed asynchronously.

[0098] In one possible implementation, upon receiving a task instruction, the coroutine interface parses the task instruction and uses the loop.create_task function to create an asynchronously executable task unit, i.e., a coroutine task instance, based on the parsed task instruction, so as to asynchronously control the vehicle to perform a determined target task.

[0099] Step (2): calling the target function corresponding to the target task in the coroutine task instance so that the vehicle executes the target task.

[0100] Specifically, after using the loop.create_task function to create a coroutine task instance based on the task instruction, the target function corresponding to the target task, that is, the asynchronous function, such as the start_vehicle function or the accelerate function, can be called based on the task instruction to enable the vehicle to execute the target task asynchronously.

[0101] It should be noted that in an embodiment of the present application, when the coroutine interface receives a task instruction, it can first create a coroutine task instance based on the task instruction, and then call the target function corresponding to the target task in the task instance to enable the vehicle to perform the target task. Since the coroutine task instance is an asynchronously executable task unit, it can ensure that each task in the target task can run in an independent execution environment and will not block the main thread or other tasks, so that the vehicle can quickly respond to the switching of the sentry mode working state.

[0102] In summary, the vehicle control method provided in the embodiment of the present application can determine the target working state of the vehicle's sentry mode by acquiring the vehicle's status data, and determine the target task corresponding to the target working state based on the state machine. Since the state machine can quickly respond to the switching of the sentry mode's working state, it can quickly determine the task that the vehicle currently needs to perform (i.e., the target task) based on the target working state of the sentry mode. Therefore, the vehicle waiting time can be reduced, that is, the vehicle can quickly execute the target task, avoiding unnecessary tasks being continuously executed by the vehicle, reducing unnecessary resource consumption, and thus reducing the vehicle's energy consumption; in addition, since different target tasks are used to indicate the opening and / or closing of different sentry mode functional modules, in each target working state of the sentry mode, the vehicle only needs to turn on some functional modules of the sentry mode indicated by the target task, without turning on other functional modules of the sentry mode, thereby further reducing the vehicle's energy consumption.

[0103] Figure 3 It is a schematic flow chart of another vehicle control method provided in an embodiment of the present application.

[0104] For example, Figure 3 As shown, the execution subject is Figure 1 Taking the VCU 120 in FIG. 3 as an example, the method 300 includes the following steps 301 to 306:

[0105] Step 301: Receive at least one broadcast event generated by a vehicle based on a preset receiving component.

[0106] It should be noted that after the vehicle is started, that is, after the vehicle system has completed startup, a broadcast event corresponding to the vehicle startup completion is generated, so that various applications in the vehicle system can begin the necessary initialization operations. Therefore, in order to reduce the delay time for Sentry Mode to enter the operating state, that is, to minimize the delay time for Sentry Mode to enter the operating state after the vehicle has completed startup, in one possible embodiment, a preset receiving component can receive at least one broadcast event generated by the vehicle. When the broadcast event is a broadcast event generated during vehicle startup, Sentry Mode can be directly controlled to enter the operating state, thereby increasing the speed at which Sentry Mode enters the operating state.

[0107] In one possible implementation, the receiving component may be a broadcast receiver BootCompleteReceiver. Since the broadcast receiver is a component in the Android operating system specifically used to receive vehicle startup completion broadcasts, after the vehicle completes startup, it can quickly determine that the vehicle has completed startup, thereby allowing the sentry mode to enter the working state, effectively reducing the delay time for the sentry mode to enter the working state.

[0108] Step 302 : When the broadcast event is a broadcast event generated when the vehicle is started, control the sentry mode to enter a working state.

[0109] Specifically, when the broadcast event is a broadcast event generated when the vehicle is started, the VCU can call an application programming interface (API) or send a command to the sentry mode control unit to put the sentry mode into operation.

[0110] Step 303: Acquire vehicle status data.

[0111] Step 304 : determining a target operating state of the sentry mode of the vehicle based on the vehicle state data.

[0112] Step 305: Determine a target task corresponding to the target working state based on the state machine.

[0113] Step 306: Control the vehicle to perform the target task.

[0114] The specific implementation of steps 303 to 306 can be found in the above embodiment and will not be repeated here.

[0115] Figure 4 It is a structural schematic diagram of a vehicle control device provided in an embodiment of the present application.

[0116] For example, Figure 4 As shown, the apparatus 400 includes:

[0117] An acquisition module 401 is used to acquire vehicle status data, where the vehicle status data is used to represent the current status of the vehicle;

[0118] A determination module 402 is configured to determine a target operating state of the sentry mode of the vehicle based on the vehicle status data, where the target operating state is an operating state that matches the current state of the vehicle, and different target tasks are used to instruct different sentry mode function modules to be turned on and / or off;

[0119] The determination module 402 is further configured to determine a target task corresponding to the target working state based on the state machine, where the target task is a task that causes the sentry mode to be in the target working state;

[0120] The control module 403 is used to control the vehicle to perform the target task.

[0121] In one possible implementation, the vehicle's status data includes the vehicle's power status and the vehicle's sentry mode switch status; the target operating state includes at least one of an on state and an off state; the determination module 402 is specifically used to determine the off state as the target operating state of the sentry mode when the vehicle's power is in the on state or the vehicle's sentry mode switch is in the off state; or, when the vehicle's power is in the off state and the vehicle's sentry mode switch is in the off state, determine the off state as the target operating state of the sentry mode; when the vehicle's power is in the off state and the vehicle's sentry mode switch is in the on state, determine the on state as the target operating state of the sentry mode.

[0122] In one possible implementation, the vehicle's status data also includes whether the vehicle triggers an arming signal; the on state includes at least one of a first pre-on state, a second pre-on state, an on low-power state, and an on monitoring state; the determination module 402 is specifically used to, when the vehicle's power supply is in a power-off state, the vehicle triggers an arming signal, and the vehicle's sentry mode switch is in an on state, sequentially determine the first pre-on state, the second pre-on state, and the on monitoring state as the target working states of the sentry mode; when the vehicle's power supply is in a power-off state, the vehicle does not trigger an arming signal, and the vehicle's sentry mode switch is in an on state, determine the on low-power state as the target working state of the sentry mode.

[0123] In one possible implementation, the state machine predefines the mapping relationship between different target working states of the sentinel mode and the target tasks; the determination module 402 is specifically used to determine the target task corresponding to the target working state based on the mapping relationship and the target working state predefined in the state machine.

[0124] In one possible implementation, when the target working state of the sentry mode is the off state, the target task corresponding to the target working state includes turning off the monitoring module and video recording module of the sentry mode; when the target working state is the first pre-on state, the target task corresponding to the first pre-on state includes turning on the delay detection module of the sentry mode, and the delay detection module is used to perform delay detection on the power stability of the vehicle; when the target working state is the second pre-on state, the target task corresponding to the second pre-on state includes turning off the delay detection module, and turning on the monitoring module and video recording module for initializing the sentry mode; when the target working state is the on monitoring state, the target task corresponding to the on monitoring state includes turning off the monitoring module and video recording module for initializing the sentry mode, and turning on the monitoring module and video recording module of the sentry mode; when the target working state is the on low power consumption state, the target task corresponding to the on low power consumption state includes turning off the monitoring module and video recording module of the sentry mode, and turning on the arming detection module of the sentry mode, and the arming detection module is used to detect whether the vehicle triggers the arming signal.

[0125] In one possible implementation, the control module 403 is specifically configured to asynchronously control the vehicle to execute a target task based on a state machine and a corresponding coroutine interface.

[0126] In one possible implementation, the device also includes a transceiver module, which is used for the state machine to send a task instruction to the coroutine interface to switch the working state of the sentinel mode to the target working state, and the task instruction includes a target task corresponding to the target working state; when the coroutine interface receives the task instruction, the coroutine interface asynchronously controls the vehicle to perform the target task, generates a response instruction, and sends the response instruction to the state machine, and the response instruction is used to indicate that the working state of the sentinel mode has been switched to the target working state; the determination module 402 is also used for the state machine to determine that the sentinel mode is in the target working state when it receives the response instruction sent by the coroutine interface.

[0127] In one possible implementation, the device also includes a creation module, which is used for the coroutine interface to create a coroutine task instance based on the task instruction when receiving the task instruction. The coroutine task instance is a task unit that can be executed asynchronously; and a calling module, which calls the target function corresponding to the target task in the task instance so that the vehicle can perform the target task.

[0128] In one possible implementation, before obtaining the vehicle's status data, the transceiver module is also used to receive at least one broadcast event generated by the vehicle based on a preset receiving component; the control module 403 is specifically used to control the sentry mode to enter the working state when the broadcast event is a broadcast event generated when the vehicle is started.

[0129] Figure 5 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application.

[0130] For example, Figure 5 As shown, the vehicle 500 includes: a memory 501 and a processor 502, wherein the memory 501 stores an executable program code 503, and the processor 502 is used to call and execute the executable program code 503 to perform a vehicle control method.

[0131] In addition, an embodiment of the present application also protects a device, which may include a memory and a processor, wherein the memory stores executable program code, and the processor is used to call and execute the executable program code to perform a vehicle control method provided by an embodiment of the present application.

[0132] In this embodiment, the device can be divided into functional modules based on the above-described method examples. For example, each functional module can be mapped to a specific functional module, or two or more functions can be integrated into a single processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and represents only a logical functional division. In actual implementation, other division methods may be used.

[0133] In the case of dividing each functional module into corresponding functional modules, the device may further include a transceiver module, a creation module, and a call module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0134] It should be understood that the device provided in this embodiment is used to execute the above-mentioned vehicle control method, and thus can achieve the same effect as the above-mentioned implementation method.

[0135] In the case of an integrated unit, the device may include a processing module and a storage module. When the device is used in a vehicle, the processing module may be used to control and manage the vehicle's movements, while the storage module may be used to support the vehicle's execution of relevant program codes.

[0136] The processing module may be a processor or controller that implements or executes the various exemplary logic blocks, modules, and circuits described in conjunction with the present disclosure. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processing (DSP) and a microprocessor, and the storage module may be a memory.

[0137] In addition, the device provided in the embodiments of the present application can specifically be a chip, component or module, and the chip may include a connected processor and memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute a vehicle control method provided in the above embodiment.

[0138] This embodiment also provides a computer-readable storage medium, which stores computer program code. When the computer program code runs on a computer, the computer executes the above-mentioned related method steps to implement a vehicle control method provided by the above embodiment.

[0139] This embodiment also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement a vehicle control method provided by the above embodiment.

[0140] Among them, the device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0141] Based on the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0142] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented based on other ways. For example, the device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be based on some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0143] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A vehicle control method, characterized in that: The method comprises: Acquiring vehicle status data, where the vehicle status data is used to represent the current status of the vehicle; determining a target operating state of the sentry mode of the vehicle based on the state data of the vehicle, the target operating state being an operating state that matches a current state of the vehicle; Determining a target task corresponding to the target working state based on a state machine, wherein the target task is a task that causes the sentinel mode to be in the target working state, and different target tasks are used to instruct to turn on and / or turn off different functional modules of the sentinel mode; controlling the vehicle to perform the target task; The determining, based on the vehicle status data, a target operating state of the sentry mode of the vehicle includes: When the power supply of the vehicle is in a power-off state, the vehicle triggers an arming signal, and the switch of the sentry mode of the vehicle is in an on state, sequentially determining a first pre-on state, a second pre-on state, and an on-monitoring state as target operating states of the sentry mode; When the power supply of the vehicle is in a power-off state, the vehicle has not triggered the arming signal, and the switch of the sentry mode of the vehicle is in an on state, the low power consumption state is determined to be the target working state of the sentry mode.

2. The method according to claim 1, characterized in that The vehicle status data includes a power status of the vehicle and a sentry mode switch status of the vehicle; the target operating state includes at least one of an on state and an off state; The determining, based on the vehicle status data, a target operating state of the sentry mode of the vehicle further comprises: When the power supply of the vehicle is in the on state or the switch of the sentry mode of the vehicle is in the off state, determining the off state as the target operating state of the sentry mode; or when the power supply of the vehicle is in the off state and the switch of the sentry mode of the vehicle is in the off state, determining the off state as the target operating state of the sentry mode; When the power source of the vehicle is in a power-off state and the switch of the sentry mode of the vehicle is in an on state, the on state is determined as a target operating state of the sentry mode.

3. The method according to claim 1, characterized in that The state machine predefines a mapping relationship between different target working states of the sentinel mode and the target tasks; The determining, based on the state machine, a target task corresponding to the target working state includes: Based on the mapping relationship predefined in the state machine and the target working state, a target task corresponding to the target working state is determined.

4. The method according to claim 3, characterized in that In a case where the target working state of the sentinel mode is an off state, the target task corresponding to the target working state includes shutting down the monitoring module and the video recording module of the sentinel mode; In a case where the target operating state is a first pre-on state, the target task corresponding to the first pre-on state includes activating a delay detection module of the sentinel mode, the delay detection module being configured to perform delay detection on the power supply stability of the vehicle; In a case where the target working state is the second pre-on state, the target task corresponding to the second pre-on state includes turning off the delay detection module, and turning on the monitoring module and the video recording module that initialize the sentinel mode; In the case where the target working state is the monitoring state on, the target task corresponding to the monitoring state on includes shutting down the monitoring module and the video recording module that initialize the sentinel mode, and turning on the monitoring module and the video recording module that initialize the sentinel mode; When the target working state is the low power consumption state, the target task corresponding to the low power consumption state includes turning off the monitoring module and the video recording module of the sentry mode, and turning on the defense detection module of the sentry mode. The defense detection module is used to detect whether the vehicle triggers the defense signal.

5. The method according to claim 1, wherein The controlling the vehicle to perform the target task includes: The vehicle is asynchronously controlled to execute the target task based on the state machine and the corresponding coroutine interface.

6. The method according to claim 5, characterized in that The asynchronously controlling the vehicle to execute the target task based on the state machine and the corresponding coroutine interface includes: The state machine sends a task instruction to the coroutine interface to switch the working state of the sentinel mode to the target working state, wherein the task instruction includes the target task corresponding to the target working state; Upon receiving the task instruction, the coroutine interface asynchronously controls the vehicle to execute the target task, generates a response instruction, and sends the response instruction to the state machine, wherein the response instruction is used to indicate that the working state of the sentry mode has been switched to the target working state; When the state machine receives the response instruction sent by the coroutine interface, it determines that the sentinel mode is in the target working state.

7. The method according to claim 6, characterized in that Upon receiving the task instruction, the coroutine interface asynchronously controls the vehicle to execute the target task, including: When the coroutine interface receives the task instruction, it creates a coroutine task instance based on the task instruction, and the coroutine task instance is a task unit that can be executed asynchronously; The target function corresponding to the target task is called in the coroutine task instance to enable the vehicle to perform the target task.

8. The method according to claim 1, characterized in that Before obtaining the status data of the vehicle, the method further includes: receiving, based on a preset receiving component, at least one broadcast event generated by the vehicle; In a case where the broadcast event is a broadcast event generated when the vehicle is started, the sentry mode is controlled to enter a working state.

9. A vehicle, characterized in that: The vehicle comprises: a memory for storing executable program code; A processor is configured to call and run the executable program code from the memory, so that the vehicle executes the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Vehicle sentry monitoring method, system, monitoring device and controller

    CN116653857A

  • Vehicle sentry mode control method and control system and vehicle

    CN117382578A