A vehicle timing task execution method, device, equipment and storage medium
Patent Information
- Application Number
- CN202310298857.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-03-24
AI Technical Summary
但这样的车辆定时任务执行方式在车辆进行系统重启、系统断电,以及进行重启时丢失预约定时任务,出现定时失效的情况
[0015]本发明的有益效果:本发明中一种车辆定时任务执行方法、装置、设备及存储介质,通过获取预约定时任务,预约定时任务包括任务时刻和任务事件,将预约定时任务存储至本地数据库,并生成任务列表,任务列表包括任务时刻、任务事件,以及任务时刻和任务事件之间的任务关联关系,本地数据库设置在车端服务器中,遍历任务列表,从预约定时任务中得到任务时刻在预设时间范围内的目标定时任务,控制车辆执行所述目标定时任务的任务事件;本发明提出的技术方案,通过将预约定时任务存储至车端服务器中的本地数据库中,即便在系统重启、系统断电或进程重启的情况下都能通过检测本地数据库得到待执行的预约定时任务,从而有效避免了预约任务丢失或不能执行的情况的发生。
Smart Images

Figure CN116225661B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent vehicle technology, specifically to a method, apparatus, device, and storage medium for executing timed tasks in a vehicle. Background Technology
[0002] As the automotive market matures, the intelligence of in-vehicle central control systems is becoming increasingly sophisticated, in-vehicle applications are becoming more and more complex, the application scenarios are becoming more and more intricate, and customer experience is becoming increasingly important. Currently, there is a growing demand for appointment-based applications, and more and more problems are being exposed. Consumers are beginning to pay attention to and value these after-sales issues, and complaints are becoming more and more frequent. Therefore, the stability of the system is becoming increasingly important, especially the stability of the appointment-based scheduled task system.
[0003] Typically, scheduled tasks are stored in a pre-set database. Before each scheduled task is executed, the task time and task event are retrieved from the database, and then the corresponding task event is executed based on the task time. However, this method of executing scheduled tasks for vehicles can lead to the loss of scheduled tasks during system restarts, power outages, or other similar events, resulting in scheduling failures. Summary of the Invention
[0004] In view of the shortcomings of the prior art described above, the present invention provides a method, apparatus, device and storage medium for executing scheduled tasks for vehicles, so as to solve the technical problem that the scheduled tasks are lost and the timing fails when the vehicle is restarted, the system is powered off or restarted.
[0005] This invention provides a method for executing scheduled tasks in a vehicle. The method includes: acquiring a scheduled task, the scheduled task including a task time and a task event; storing the scheduled task in a local database and generating a task list, the task list including a task time, a task event, and a task association relationship between the task time and the task event, the local database being located in a vehicle-side server; traversing the task list to obtain a target scheduled task whose task time is within a preset time range from the scheduled tasks; and controlling the vehicle to execute the task event of the target scheduled task.
[0006] In one embodiment of the present invention, before obtaining the scheduled task, the method further includes: reading first task data from the vehicle-side memory and obtaining a local scheduled task based on the first task data, wherein the local scheduled task is obtained based on a local preset; receiving second task data from a remote mobile device and obtaining a remote scheduled task based on the second task data, wherein the remote mobile device has a connection relationship with the vehicle; and determining the local scheduled task and the remote scheduled task as the scheduled task.
[0007] In one embodiment of the present invention, traversing the task list to obtain target timed tasks whose task times fall within a preset time range from the scheduled timed tasks includes: when the vehicle is in operation, detecting the task times of each scheduled timed task based on a preset time period; determining the time range that is greater than or equal to the difference between the current time and half a preset time period, and less than the sum of the current time and half a preset time period, as the target time range; if the task time of a scheduled timed task falls within the target time range, then the scheduled timed task is determined as the target timed task.
[0008] In one embodiment of the present invention, traversing the task list to obtain target scheduled tasks whose task times fall within a preset time range from the scheduled tasks further includes: before the vehicle enters a hibernation state, detecting scheduled tasks in the task list whose task times fall within a preset first time range from the current time, and determining the detected scheduled tasks as target scheduled tasks; when the vehicle ends a hibernation state, detecting scheduled tasks in the task list whose task times fall within a preset second time range from the current time, and determining the detected scheduled tasks as target scheduled tasks; the sum of the length of the first preset time range and the length of the second preset time range is equal to the length of time from when the vehicle enters hibernation to when hibernation ends.
[0009] In one embodiment of the present invention, controlling a vehicle to execute the target task event includes: obtaining the task category of the target task, the task category including a single task that is executed only once and a cyclic task that needs to be executed multiple times; when the target task is a single task, controlling the vehicle to execute the single task, and deleting the target task from the task list after the task execution is completed; when the target task is a cyclic task, controlling the vehicle to execute the cyclic task, and deleting the cyclic task from the task list after the last task execution of the cyclic task is completed.
[0010] In one embodiment of the present invention, controlling a vehicle to execute the cyclic task includes: acquiring the cyclic task time and the task event of the cyclic task, wherein the cyclic task includes multiple cyclic task times; if any target cyclic task time is within a preset time range, controlling the vehicle to execute the task event of the cyclic task; when the target cyclic time is the last task time of the cyclic task, deleting the cyclic task from the task list after the cyclic task event is completed.
[0011] The present invention provides a vehicle timed task execution device, the device comprising: a task acquisition module for acquiring scheduled tasks, the scheduled tasks including task time and task events; a task storage module for storing the scheduled tasks in a local database and generating a task list, the task list including task time, task events, and task association relationships between task time and task events, the local database being located in a vehicle-side server; a task detection module for traversing the task list and obtaining target timed tasks whose task time falls within a preset time range from the scheduled tasks; and a task execution module for controlling the vehicle to execute the target task events.
[0012] In one embodiment of the present invention, the task detection module further includes a task push module, used to push the target task obtained by the task detection module to the task execution module, so that the task execution module controls the vehicle to execute the target task event.
[0013] The present invention provides an electronic device comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the vehicle timed task execution method as described above.
[0014] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer processor, causes the computer to perform the vehicle timed task execution method as described above.
[0015] The beneficial effects of this invention are as follows: This invention provides a method, apparatus, device, and storage medium for executing scheduled tasks in a vehicle. By acquiring scheduled tasks, which include task times and task events, and storing these tasks in a local database, a task list is generated. This task list includes task times, task events, and the task relationships between task times and task events. The local database is located on a vehicle-side server. The task list is traversed to obtain target scheduled tasks whose task times fall within a preset time range from the scheduled tasks. The vehicle is then controlled to execute the task events of the target scheduled tasks. The technical solution proposed in this invention, by storing scheduled tasks in a local database on the vehicle-side server, ensures that scheduled tasks to be executed can be obtained by detecting the local database even during system restarts, power outages, or process restarts, thereby effectively preventing the loss or inability to execute scheduled tasks.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0018] Figure 1 This is a schematic diagram illustrating the implementation environment of a vehicle timed task execution method, as shown in an exemplary embodiment of this application.
[0019] Figure 2 This is a step diagram illustrating a vehicle timed task execution method according to an exemplary embodiment of this application;
[0020] Figure 3(a) is a flowchart illustrating the acquisition of vehicle timed tasks in an exemplary embodiment of this application;
[0021] Figure 3(b) is a flowchart illustrating the acquisition of a vehicle timed task execution method in another exemplary embodiment of this application;
[0022] Figure 4 This is a flowchart illustrating the task data storage process in an exemplary embodiment of this application;
[0023] Figure 5 This is a flowchart illustrating a task data detection process, as shown in an exemplary embodiment of this application.
[0024] Figure 6 This is a flowchart illustrating the execution of a task, as shown in an exemplary embodiment of this application;
[0025] Figure 7 This is a full flowchart illustrating a vehicle timed task execution method according to an exemplary embodiment of this application;
[0026] Figure 8 This is a block diagram illustrating a vehicle timed task execution device according to an exemplary embodiment of this application;
[0027] Figure 9 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0028] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.
[0029] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0030] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0031] First, it's important to clarify that Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. TCP is designed to adapt to layered protocol hierarchies that support multiple network applications. Pairs of processes on host computers connected to different but interconnected computer networks rely on TCP for reliable communication services.
[0032] Redis (Remote Dictionary Server) is an open-source, ANSI C-written, network-enabled, in-memory or persistent, log-structured, key-value database that provides APIs for multiple languages.
[0033] Figure 1 This is a schematic diagram illustrating the implementation environment of a vehicle timed task execution, as shown in an exemplary embodiment of this application.
[0034] like Figure 1As shown, the implementation environment for executing vehicle-timed tasks includes a mobile device 102 and an intelligent vehicle 102. The mobile device 101 can be any mobile device, such as a smartphone or tablet, with programmatic content installed that enables connection between the mobile device and the intelligent vehicle. The intelligent vehicle 102 can be any intelligent vehicle equipped with an intelligent control module. Those skilled in the art can set scheduled tasks using the mobile device 101 or the intelligent vehicle 102, store and detect these scheduled tasks using the intelligent vehicle 102, and control the intelligent vehicle 102 to execute the scheduled task when a scheduled task within a preset time range is detected.
[0035] Figure 2 This is a step diagram illustrating a vehicle timed task execution method according to an exemplary embodiment of this application.
[0036] like Figure 2 As shown, in an exemplary embodiment, the vehicle timed task execution method includes at least steps S210 to S240, which are described in detail below:
[0037] Step S210: Obtain the scheduled task. The scheduled task includes the task time and task event.
[0038] Before obtaining the scheduled task, the process also includes: reading the first task data from the vehicle's memory and obtaining the local scheduled task based on the first task data, wherein the local scheduled task is obtained based on local presets; receiving the second task data sent by the remote mobile device and obtaining the remote scheduled task based on the second task data, wherein there is a connection between the remote mobile device and the vehicle; and determining the local scheduled task and the remote scheduled task as the scheduled task.
[0039] Figure 3(a) is a flowchart illustrating the acquisition of vehicle scheduled tasks in an exemplary embodiment of this application. As shown in Figure 3(a), a local scheduled task is first set up locally in the vehicle to obtain local message data; then, the scheduled task data (i.e., local scheduled task data) is obtained by parsing the local message data.
[0040] In one embodiment of the present invention, the user inputs a scheduled task at the vehicle central control center. The vehicle central control center converts the received scheduled task into message data and stores it locally. Then, it obtains the scheduled task data by reading the local message data and obtains the task time and task event of the scheduled task (i.e., the local scheduled task) by parsing the scheduled task data.
[0041] Figure 3(b) is a flowchart illustrating the acquisition process of a vehicle timed task execution method according to another exemplary embodiment of this application. As shown in Figure 3(b), a remote scheduled task is first set up through a remote mobile device connected to the vehicle, and TCP data is obtained. Then, the timed task data is obtained by parsing the TCP data, thereby obtaining the task time and task event of the timed task (remote timed task). It should be understood that the remote mobile device involved here includes, but is not limited to, any mobile device with programmatic content that connects the mobile device and the intelligent vehicle, such as smartphones and tablets. This invention does not impose any limitations on this.
[0042] Step S220: Store the scheduled tasks in the local database and generate a task list. The task list includes task time, task event, and task association relationship between task time and task event. The local database is set in the vehicle-side server.
[0043] Figure 4 This is a flowchart illustrating a task data storage process, as shown in an exemplary embodiment of this application. Figure 4 As shown, the scheduled task information is first obtained, then stored in the Redis (Remote DictionaryServer) database, and finally a database table is generated in the database. It should be understood that the database mentioned here is a local database, which is set on the vehicle-side server.
[0044] In one embodiment of the present invention, remote timed tasks and local timed tasks are first obtained to obtain scheduled timed task information, which includes multiple scheduled timed tasks, as well as the task time and task event of each scheduled timed task; then the obtained scheduled timed task information is written into the local database mounted on the vehicle, i.e., the Redis database; finally, the task list (database table) shown below is generated in the database.
[0045] Table 1
[0046] Task 1 Time 1 Event 1 Task 2 Time 2 Event 2 Task 2 Time 3 Event 3 Task 4 Time 4 Event 4 …… …… ……
[0047] It should be understood that scheduled tasks can be one-time tasks or recurring tasks, and a task can include one event or multiple events. Therefore, time 1 in the table above does not represent a single moment, but a set of moments that includes one or more different moments. Similarly, event 1 does not represent a single event, but a set of events that includes one or more different events.
[0048] Step S230: Traverse the task list and obtain the target scheduled tasks whose time is within the preset time range from the scheduled scheduled tasks.
[0049] Figure 5 This is a flowchart illustrating a task data detection process, as shown in an exemplary embodiment of this application. Figure 5 As shown, the system queries the generated task list and searches the Redis database for target tasks to be executed within a preset time range. If there are no scheduled tasks (target tasks to be executed) at present, the system queries the data again. If any target task to be executed is found, the obtained target task to be executed is sent to the task execution module.
[0050] In one embodiment of the present invention, traversing the task list to obtain target timed tasks whose task times fall within a preset time range from the scheduled timed tasks includes: when the vehicle is in operation, detecting the task times of each scheduled timed task based on a preset time period; determining the time range that is greater than or equal to the difference between the current time and half a preset time period, and less than the sum of the current time and half a preset time period, as the target time range; if the task time of a scheduled timed task falls within the target time range, then the scheduled timed task is determined as the target timed task.
[0051] In one embodiment of the present invention, taking periodic task detection with a period of 30 seconds as an example, and the current time as 3:05 PM as an example, task detection is performed at the current time to obtain task events whose task time is within the range of 3:04:45 PM to 3:05:15 PM. If there is a scheduled task to be executed within this time range, the scheduled task is identified as the target task and sent to the task execution module to control the vehicle to execute the task event of the target task. If there is no scheduled task to be executed within this time range, the tasks to be processed with task time between 3:05:15 PM and 3:05:45 PM are processed at 3:05:30 PM, and so on. It should be understood that since task detection is not performed every moment and there is a detection period, in order to avoid tasks whose task time is outside the task detection time being missed and thus not executed, a detection time is extended before and after the current time during each task detection, so that target tasks whose task time is between any two task detection times can be executed without being missed.
[0052] The process involves traversing the task list and obtaining target scheduled tasks whose time falls within a preset time range from the scheduled tasks. This also includes: before the vehicle enters hibernation, detecting scheduled tasks in the task list whose time falls within the current time and a preset first time range thereafter, and identifying the detected scheduled tasks as target scheduled tasks; when the vehicle exits hibernation, detecting scheduled tasks in the task list whose time falls within the current time and a preset second time range thereafter, and identifying the detected scheduled tasks as target scheduled tasks; the sum of the lengths of the first and second preset time ranges equals the length of time from when the vehicle enters hibernation to when it ends hibernation.
[0053] In one embodiment of the present invention, when the vehicle is not in a driving state, it will enter a dormant state for a long time to save energy, and will be woken up periodically after entering dormant state to execute a scheduled task. Taking a target vehicle that periodically enters dormant state and wakes up for 1 minute every 29 minutes of dormancy as an example: The target vehicle will enter dormant state at 17:30, be woken up at 17:59, and enter dormant state again at 18:00. The system checks whether there is a target task within the time range of 14 minutes before and after entering dormant state at 17:30, and 15 minutes after entering dormant state, i.e., whether there is a target task with a task time between 17:16 and 17:45. If so, the vehicle is controlled to execute the target task; otherwise, the vehicle is controlled to enter dormant state. Similarly, when the vehicle is woken up at 17:59, the system checks whether there is a target task with a task time between 14 minutes before and 15 minutes after the wake-up time. If so, the vehicle is controlled to execute the target task; otherwise, it remains awake for 1 minute before entering dormant state again. It should be understood that the above time is only an example, indicating that during the process of the vehicle entering hibernation and waking up, the tasks to be executed need to be detected before or after entering hibernation, so as to ensure that the target task in hibernation can be executed, without imposing any restrictions on the hibernation cycle or the detection time period set in this application.
[0054] Step S240: Control the vehicle to execute the target timed task event.
[0055] Figure 6 This is a flowchart illustrating the execution of a task, as shown in an exemplary embodiment of this application. Figure 6As shown, the system periodically detects scheduled tasks to be executed by the target vehicle. After detecting a task, it controls the vehicle to execute the task event of that task. Then, it determines the task category of the target task. If the target task is a single task, the task data of the target task is deleted from the local database after execution. If the target task is not a single task but a cyclic task, it determines whether the current execution is the last task of the cyclic task. If so, the task data of the target task is deleted from the local database after execution. If not, it enters the task detection loop again, waits for the next task execution time to be detected, and then executes the task event of the target task.
[0056] Controlling the vehicle to execute a target task event includes: obtaining the task category of the target task, which includes a single task that is executed only once and a cyclic task that needs to be executed multiple times; when the target task is a single task, controlling the vehicle to execute the single task and deleting the target task from the task list after the task is completed; when the target task is a cyclic task, controlling the vehicle to execute the cyclic task and deleting the cyclic task from the task list after the last task of the cyclic task is completed.
[0057] In one embodiment of the present invention, the car owner sets a scheduled task A as needed. According to the task settings, the scheduled task time is 18:30. The event of the target task is "to call a". According to the task tag, the task is determined to be a single task that is only executed once. Then, the vehicle is controlled to call a at 18:30. After the call is connected, the scheduled task is deleted from the task list.
[0058] Controlling the vehicle to execute a cyclic task includes: obtaining the cyclic task time and the cyclic task's task event; the cyclic task includes multiple cyclic task times; if any target cyclic task time is within a preset time range, then control the vehicle to execute the cyclic task's task event; when the target cyclic time is the last task time of the cyclic task, then delete the cyclic task from the task list after the cyclic task event is completed.
[0059] In one embodiment of the present invention, the car owner sets up a scheduled task B according to their needs. According to the task settings, the task time of the scheduled task is "8:00 AM from October 1st to 3rd", and the task event is "turn on the audio". According to the task tag, the scheduled task is a cyclical task with a task count of 3. The task is marked once after each task is completed, until the audio is turned on at 8:00 AM on October 3rd (i.e., after the last target task is completed), at which point the task data of the scheduled task is deleted from the database.
[0060] In one embodiment of the present invention, the car owner sets a scheduled task C according to his / her needs. According to the task settings, the task time of the scheduled task is "18:00 on a weekday" and the task event is "turn on the air conditioner". According to the task label, the scheduled task is a cyclic task. After each task is completed, it will enter the loop again and wait for the next task execution time.
[0061] Figure 7 This is a complete flowchart illustrating a vehicle timed task execution method according to an exemplary embodiment of this application. Figure 7 As shown, the scheduled task is first obtained through the cloud platform or local storage. Then, the scheduled task data is stored in the local database through the vehicle device. The scheduled task is then listed in the local database as a task to be executed within the current time range. Finally, after obtaining the scheduled task to be executed, the vehicle is controlled to execute the scheduled task event.
[0062] Figure 8 This is a block diagram illustrating a vehicle timed task execution device according to an exemplary embodiment of this application. The device can be applied to… Figure 1 The implementation environment shown is specifically configured in computer device 102. This device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.
[0063] like Figure 8 As shown, the exemplary vehicle timed task execution device includes: a task acquisition module 810, a task storage module 820, a task detection module 830, and a task execution module 840.
[0064] The system includes a task acquisition module 810 for acquiring scheduled tasks, which include task time and task events; a task storage module 820 for storing scheduled tasks in a local database and generating a task list, which includes task time, task events, and the task relationships between task time and task events, with the local database located on the vehicle-side server; a task detection module 830 for traversing the task list and obtaining target scheduled tasks whose task time falls within a preset time range from the scheduled tasks; and a task execution module 840 for controlling the vehicle to execute the target task events.
[0065] In one embodiment of the present invention, the task detection module further includes a task push module, which is used to push the target task obtained by the task detection module to the task execution module, so that the task execution module controls the vehicle to execute the target task event.
[0066] It should be noted that the vehicle timed task execution device and the vehicle timed task execution method provided in the above embodiments belong to the same concept. The specific methods of execution of each module and unit have been described in detail in the method embodiments and will not be repeated here. In practical applications, the vehicle timed task execution device provided in the above embodiments 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. The present invention does not limit this.
[0067] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the vehicle timed task execution method provided in the above embodiments.
[0068] Figure 9 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 9 The computer system 900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0069] like Figure 9 As shown, the computer system 900 includes a Central Processing Unit (CPU) 901, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 902 or loaded from storage portion 908 into Random Access Memory (RAM) 903, such as performing the methods described in the above embodiments. The RAM 903 also stores various programs and data required for system operation. The CPU 901, ROM 902, and RAM 903 are interconnected via a bus 904. An Input / Output (I / O) interface 905 is also connected to the bus 904.
[0070] The following components are connected to I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to I / O interface 905 as needed. Removable media 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 910 as needed so that computer programs read from them can be installed into storage section 908 as needed.
[0071] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 909, and / or installed from removable medium 911. When the computer program is executed by central processing unit (CPU) 901, it performs various functions defined in the system of this application.
[0072] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0073] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0074] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0075] Another aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a computer's processor, causes the computer to perform the vehicle timed task execution method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not incorporated into the electronic device.
[0076] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the vehicle timed task execution method provided in the various embodiments described above.
[0077] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for executing timed tasks for vehicles, characterized in that, The method includes: Obtain the scheduled task, which includes the task time and task event; The scheduled tasks are stored in a local database, and a task list is generated. The task list includes task time, task event, and task association relationship between task time and task event. The local database is set in the vehicle-side server. Traverse the task list to obtain the target timed tasks whose time is within a preset time range from the scheduled timed tasks; Specifically, when the vehicle is in operation, the task time of each scheduled task is detected based on a preset time period; the time range that is greater than or equal to the difference between the current time and half of the preset time period, and less than the sum of the current time and half of the preset time period, is determined as the target time range; if the task time of a scheduled task is within the target time range, then the scheduled task is determined as the target scheduled task. Before the vehicle enters hibernation mode, scheduled tasks in the task list that are within the current time and a preset first time range ahead are detected, and the detected scheduled tasks are identified as target scheduled tasks; when the vehicle exits hibernation mode, scheduled tasks in the task list that are within the current time and a preset second time range ahead are detected, and the detected scheduled tasks are identified as target scheduled tasks; the sum of the length of the first preset time range and the length of the second preset time range is equal to the length of time from when the vehicle enters hibernation to when hibernation ends; The task event that controls the vehicle to execute the target timed task.
2. The vehicle timed task execution method according to claim 1, characterized in that, Before obtaining the scheduled task, it also includes: Read the first task data from the vehicle-side memory and obtain a local timed task based on the first task data. The local timed task is obtained based on a local preset. The system receives second task data from a remote mobile device and obtains a remote timed task based on the second task data. The remote mobile device and the vehicle are connected. The local scheduled task and the remote scheduled task are designated as scheduled tasks.
3. The vehicle timed task execution method according to any one of claims 1-2, characterized in that, The task events that control the vehicle to execute the target timed task include: Obtain the task category of the target timed task, which includes single tasks that are executed only once and loop tasks that need to be executed multiple times; When the target timed task is a single task, control the vehicle to execute the single task, and delete the target timed task from the task list after the task is completed; When the target timed task is a cyclic task, the vehicle is controlled to execute the cyclic task, and after the last task of the cyclic task is completed, the cyclic task is deleted from the task list.
4. The vehicle timed task execution method according to claim 3, characterized in that, Controlling the vehicle to perform the cyclical task includes: Obtain the loop task time and the task event of the loop task, wherein the loop task includes multiple loop task times; If any target cyclic task is within a preset time range, then the vehicle is controlled to execute the task event of the cyclic task; When the target cycle time is the last task time of the cycle task, the cycle task will be removed from the task list after the cycle task event is completed.
5. A vehicle timed task execution device, characterized in that, The device includes: The task acquisition module is used to acquire scheduled tasks, which include task time and task events. The task storage module is used to store the scheduled tasks in a local database and generate a task list. The task list includes task time, task event, and task association relationship between task time and task event. The local database is set in the vehicle-side server. The task detection module is used to traverse the task list and obtain the target timed tasks whose time is within a preset time range from the scheduled timed tasks. Specifically, when the vehicle is in operation, the task time of each scheduled task is detected based on a preset time period; the time range that is greater than or equal to the difference between the current time and half of the preset time period, and less than the sum of the current time and half of the preset time period, is determined as the target time range; if the task time of a scheduled task is within the target time range, then the scheduled task is determined as the target scheduled task. Before the vehicle enters hibernation mode, scheduled tasks in the task list that are within the current time and a preset first time range ahead are detected, and the detected scheduled tasks are identified as target scheduled tasks; when the vehicle exits hibernation mode, scheduled tasks in the task list that are within the current time and a preset second time range ahead are detected, and the detected scheduled tasks are identified as target scheduled tasks; the sum of the length of the first preset time range and the length of the second preset time range is equal to the length of time from when the vehicle enters hibernation to when hibernation ends; The task execution module is used to control the vehicle to execute the target timed task.
6. The vehicle timed task execution device according to claim 5, characterized in that, The task detection module also includes: The task push module is used to push the target timed task obtained by the task detection module to the task execution module, so that the task execution module controls the vehicle to execute the target timed task event.
7. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the vehicle timed task execution method as described in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by the computer's processor, causes the computer to perform the vehicle timed task execution method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Timing-task processing method and device, storage medium and computer equipment
CN107748695A
Task scheduling method and device, electronic equipment and storage medium
CN115756805A