Task scheduling control method, device, equipment, vehicle and readable storage medium

CN122909064APending Publication Date: 2026-10-13CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611296529.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]本发明的目的之一在于提供一种任务调度控制方法,以解决现有技术中汽车域控制器在任务调度时由于任务延迟等因素导致域控制器发出的各帧报文出现冲突以及通信异常的问题;目的之二在于提供一种任务调度控制装置;目的之三在于提供一种电子设备,目的之四在于提供一种车辆;目的之五在于提供一种计算机可读存储介质

Benefits of technology

[0036](1)基于缓冲队列与总线发送状态检测,实时补偿调度延迟,解决汽车域控制器中因任务调度波动导致的总线通信异常问题,避免帧冲突与延迟累积。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122909064A_ABST
    Figure CN122909064A_ABST
Patent Text Reader

Abstract

The application relates to a task scheduling control method, device, equipment, vehicle and readable storage medium, which comprises the following steps: acquiring the bus transceiving state of a master node at a current time, the last frame message sending time of the master node and a to-be-sent message, wherein the bus transceiving state comprises an idle state and a busy state; if the time interval between the last frame message sending time and the current time is less than a target value and / or the bus transceiving state is the busy state, the to-be-sent message is stored in a buffer queue; when it is monitored that the bus transceiving state is switched from the busy state to the idle state at a next time and the time interval between the next time and the last frame message sending time is greater than or equal to the target value, a target message is selected from at least one message in the buffer queue and is sent to a slave node connected with the master node through a communication bus. The method can reasonably schedule subsequent messages when message sending is delayed, and frame conflict and message delay accumulation can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle communication technology, specifically to a task scheduling and control method, apparatus, device, vehicle, and readable storage medium. Background Technology

[0002] As automotive electronic and electrical architectures evolve towards integration and domain control, the automotive domain controller, as the core control unit, undertakes the integrated management function of multiple bus communication protocols. In the Local Interconnect Network (LIN) bus, the domain controller needs to schedule multiple LIN nodes to transmit and receive data at fixed intervals in order to realize the control and status monitoring of low-speed peripherals such as doors, windows, and lights.

[0003] However, the current task scheduling of domain controllers has periodic fluctuations, which can easily cause LIN communication to be affected by scheduling delays, resulting in problems such as frame conflicts and communication anomalies. Therefore, there is an urgent need for a scheduling method that can avoid the fluctuations in task scheduling. Summary of the Invention

[0004] One objective of this invention is to provide a task scheduling and control method to solve the problem of conflicts and communication anomalies in the frames of messages sent by the domain controller due to factors such as task delay during task scheduling in the prior art; a second objective is to provide a task scheduling and control device; a third objective is to provide an electronic device; a fourth objective is to provide a vehicle; and a fifth objective is to provide a computer-readable storage medium.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A task scheduling and control method, comprising:

[0007] Obtain the bus transmit / receive status of the master node at the current moment, the transmission time of the previous frame of the master node, and the messages to be sent. The bus transmit / receive status includes idle status and busy status.

[0008] If the time interval between the previous frame message transmission time and the current time is less than the target value and / or the bus transceiver status is the busy state, then the message to be sent is stored in the buffer queue.

[0009] When it is detected that the bus transmit / receive state changes from the busy state to the idle state in the next moment, and the time interval between the next moment and the time of sending the previous frame message is greater than or equal to the target value, a target message is selected from at least one message in the buffer queue and sent to the slave node connected to the master node through the communication bus.

[0010] Furthermore, it also includes:

[0011] After the target message is sent, check whether there are any remaining unsent messages in the buffer queue;

[0012] If there are any remaining unsent messages in the buffer queue, the expected sending time of each remaining message in the buffer queue is adjusted according to the sending time of the target message.

[0013] Based on the expected transmission time of each message, a new target message is selected from the remaining unsent messages and sent to the slave node.

[0014] Furthermore, it also includes: if there are remaining unsent messages in the buffer queue, and the master node receives a new message to be sent, then the new message is cached in the buffer queue.

[0015] Furthermore, it also includes:

[0016] If the time interval between the previous frame message sending time and the current time is greater than or equal to the target value, and the bus transceiver state is in the idle state, and there are remaining unsent messages in the buffer queue, then a new target message is selected from the remaining unsent messages and sent to the slave node.

[0017] If the time interval between the previous frame message transmission time and the current time is greater than or equal to the target value, and the bus transceiver state is in the idle state, and there are no remaining unsent messages in the buffer queue, then the message to be sent will be sent to the slave node.

[0018] Furthermore, the step of selecting a target message from at least one message in the buffer queue and sending it to a slave node connected to the master node via a communication bus includes:

[0019] Select the message that was first cached in the buffer queue from at least one message, and determine it as the target message;

[0020] Based on the message identifier and preset association relationship of the target message, determine the association configuration word associated with the target message;

[0021] Determine whether the value of the configuration bit in the associated configuration word matches the preset value;

[0022] If the value of the configuration bit matches the preset value, the target message is sent to the slave node corresponding to the configuration bit.

[0023] Furthermore, it also includes: if the value of the configuration bit does not match the preset value, then skip the transmission of the target message and select a new target message from at least one message in the buffer queue; and send the new target message to other slave nodes connected to the master node via the communication bus.

[0024] Furthermore, it also includes: if the target message does not have an associated configuration word, then the target message is sent to the slave node connected to the master node via a communication bus.

[0025] Furthermore, it also includes: obtaining the node identifier of each slave node; and associating each node identifier with at least one configuration bit in the associated configuration word.

[0026] Furthermore, it also includes: obtaining the transmission time interval between two adjacent historical messages that have been sent to the slave node; and adjusting the target value according to the transmission time interval.

[0027] Furthermore, the communication bus is a local area network bus.

[0028] A task scheduling and control device, comprising:

[0029] The acquisition module is used to acquire the bus transmission and reception status of the master node at the current moment, the transmission time of the previous frame of the master node, and the messages to be sent to the slave node. The bus transmission and reception status includes idle status and busy status. The master node communicates with the slave node through the communication bus.

[0030] The caching module is used to store the message to be sent into a buffer queue if the time interval between the sending time of the previous frame message and the current time is less than the target value and / or the bus transceiver status is the busy state.

[0031] The sending module is configured to select a target message from at least one message in the buffer queue and send it to the slave node when it detects that the bus transmit / receive status will change from the busy state to the idle state in the next moment, and the time interval between the next moment and the transmission time of the previous frame message is greater than or equal to the target value.

[0032] An electronic device includes: a memory and a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the method described above.

[0033] A vehicle includes a vehicle body and an electronic device disposed in the vehicle body as described above, the electronic device being used to perform the method described above.

[0034] A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described above.

[0035] The beneficial effects of this invention are:

[0036] (1) Based on buffer queue and bus transmission status detection, real-time compensation for scheduling delay is provided to solve the problem of bus communication abnormality caused by task scheduling fluctuation in the automotive domain controller and avoid frame conflict and delay accumulation.

[0037] (2) By dynamically controlling the activation status of each slave node under the bus through configuration words, the flexible configuration of the multi-model scheduling table can be realized, and the software can be adapted to the configuration requirements of multiple models. Attached Figure Description

[0038] Figure 1 A flowchart illustrating the task scheduling and control method provided in this application embodiment;

[0039] Figure 2 This is a schematic diagram of the message transmission determination process provided in the embodiments of this application;

[0040] Figure 3 This is a schematic diagram of the message sending process provided in an embodiment of this application;

[0041] Figure 4 A schematic diagram of a traditional scheduling table configuration;

[0042] Figure 5 The scheduling representation provided for the embodiments of this application;

[0043] Figure 6 This is a schematic diagram of task scheduling delay provided in an embodiment of this application;

[0044] Figure 7 A flowchart of scheduling delay compensation provided for embodiments of this application;

[0045] Figure 8 A schematic diagram of the task scheduling and control device provided in this application;

[0046] Figure 9 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0047] 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.

[0048] 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.

[0049] With the development of automotive electronics, automotive domain controllers are becoming increasingly complex and integrated. Domain controllers primarily handle the centralized management of the vehicle's low-speed network. The master node drives multiple slave nodes on the communication bus to transmit and receive data according to periodic tasks, enabling functions such as door, window, light, and status acquisition. The above communication system architecture mainly consists of the domain controller (master node), communication bus, multiple slave nodes, and a master-slave communication mechanism associated with the scheduling table.

[0050] In traditional technologies, master nodes often employ a master-slave scheduling method based on periodic tasks, triggering each slave node to exchange messages sequentially according to a preset scheduling table. The scheduling process typically relies on fixed time slots to arrange the sending order of each node, with the master node initiating the transmission of the next frame of messages in a predetermined order when each task cycle arrives.

[0051] The aforementioned scheduling method is highly sensitive to task execution timing. When system load changes or task execution time fluctuates, the actual interval between two adjacent scheduling sessions may deviate from expectations. The master node may enter the next scheduling session before the previous frame has been completed, easily leading to message overlap, frame collisions, and subsequent communication anomalies. If the master node is unaware that the bus is currently busy, delayed messages will continue to be postponed, causing a backlog that persists, resulting in decreased signal timeliness and, in severe cases, misjudgment of node loss. Furthermore, static scheduling tables typically reserve fixed time slots for all nodes. Nodes not installed in different vehicle models or configurations still occupy scheduling resources, preventing the effective use of idle time slots and reducing bus utilization. Modifying the scheduling table and adapting the software version for different vehicle models also increases development, integration, and maintenance costs, limiting the reuse of the same software across multiple vehicle configurations.

[0052] To address the aforementioned technical issues, this application provides a task scheduling and control method. This method associates the current bus transmission and reception status, the transmission time of the previous frame, and the messages to be sent. When the message transmission conditions are not met, messages are buffered to prevent the master node from triggering further transmissions when the bus is busy or the frame interval is insufficient. The domain controller, acting as the master node, is connected to multiple slave nodes via a communication bus, enabling status determination and scheduling adjustments within the existing master-slave architecture. After the bus transitions from busy to idle and the target time interval is met, messages are selected from the buffer and sent to the corresponding slave node. The scheduling process is changed from fixed-point triggering to a dynamic release method combining bus status and inter-frame time intervals, mitigating conflicts and latency accumulation caused by periodic fluctuations while maintaining stability in multi-node communication environments.

[0053] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0054] Figure 1 This is a flowchart illustrating the task scheduling and control method provided in an embodiment of this application. Figure 1 As shown, this task scheduling and control method can be implemented through the following steps:

[0055] Step 110: Obtain the master node's bus transmit / receive status at the current moment, the master node's previous frame transmission time, and pending messages. The bus transmit / receive status includes idle and busy states.

[0056] Step 120: If the time interval between the previous frame's transmission time and the current time is less than the target value and / or the bus transmit / receive status is busy, then store the message to be sent into the buffer queue.

[0057] Step 130: When it is detected that the bus transmit / receive status changes from busy to idle in the next moment, and the time interval between the next moment and the previous frame message transmission time is greater than or equal to the target value, select the target message from at least one message in the buffer queue and send it to the slave node connected to the master node through the communication bus.

[0058] In this embodiment, the master node connects to multiple slave nodes via a communication bus and undertakes message sending, status monitoring, and scheduling control functions. For example, the master node can be an automotive domain controller, which acts as the execution entity to perform the aforementioned method. The automotive domain controller's task scheduling employs periodic tasks to poll and schedule tasks of different periods to complete various functions. However, some uncontrollable factors can prevent task scheduling from being perfectly accurate as expected. A periodic task may contain multiple tasks, and the execution time of each task may vary under different circumstances. Through combination, this can lead to fluctuations in the overall periodic task, thus affecting bus communication scheduling.

[0059] In step 110 above, the current time corresponds to the time when the master node performs a scheduling judgment. This time can be the time when the periodic task arrives, or it can be the time when the master node triggers the processing after receiving a bus status change notification.

[0060] The bus transmit / receive status is used to characterize the current transmission and reception status of the master node on the communication bus. The idle status indicates that the master node is not currently occupying the bus and the bus meets the new transmission start conditions. The busy status indicates that the master node is transmitting or receiving, or the bus layer detects that the current frame has not yet ended.

[0061] For example, the master node can read the current bus status through the status register of the bus controller. When the transmit enable bit, receive busy flag bit, or frame processing flag bit is active, the bus transmit / receive status is determined to be busy. When none of the above flag bits are active and the bus controller does not detect frame transmission, the bus transmit / receive status is determined to be idle.

[0062] The previous frame message sending time is used to record the time point corresponding to the most recent actual message sent by the master node. This time point can be recorded as the time when the previous frame message started sending or the time when the previous frame message was sent. In this application, the timestamp of the previous frame message started sending is used so as to uniformly calculate the time interval between two adjacent sending starts.

[0063] The message to be sent is the message data generated by the current scheduled task but not yet sent through the communication bus. It may include message identifier, target slave node address, and data field content.

[0064] Regarding step 120 above, the target value is used to define the minimum time interval that the master node should satisfy between two consecutive transmissions. For example, this target value is matched with the frame length of the communication bus, the node response clock, and the system scheduling cycle.

[0065] In some implementations, the transmission time interval between two adjacent historical messages sent to the slave node can be obtained; the target value can be adjusted based on the transmission time interval.

[0066] In this embodiment, after the master node completes the transmission of historical messages, it records the transmission time interval between two adjacent historical messages that have been sent to the slave node, and inputs this time interval as a representation of the current communication rhythm into the target value adjustment logic.

[0067] By adjusting the target value, the transmission time of subsequent messages can be advanced or delayed. For example, if the transmission time of the previous message frame was originally time t... 01 If the initial target value is set to 10 milliseconds, then at the current time t... 01 Only when the time interval between the previous frame's transmission time and the current time is +10 milliseconds will the condition be met that the time interval between the previous frame's transmission time and the current time be equal to the target value (10 milliseconds). If the bus's transmit / receive state is idle at this time, then at the current time t... 01 The target message can only be sent after +10 milliseconds.

[0068] However, if the target value is adjusted to 9 milliseconds, then at t 01 If the bus is idle at +9 milliseconds, the target message can be sent. This is equivalent to sending the target message 1 millisecond earlier, so as to catch up with the fluctuating delay as soon as possible and thus achieve communication stability.

[0069] For example, when the acquired transmission time interval is greater than the preset benchmark value, the target value can be reduced accordingly; when the acquired transmission time interval is less than the preset benchmark value, the target value can be increased accordingly, so as to avoid the transmission of the later frame in two adjacent frames affecting the previous frame.

[0070] This implementation method improves the dynamic adaptability of the scheduling compensation strategy by adjusting the target value, reduces the probability of false compensation, and avoids frame conflicts or resource waste caused by fixed target values. Furthermore, dynamic target value adjustment can adapt to the scheduling needs of different vehicle models (e.g., high-load vehicles require more flexible scheduling intervals), further enhancing system flexibility.

[0071] In step 120 above, after obtaining the current time and the sending time of the previous frame, the master node calculates the time interval Δt, with the formula Δt = t. 当前 -t 上一帧 , where t 当前 The timestamp t represents the current moment. 上一帧 This represents the timestamp corresponding to the sending time of the previous message frame. When Δt is less than the target value, it indicates that the sending interval between the previous message frame and the current frame has not met the minimum time interval requirement.

[0072] In addition, when the bus transmit / receive status is busy, it means that even if the minimum time interval requirement is met, there is no condition to send a message immediately. The message to be sent will be buffered and written into the buffer queue. The buffer queue is used to temporarily store messages that cannot be sent immediately because the current sending conditions are not met.

[0073] In some implementations, the aforementioned buffer queue can be a First-In-First-Out (FIFO) queue, which allows the transmission order of each message to be adjusted according to the order in which each message is buffered into the buffer queue. That is, when the buffer queue contains messages A, B, and C, if message A was buffered into the FIFO queue first, then message A is sent first; if message C was buffered into the FIFO queue last, then message C is sent last.

[0074] In a new scheduling cycle, the master node may receive new messages to be sent. If not all messages in the FIFO queue have been sent, the new message will be cached in the FIFO queue, and then all messages in the FIFO queue will be sent out in the first-in-first-out order.

[0075] Regarding step 130 above, the next moment corresponds to the subsequent moment detected by the master node when it continues to monitor the bus transmit / receive status after completing the aforementioned buffering process. The master node continuously acquires changes in the bus transmit / receive status through polling or interruption. When the bus transmit / receive status switches from busy to idle, the master node records this status change event as a transmission detection opportunity and reads the system time again as the next moment. It then calculates the time interval Δt1 between the next moment and the transmission time of the previous frame, using the formula Δt1 = t 下一时刻 -t 上一帧 .

[0076] Specifically, when both the bus transmit / receive status and the time interval are satisfied, the master node can select a target message from at least one message in the buffer queue and initiate transmission. After transmission is completed, the master node updates the transmission time of the previous frame to the transmission start time of the current target message.

[0077] The task scheduling control method provided in this application creates a buffer queue to cache messages that are not sent out in time due to scheduling delays, and then continues to send the messages cached in the buffer queue under certain conditions. This can solve the communication anomaly problem caused by task scheduling fluctuations in the master node, avoid frame conflicts and delay accumulation, and ensure communication reliability.

[0078] In other embodiments, the buffer queue may cache multiple messages. After selecting one message as the target message and sending it, it is necessary to check whether there are any remaining unsent messages in the buffer queue. If there are any remaining unsent messages in the buffer queue, these remaining messages in the buffer queue should be sent first.

[0079] When sending these remaining messages, the expected sending time of each message in the buffer queue needs to be adjusted according to the sending time of the target message. Then, according to the expected sending time of each message, a new target message is selected from the remaining unsent messages in the buffer queue and sent to the slave node connected to the master node via the communication bus.

[0080] In this embodiment, when the master node sends a target message, the overall send / receive status will be in a busy state. At this time, if the master node receives a new message, it will also be cached in the buffer queue. When a new message is added to the buffer queue, or when a message in the buffer queue is selected as the target message and sent, the expected transmission time of the remaining messages in the buffer queue needs to be reassessed and adjusted.

[0081] For example, taking a buffer queue containing messages A, B, and C as an example, suppose the scheduling table was originally configured to send message A at time t0 and message B at t0+10 milliseconds. However, due to factors such as delay, message A cannot be sent at time t0 and is cached in the buffer list. It is not until t0+10 milliseconds that message A is retrieved from the buffer queue as the target message and sent. At this time, message B is also unable to be sent in time due to the delay of message A and is also cached in the buffer queue.

[0082] Therefore, after message A is sent, the expected sending time of message B needs to be adjusted (for example, to t0+20 milliseconds). Then, at t0+20 milliseconds, message B is selected from the buffer queue as the new target message and sent out.

[0083] In this embodiment of the application, after each target message is selected from the buffer queue and sent, if there are still multiple unsent messages in the buffer queue, the corresponding messages are retrieved one by one according to the adjusted expected sending time and the bus interface is driven to send them to the corresponding slave node until the buffer queue is cleared. This allows the messages that have been cached in the buffer queue to be released continuously after the target message is completed, maintaining the continuity of scheduling and ensuring stable output of bus communication.

[0084] Furthermore, in some embodiments, when there are still unsent messages in the buffer queue, the remaining messages in the buffer queue need to be sent first. During this process, if the master node receives a new message to be sent, it needs to cache the new message in the buffer queue and then wait to send it.

[0085] In this embodiment, if it is confirmed that there are still unsent messages in the buffer queue, the master node continues to listen for new message access requests. When the master node receives a new message to be sent, it does not send the new message directly, but writes it to the end of the buffer queue so that it waits for subsequent scheduling along with the existing messages in the queue.

[0086] When a new message is cached in the buffer queue, the master node records the timestamp, enqueue number, or sequence marker of the message's entry into the buffer queue. Upon completing the buffer queue organization, the master node reads the sequence marker corresponding to each message and reorders the messages according to their enqueue order, placing the first cached message at the front of the transmission sequence, with subsequent cached messages arranged sequentially at the back. If the buffer queue itself already stores messages in the cached order, the existing order is maintained and the messages are directly used for subsequent transmissions.

[0087] For example, new messages are appended to the end of the queue, ensuring that all messages are sent sequentially according to the order in which they are buffered. This sorting rule ensures that messages in the buffer queue have a defined order when transmission resumes, facilitating the master node to continuously release messages to be sent after the bus transitions from a busy state to an idle state.

[0088] For example, if the scheduling table specifies that message A needs to be sent before message B and message C needs to be sent after message B, and if messages A and B are cached in the buffer queue, after selecting message A as the target message and sending message A, message B in the buffer queue needs to be sent instead. The newly received message C needs to be cached in the buffer queue and sent after message B.

[0089] In practical applications, the enqueue number can be implemented using a monotonically increasing count value or a timestamp generated by the system clock. The former facilitates quick comparison, while the latter facilitates association with the message arrival time.

[0090] This embodiment continues to accept new messages arriving later even when the buffer queue is not empty, ensuring that new messages are not discarded or overwritten because previous messages have not been sent. When the master node is in an idle state on the bus and meets the sending conditions, it then retrieves messages from the buffer queue sequentially and sends them to the corresponding slave nodes. This maintains a consistent queuing relationship between new and existing messages, thereby preserving the integrity of communication data and the consistency of the sending order. Furthermore, this makes buffer management suitable for low-speed vehicle network scenarios with large load fluctuations.

[0091] Figure 2 This is a schematic diagram of the message transmission determination process provided in the embodiments of this application, such as... Figure 2 As shown, the steps include:

[0092] Step 210: If the time interval between the previous frame's transmission time and the current time is greater than or equal to the target value, and the bus's transmit / receive state is idle, and there are remaining unsent messages in the buffer queue, then select a new target message from the remaining unsent messages and send it to the slave node.

[0093] Step 220: If the time interval between the previous frame's transmission time and the current time is greater than or equal to the target value, and the bus's transmit / receive state is idle, and there are no remaining unsent messages in the buffer queue, then the message to be sent will be sent to the slave node.

[0094] In this embodiment, taking the vehicle domain controller as the master node, the communication management unit in the vehicle domain controller can read the sending time of the previous frame message and subtract the current system time value from it to obtain the time interval.

[0095] In addition, the vehicle domain controller can determine whether the bus transceiver of the vehicle domain controller is in an idle state by using the bus status register or the transceiver status feedback signal.

[0096] The master node begins sending messages only if the time interval is greater than or equal to the target value and the bus transceiver state is idle.

[0097] If there are any unsent messages in the buffer queue, those messages should be sent first. Even if new messages are generated during this process, they should be buffered in the buffer queue to ensure the continuity of message transmission throughout the communication process.

[0098] The master node will only send the current message to be sent to the slave node connected to it via the communication bus if there are no remaining unsent messages in the buffer queue.

[0099] The aforementioned messages may be related to door control, window control, lighting control, or status acquisition.

[0100] The target value can be configured based on the bus speed, message length, and scheduling cycle. In practical applications, this value can be given by calibration parameters, and this application does not limit it.

[0101] By adopting the embodiments of this application, the master node prioritizes selecting messages from the buffer queue for transmission when the time interval and idle state are met. This ensures that the transmission timing aligns with the real-time bus status, thereby maintaining a stable message exchange rhythm in the communication link, improving the timeliness of message delivery, avoiding confusion in message transmission order, and guaranteeing the continuity of message transmission. Moreover, for scenarios where domain controllers centrally manage the vehicle's low-speed network, this mechanism is compatible with the master-slave communication architecture and allows messages to be directly delivered to the corresponding slave nodes based on conditions.

[0102] Figure 3 This is a schematic diagram of the message transmission process provided in the embodiments of this application, such as... Figure 3 As shown, it includes the following steps:

[0103] Step 310: Select the message that was first cached in the buffer queue from at least one message and determine it as the target message;

[0104] Step 320: Determine the association configuration word associated with the target message based on the message identifier and preset association relationship of the target message;

[0105] Step 330: If the value of the configuration bit matches the preset value, then send the target message to the slave node corresponding to the configuration bit.

[0106] Continuing with the example of the automotive domain controller as the master node, slave nodes can be other controllers in the vehicle connected to the domain controller via a bus. As the integration level of automotive domain controllers increases, different vehicle models may have different configurations regarding the number of nodes connected to the bus. This leads to the problem of not being able to share a single software version, resulting in increased integration development workload and costs. Therefore, in this embodiment, configuration words are used to enable different node scheduling within a single software version, reducing development and integration costs.

[0107] The preset association relationship can be in the form of an association relationship table, which can be stored in the master node's memory. The table entries can be in the form of a correspondence between message identifier and configuration word address, configuration word value or configuration word offset, so that the master node can quickly locate the associated configuration word associated with the target message.

[0108] The master node further extracts the configuration bits from the associated configuration word and compares the value of the configuration bit with the preset value. When the two match, the master node determines that the slave node corresponding to the configuration bit exists, meets the sending requirements, and sends the target message to the corresponding slave node via the communication bus.

[0109] The associated configuration word can consist of one byte, two bytes, or more bytes. The configuration bits can be a single bit or a series of consecutive bits, used to indicate whether the slave node receiving the message is an invalid node.

[0110] For example, taking the configuration word as 0xFF, its corresponding binary number is 11111111. This binary number 11111111 has a total of 8 configuration bits, each of which (i.e., one configuration bit) corresponds to one slave node. That is, the master node is connected to a total of 8 slave nodes through the communication bus.

[0111] For example, if the preset value is 1, and the values ​​of the first to the eighth bits of the binary number 11111111 are all 1, this indicates that all nodes from node 1 to node 8 exist and are not invalid nodes.

[0112] Specifically, when a target message needs to be sent to a slave node (e.g., slave node 1), the master node will only initiate the message sending operation if slave node 1 is not an invalid node.

[0113] Additionally, if the configuration word is 0x80, its corresponding binary number is 10000000. This indicates that only the first slave node 1 is not an invalid node, while slave nodes 2 through 8 are all invalid nodes. By adjusting the value of the configuration word, the problem of different vehicle models having different configurations for the number of bus-connected nodes, which prevents them from sharing a single software version and leads to increased workload and costs in integration development, can be solved.

[0114] Furthermore, in some implementations, taking a preset value of 1 as an example, if the value of the configuration bit does not match the preset value, the transmission of the target message is skipped, and a new target message is selected from at least one message in the buffer queue; then the new target message is sent to other slave nodes connected to the master node via the communication bus.

[0115] In this embodiment, taking the configuration word 0x80 mentioned above as an example, its corresponding binary number is 10000000. This means that only the first slave node 1 is not an invalid node, while slave nodes 2 to 8 are all invalid nodes. That is, the values ​​of the second configuration bit to the eighth configuration bit do not match the preset value 1.

[0116] If the target message needs to be sent to any of the slave nodes from node 2 to node 8, the master node will not execute the target message sending operation. Instead, it will skip the target message and continue to select a new target message from at least one message in the buffer queue. This is because an invalid node requires a time slot in the scheduling table. If the target message is sent to an invalid slave node, 10 milliseconds are wasted for each invalid node in a 10-millisecond scheduling cycle, which will reduce the timeliness of the signal.

[0117] Furthermore, in actual development, invalid nodes may fail to reply with data to the master node, affecting task scheduling in the next cycle and causing communication anomalies. Therefore, it is necessary to identify which slave nodes are invalid nodes through configuration bits and skip sending messages to invalid nodes. This avoids both the message sending time of invalid nodes and communication anomalies.

[0118] Specifically, in some implementations, the node identifier of each slave node can be obtained; then each node identifier is associated with at least one configuration bit in the associated configuration word.

[0119] In this embodiment, the node identifier (e.g., node ID) corresponding to each node is associated with a certain configuration bit of a certain configuration word, and the message identifier (e.g., message ID) is associated with the configuration word in the program code.

[0120] Taking the vehicle domain controller as the master node as an example, during scheduling, the associated configuration word of the current slave node is read. If there is no associated configuration word, the slave node is considered to exist. If there is an associated configuration word, it is determined whether the configuration bit corresponding to the configuration word is 1. If it is 0, the message is sent to the slave node normally. If it is 1, it means that the slave node is an invalid node, and the process jumps directly to the next slave node. At the same time, the next slave node also needs to check the associated configuration word.

[0121] Figure 4 A schematic diagram of a traditional scheduling table configuration, such as... Figure 4 As shown, different vehicle models have different configurations for the number of bus-connected nodes. To achieve different combinations of nodes, multiple scheduling tables need to be configured. As the project develops, new scheduling tables may appear, which will frequently change the protocol. Even worse, each node may correspond to different optional configurations, which will generate even more scheduling tables. This is not software-friendly and cannot be done with a single version of the software.

[0122] For example, Figure 5 The scheduling representation provided for the embodiments of this application is as follows: Figure 5 As shown, the scheduling table contains all slave nodes. Taking 8 slave nodes as an example, the invalid nodes can be identified by a configuration word 0xFF.

[0123] In this configuration word 0xFF, the values ​​of bits 0-7 indicate whether slave nodes 1-8 exist. For example, bit 0 being 1 indicates that slave node 1 exists. If the configuration word is updated to 0x55, it corresponds to the above. Figure 4 In scheduling table 1, it is indicated that slave nodes 2, 4, 6, and 8 are all invalid nodes. If the configuration word is 0xAA, then... Figure 4 The scheduling table 2 shows that slave node 1, slave node 3, slave node 5 and slave node 7 are all invalid nodes.

[0124] Based on the above introduction, when a vehicle leaves the production line, the configuration word is configured according to the actual hardware configuration of the vehicle, so that different configurations can use the same version of controller software.

[0125] This implementation associates the node identifier of each slave node with a configuration bit in the configuration word. The value of this configuration bit indicates whether the slave node is invalid, enabling the master node to manage all slave nodes uniformly without changing the basic communication architecture. This allows slave nodes of different vehicle models or configurations to be adjusted via configuration bits without requiring extensive changes to the underlying message control logic, thereby improving the consistency and adaptability of scheduling configurations.

[0126] In addition, in some embodiments, if the target message does not have an associated configuration word, the target message is sent to the slave node connected to the master node via a communication bus.

[0127] In this embodiment, after determining the target message, the master node can perform a search based on the message identifier of the target message and the preset association relationship. When the search result does not contain the associated configuration word corresponding to the target message, it means that the target message is not constrained by this type of configuration word. At this time, the master node does not need to continue to perform configuration bit matching judgment, but directly sends the target message to the slave node connected to the master node through the communication bus.

[0128] The slave node can be a vehicle body control related node. The master node can encapsulate the target message into a corresponding bus frame through the bus controller and send it down to ensure that the message can still maintain a normal communication link when no associated information is configured.

[0129] In this implementation, when a message lacks an associated configuration word, the master node sends the message directly, omitting the configuration bit reading and matching process and improving message sending efficiency. Furthermore, for vehicle networks with different vehicle configurations, direct forwarding of messages without associated configuration words can be achieved without changing the existing master-slave communication architecture, ensuring the continuity of the communication link and the integrity of message scheduling.

[0130] The above description of configuration words, through implementation methods or examples, demonstrates how flexibly configuring whether a slave node is an invalid node improves software reusability and avoids invalid nodes affecting scheduling cycles and communication (an invalid node occupies a time slot in the scheduling table; with a 10-millisecond scheduling cycle, each invalid node wastes 10 milliseconds, leading to reduced signal timeliness). Furthermore, in actual development, the lack of data response from invalid nodes can cause communication anomalies in subsequent nodes, and there's also a probability of node loss leading to communication failures. Flexible configuration of whether a node is invalid via configuration words allows for flexible configuration changes without protocol modifications, enabling software sharing across different vehicle configurations, reducing costs, and resolving the aforementioned problems encountered in actual development.

[0131] In some implementations, the aforementioned communication bus can be a Local Interconnect Network (LIN). Because LIN communication baud rates are usually relatively low, taking 19200 bits per second as an example, sending an 8-byte LIN message theoretically takes about 7 milliseconds. However, due to various factors, the time may be longer. Periodic task scheduling is based on a 10-millisecond cycle. When facing periodic fluctuations such that the time interval between two consecutive scheduling sessions is less than 10 milliseconds, or even less than 7 milliseconds in more severe cases, a new message frame may be sent to the bus before the previous frame has been completely sent, causing a conflict that affects the previous message frame. The main manifestation of this is that there may be false alarms of node loss, leading to communication abnormalities between the master node and the slave node.

[0132] For example, Figure 6 This is a schematic diagram of task scheduling delay provided in an embodiment of this application, such as... Figure 6 As shown, the second scheduling is delayed by 3 milliseconds for some reason. If normal scheduling continues, the time interval between the second and third scheduling will be 7 milliseconds, which may cause the third scheduling data transmission to affect the second scheduling. However, if the second scheduling is skipped, the entire communication process will be delayed by one cycle.

[0133] Based on this, this implementation provides a LIN scheduling delay compensation method to solve the problem of LIN communication abnormalities caused by the fluctuation of periodic task scheduling in the automotive domain controller. By using delay compensation scheduling, this situation can be effectively avoided without affecting the timeliness of the signal. Figure 7 The flowchart for scheduling delay compensation provided in the embodiments of this application is as follows: Figure 7 As shown, it includes the following steps:

[0134] Step 710: Determine if the LIN transmit / receive status is busy and if the scheduling time interval meets the frame interval. The frame interval can refer to the target value mentioned above.

[0135] Step 720: Determine if the FIFO queue is empty.

[0136] Step 730: Send the message normally.

[0137] Step 740: Send messages in the FIFO queue first.

[0138] Step 750: Cache the FIFO queue.

[0139] Step 760: Enter 1-millisecond task polling.

[0140] Traditional protocol stacks do not handle the steps of determining whether LIN transmission and reception is busy or whether the scheduling time interval meets the LIN frame interval. Even if they do handle it, scheduling can only wait until the next cycle, which will cause the node to be delayed by one cycle. If there are frequent fluctuations, the delay will continue to accumulate.

[0141] In this embodiment, a FIFO queue is provided to buffer packets that cannot be scheduled normally. For example, if the interval between two consecutive scheduling attempts is less than 7 milliseconds, the packet is considered to be unable to be scheduled normally. Alternatively, if the status returned by the LIN driver indicates that the packet is still in the process of sending and receiving the previous frame and is in a busy state, the packet can also be considered to be unable to be scheduled normally.

[0142] Each time the LIN message sending interface is scheduled, a timestamp is recorded and the difference between the timestamp and the previously recorded timestamp is calculated. If the time difference is less than the target value, the message is not sent immediately, but the message to be sent is placed in the FIFO buffer and scheduled again when the subsequent conditions are met. At the same time, the status returned by the LIN driver needs to be obtained to ensure that the current status is in an idle state. If it is not in an idle state, it means that the previous frame of message transmission and reception has not ended. Both of the above conditions need to be met at the same time.

[0143] After both of the above conditions are met, the scheduling cycle first checks if there is a message buffer in the FIFO. If there is a message buffer in the FIFO, the messages in the FIFO are sent first to ensure the timing of the messages. Then, the message to be scheduled is buffered in the FIFO and waits to be processed and sent later. If there is no message buffer in the FIFO, and the LIN transmit and receive are not in a busy state and the frame interval of two consecutive LIN scheduling sessions meets the target value, then the message is sent normally.

[0144] This allows setting a 1-millisecond cycle for the task to poll the LIN's transmit and receive status and frame interval to see if they meet the target value. Once the transmission condition is met, the corresponding operation is executed to send the message buffered in the FIFO.

[0145] Alternatively, the same effect can be achieved by adding a LIN send completion callback function, which performs the LIN send / receive status check in the send callback, and then executes subsequent operations.

[0146] Because the LIN scheduling period of 10 milliseconds is longer than the LIN message transmission time of 7 milliseconds, the above strategy can utilize this time difference to make up for the fluctuating delay, thereby achieving the stability of LIN communication.

[0147] Figure 8 A schematic diagram of the task scheduling and control device provided in this application is shown below. Figure 8 As shown, the task scheduling control device 80 provided in this embodiment includes:

[0148] The acquisition module 801 is used to acquire the bus transmission and reception status of the master node at the current moment, the transmission time of the previous frame of the master node, and the messages to be sent to the slave node. The bus transmission and reception status includes idle status and busy status. The master node communicates with the slave node through the communication bus.

[0149] The caching module 802 is used to store the message to be sent into the buffer queue if the time interval between the sending time of the previous frame message and the current time is less than the target value and / or the bus transceiver status is busy.

[0150] The sending module 803 is used to select a target message from at least one message in the buffer queue and send it to the slave node when it detects that the bus transmit / receive status will change from busy to idle in the next moment, and the time interval between the next moment and the transmission time of the previous frame message is greater than or equal to the target value.

[0151] Optionally, the task scheduling control device further includes a time compensation module, used for:

[0152] After sending the target message, check if there are any remaining unsent messages in the buffer queue;

[0153] If there are remaining unsent messages in the buffer queue, the expected sending time of each remaining message in the buffer queue is adjusted according to the sending time of the target message.

[0154] Based on the expected transmission time of each message, a new target message is selected from the remaining unsent messages and sent to the slave node.

[0155] Optionally, the task scheduling and control device further includes a message detection module, which is used to cache the new message into the buffer queue if there are remaining unsent messages in the buffer queue and the master node receives a new message to be sent.

[0156] Optionally, the task scheduling control device further includes a condition determination module, used for:

[0157] If the time interval between the previous frame's transmission time and the current time is greater than or equal to the target value, and the bus's transmit / receive state is idle, and there are remaining unsent messages in the buffer queue, then a new target message is selected from the remaining unsent messages and sent to the slave node.

[0158] If the time interval between the previous message transmission time and the current time is greater than or equal to the target value, and the bus transmit / receive state is idle, and there are no remaining unsent messages in the buffer queue, then the message to be sent will be sent to the slave node.

[0159] Optionally, the sending module can be specifically used for:

[0160] Select the message that was first cached in the buffer queue from at least one message and determine it as the target message;

[0161] Based on the message identifier and preset association relationship of the target message, determine the association configuration word associated with the target message;

[0162] Determine whether the values ​​of the configuration bits in the associated configuration word match the preset values;

[0163] If the value of the configuration bit matches the preset value, the target message will be sent to the slave node corresponding to the configuration bit.

[0164] Optionally, the task scheduling control device further includes a matching detection module, used to: if the value of the configuration bit does not match the preset value, skip the transmission of the target message and select a new target message from at least one message in the buffer queue; and send the new target message to other slave nodes connected to the master node via the communication bus.

[0165] Optionally, the task scheduling control device further includes a configuration detection module, which sends the target message to the slave node connected to the master node via a communication bus if the target message does not have an associated configuration word.

[0166] Optionally, the task scheduling control device further includes a configuration module for obtaining the node identifier of each slave node and associating each node identifier with at least one configuration bit in the associated configuration word.

[0167] Optionally, the task scheduling control device further includes a target value adjustment module, used to obtain the transmission time interval between two adjacent historical messages sent to slave nodes; and adjust the target value according to the transmission time interval.

[0168] Optionally, the communication bus is a local area network bus.

[0169] The task scheduling and control device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0170] Figure 9 A schematic diagram of the structure of the electronic device provided in this application. Figure 9 As shown, the electronic device 90 provided in this embodiment includes at least one processor 901 and a memory 902. Optionally, the electronic device 90 also includes a communication component 903.

[0171] The processor 901, memory 902, and communication component 903 are connected via a bus.

[0172] In a specific implementation, at least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the above-described method.

[0173] The specific implementation process of the processor can be found in the above method embodiments, and its implementation principle and technical effect are similar, so it will not be repeated here.

[0174] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0175] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0176] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0177] This application also provides a vehicle, including a vehicle body and an electronic device disposed in the vehicle body, the electronic device being used to perform the above-described method.

[0178] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0179] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0180] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0181] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0182] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0183] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0184] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0185] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0186] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0187] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

[0188] The above embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention.

Claims

1. A task scheduling and control method, characterized in that, include: Obtain the bus transmit / receive status of the master node at the current moment, the transmission time of the previous frame of the master node, and the messages to be sent. The bus transmit / receive status includes idle status and busy status. If the time interval between the previous frame message transmission time and the current time is less than the target value and / or the bus transceiver status is the busy state, then the message to be sent is stored in the buffer queue. When it is detected that the bus transmit / receive state changes from the busy state to the idle state in the next moment, and the time interval between the next moment and the time of sending the previous frame message is greater than or equal to the target value, a target message is selected from at least one message in the buffer queue and sent to the slave node connected to the master node through the communication bus.

2. The method according to claim 1, characterized in that, Also includes: After the target message is sent, check whether there are any remaining unsent messages in the buffer queue; If there are any remaining unsent messages in the buffer queue, the expected sending time of each remaining message in the buffer queue is adjusted according to the sending time of the target message. Based on the expected transmission time of each message, a new target message is selected from the remaining unsent messages and sent to the slave node.

3. The method according to claim 1 or 2, characterized in that, Also includes: If there are remaining unsent messages in the buffer queue, and the master node receives a new message to be sent, then the new message is cached in the buffer queue.

4. The method according to claim 1, characterized in that, Also includes: If the time interval between the previous frame message sending time and the current time is greater than or equal to the target value, and the bus transceiver state is in the idle state, and there are remaining unsent messages in the buffer queue, then a new target message is selected from the remaining unsent messages and sent to the slave node. If the time interval between the previous frame message transmission time and the current time is greater than or equal to the target value, and the bus transceiver state is in the idle state, and there are no remaining unsent messages in the buffer queue, then the message to be sent will be sent to the slave node.

5. The method according to claim 1, characterized in that, The step of selecting a target message from at least one message in the buffer queue and sending it to a slave node connected to the master node via a communication bus includes: Select the message that was first cached in the buffer queue from at least one message, and determine it as the target message; Based on the message identifier and preset association relationship of the target message, determine the association configuration word associated with the target message; Determine whether the value of the configuration bit in the associated configuration word matches the preset value; If the value of the configuration bit matches the preset value, the target message is sent to the slave node corresponding to the configuration bit.

6. The method according to claim 5, characterized in that, Also includes: If the value of the configuration bit does not match the preset value, the transmission of the target message is skipped, and a new target message is selected from at least one message in the buffer queue. The new target message is sent to other slave nodes that are connected to the master node via the communication bus.

7. The method according to claim 5, characterized in that, Also includes: If the target message does not have an associated configuration word, the target message is sent to the slave node connected to the master node via the communication bus.

8. The method according to claim 5, characterized in that, Also includes: Get the node identifier of each slave node; Each node identifier is associated with at least one configuration bit in the associated configuration word.

9. The method according to any one of claims 1-8, characterized in that, Also includes: Obtain the transmission time interval between two adjacent historical messages that have been sent to the slave node; The target value is adjusted according to the transmission time interval.

10. The method according to any one of claims 1-8, characterized in that, The communication bus is a local area network bus.

11. A task scheduling and control device, characterized in that, include: The acquisition module is used to acquire the bus transmission and reception status of the master node at the current moment, the transmission time of the previous frame of the master node, and the messages to be sent to the slave node. The bus transmission and reception status includes idle status and busy status. The master node communicates with the slave node through the communication bus. The caching module is used to store the message to be sent into a buffer queue if the time interval between the sending time of the previous frame message and the current time is less than the target value and / or the bus transceiver status is the busy state. The sending module is configured to select a target message from at least one message in the buffer queue and send it to the slave node when it detects that the bus transmit / receive status will change from the busy state to the idle state in the next moment, and the time interval between the next moment and the transmission time of the previous frame message is greater than or equal to the target value.

12. An electronic device, characterized in that, include: Memory and processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-10.

13. A vehicle, characterized in that, The vehicle includes a vehicle body and an electronic device as described in claim 12 disposed in the vehicle body, the electronic device being used to perform the method as described in any one of claims 1-10.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-10.