Vehicle control method and vehicle

By acquiring vehicle status data and determining target tasks based on the state machine, controlling the vehicle only turns on the necessary functional modules, solving the problem of high energy consumption in the intelligent sentry mode of the vehicle in the prior art, and achieving an effective reduction of energy consumption.

CN119749439AActive Publication Date: 2025-04-04GREAT WALL MOTOR CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing intelligent sentry mode of vehicles continues to turn on all functional modules for monitoring after the owner leaves the vehicle, resulting in high energy consumption of the vehicle and lacks methods to effectively reduce energy consumption.

Method used

By obtaining vehicle status data, determining the target working status of the sentry mode, determining the corresponding target task based on the state machine, controlling the vehicle to perform target tasks, and only turning on necessary functional modules to reduce unnecessary resource consumption.

Benefits of technology

It realizes rapid response to Sentinel mode working state switching, reduces vehicle waiting time, avoids unnecessary tasks to be continuously executed, and reduces vehicle energy consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119749439A_ABST
    Figure CN119749439A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle control method and a vehicle, the method is applied to the technical field of vehicles, and the method comprises the steps that state data of the vehicle are acquired, and the state data of the vehicle are used for representing the current state of the vehicle; based on the state data of the vehicle, a target working state of a sentry mode of the vehicle is determined, and the target working state is a working state matched with the current state of the vehicle; target tasks corresponding to the target working state are determined based on the state machine, the target tasks are tasks enabling the sentry modes to be in the target working state, and different target tasks are used for indicating to open and / or close functional modules of different sentry modes; according to the method, 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 specifically, to a vehicle control method and a vehicle in the field of vehicle technology. Background Art

[0002] As cars are increasingly used in families, car intelligence is also developing, and Sentry Mode plays an important role in this. Sentry Mode means that after the owner leaves the car, the vehicle can start parking monitoring to monitor the safety of the vehicle. When the vehicle is damaged (for example, collision or scratch, etc.), the camera module such as the panoramic camera outside the car or the driving recorder records the process of the vehicle being damaged, so as to notify the owner that the accident has occurred and record the incident process.

[0003] However, currently the 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 the 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 issue that needs to be urgently addressed. Summary of the invention

[0005] The present application provides a vehicle control method and a vehicle, wherein the method 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 execute the target task.

[0007] In the above technical scheme, 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 needs to perform at the moment (i.e., the target task) based on the target working state of the sentry mode, the waiting time of the vehicle 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 energy consumption of the vehicle; in addition, since different target tasks are used to indicate the opening and / or closing of different sentry mode function modules, in each target working state of the sentry mode, the vehicle only needs to turn on some of the sentry mode function modules indicated by the target task, without turning on other function modules of the sentry mode, thereby further reducing the energy consumption of the vehicle.

[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, including: when the vehicle's power is in a powered-on state or the vehicle's sentry mode switch is in an off state, determining the 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 an off state, determining the 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 an off state, determining the 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 status data of the vehicle also includes whether the vehicle triggers an arming signal; the start-up state includes at least one of a first pre-start-up state, a second pre-start-up state, an on-low power consumption state, and an on-monitoring state; 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 start-up 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-start-up state, the second pre-start-up 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 consumption state is determined as the target working state of the sentry mode.

[0010] In the above technical solution, the status data of the vehicle also includes whether the vehicle triggers the defense signal, and the open state can include at least one of the first pre-open state, the second pre-open state, the open low power consumption state and the open monitoring state. When the vehicle is in the open state and the vehicle triggers the defense signal, the first pre-open state, the second pre-open state and the open monitoring state can be determined as the target working state of the sentinel mode in sequence, so that when the sentinel mode is in the open state and the vehicle triggers the defense signal, the target tasks corresponding to the first pre-open state, the second pre-open state and the open monitoring state can be executed in sequence, that is, when the target task corresponding to the first pre-open state is not executed, the target task corresponding to the second pre-open state and the open monitoring state will not be executed, so that the vehicle can quickly respond to the switching of the working state of the sentinel mode and reduce delay. In addition, when the vehicle is in the open state and the vehicle does not trigger the defense signal, it indicates that the user may be in the car at this time, that is, the user is still using the vehicle. Therefore, in this case, the open low power consumption state can be determined as the target working state of the sentinel mode to reduce the energy consumption of the vehicle.

[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, a mapping relationship between different target working states of the sentinel mode and the target tasks is predefined in the state machine; 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 scheme, the mapping relationship between different target working states of the sentinel mode and the target tasks can be predefined in the state machine, so that after determining the target working state of the sentinel 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 consumption of resources.

[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 the 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 the 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 the video recording module for initializing the sentinel mode, and turning on the monitoring module and the 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 the video recording module of the sentinel mode, and turning on the defense detection module of the sentinel mode, and the defense detection module is used to detect whether the vehicle triggers the defense signal.

[0014] In the above technical solution, the target tasks corresponding to different target working states include turning on different sentinel mode submodules and turning off different sentinel mode submodules. 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 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, etc. It should be noted that when the sentinel 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 sentinel mode and turning on the defense detection module of the sentinel mode, so that when the defense detection module detects that the vehicle triggers the defense signal, the monitoring state is determined to be the target working state of the sentinel mode to ensure the safety of the vehicle.

[0015] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, 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 scheme, 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 the video recording module that initialize the sentinel mode) from 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 a 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 the coroutine interface receives a 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; calling the target function corresponding to the target task in the coroutine task instance so that the vehicle performs 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 sentinel mode working state.

[0020] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, before obtaining the status data of the vehicle, 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 status data of the vehicle, at least one broadcast event generated by the vehicle can also 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 the status data of the vehicle, where the status data of the vehicle is used to indicate the current status of the vehicle;

[0024] A determination module, configured to determine a target working state of the sentry mode of the vehicle based on the state data of the vehicle, the target working state being a working state matching the current state of the vehicle;

[0025] The determination module is further used to determine a target task corresponding to a target working state based on the state machine, wherein the target task is a task for making the sentinel mode be in the target working state, and different target tasks are used to instruct to turn on and / or turn off different sentinel 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 used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the vehicle executes the vehicle control method in the first aspect or any possible implementation of the first aspect.

[0028] In a fourth aspect, a computer program product is provided, which includes: a computer program code, which, when executed 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 It 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 is a structural schematic 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 technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present 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 the present application, "multiple" means two or more than two.

[0036] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, 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, and are suitable for a large number of concurrent tasks. (2) Saving state: 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, which 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 things and a mathematical model. A state machine can receive a series of inputs and, through internal processing, migrate its system state and generate certain outputs. A state machine system can be described by a directed graph, where the vertices of the directed graph are the states of the state machine system and the edges of the directed graph are the inputs and outputs required for the state machine system to migrate from one state to another.

[0040] The so-called "state" is a position of the state machine system, at which the system is stable and waiting for input for state transition. State transition occurs when the state that the state machine system is waiting for is satisfied or the event that is being waited for has occurred, and a series of actions are triggered thereafter. The state machine system contains a set of state sets, of which one and only one is the starting state of the state machine system, also recorded as the initial state. At the same time, the state machine system also contains a set of input symbols, an input symbol set and a transition function from the current state to the next state. When the system starts, the system is in the initial state, and when the system receives a certain set of inputs, it will transfer to the next state.

[0041] Figure 1 It 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 implementation, VCU120 is capable of acquiring status data representing the current status of vehicle 110, and determining a target operating state of the sentry mode of vehicle 110 based on the status data, and then determining a target task corresponding to the target operating state based on a state machine, and finally controlling 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 It is a schematic flow chart 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, obtaining vehicle status data, where the vehicle status data is used to represent the current status of the vehicle.

[0049] Among them, the vehicle status data may include the vehicle's power status, the vehicle's sentry mode switch status, and whether the vehicle triggers the defense 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 sentinel 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 sentinel mode is provided by the auxiliary battery; the switch state of the vehicle's sentinel mode includes the sentinel mode switch being in the on state and the sentinel mode switch being in the off state.

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

[0052] In one possible implementation, the VCU may read the switch flag of the sentinel mode 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 switch flag of the sentinel mode.

[0053] Optionally, the switch flag of the sentinel mode 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 of the application. Among them, True and 1 are used to indicate that the switch of the sentinel mode is in the on state, and Falsee and 0 are used to indicate that the switch of the sentinel mode 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 understandable that the arming signal is usually used to indicate that the vehicle has entered a warning or protection mode, i.e., a sentinel mode. In a possible implementation, the VCU can communicate internally through 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, when it is detected that all door locks of the vehicle are locked and the engine is in the off state, it is determined that the vehicle has triggered the arming signal; when it is detected that the door locks of the vehicle are unlocked or the engine is in the starting state, it is determined that the vehicle has not triggered the arming signal.

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

[0057] Specifically, after the VCU acquires the status data of the vehicle, the target working state of the sentry mode of the vehicle can be determined 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 sentry mode of the vehicle based on the vehicle's status data.

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

[0060] It can be seen from the above embodiments that the status data of the vehicle may include the power status of the vehicle and the switch status of the sentry mode of the vehicle; wherein the power status of the vehicle includes a power-on status and a power-off status, and the switch status of the sentry mode of the vehicle includes the sentry mode switch being in an on state and the sentry mode switch being in an off state. Correspondingly, in a possible implementation, based on the status data of the vehicle, determining the target working state of the sentry mode of the vehicle includes: when the power of the vehicle is in a power-on state or the switch of the sentry mode of the vehicle is in an off state, the off state may be determined as the target working state of the sentry mode; or, when the power of the vehicle is in a power-off state and the switch of the sentry mode of the vehicle is in an off state, the off state may be determined as the target working state of the sentry mode; when the power 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 may be determined as the target working state of the sentry mode.

[0061] It should be noted that, when the power of the vehicle is in the powered-on state, it indicates that the user is using the vehicle at this time and can pay attention to the vehicle situation, so there is no need to monitor the safety of the vehicle through the sentry mode, that is, in this case, the off state can be determined as the target working state of the sentry mode; when the switch of the sentry mode of the vehicle is in the off state, it indicates that the user has manually turned off the sentry mode, that is, the user does not need to monitor the safety of the vehicle through the sentry mode at this time, so in this case, the off state can also be determined as the target working state of the sentry mode, that is, when the power of the vehicle is in the powered-on state or the switch of the sentry mode of the vehicle is in the off state, or when the power of the vehicle is in the powered-off state and the switch of the sentry mode of the vehicle is in the off state, the off state can be determined as the target working state of the sentry mode. In addition, when the power of the vehicle is in the powered-off state and the switch of the sentry mode of the vehicle is in the on state, it indicates that the user has turned on the sentry mode when not using the vehicle, that is, the user may have a demand for the sentry mode at this time, so in this case, the on state can be determined as the target working state of the sentry mode to monitor the safety of the vehicle.

[0062] In order to control the vehicle more finely, in a 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 consumption state, and an on monitoring state. Correspondingly, in a possible implementation, when the power 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 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 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 consumption 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 the stability when the on-monitoring state is determined as the target working state, that is, in order to ensure the stability when switching the working state of the sentry mode, before the on-monitoring state is determined 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 stability means that when the first pre-start state is determined as the target working state of the sentinel mode, the detection of the power stability will not be started immediately, but after waiting for a preset 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, the detection of the power stability will be started. Specifically, after waiting for a preset time, the voltage or current of the vehicle power supply can be obtained at fixed intervals, and the threshold value (voltage threshold value / current threshold value) is subtracted from the voltage or current of each vehicle power supply obtained to obtain multiple deviations between the voltage or current of the vehicle power supply and the threshold value. When the multiple deviations are all less than the preset deviations, 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 without drastic fluctuations. 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 turn on the sentinel mode monitoring module and video recording module when the sentinel mode is in the on-monitoring state, that is, the sentinel mode monitoring module and video recording module can work normally, after the vehicle completes the power supply stability test, the sentinel 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-turn-on state as the target working state of the sentinel mode, so that the vehicle completes the initialization of the sentinel mode monitoring module and video recording module, thereby ensuring that the sentinel mode monitoring module and video recording module can work normally when the sentinel 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 sentinel 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 sentinel mode monitoring module and video recording module can work normally, the monitoring state can be turned on as the target working state of the sentinel mode to monitor the safety of the vehicle.

[0068] It can be seen from the above that when the power supply of the vehicle is in the off state, the vehicle triggers the arming signal and the switch of the sentry mode of the vehicle 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 state 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, when the target tasks corresponding to the first pre-on state and the second pre-on state are not executed, the target tasks corresponding to the on-monitoring state will not be executed, so as to ensure that when the working state of the sentry mode is in the on-monitoring state, the power supply of the vehicle can provide stable power for the monitoring module and the video recording module of the sentry mode, and the monitoring module and the video recording module of the sentry mode 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 the best conditions, avoid multiple target tasks being carried out at the same time and causing resource conflicts, so that the vehicle can quickly respond to the switching of the working state of the sentry mode and reduce delays.

[0069] It should be noted that in the prior art, after the sentinel module is in the on state, the sentinel 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 sentinel mode monitoring module at this time. That is, in this case, it is unnecessary for the vehicle to turn on the sentinel 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 switch of the sentinel mode of the vehicle is in the on state, the low power consumption state can be determined as the target working state of the sentinel mode, so that in this case, only the arming detection module of the sentinel mode is turned on, so that when the arming detection module detects that the vehicle triggers the arming signal, the on monitoring state is determined as the target working state of the sentinel mode to monitor the safety of the vehicle. It can be understood that when the vehicle's power is in a power-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 consumption state will be determined as the target working state of the sentry mode at this time.

[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 sentinel mode in the target working state, and different target tasks are used to instruct to turn on and / or turn off different sentinel mode function modules.

[0071] Among them, the state machine is an abstraction of the operating rules of real things and a mathematical model. The state machine can receive a series of inputs and, through internal processing, migrate its system state and generate certain outputs. For example, when the target working state of the sentinel mode is input into the state machine, the state machine can output the target task corresponding to the target working 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 may predefine a 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 may 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 sentinel 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 sentinel mode and the target task. Therefore, the waiting time of the vehicle can be reduced, 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 sentinel mode is switched to the on state, the vehicle will be controlled to execute all tasks corresponding to the on state at the same time (for example, when the sentinel mode is in the on state, the vehicle will be controlled to delay detection of the power state and initialize the monitoring module and the video recording module, etc.), so that multiple tasks are performed simultaneously, resulting in resource conflicts, thereby increasing the response time for switching the working state of the sentinel mode to the on state. It can be seen from the above embodiments that when the power of the vehicle is in the power-off state, the vehicle triggers the arming signal and the switch of the sentry mode of the vehicle 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 in sequence, so that the VCU can allocate resources more effectively to ensure that each target task can be completed under the best conditions, avoid resource conflicts caused by multiple target tasks being carried out simultaneously, so that the vehicle can quickly respond to the switching of the working state of the sentry mode 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 into the state machine through a configuration file or code.

[0077] In a possible implementation, developers can use enumeration types to define the mapping relationship between different target working states of the sentinel mode and target tasks, 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 sentinel mode is as follows: 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 the 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 the 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 the video recording module for initializing the sentinel mode, and turning on the monitoring module and the 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 the video recording module of the sentinel mode, and turning on the defense detection module of the sentinel mode, and the defense detection module is used to detect whether the vehicle triggers the defense signal.

[0079] The monitoring module is used to collect environmental data around the vehicle in real time 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 abnormal sounds in the vehicle, whether the windows or doors are damaged, etc.), so as to trigger corresponding response measures in the event of abnormalities, such as activating alarms, notifying users, 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 power supply stability of the vehicle. For the relevant description on the delay detection on the power supply stability of the vehicle, please refer to the above embodiment, which 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 (i.e., execute the task) when needed, thereby effectively reducing resource waste and reducing the energy consumption of the vehicle. In addition, when the sentinel 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 sentinel mode, and turning on the defense detection module of the sentinel mode. It can be understood that when the sentinel mode is in the low-power state, turning on the defense detection module of the sentinel mode can make the monitoring state on as the target working state of the sentinel mode when the defense detection module detects that the vehicle triggers the defense signal, thereby ensuring 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 sentinel mode monitoring module or video recording module fails, it indicates that the sentinel mode monitoring module or video recording module cannot work normally when the sentinel mode is in the open monitoring state, that is, it cannot normally determine whether the vehicle has an abnormal situation 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 sentinel 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 sentinel 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, controlling the vehicle to perform the target task.

[0086] Specifically, after determining the target task corresponding to the target working state based on the state machine, the VCU can 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 of the initialization sentinel mode, the VCU will control the vehicle to shut down the delay detection module and start the monitoring module and video recording module of the initialization sentinel mode.

[0088] In one possible implementation, the VCU may asynchronously control the vehicle to perform 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 the target task to be executed in parallel or concurrently without blocking the main thread, that is, in this programming mode, each task can be performed 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 describes in detail 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, and the task instruction includes a target task corresponding to the target working state, so that when the coroutine interface receives the task instruction, it 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, so that the state machine finally determines that the sentinel mode is in the target working state when it receives 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 the sentinel mode to the target working state to the coroutine interface through a message queue, so as to decouple the state machine and the coroutine interface. Specifically, the state machine can put the task instruction of switching the working state of the sentinel mode to the target working state into the 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, the callback function corresponding to the target working state can be directly called 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 detailed introduction in two steps on how the coroutine interface asynchronously controls the vehicle to perform the target task when it receives 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 sentinel 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 sentinel 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 sentinel mode's working state, and quickly determine the task that the vehicle needs to perform at the moment (i.e., the target task) based on the target working state of the sentinel mode, 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 sentinel mode function modules, in each target working state of the sentinel mode, the vehicle only needs to turn on some of the sentinel mode function modules indicated by the target task, without turning on other function modules of the sentinel 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. 1 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 when the vehicle is started, that is, when the vehicle system is started, a broadcast event corresponding to the completion of the vehicle startup will be generated, so that each application in the vehicle system can start the necessary initialization operation. Therefore, in order to reduce the delay time of the sentinel mode entering the working state, that is, to minimize the delay time of the sentinel mode entering the working state after the vehicle is started, in a possible implementation, 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 sentinel mode is directly controlled to enter the working state, thereby increasing the speed of the sentinel mode entering the working 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 the vehicle startup completion broadcast, after the vehicle completes startup, it can quickly determine that the vehicle has completed startup, thereby allowing the sentry mode to enter a 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, the sentry mode is controlled 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 (Application Programming Interface, API) or send a command to the sentry mode control unit to put the sentry mode into a working state.

[0110] Step 303, obtaining 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 the target task corresponding to the target working state based on the state machine.

[0113] Step 306, controlling the vehicle to perform the target task.

[0114] The specific implementation of steps 303 to 306 can be found in the above embodiments and will not be described again 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 device 400 includes:

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

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

[0119] The determination module 402 is further used 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 sentinel 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 status data of the vehicle includes the power status of the vehicle and the switch status of the sentry mode of the vehicle; 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 power of the vehicle is in the on state or the switch of the sentry mode of the vehicle is in the off state; or, when the power of the vehicle is in the off state and the switch of the sentry mode of the vehicle is in the off state, determine the off state as the target operating state of the sentry mode; when the power of the vehicle is in the off state and the switch of the sentry mode of the vehicle is in the on state, determine the on state as the target operating state of the sentry mode.

[0122] In one possible implementation, the status data of the vehicle 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 consumption state, and an on monitoring state; the determination module 402 is specifically used to determine the first pre-on state, the second pre-on state, and the on monitoring state as the target working states of the sentinel mode in sequence when the power supply of the vehicle is in a power-off state, the vehicle triggers an arming signal, and the switch of the sentinel mode of the vehicle is in an on state; 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 sentinel mode of the vehicle is in an on state, the on low power consumption state is determined as the target working state of the sentinel 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 sentinel mode is the off state, the target task corresponding to the target working state includes turning off the monitoring module and the 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 the 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 the video recording module for initializing the sentinel mode, and turning on the monitoring module and the 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 the video recording module of the sentinel mode, and turning on the defense detection module of the sentinel mode, and the defense detection module is used to detect whether the vehicle triggers the defense signal.

[0125] In a possible implementation, the control module 403 is specifically used to asynchronously control the vehicle to execute the target task based on the state machine and the 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 performs 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 sentinel mode to enter a 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 an executable program code, and the processor is used to call and execute the executable program code to execute a vehicle control method provided by an embodiment of the present application.

[0132] In this embodiment, the functional modules of the device can be divided according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0133] In the case of dividing each functional module according to each function, the device may also include a transceiver module, a creation module, and a calling 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, which 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 applied to a vehicle, the processing module may be used to control and manage the actions of the vehicle. The storage module may be used to support the vehicle in executing related program codes, etc.

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

[0137] In addition, the device provided in the embodiments of the present application may 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 embodiments.

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

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

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

[0141] Based on the description of the above implementation methods, technicians 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 assigned to 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 the present application, it should be understood that the disclosed devices and methods can be implemented based on other methods. 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, such as 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 contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A vehicle control method, characterized in that: The method comprises: Acquiring vehicle status data, wherein the vehicle status data is used to represent the current status of the vehicle; Determining a target operating state of a 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; Determine a target task corresponding to the target working state based on the state machine, wherein the target task is a task that enables 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; The vehicle is controlled to perform the target task.

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

3. The method according to claim 2, characterized in that The vehicle status data also includes whether the vehicle triggers an arming signal; the opening state includes at least one of a first pre-opening state, a second pre-opening state, an opening low power consumption state, and an opening monitoring state; 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, determining the on state as the target working state of the sentry mode includes: When the power supply of the vehicle is in a power-off state, the vehicle triggers the arming signal, and the switch of the sentry mode of the vehicle is in an on state, sequentially determining the first pre-on state, the second pre-on state, and the on-monitoring state as target working states of the sentry mode; When the power supply of the vehicle is in a power-off state, the vehicle does not trigger the arming signal, and the switch of the sentry mode of the vehicle is in an on state, the on-state of low power consumption is determined as a target working state of the sentry mode.

4. 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 the target task corresponding to the target working state based on the state machine 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.

5. The method according to claim 4, characterized in that In the case where the target working state of the sentinel mode is the 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 the case where the target working state is the first pre-on state, the target task corresponding to the first pre-on state includes starting a delay detection module of the sentinel mode, the delay detection module being used to perform delay detection on the power supply stability of the vehicle; In the case where the target working state is the second pre-starting state, the target task corresponding to the second pre-starting 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 sentinel mode, and turning on the defense detection module of the sentinel mode, and the defense detection module is used to detect whether the vehicle triggers the defense signal.

6. The method according to claim 1, characterized in that 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.

7. The method according to claim 6, 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; When 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 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.

8. The method according to claim 6, characterized in that When the coroutine interface receives the task instruction, asynchronously controlling the vehicle to execute the target task includes: When receiving the task instruction, the coroutine interface creates a coroutine task instance based on the task instruction, wherein 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 so that the vehicle executes the target task.

9. The method according to claim 1, characterized in that: Before acquiring the status data of the vehicle, the method further includes: receiving at least one broadcast event generated by the vehicle based on a preset receiving component; 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.

10. A vehicle, characterized in that: The vehicle comprises: A memory for storing executable program codes; A processor, 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 9.

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

  • Vehicle-mounted camera system control method, vehicle-mounted camera system and storage medium

    CN117615123A

  • Power supply assembly control method and device, equipment and medium

    CN118107499A

  • State diagnosis method, device, chip, system and medium for vehicle-mounted camera module

    CN118748714A