Communication method for vehicle, communication device for vehicle, vehicle, and storage medium
By acquiring the communication channel status before transmitting vehicle data and selecting an idle channel for data transmission, the functional delay and low efficiency caused by channel occupancy in vehicle communication are solved, achieving stable and efficient data transmission.
Patent Information
- Application Number
- CN202511819230.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-02-17
AI Technical Summary
In existing technologies, when vehicle data is transmitted, the occupation of communication channels causes delays in the response of other functional modules, service interruptions, and low transmission efficiency.
Before transmitting data, a request frame is actively sent to obtain the current status of each communication channel, an idle channel is selected for data transmission, and the channel status is confirmed through channel management frames and response frames to ensure that the selected channel is idle and initialized successfully.
It improves data transmission efficiency, reduces communication conflicts, ensures the stability and reliability of data transmission, and enhances the user experience.
Smart Images

Figure CN121547480A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle communication, and more specifically, to a vehicle communication method, a vehicle communication device, a vehicle, and a storage medium in the field of vehicle communication. Background Technology
[0002] As vehicles become increasingly intelligent, they integrate various functional modules. When performing functions or updating existing functions (such as multimedia data transmission, application downloads, and module firmware upgrades), extensive data interaction is required between different communication nodes, necessitating a stable and reliable in-vehicle communication mechanism. In existing technologies, data transmission in vehicles typically consumes a significant amount of bandwidth on the communication channel. When a functional module initiates data transmission, the communication channel may be continuously occupied for an extended period, preventing other functions that require the same channel from functioning properly, leading to issues such as delayed response times, service interruptions, and even functional malfunctions.
[0003] Therefore, improving data transmission efficiency is an urgent problem that needs to be solved. Summary of the Invention
[0004] This application provides a vehicle communication method, a vehicle communication device, a vehicle, and a storage medium, which can improve data transmission efficiency.
[0005] Firstly, a vehicle communication method is provided, the method comprising: In response to a transmission request for target communication data in the vehicle, a first request frame is sent to multiple communication channels. The first request frame is used to request the current status of each of the multiple communication channels and includes the identifiers of the multiple communication channels. A first response frame is received from the first request frame. The first response frame includes indication information, which is used to indicate the current status of each communication channel. Based on the current state of each communication channel, determine the target communication channel among multiple communication channels; Transmit target communication data on the target communication channel.
[0006] In the embodiments of this application, compared to the prior art which occupies all bandwidth when transmitting data, resulting in the inability to execute other functional instructions during data transmission and thus requiring the execution of functional instructions before data transmission, reducing data transmission efficiency, this solution actively sends a request frame before transmitting data. The request frame obtains the current status of multiple communication channels, and by confirming the status of each communication channel, selects a communication channel that can establish a connection, and transmits data through that channel. Therefore, this solution can utilize idle channels for data transmission while other functional instructions are executed on some communication channels, thereby improving data transmission efficiency.
[0007] In conjunction with the first aspect, in some possible implementations, the target communication channel among multiple communication channels is determined based on the current state of each communication channel, including: The communication channel that is currently in an idle state is designated as the first communication channel; Based on the first communication channel, determine the target communication channel.
[0008] In the embodiments of this application, after receiving the response frame of the first request frame, the current state of each communication channel can be obtained; the communication channel whose current state is idle is determined as the first communication channel, and the target communication channel for data transmission is determined based on the first communication channel. Compared with the prior art, which only sends connection request information when transmitting data and cannot obtain the current state of each communication channel, thus making it impossible to use it for data transmission when executing other function instructions, resulting in low communication efficiency, this solution can determine the communication channel whose current state is idle as the first communication channel and further determine the target communication channel based on the first communication channel, ensuring that communication data is transmitted on idle and available communication channels; through the above method, communication conflicts can be reduced, thereby improving the transmission efficiency of communication data.
[0009] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the communication method also includes: Send a second request frame to the first communication channel. The second request frame is used to request the first communication channel to be initialized. A second response frame is received from the second request frame, the second response frame including the initialization state of the first communication channel; Based on the first communication channel, the target communication channel is determined, including: The target communication channel is determined based on the first communication channel and the second response frame.
[0010] In the embodiments of this application, after determining the idle communication channel as the first communication channel, a second request frame is sent to the first communication channel to request its initialization, and a second response frame containing the initialization status is received. Finally, the target communication channel is determined based on the first communication channel and the second response frame. Compared with the prior art, which only sends connection request information during data transmission and cannot obtain the current status of each communication channel, thus making it impossible to use it to transmit data when executing other function instructions, resulting in low communication efficiency, this solution determines the target communication channel based on the first communication channel and the second response frame. Therefore, it can ensure that the selected target communication channel is not only in an idle state, but also in a successfully initialized and usable state. Through the above method, the reliability of target communication data transmission can be further improved, thereby improving the stability of data transmission.
[0011] In combination with the first aspect and the above implementation methods, in some possible implementation methods, determining the target communication channel based on the first communication channel and the second response frame includes: Based on the second response frame, a second communication channel is determined in the first communication channel. The second communication channel is used to represent the communication channel in the first communication channel whose initialization status is successful. The second communication channel is designated as the target communication channel.
[0012] In the embodiments of this application, a second communication channel is determined in the first communication channel based on the second response frame, so that only communication channels whose initialization state is successful are further selected. Compared with the prior art, which may lead to the selection of communication channels that fail to initialize and cannot perform data transmission normally because it is impossible to distinguish whether the initialization of an idle channel is successful, this solution determines the second communication channel that indicates successful initialization as the target communication channel, thus ensuring that the communication channel used to transmit the target communication data is not only in an idle state, but has also been successfully initialized. Through the above method, the accuracy of communication channel selection and the reliability of target communication data transmission can be further improved, thereby improving the overall data transmission efficiency.
[0013] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the communication method also includes: When a second request frame is sent to the first communication channel, a first timer is started. The first timer is used to monitor the initialization duration of the first communication channel. If the timing result of the first timer is greater than or equal to the first preset duration, the first fault information is sent. The first fault information is used to indicate that a fault exists when the first communication channel is initialized.
[0014] In the embodiments of this application, a first timer is started when a second request frame is sent to the first communication channel, and the initialization duration of the first communication channel is monitored based on the first timer. This allows for timely determination of whether the communication channel has completed initialization within a preset duration. Compared to the prior art, where the inability to distinguish whether the initialization of an idle channel is successful may lead to the selection of a communication channel that fails to initialize and cannot perform data transmission normally, this solution not only ensures that the communication channel ultimately used to transmit the target communication data is not only in an idle state but has also successfully completed initialization. Furthermore, it sends a first fault message when the timing result of the first timer exceeds a first preset duration to indicate an abnormal channel initialization. Therefore, it can promptly eliminate communication channels with initialization faults. Through the above method, it is possible to avoid selecting the wrong target communication channel, improve the timeliness of fault detection, and thus ensure the reliability of the data transmission process.
[0015] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the communication method also includes: When a first request frame is sent to multiple communication channels, a second timer is started. The second timer is used to monitor the response time of the first request frame. If the first response frame sent by the third communication channel among multiple communication channels is not received when the duration of the second timer is greater than or equal to the second preset duration, the second timer is restarted. The first request frame is sent again to the third communication channel.
[0016] In the embodiments of this application, a second timer is started when a first request frame is sent to multiple communication channels, and the response duration of the first request frame is monitored using the second timer. This allows for real-time determination of whether each communication channel returns a first response frame within a second preset duration. Since this scheme restarts the second timer and sends the first request frame to the third communication channel again when the timer exceeds the second preset duration and no first response frame is received from the third communication channel, it ensures that the first request frame is promptly resent in case of communication channel delays or packet loss, thereby ensuring the acquisition of the current status of each communication channel. Through the above method, the reliability of the first request frame transmission can be improved, thereby enabling the acquisition of the communication status of each communication channel, enhancing the stability of the target communication channel selection process, and improving data transmission efficiency.
[0017] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the communication method also includes: When the first request frame is sent to multiple communication channels, a third timer is started. The third timer is used to monitor the connection establishment time of multiple communication channels. If the timing duration of the third timer is greater than or equal to the third preset duration, and the first response frame sent by the fourth communication channel among multiple communication channels is not received, the second fault information is sent. The third preset duration is greater than the second preset duration. The second fault information is used to indicate that there is a connection failure in the fourth communication channel.
[0018] In the embodiments of this application, a third timer is started when a first request frame is sent to multiple communication channels, and the third timer is used to monitor the connection establishment time of each communication channel. It can determine whether the communication channel has successfully established a connection within a third preset time. Compared with the prior art, which lacks a connection establishment time monitoring mechanism, resulting in the inability to identify communication channels in a timely manner when the connection is abnormal, this solution sends a second fault information when the third timer reaches the third preset time and the first response frame sent by the fourth communication channel has not been received. This can accurately indicate that the fourth communication channel has a connection failure. Through the above method, a fault prompt can be issued in a timely manner when a connection failure occurs in the communication channel, improving the fault detection capability of the communication system, thereby ensuring the reliability of the selection of subsequent target communication channels and the communication data transmission process.
[0019] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the communication method also includes: In multiple communication channels, the indication information of the fifth communication channel is used to indicate that the fifth communication channel is in an idle state, and to determine that the current state of the fifth communication channel is an idle state. In multiple communication channels, the indication information of the fifth communication channel is used to indicate when the fifth communication channel is in an occupied state, and to determine the current state of the fifth communication channel as occupied. In multiple communication channels, the indication information of the fifth communication channel is used to determine the current state of the fifth communication channel as a fault state when the fifth communication channel is in a fault state.
[0020] In the embodiments of this application, the current state of the fifth communication channel is determined to be idle, occupied, or faulty based on the indication information of the fifth communication channel, which can accurately determine the state of each communication channel. Compared with the prior art, which only sends connection request information when transmitting data and cannot obtain the current state of each communication channel, thus making it impossible to use it to transmit data when executing other function instructions, resulting in low communication efficiency, this solution can accurately distinguish the state of the communication channel because it explicitly matches the three states corresponding to the indication information. Through the above method, the communication channel can be selected or processed based on the current state of the communication channel, improving the reliability of communication channel state management, thereby ensuring the stable operation of subsequent communication processes and improving the efficiency of data transmission.
[0021] Secondly, a vehicle communication device is provided, the communication device comprising: The sending module is used to send a first request frame to multiple communication channels in response to a transmission request for target communication data in the vehicle. The first request frame is used to request the current status of each communication channel among the multiple communication channels. The first request frame includes the identifiers of the multiple communication channels. The processing module is configured to receive a first response frame from a first request frame, the first response frame including indication information, the indication information being used to indicate the current state of each communication channel; determine a target communication channel among multiple communication channels based on the current state of each communication channel; and transmit target communication data on the target communication channel.
[0022] It should be understood that the extensions, limitations, explanations and descriptions of the relevant content in the first aspect above also apply to the same content in the second aspect.
[0023] Thirdly, a vehicle is provided, including a memory and a processor; the memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the vehicle to perform the vehicle communication method of the first aspect or any possible implementation thereof.
[0024] Fourthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to execute the vehicle communication method described in the first aspect or any possible implementation thereof.
[0025] Fifthly, a computer-readable storage medium is provided that stores computer program code, which, when executed on a computer, causes the computer to perform the vehicle communication method described in the first aspect or any possible implementation thereof. Attached Figure Description
[0026] Figure 1 This is a schematic diagram of the channel direction provided in an embodiment of this application; Figure 2 This is a schematic flowchart illustrating a vehicle communication method provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the state transition of a mode manager provided in an embodiment of this application; Figure 4 This is a schematic diagram of a channel state transition provided in an embodiment of this application; Figure 5 This is a schematic diagram of data transmission provided in an embodiment of this application; Figure 6 This is a schematic flowchart illustrating another vehicle communication method provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a vehicle communication device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application. Detailed Implementation
[0027] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0028] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0029] Before introducing the methods of the embodiments of this application, the technical terms that may be involved in the embodiments of this application will be explained first.
[0030] Communication channels, also known as data transmission channels, link channels, physical communication links, or logical communication links, are used to transmit communication data and control commands between vehicle controllers. For example, communication channels may include Controller Area Network (CAN) communication channels, Ethernet communication channels, and wireless communication channels.
[0031] Over-the-Air (OTA) technology, also known as remote wireless upgrade, online firmware update, or over-the-air programming, is used to remotely update the software, firmware, or application data of electronic control units in a vehicle via mobile communication networks or wireless local area networks. For example, a complete OTA upgrade process may include: downloading an encrypted upgrade package from a cloud server, performing integrity verification on the vehicle, entering secure flashing mode to update the program, and verifying the new version's functionality after a reboot.
[0032] Network Protocol Control Information (N_PCI): Also known as network layer control information or data transmission control codes, it is used in network layer protocols to identify and interpret the type of network protocol data units and control the transmission of multi-packet data. For example, N_PCI may include: control fields for identifying single frames, first frames, flow control frames, and consecutive frames, as well as channel management frames for managing connection states and response frames for acknowledgment responses, which are newly added in this invention.
[0033] As vehicles become increasingly intelligent, they integrate various functional modules. When performing functions or updating existing functions (such as multimedia data transmission, application downloads, and module firmware upgrades), extensive data interaction is required between different communication nodes, necessitating a stable and reliable in-vehicle communication mechanism. In existing technologies, data transmission in vehicles typically consumes a significant amount of bandwidth on the communication channel. When a functional module initiates data transmission, the communication channel may be continuously occupied for an extended period, preventing other functions that require the same channel from functioning properly, leading to issues such as delayed response times, service interruptions, and even functional malfunctions.
[0034] For example, vehicle controllers have many applications for dynamic headlight effects, such as headlight music rhythms and headlight animation effects. When updating headlight animation effects, the function is updated via OTA. An OTA upgrade requires users to remotely push the upgrade via wireless network, which generally takes a long time and consumes channel bandwidth. This means that while updating the animation effect, other function commands cannot be executed using the channel, affecting the user experience. Furthermore, traditional asynchronous communication methods suffer from low data transmission efficiency and poor real-time performance.
[0035] In view of this, this scheme actively sends a request frame before transmitting data, obtains the current status of multiple communication channels through the request frame, and selects the communication channel that can establish a connection by confirming the status of each communication channel. Data is then transmitted through the communication channel that can establish a connection. Therefore, this scheme can transmit data using idle channels while other function instructions are executed on some communication channels, thus improving the efficiency of data transmission.
[0036] In the embodiments of this application, a Channel Management Frame (CMF) and a Response Frame (RF) are added to N_PCI to control the message transmission protocol and message processing control flow. The CMF frame can be used to control the connection and disconnection of communication between two nodes, specifying the communication channel and direction of communication transmission through the CAN ID (i.e., CAN identifier). Multimedia CAN message transmission is completed by sending and receiving multimedia CAN communication data between the two nodes in packets. The RF frame controls the termination of communication between the two nodes.
[0037] For example, a CAN ID can include 11 bits, specifically composed of three parts: header information, channel direction (CD), and channel number, as shown in Table 1. The header information is typically used to identify whether the frame belongs to the multimedia CAN protocol or another protocol frame, and can also be used to distinguish the priority between different protocol frames. The header value can be set by the device manufacturer. Specifically, bits 8 to 10 correspond to the header information, bit 7 corresponds to the channel direction, and bits 0 to 6 correspond to the channel number.
[0038] Table 1
[0039] Optionally, the priority of frames of different protocols can be: CMF > RF > other N_PCI, that is, the priority of CMF is higher than the priority of RF, the priority of RF is higher than the priority of other N_PCI, and other N_PCI can include single frame (SF), first frame (FF), flow control frame (FC), and consecutive frame (CF).
[0040] Among them, such as Figure 1 As shown, the CD value can be used to indicate the transmission direction of a CAN frame in the channel between two nodes. In the channel, if the CD value of node 1 is 0, then node 1 always sends CAN frames with CD=0 and only receives CAN frames with the corresponding CANID CD=1. Node 2, on the other hand, always sends CAN frames with CD=1 and only receives CAN frames with the corresponding CAN identifier CD=0.
[0041] In addition, the channel number can be used to identify the various identifiers of the channel connecting two nodes, and the value of the channel number can be set by the equipment manufacturer.
[0042] The following is combined with Figure 2 A vehicle communication method provided in the embodiments of this application will be described in detail.
[0043] Figure 2 This is a schematic flowchart illustrating a vehicle communication method provided in an embodiment of this application. Figure 2 As shown, method 200 includes steps S210 to S240, which are described in detail below.
[0044] For example, Figure 2 The method 200 shown can be executed by a vehicle; or by a processor in the vehicle; or by a chip in the processor of the vehicle; or by a software platform integrated in an electronic device; or by a gateway in the vehicle.
[0045] S210, in response to a request to transmit target communication data in the vehicle, a first request frame is sent to multiple communication channels.
[0046] The first request frame is a CMF, which is a special communication frame defined in this application. It can be used to request the current status of each communication channel among multiple communication channels. The first request frame includes the identifiers of multiple communication channels.
[0047] In the embodiments of this application, before initiating actual data transmission, the node that needs to send data does not blindly send data directly to the receiving node on a certain channel, but sends a first request frame to multiple channels between nodes to obtain the current status of each communication channel.
[0048] For example, the Network Layer Protocol Data Unit (N_PDU) of a multimedia CAN frame consists of a Network Access Identifier (N_AI), an N_PCI, and Network Data (N_Data). Specifically, the format of the N_PDU can be as shown in Table 2. The data segment can consist of N_PCI and N_Data. N_PCI is used to identify the type of the frame. For SF, the first byte is used to indicate the SF identifier, and the second to eighth bytes are network data; for FF, the first and second bytes are used to indicate the FF identifier, and the third to eighth bytes are network data; for CF, the first byte is used to indicate the CF identifier, and the second to eighth bytes are network data; for FC, the first and third bytes are used to indicate the FC identifier, and the fourth to eighth bytes are network data; for RF, the first byte is used to indicate the RF identifier, and the second to eighth bytes are network data; for SF, the first byte is used to indicate the SF identifier, and the second to fourth bytes are network data.
[0049] Table 2
[0050] The identification method in N_PCI for different types of N_PDU is shown in Table 3. Among them, Byte1 of SF is 0000; Byte1 of FF is 0001; Byte1 of CF is 0010; Byte1 of FC is 0011; Byte1 of RF is 1110; and Byte1 of CMF is 1111.
[0051] Table 3
[0052] Specifically, the frame structure of CMF can be shown in Table 4. Its data field consists of 4 bytes: the high 4 bits of byte 1 are fixed at 1111 and serve as the N_PCI field to identify the CMF frame. Its low 4 bits, together with byte 2, form a 16-bit maximum receive data packet size field, used to negotiate communication parameters. Byte 3 is defined as the minimum inter-frame interval time, used to control the data flow rate. The highest 6 bits of byte 4 are reserved and fixed at 0, and its lowest 2 bits are defined as message control parameters (M_cmd), used to carry connection management commands such as TTC or TTD.
[0053] Table 4
[0054] The maximum data packet size can range from 6 bits to 4094 bits.
[0055] For example, the message command (M_cmd) can be represented by a 2-bit value. A node sends a CMF frame with M_cmd to other nodes via the CAN bus to indicate the node's status. For instance, a value of 01 for M_cmd indicates that the current node is in a Try to connect (TTC) state, meaning the current node intends to open the channel; a value of 10 for M_cmd indicates that the current node is in a Try to disconnect (TTD) state, meaning the current node is disconnecting from the opened channel.
[0056] It should be understood that when a data transmission requirement is detected, or when a channel connection request is detected, a CMF is sent to multiple communication channels, and the value of M_cmd in the CMF is 01.
[0057] Optionally, if the value of M_cmd in the CMF is used to represent neither TTC nor TTD, then the CMF is ignored.
[0058] Alternatively, in another embodiment, if the value of M_cmd in the CMF is not used to represent either TTC or TTD, then it is determined that the node currently sending the CMF is faulty, and the fault information is recorded.
[0059] For example, when a driver selects a new headlight animation on the vehicle's touchscreen and clicks update, the vehicle's host (source node) does not immediately begin transmitting the animation data file. The source node first broadcasts a first request frame (TTC CMF) to all preset logical channels leading to the left and right headlight controllers (e.g., channels 1 to 8).
[0060] In the embodiments of this application, after the vehicle is powered on, the Electronic Control Unit (ECU) begins initialization. After initialization is completed, it enters the active state, that is, the ECU enters a stable and ready working stage. In this state, the core functions and services of the ECU have been loaded and are in standby mode.
[0061] For example, after the vehicle is powered on, the ECU enters the Active state after initialization. In this state, the mode manager in the ECU can receive and recognize multimedia CAN protocol frame connection requests at the application layer. Upon receiving a multimedia CAN protocol frame connection request, the mode manager initiates a channel open request to all channel managers. Upon receiving the channel open request from the mode manager, the channel managers send TTC CMFs to each communication channel. Figure 3 As shown, after the mode manager 30 detects that the vehicle is powered on, it executes 301, at which point the ECU begins initialization; when the mode manager 30 detects a connection request, it executes 302, at which point it sends a channel opening request to all channel managers.
[0062] For example, when the channel manager receives a channel open request, it sends a TTC CMF to the communication channel.
[0063] It should be understood that after the channel manager sends TTC CMF to the channel, each communication channel enters the "connecting" state.
[0064] One implementation also includes: When the first request frame is sent to multiple communication channels, the second timer is started; If the first response frame sent by the third communication channel among multiple communication channels is not received when the duration of the second timer is greater than or equal to the second preset duration, the second timer is restarted. The first request frame is sent again to the third communication channel.
[0065] The second timer, also known as the CMF transmission timer, can be used to monitor the response time of the first request frame.
[0066] It should be noted that in the embodiments of this application, the first response frame and the second response frame are different from the response frame (RF) defined in N_PCI. The first response frame and the second response frame are used here to represent the response content to the sent first request frame. The first request frame can be CMF, and the first response frame and the second response frame can also be CMF in essence, rather than RF.
[0067] In the embodiments of this application, when the channel manager sends a first request frame to each channel, the timer corresponding to each channel starts to detect the response duration of the first request frame in that channel. It can detect that a certain channel (e.g., the third communication channel) fails to provide feedback within a preset time, thereby retransmitting the first request frame of that channel and re-detecting the response duration of the first request frame.
[0068] It should be understood that an independent second timer is maintained on each communication channel, or an independent response duration is recorded for each channel through a global timer.
[0069] For example, when an ECU requests to establish a connection with a certain communication node, it sends a first request frame to four communication channels (e.g., channel 1, channel 2, and channel 3). When the first request frame is sent, the second timer in channel 1, channel 2, and channel 3 starts counting. If a first response frame is received from channel 1 and channel 2 within a second preset duration (e.g., 500ms), but channel 3 does not respond, the second timer of channel 3 is restarted, and the first request frame is resent to channel 3.
[0070] For example, if the second timer expires while the communication channel is in the "connected" state, the channel manager restarts the second timer and sends the TTC CMF to the corresponding channel again.
[0071] For example, when the communication channel is in the "connected" state and receives a TTC CMF, the channel manager sends a channel open state transition indication to the application layer and sends a TTC CMF to the corresponding channel (the first communication channel). Then the corresponding channel enters the "open" state. If the second timer expires in the open state, the channel manager will restart the second timer and resend the TTC CMF to the corresponding channel.
[0072] In the above implementation, a second timer is started when a first request frame is sent to multiple communication channels, and the response time of the first request frame is monitored using the second timer. This allows for real-time determination of whether each communication channel returns a first response frame within a second preset time. Since this scheme restarts the second timer and sends the first request frame to the third communication channel again when the timer exceeds the second preset time and no first response frame is received from the third communication channel, it ensures that the first request frame is promptly resent in case of communication channel delays or packet loss, thereby ensuring the acquisition of the current status of each communication channel. Through the above method, the reliability of the first request frame transmission can be improved, thereby enabling the acquisition of the communication status of each communication channel, enhancing the stability of the target communication channel selection process, and improving data transmission efficiency.
[0073] One implementation also includes: When the first request frame is sent to multiple communication channels, the third timer is started; If the timing duration of the third timer is greater than or equal to the third preset duration, and the first response frame sent by the fourth communication channel among the multiple communication channels is not received, the second fault information is sent.
[0074] The third timer, also known as the channel initiation monitoring timer, is a monitoring timer defined in the embodiments of this application for determining whether the connection establishment time has expired. The third timer can be used to monitor the connection establishment time of multiple communication channels, and the third preset time is longer than the second preset time. The second fault information indicates that a connection failure exists on the fourth communication channel.
[0075] In the embodiments of this application, regardless of whether the retransmission mechanism of a single channel (i.e., retransmitting the first request frame based on the second timer) must be completed within the third preset duration defined by the third timer, if the timeout occurs, it is determined that there is a connection failure in the channel, and fault information is generated and reported.
[0076] It should be understood that an independent third timer is maintained on each communication channel, or an independent connection duration is recorded for each channel through a global timer.
[0077] For example, when an ECU requests to establish a connection with a communication node, it sends a first request frame to four communication channels (e.g., channel 1, channel 2, and channel 3). When the first request frame is sent, the second and third timers in channels 1, 2, and 3 all start timing. If a first response frame is received from channel 1 within a second preset duration (e.g., 500ms), but channels 2 and 3 do not respond, the second timers of channels 2 and 3 are restarted, and the first request frame is resent to channels 2 and 3. If a first response frame is received from channel 2 within a third preset duration (e.g., 10s), but channel 3 does not respond, a channel error indication is sent to the bus, and the node fault counter is incremented.
[0078] Optionally, when the first response frame of the first request frame is detected, the timing of the second and third timers is stopped.
[0079] Optionally, if the first response frame of the first request frame is not detected within the third preset time period, the first request frame is retransmitted, and the second and third timers are restarted.
[0080] For example, when the communication channel is in the "connected" state, if the third timer times out, the channel manager sends a channel error indication to the bus and increments the node fault counter.
[0081] For example, when the communication channel is in the "connected" state, upon receiving a TTC CMF or TTD CMF, the channel manager stops the third timer, sends a channel open state transition indication to the application layer, and sends a TTC CMF to the corresponding channel (the first communication channel), after which the corresponding channel enters the "open" state.
[0082] In the above implementation, a third timer is started when a first request frame is sent to multiple communication channels, and the third timer is used to monitor the connection establishment time of each communication channel. It can determine whether the communication channel has successfully established a connection within a third preset time. Compared with the prior art, which lacks a connection establishment time monitoring mechanism, resulting in the inability to identify communication channels in a timely manner when connection is abnormal, this solution sends a second fault information when the third timer reaches the third preset time and the first response frame sent by the fourth communication channel has not been received. This can accurately indicate that there is a connection failure in the fourth communication channel. Through the above method, a fault prompt can be issued in a timely manner when a connection failure occurs in the communication channel, improving the fault detection capability of the communication system, thereby ensuring the reliability of the selection of subsequent target communication channels and the communication data transmission process.
[0083] S220, Receive the first response frame of the first request frame.
[0084] The first response frame can be either TTC CMF or TTD CMF, and is used to respond to the first request frame (TTC CMF) sent by the sending node. The first response frame includes indication information, which is used to indicate the current status of each communication channel.
[0085] In the embodiments of this application, after sending the first request frame, the sending node waits for the response from the receiving node.
[0086] For example, when an ECU requests to establish a connection with a certain communication node, it sends a TTC CMF to four communication channels (e.g., channel 1, channel 2, and channel 3), and waits for the CMF returned by channel 1, channel 2, and channel 3 after sending the TTC CMF.
[0087] For example, the first response frame can be a CMF sent by the receiving node to the sending node, wherein the indication information can be M_cmd in the CMF, which is used to indicate whether the node wants to establish a connection.
[0088] One implementation also includes: In multiple communication channels, the indication information of the fifth communication channel is used to indicate that the fifth communication channel is in an idle state, and to determine that the current state of the fifth communication channel is an idle state. In multiple communication channels, the indication information of the fifth communication channel is used to indicate when the fifth communication channel is in an occupied state, and to determine the current state of the fifth communication channel as occupied. In multiple communication channels, the indication information of the fifth communication channel is used to determine the current state of the fifth communication channel as a fault state when the fifth communication channel is in a fault state.
[0089] The fifth communication channel is used to represent any one of the multiple communication channels between the sending node and the receiving node.
[0090] For example, after receiving the first response frame, based on the indication information in each first response frame, such as the M_cmd parameter in each CMF, if the value of the M_cmd parameter is 01, it is used to indicate that the corresponding channel is in an idle state, then it is determined that the corresponding channel is in an idle state, that is, a connection can be made; if the value of the M_cmd parameter is 10, it is used to indicate that the corresponding channel is in an occupied state, then it is determined that the corresponding channel is in an occupied state, and a connection cannot be made.
[0091] In one embodiment, if the value of the M_cmd parameter is 00 or 11, or if the value of the M_cmd parameter is missing, it is determined that the corresponding channel is faulty, and the current state of the channel is determined to be faulty.
[0092] In the above implementation, the current state of the fifth communication channel is determined as idle, occupied, or faulty based on the indication information, which can accurately determine the state of each communication channel. Compared with the prior art, which only sends connection request information during data transmission and cannot obtain the current state of each communication channel, thus making it impossible to use it for data transmission when executing other function instructions, resulting in low communication efficiency, this solution can accurately distinguish the state of the communication channel because it explicitly matches the three states corresponding to the indication information. Through the above method, the communication channel can be selected or processed based on the current state of the communication channel, improving the reliability of communication channel state management, thereby ensuring the stable operation of subsequent communication processes and improving data transmission efficiency.
[0093] S230. Based on the current state of each communication channel, determine the target communication channel among multiple communication channels.
[0094] The target communication channel is a communication channel selected from multiple communication channels for transmitting communication data.
[0095] In one implementation, the above method includes: The communication channel that is currently in an idle state is designated as the first communication channel; Based on the first communication channel, determine the target communication channel.
[0096] In the embodiments of this application, the channel in which the current state is idle, that is, the channel that can currently establish a communication connection with the sender of the first request frame, is determined as the first communication channel, and the target communication channel for data transmission is further determined based on the first communication channel.
[0097] In the above implementation, after receiving the first response frame of the first request frame, the current state of each communication channel can be obtained; the communication channel whose current state is idle is identified as the first communication channel, and the target communication channel for data transmission is determined based on the first communication channel. Compared with the prior art, which only sends connection request information during data transmission and cannot obtain the current state of each communication channel, thus preventing the transmission of data when executing other function instructions and resulting in low communication efficiency, this solution can identify the communication channel whose current state is idle as the first communication channel and further determine the target communication channel based on the first communication channel, ensuring that communication data is transmitted on idle and available communication channels; through the above method, communication conflicts can be reduced, thereby improving the transmission efficiency of communication data.
[0098] One implementation also includes: Send a second request frame to the first communication channel; Receive the second response frame of the second request frame; Based on the first communication channel, the target communication channel is determined, including: The target communication channel is determined based on the first communication channel and the second response frame.
[0099] The first communication channel refers to a suitable communication channel for data transmission selected based on the current state of each of the multiple communication channels. For example, it can represent a communication channel that is currently idle. The second request frame is used to request the first communication channel to be initialized. The second response frame includes the initialization status of the first communication channel.
[0100] In the embodiments of this application, after determining the first communication channel, the sending node sends a second request frame to the first communication channel. After sending the second request frame, it receives a second response frame of the second request frame to confirm the initialization state of the first communication channel. After receiving the second response frame, it determines the target communication channel.
[0101] For example, the sending node sends a first request frame (TTC CMF) to channels 1, 2, and 3. After receiving a first response frame from channels 1 and 2, it determines channels 1 and 2 as the first communication channels. The sending node then sends a second request frame (TTC CMF) to channels 1 and 2. After receiving the second request frame, channels 1 and 2 initialize themselves to prepare for establishing a communication connection, and after initialization, they send a second response frame to the sending node. If the sending node only receives the second response frame from channel 1 and does not receive the second response frame from channel 2, then channel 1 is determined as the target communication channel for data transmission.
[0102] In the above implementation, after identifying the idle communication channel as the first communication channel, a second request frame is sent to the first communication channel to request its initialization, and a second response frame containing the initialization status is received. Finally, the target communication channel is determined based on the first communication channel and the second response frame. Compared with the prior art, which only sends connection request information during data transmission and cannot obtain the current status of each communication channel, thus making it impossible to use it for data transmission when executing other function instructions, resulting in low communication efficiency, this solution determines the target communication channel based on the first communication channel and the second response frame. Therefore, it can ensure that the selected target communication channel is not only in an idle state, but also in a successfully initialized and usable state. Through the above method, the reliability of target communication data transmission can be further improved, thereby improving the stability of data transmission.
[0103] In one implementation, the above method includes: Based on the second response frame, the second communication channel is determined in the first communication channel; The second communication channel is designated as the target communication channel.
[0104] The second communication channel is used to represent the communication channel in the first communication channel whose initialization status is successful.
[0105] In one embodiment, after the sending node sends a second request frame to the first communication channel, the first communication channel is initialized. The channel in the first communication channel that has been successfully initialized sends a second response frame of the second request frame to the sending node. When the sending node receives the second response frame, it can determine the second communication channel corresponding to the second response frame according to the receiving path.
[0106] In another embodiment, after the sending node sends a second request frame to the first communication channel, the first communication channel is initialized. The channel in the first communication channel that has been successfully initialized sends a second response frame of the second request frame to the sending node. When the sending node receives the second response frame, the second response frame includes a channel identifier (e.g., a channel number), so the second communication channel can be determined based on the second response frame.
[0107] In another embodiment, after the sending node sends a second request frame to the first communication channel, the first communication channel is initialized. The channel in the first communication channel that has been successfully initialized sends a second response frame of the second request frame to the sending node. When the sending node receives the second response frame, the second response frame includes a channel identifier (e.g., channel number) and predefined parameters (e.g., M_cmd parameter). When the predefined parameters are used to indicate that the corresponding channel can be connected, the corresponding channel is determined to be the second communication channel, and the second communication channel is determined to have been successfully initialized.
[0108] In the above implementation, the second communication channel is determined from the first communication channel based on the second response frame, so that only communication channels whose initialization state is successful are further selected. Compared with the prior art, which may lead to the selection of communication channels that fail to initialize and cannot perform data transmission normally because it is impossible to distinguish whether the initialization of an idle channel is successful, this solution determines the second communication channel that indicates successful initialization as the target communication channel, thus ensuring that the communication channel used to transmit the target communication data is not only in an idle state, but has also been successfully initialized. Through the above method, the accuracy of communication channel selection and the reliability of target communication data transmission can be further improved, thereby improving the overall data transmission efficiency.
[0109] One implementation also includes: When the second request frame is sent to the first communication channel, the first timer is started; If the timing result of the first timer is greater than or equal to the first preset duration, the first fault information is sent.
[0110] The first timer, also known as the channel monitoring timer, is used to monitor the initialization duration of the first communication channel; the first fault information is used to indicate that a fault exists when the first communication channel is initialized.
[0111] In an embodiment of this application, after sending a second request frame to the first communication channel, a first timer is started. The first timer is used to monitor the completion time of the initialization process of the first communication channel. If no second response frame is fed back within a first preset time (e.g., 2s), it is determined that the first communication channel has a fault during initialization.
[0112] It should be understood that an independent second timer is maintained on each communication channel, or an independent response duration is recorded for each channel through a global timer.
[0113] Optionally, if no second response frame is received within the first preset time period, it is determined that the first communication channel has a fault during initialization, and the second request frame is resent to the first communication channel.
[0114] Optionally, if the second communication channel sends back a second response frame within a first preset time period, it is determined that the communication channel other than the second communication channel in the first communication channel has a fault during initialization, and the second request frame is resent to the communication channel other than the second communication channel in the first communication channel.
[0115] For example, a second request frame is sent to four communication channels (e.g., channel 1, channel 2, and channel 3). When the second request frame is sent, a first timer in channel 1, channel 2, and channel 3 starts counting. If a second response frame is received from channel 1 and channel 2 within a first preset duration (e.g., 2 seconds), but channel 3 does not respond, a status indication that channel 3 is off is sent to the application layer, and a channel 3 error indication is sent to the bus. The node fault counter is incremented by one.
[0116] For example, such as Figure 4As shown, after detecting vehicle power-on, the channel manager executes transition 401, at which point the channel manager completes initialization and enters the off state. When a channel open request is received in the off state, transition 402 is executed, the channel manager starts P1 and P3 timers, and sends a TTC CMF frame to the communication channel, entering the connected state. If the P1 timer times out in the connected state, transition 403 is executed, the P1 timer is restarted, and a TTC CMF frame is sent again. If the P3 timer times out in the connected state, transition 404 is executed, at which point a channel error indication is sent to the bus, and the node fault counter is incremented. If a TTC or TTD CMF frame is received in the connected state, transition 405 is executed, at which point the P3 timer is stopped, the P2 timer is started, and a channel open status indication is sent to the application layer, entering the open state. If the P2 timer times out in the open state, transition 406 is executed, at which point a channel close status indication is sent to the application layer, a channel error indication is sent to the bus, and the node fault counter is incremented. If the P1 timer times out in the open state, transition 407 is executed, at which point the P1 timer is restarted, and a TTC frame is sent again. CMF frames; if a TTC or TTD CMF frame is received while the system is enabled, conversion 408 is executed, and timer P2 is restarted.
[0117] In the above implementation, a first timer is started when a second request frame is sent to the first communication channel, and the initialization duration of the first communication channel is monitored based on the first timer. This allows for timely determination of whether the communication channel has completed initialization within a preset duration. Compared to existing technologies where the inability to distinguish between successful and unsuccessful initialization of idle channels may lead to the selection of communication channels that fail to initialize and cannot perform data transmission normally, this solution not only ensures that the communication channel ultimately used to transmit target communication data is not only in an idle state but has also successfully completed initialization. Furthermore, it sends a first fault message when the timing result of the first timer exceeds a first preset duration to indicate an abnormal channel initialization, thus enabling timely removal of communication channels with initialization faults. Through this method, the selection of the target communication channel can be avoided, the timeliness of fault detection can be improved, and the reliability of the data transmission process can be guaranteed.
[0118] S240. Transmit target communication data on the target communication channel.
[0119] In the embodiments of this application, after determining the target communication channel for data transmission, target communication data is transmitted on the target communication channel.
[0120] For example, target communication data (e.g., headlight animation data files) can be transmitted in multiple packets based on the ISO 15765-2 transport layer protocol. Figure 5As shown, the sending node splits the data into first frames and subsequent frames according to the specifications and sends them out. The receiving node (such as the headlight ECU) receives, parses, and reassembles the data. After successfully receiving the complete data, the headlight ECU stores it in its internal non-volatile memory or an external storage unit. When the ECU resets or is powered on again, its driver reads the latest data from the memory and synchronizes it to the application layer. Finally, the application layer calls this latest data to drive the headlights and achieve new animation effects.
[0121] In the above embodiments, compared to the prior art which occupies all bandwidth when transmitting data, resulting in the inability to execute other functional instructions during data transmission and thus requiring the execution of functional instructions before data transmission, reducing data transmission efficiency, this solution actively sends a request frame before data transmission. The request frame obtains the current status of multiple communication channels, and by confirming the status of each communication channel, selects a communication channel that can establish a connection, and transmits data through this channel. Therefore, this solution can utilize idle channels for data transmission while other functional instructions are executed on some communication channels, thereby improving data transmission efficiency.
[0122] The following is combined with Figure 6 Another vehicle communication method provided in the embodiments of this application will be described in detail.
[0123] Figure 6 This is a schematic flowchart illustrating another vehicle communication method provided in an embodiment of this application. Figure 6 As shown, method 600 includes S601 to S614, which are described in detail below.
[0124] For example, Figure 6 The method 600 shown can be executed by a vehicle; or by a processor in the vehicle; or by a chip in the processor of the vehicle; or by a software platform integrated in an electronic device; or by a gateway in the vehicle.
[0125] S601. When detecting the need to update the vehicle headlight animation, send the first request frame to multiple channels.
[0126] For example, when it is detected that the user clicks "Update welcome lighting effect" on the central control screen, a TTC CMF frame is broadcast to channels 1, 2, and 3 leading to the vehicle lighting ECU.
[0127] Alternatively, the implementation of S601 can be found in [reference needed]. Figure 2 The relevant descriptions in S210 will not be repeated here.
[0128] S602, Start the second and third timers.
[0129] For example, while sending the request frame, a second timer of 500ms (for monitoring single response timeout retry) and a third timer of 10 seconds (for monitoring the total timeout of the entire connection phase) are started.
[0130] Alternatively, the implementation of S602 can be found in [reference needed]. Figure 2 The relevant descriptions in S210 will not be repeated here.
[0131] S603. Determine whether the timing duration of the second timer is greater than or equal to 500ms; if yes, execute S604; if no, execute S605.
[0132] For example, determine whether the timing duration of the second timer is greater than or equal to 500ms; if the timing duration of the second timer is greater than or equal to 500ms, the waiting time for a response after the first request frame is sent is relatively long, and there may be packet loss. It is necessary to resend the first request frame and start timing again, and execute S604; if the timing duration of the second timer is less than 500ms, that is, the first response frame of the first request frame is received, then the first response frame is received and the target communication channel is further determined based on the first response frame, and execute S605.
[0133] Alternatively, the implementation of S603 can be found in [reference needed]. Figure 2 The relevant descriptions in S210 will not be repeated here.
[0134] S604, Restart the second timer and resend the first request frame.
[0135] For example, since no response is received within 500ms, the 500ms timer is restarted, and TTC CMF frames are sent to channels 1, 2, and 3 again.
[0136] Optionally, if channel 1 and channel 2 send TTC CMF within 500ms, but channel 3 does not send it, then the second timer corresponding to channel 3 is restarted, and TTC CMF is resent to channel 3.
[0137] Alternatively, the implementation of S604 can be found in [reference needed]. Figure 2 The relevant descriptions in S210 will not be repeated here.
[0138] S605, The first response frame of the first request frame is received.
[0139] For example, a response is received from the peer (e.g., multiple TTC CMFs).
[0140] Alternatively, the implementation of S605 can be found in [reference needed]. Figure 2 The relevant descriptions in S220 will not be repeated here.
[0141] S606. Determine whether the timing duration of the third timer is greater than or equal to 10 seconds; if yes, execute S607; if no, execute S605.
[0142] For example, determine whether the timing duration of the third timer is greater than or equal to 10 seconds; if the timing duration of the third timer is greater than or equal to 10 seconds, the waiting time for a response after the first request frame is sent is long, which may indicate a channel failure (e.g., software failure, hardware failure, or power supply failure), and a fault information needs to be sent, and execute S607; if the timing duration of the third timer is less than 10 seconds, the first response frame of the first request frame is received, then the first response frame is received and the target communication channel is further determined based on the first response frame, and execute S605.
[0143] Alternatively, the implementation of S606 can be found in [reference needed]. Figure 2 The relevant descriptions in S210 will not be repeated here.
[0144] S607, Send second fault information.
[0145] For example, if no connection is successfully established within 10 seconds, a fault code "light communication connection timed out" is sent to the diagnostic system.
[0146] Optionally, a channel error indication is sent to the bus, and the node fault counter is incremented by one.
[0147] Alternatively, the implementation of S607 can be found in [reference needed]. Figure 2 The relevant descriptions in S210 will not be repeated here.
[0148] S608. Based on the first response frame, determine the first communication channel through which a connection can be established.
[0149] For example, based on the TTC CMF frames sent by each channel, the communication channel that is in an idle state and currently capable of establishing a communication connection is determined as the first communication channel.
[0150] Alternatively, the implementation of S608 can be found in [reference needed]. Figure 2 The relevant descriptions in S230 will not be repeated here.
[0151] S609. Send a second request frame to the first communication channel.
[0152] For example, a second TTC CMF frame is sent to channel 1 to request channel 1 to initialize.
[0153] Alternatively, the implementation of S609 can be found in [reference needed]. Figure 2 The relevant descriptions in S230 will not be repeated here.
[0154] S610, Start the first timer.
[0155] For example, while sending the second TTC CMF frame to channel 1, the first timer corresponding to channel 1 is started to monitor the initialization timeout status of channel 1.
[0156] Alternatively, the implementation of S610 can be found in [reference needed]. Figure 2 The relevant descriptions in S230 will not be repeated here.
[0157] S611. Determine whether the timing duration of the first timer is greater than or equal to 2 seconds; if yes, execute S612; if no, execute S613.
[0158] For example, determine whether the timing duration of the first timer is greater than or equal to 2 seconds; if the timing duration of the first timer is greater than or equal to 2 seconds, the waiting time for a response after the second request frame is sent is relatively long, which may indicate a channel initialization failure (e.g., initialization failure due to a problem with the channel itself), and it is necessary to send fault information and execute S612; if the timing duration of the first timer is less than 2 seconds, that is, the second response frame of the second request frame is received, then the second response frame is received and the target communication channel is further determined based on the second response frame, and S613 is executed.
[0159] Alternatively, the implementation of S611 can be found in [reference needed]. Figure 2 The relevant descriptions in S230 will not be repeated here.
[0160] S612, Send the first fault information.
[0161] For example, if no TTC CMF is received from channel 1 within 2 seconds, the on-board unit sends a fault message "channel 1 initialization failed".
[0162] Optionally, a channel error indication is sent to the bus, and the node fault counter is incremented by one.
[0163] Alternatively, the implementation of S612 can be found in [reference needed]. Figure 2 The relevant descriptions in S230 will not be repeated here.
[0164] S613. The communication channel indicated by the second request frame as having successfully initialized is determined as the target channel.
[0165] For example, if a TTC CMF frame is received from channel 1 within 2 seconds, confirming that its initialization was successful, channel 1 is determined as the target channel.
[0166] Alternatively, the implementation of S613 can be found in [reference needed]. Figure 2 The relevant descriptions in S230 will not be repeated here.
[0167] S614. Transmit communication data to the target communication channel.
[0168] For example, on channel 1, new vehicle lighting animation data is packetized into first frames and continuous frame streams for transmission in accordance with the ISO 15765-2 protocol.
[0169] Alternatively, the implementation of S614 can be found in [reference needed]. Figure 2 The relevant descriptions in S240 will not be repeated here.
[0170] In the above embodiments, compared to the prior art which occupies all bandwidth when transmitting data, resulting in the inability to execute other functional instructions during data transmission and thus requiring the execution of functional instructions before data transmission, reducing data transmission efficiency, this solution actively sends a request frame before data transmission. The request frame obtains the current status of multiple communication channels, and by confirming the status of each communication channel, selects a communication channel that can establish a connection, and transmits data through this channel. Therefore, this solution can utilize idle channels for data transmission while other functional instructions are executed on some communication channels, thereby improving data transmission efficiency.
[0171] The above text combined Figures 1 to 6 This application provides a detailed description of a vehicle communication method based on its embodiments; the following will be combined with... Figure 7 and Figure 8 The apparatus embodiments of this application are described in detail below. It should be understood that the apparatus in the embodiments of this application can perform the various methods described in the foregoing embodiments of this application, that is, the specific working processes of the various products described below can be referred to the corresponding processes in the foregoing method embodiments.
[0172] Figure 7 This is a schematic diagram of the structure of a vehicle communication device provided in an embodiment of this application. The vehicle communication device 700 includes a transmitting module 710 and a processing module 720.
[0173] The sending module is used to send a first request frame to multiple communication channels in response to a transmission request for target communication data in the vehicle. The first request frame is used to request the current status of each communication channel among the multiple communication channels. The first request frame includes the identifiers of the multiple communication channels. The processing module is configured to receive a first response frame from a first request frame, the first response frame including indication information, the indication information being used to indicate the current state of each communication channel; determine a target communication channel among multiple communication channels based on the current state of each communication channel; and transmit target communication data on the target communication channel.
[0174] Optionally, as an embodiment, the processing module 720 is specifically used to: determine the communication channel whose current state is idle as the first communication channel; and determine the target communication channel based on the first communication channel.
[0175] Optionally, as an embodiment, the processing module 720 is further configured to: send a second request frame to the first communication channel, the second request frame being used to request the first communication channel to be initialized; receive a second response frame of the second request frame, the second response frame including the initialization state of the first communication channel; and determine a target communication channel based on the first communication channel, including: determining the target communication channel based on the first communication channel and the second response frame.
[0176] Optionally, as an embodiment, the processing module 720 is specifically used to: determine a second communication channel in the first communication channel based on the second response frame, wherein the second communication channel is used to represent the communication channel in the first communication channel whose initialization state is successful; and determine the second communication channel as the target communication channel.
[0177] Optionally, as an embodiment, the processing module 720 is further configured to: start a first timer when sending a second request frame to the first communication channel, the first timer being used to monitor the initialization duration of the first communication channel; and send first fault information when the timing result of the first timer is greater than or equal to a first preset duration, the first fault information being used to indicate that a fault exists when the first communication channel is initialized.
[0178] Optionally, as an embodiment, the processing module 720 is further configured to: when sending a first request frame to multiple communication channels, start a second timer, the second timer being used to monitor the response duration of the first request frame; when the duration of the second timer is greater than or equal to a second preset duration, if the first response frame sent by the third communication channel among the multiple communication channels is not received, restart the second timer; and send the first request frame to the third communication channel again.
[0179] Optionally, as an embodiment, the processing module 720 is further configured to: when sending a first request frame to multiple communication channels, start a third timer, the third timer being used to monitor the connection establishment duration of the multiple communication channels; when the timing duration of the third timer is greater than or equal to a third preset duration, if the first response frame sent by the fourth communication channel among the multiple communication channels is not received, send second fault information, the third preset duration being greater than the second preset duration, the second fault information being used to indicate that there is a connection failure in the fourth communication channel.
[0180] Optionally, as an embodiment, the processing module 720 is further configured to: determine the current state of the fifth communication channel as idle when the indication information of the fifth communication channel among multiple communication channels indicates that the fifth communication channel is in an idle state; determine the current state of the fifth communication channel as occupied when the indication information of the fifth communication channel among multiple communication channels indicates that the fifth communication channel is in an occupied state; and determine the current state of the fifth communication channel as faulty when the indication information of the fifth communication channel among multiple communication channels indicates that the fifth communication channel is in a faulty state.
[0181] It should be noted that the communication device 700 of the aforementioned vehicle is embodied in the form of a functional unit. The term "module" here can be implemented in software and / or hardware, without specific limitations.
[0182] For example, a "module" can be a software program, hardware circuit, or a combination of both that implements the above functions. Hardware circuits may include application-specific integrated circuits (ASICs), electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functions.
[0183] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0184] Figure 8 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application.
[0185] For example, vehicle 800 includes processor 810, memory 820 and executable program code 830.
[0186] For example, vehicle 800 includes one or more processors 810 that can support the vehicle 800 in implementing the vehicle communication method in the method embodiment. The processor 810 can be a general-purpose processor or a special-purpose processor. For example, processor 810 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.
[0187] For example, the processor 810 can be used to control the vehicle 800, execute software programs, and process data from the software programs. The vehicle 800 may also include a communication unit for receiving and transmitting signals.
[0188] For example, the vehicle 800 may include one or more memories 820 storing executable program code 830. The executable program code 830 can be run by the processor 810 to generate instructions, causing the processor 810 to execute the vehicle communication method described in the above method embodiments according to the instructions. For example, the processor 810 executes the following according to the instructions: in response to a transmission request for target communication data in the vehicle, sending a first request frame to multiple communication channels, the first request frame being used to request the current status of each communication channel among the multiple communication channels, the first request frame including the identifiers of the multiple communication channels; receiving a first response frame of the first request frame, the first response frame including indication information, the indication information being used to indicate the current status of each communication channel; determining a target communication channel among the multiple communication channels based on the current status of each communication channel; and transmitting the target communication data on the target communication channel.
[0189] Optionally, the memory 820 may also store data. Optionally, the processor 810 may also read data stored in the memory 820, which may be stored at the same memory address as the executable program code 830, or the data may be stored at a different memory address than the executable program code 830.
[0190] For example, the processor 810 and memory 820 can be configured separately or integrated together, for example, integrated on the system-on-chip (SOC) of the terminal device.
[0191] For example, the memory 820 can be used to store related programs of the vehicle communication method provided in the embodiments of this application, and the processor 810 can be used to call the executable program code 830 stored in the memory 820 when controlling the vehicle to execute the vehicle communication method of the embodiments of this application. This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the vehicle communication method of any of the foregoing embodiments.
[0192] The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, Digital Video Discs (DVDs), Compact Disc Read-Only Memory (CD-ROMs), microdrives, and magneto-optical disks, read-only memory (ROMs), random access memory (RAMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), dynamic random access memory (DRAMs), video random access memory (VRAMs), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0193] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement the vehicle communication method in the above embodiments.
[0194] In addition, the electronic device provided in the embodiments of this application may specifically be a chip, component or module. The electronic device may include a connected processor and a memory. The memory is used to store instructions. When the electronic device is running, the processor may call and execute the instructions to make the chip execute the vehicle communication method in the above embodiments.
[0195] The vehicle, computer-readable storage medium, computer program product or chip provided in this application are all used to execute the communication method of the corresponding vehicle provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the communication method of the corresponding vehicle provided above, and will not be repeated here.
[0196] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0197] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0198] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A vehicle communication method, characterized in that, The communication method includes: In response to a transmission request for target communication data in the vehicle, a first request frame is sent to multiple communication channels. The first request frame is used to request the current status of each of the multiple communication channels and includes the identifiers of the multiple communication channels. A first response frame is received from the first request frame, the first response frame including indication information, the indication information being used to indicate the current status of each communication channel; Based on the current state of each communication channel, determine the target communication channel among the plurality of communication channels; The target communication data is transmitted on the target communication channel.
2. The communication method according to claim 1, characterized in that, Determining the target communication channel among the plurality of communication channels based on the current state of each communication channel includes: The communication channel whose current state is idle is identified as the first communication channel. The target communication channel is determined based on the first communication channel.
3. The communication method according to claim 2, characterized in that, The communication method further includes: Send a second request frame to the first communication channel, the second request frame being used to request the first communication channel to be initialized; A second response frame is received from the second request frame, the second response frame including the initialization state of the first communication channel; Determining the target communication channel based on the first communication channel includes: The target communication channel is determined based on the first communication channel and the second response frame.
4. The communication method according to claim 3, characterized in that, Determining the target communication channel based on the first communication channel and the second response frame includes: Based on the second response frame, a second communication channel is determined in the first communication channel, and the second communication channel is used to represent the communication channel in the first communication channel whose initialization state is successful. The second communication channel is determined as the target communication channel.
5. The communication method according to claim 3, characterized in that, The communication method further includes: When the second request frame is sent to the first communication channel, a first timer is started. The first timer is used to monitor the initialization duration of the first communication channel. If the timing result of the first timer is greater than or equal to the first preset duration, a first fault message is sent. The first fault message is used to indicate that a fault exists when the first communication channel is initialized.
6. The communication method according to claim 1, characterized in that, The communication method further includes: When the first request frame is sent to the plurality of communication channels, a second timer is started, the second timer being used to monitor the response duration of the first request frame; If the first response frame sent by the third communication channel among the plurality of communication channels is not received when the timing duration of the second timer is greater than or equal to the second preset duration, the second timer is restarted. The first request frame is sent again to the third communication channel.
7. The communication method according to claim 6, characterized in that, The communication method further includes: When the first request frame is sent to the plurality of communication channels, a third timer is started, the third timer being used to monitor the connection establishment duration of the plurality of communication channels; If the first response frame sent by the fourth communication channel among the plurality of communication channels is not received when the duration of the third timer is greater than or equal to the third preset duration, a second fault information is sent. The third preset duration is greater than the second preset duration, and the second fault information is used to indicate that there is a connection failure in the fourth communication channel.
8. A communication device for a vehicle, characterized in that, The communication device includes: The sending module is configured to send a first request frame to multiple communication channels in response to a transmission request for target communication data in the vehicle. The first request frame is used to request the current status of each of the multiple communication channels and includes the identifiers of the multiple communication channels. The processing module is configured to receive a first response frame from the first request frame, the first response frame including indication information, the indication information being used to indicate the current state of each communication channel; determine a target communication channel among the plurality of communication channels based on the current state of each communication channel; and transmit the target communication data on the target communication channel.
9. A vehicle, characterized in that, The vehicles include: Memory, used to store executable program code; A processor for calling and running the executable program code from the memory, causing the vehicle to perform the communication method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the communication method as described in any one of claims 1 to 7.