Data transmission method and vehicle
Patent Information
- Application Number
- CN202610683910.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-09-29
AI Technical Summary
[0004]随着软件升级包容量不断增长,基于三层路由与转发机制的一系列操作存在丢包率较高以及数据传输效率较低,严重影响了ECU软件升级的成功率
[0030]其中,第四方面至第六方面中任一种设计方式所带来的技术效果可参见第一方面、第二方面及第三方面中不同设计方式所带来的技术效果,此处不再赘述。
Smart Images

Figure CN122845700A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a data transmission method and a vehicle. Background Technology
[0002] With the continuous development of vehicle electronic and electrical architecture, more and more Electronic Control Units (ECUs) are integrated into vehicles. These ECUs are used to realize various functions such as power control, body management, infotainment, and advanced driver assistance. In order for the ECU to perform the aforementioned functions, corresponding software packages need to be installed on the ECU and the software packages need to be upgraded.
[0003] Traditional ECU software upgrades rely on a complex three-layer routing and forwarding mechanism. After the vehicle receives the software upgrade package, it needs to be transmitted to the target ECU based on the aforementioned mechanism to enable the ECU software upgrade. This mechanism includes the following operations: data fragmentation, Internet Protocol (IP) addressing, and hop-by-hop transmission. Data fragmentation involves dividing the large software upgrade package into smaller blocks that fit the network transmission size. IP addressing involves labeling each data block with the target ECU's network layer logical address and querying routing tables hop-by-hop across multiple network nodes to determine the next hop. Hop-by-hop transmission means that the software upgrade package must be forwarded through multiple intermediate nodes such as gateways and routers.
[0004] As the size of software upgrade packages continues to grow, a series of operations based on the three-layer routing and forwarding mechanism suffer from high packet loss rates and low data transmission efficiency, which seriously affects the success rate of ECU software upgrades. Summary of the Invention
[0005] This application provides a data transmission method and vehicle that can shorten the data transmission path and avoid data fragmentation transmission, thereby shortening the data transmission time and reducing the packet loss rate. In the scenario of software upgrade in electronic control unit, this can improve the success rate of electronic control unit software upgrade.
[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions: In a first aspect, a data transmission method is provided, applied to a vehicle. The method includes: upon receiving a transmission channel establishment request from an electronic device, establishing a target transmission channel with the electronic device; wherein the target transmission channel is a channel for transmitting data based on a data link layer address and a physical port; upon receiving a first instruction from the electronic device, determining a target physical port corresponding to the data link layer address based on the data link layer address in the first instruction; wherein the first instruction includes software upgrade data and the data link layer address of a target electronic control unit; and transmitting the software upgrade data to the target electronic control unit based on the target physical port.
[0007] In this application, a dedicated target transmission channel based on a data link layer address is established, and the target physical port is directly determined using this data link layer address. The software upgrade data is then transmitted to the target electronic control unit (ECU) corresponding to the target physical port. This method effectively avoids data fragmentation, IP addressing, and hop-by-hop transmission operations inherent in traditional Layer 3 routing and forwarding mechanisms. It shortens the transmission path and avoids data fragmentation, thereby reducing data transmission time and packet loss rate. Consequently, in scenarios involving software upgrades within ECUs, this method can improve the success rate of ECU software upgrades.
[0008] In conjunction with the first aspect, in one possible design approach, determining the target physical port corresponding to the data link layer address based on the data link layer address in the first instruction includes: determining the target physical port corresponding to the data link layer address from a preset mapping table based on the data link layer address in the first instruction; wherein the preset mapping table includes the mapping relationship between data link layer addresses and physical ports.
[0009] In this application, through a pre-set mapping table, the vehicle can quickly find the unique corresponding physical port based on the received data link layer address by looking up the table, realizing fast address-to-port lookup, simplifying the addressing process, and improving the accuracy and efficiency of data transmission.
[0010] In conjunction with the first aspect, in one possible design approach, establishing a target transmission channel with an electronic device includes: determining the target physical port carried in the transmission channel establishment request; and establishing the target transmission channel based on the target physical port.
[0011] In this application, when an electronic device initiates a transmission channel establishment request, it can specify the target physical port. The vehicle can then establish a target transmission channel based on the specified target physical port, making the establishment of the target transmission channel clearly directional and thus improving the security of data transmission.
[0012] In conjunction with the first aspect, in one possible design, the method further includes: receiving a transmission channel establishment request sent by an electronic device when the size of the software upgrade data is greater than a preset threshold; receiving a second instruction sent by an electronic device when the size of the software upgrade data is less than or equal to the preset threshold; wherein the second instruction includes the software upgrade data and a network layer address, and the second instruction is used to instruct the vehicle to transmit the software upgrade data based on the network layer address; and transmitting the software upgrade data to the target electronic control unit using a data transmission method based on the network layer address.
[0013] In this application, when the software upgrade data is small, there is generally no data fragmentation issue and the packet loss rate is low. The vehicle's existing Layer 3 routing mechanism can be directly used without needing to establish a new Layer 2 routing channel, saving energy consumption associated with establishing and maintaining such a channel. When the software upgrade data is large, the vehicle's existing Layer 3 routing mechanism is directly used. This ensures high performance for large data transmission while avoiding the waste of resources by using high-overhead direct connections for small data. This makes efficient use of data transmission methods, improving data transmission efficiency while also considering energy consumption.
[0014] In conjunction with the first aspect, in one possible design, before receiving the transmission channel establishment request from the electronic device, the method further includes: upon receiving a security access request sent by the electronic device, generating a random number and generating a target key based on the random number, and feeding back the random number to the electronic device; upon receiving a key to be verified sent by the electronic device, matching the key to be verified with the target key, and if the key to be verified matches the target key, feeding back authentication success information to the electronic device.
[0015] In this application, a secure authentication process based on random numbers and keys is added before establishing the transmission channel. This ensures that only legally authorized electronic devices can establish a data transmission channel with the vehicle, effectively preventing unauthorized access and attacks by unauthorized devices, and greatly improving the security of the entire software upgrade process.
[0016] In conjunction with the first aspect, in one possible design approach, the target transmission channel is shut down upon detection of a preset abnormal event; wherein the abnormal event includes the target electronic control unit failing to respond to the software package upgrade data or generating a negative response after sending the software package upgrade data to the target electronic control unit.
[0017] In this application, when an abnormal event such as the target electronic control unit not responding to the software package upgrade data or generating a negative response is detected, the target transmission channel is shut down. This can release the occupied communication resources in a timely manner and avoid invalid data transmission in an error state.
[0018] In conjunction with the first aspect, in one possible design approach, the target transmission channel is shut down upon successful software upgrade.
[0019] In this application, if the software upgrade is successful, timely shutdown of the target transmission channel can reclaim the network bandwidth and port resources within the vehicle for use by other communication tasks, thus avoiding long-term idleness and waste of resources.
[0020] Secondly, a data transmission method is provided, which is applied to an electronic device. The method includes: if the size of the software upgrade data is greater than a preset threshold, sending a transmission channel establishment request to the vehicle; wherein the transmission channel establishment request is used to instruct the vehicle to establish a target transmission channel, the target transmission channel being a channel for transmitting data based on a data link layer address and a physical port; upon receiving a response information indicating that the target transmission channel has been successfully established, sending a first instruction to the vehicle; wherein the first instruction is used to instruct the vehicle to transmit the software upgrade data based on the target transmission channel, and the first instruction includes the software upgrade data and the data link layer address of the target electronic control unit.
[0021] In this application, the electronic device can determine the target transmission mode of the vehicle transmission data based on the size of the software upgrade data to be transmitted. When the software upgrade data is small, there is generally no data fragmentation problem and the packet loss rate is small. The original three-layer routing and forwarding mechanism in the vehicle can be directly used without the need to re-establish the two-layer routing and forwarding channel, thus saving energy consumption in establishing and maintaining the two-layer routing and forwarding channel.
[0022] In conjunction with the second aspect, in one possible design, the method further includes: if the size of the software upgrade data to be transmitted is less than or equal to a preset threshold, then sending a second instruction to the vehicle; wherein the second instruction contains the software upgrade data and a network layer address, and the second instruction is used to instruct the vehicle to transmit the software upgrade data based on the network layer address.
[0023] In this application, when the software upgrade data is small, there is generally no data fragmentation issue and the packet loss rate is low. The vehicle's existing Layer 3 routing mechanism can be directly used without needing to establish a new Layer 2 routing channel, saving energy consumption associated with establishing and maintaining such a channel. When the software upgrade data is large, the vehicle's existing Layer 3 routing mechanism is directly used. This ensures high performance for large data transmission while avoiding the waste of resources by using high-overhead direct connections for small data. This makes efficient use of data transmission methods, improving data transmission efficiency while also considering energy consumption.
[0024] In conjunction with the second aspect, in one possible design, the method further includes: sending a secure access request to the vehicle; and upon receiving a random number sent by the vehicle, calculating a key to be verified based on the random number and sending the key to be verified to the vehicle.
[0025] In this application, a secure authentication process based on random numbers and keys is added before establishing the transmission channel. This ensures that only legally authorized electronic devices can establish a data transmission channel with the vehicle, effectively preventing unauthorized access and attacks by unauthorized devices, and greatly improving the security of the entire software upgrade process.
[0026] Thirdly, a data transmission method is provided, applied to a data transmission system including an electronic device and a vehicle. The method includes: the electronic device sending a transmission channel establishment request to the vehicle; upon receiving the transmission channel establishment request, the vehicle establishing a target transmission channel with the electronic device and sending a response message indicating successful establishment of the target transmission channel back to the electronic device; wherein the target transmission channel is a channel for transmitting data based on a data link layer address and a physical port; upon receiving the response message, the electronic device sending a first instruction to the vehicle; upon receiving the first instruction, the vehicle determining a target physical port corresponding to the data link layer address based on the data link layer address in the first instruction; wherein the first instruction includes software upgrade data and the data link layer address of a target electronic control unit; and transmitting the software upgrade data to the target electronic control unit based on the target physical port.
[0027] Fourthly, embodiments of this application provide a vehicle, including: a vehicle-mounted unit; and a memory for storing executable instructions of the vehicle-mounted unit, wherein the vehicle-mounted unit is used to execute the data transmission method described in the first aspect and any of its possible design schemes.
[0028] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program for performing the data transmission method described in the first, second, or third aspects and any possible design of the above.
[0029] Sixthly, embodiments of this application provide a computer program product, which includes a computer program. When the computer program is executed by a processor of a computer device, it enables the computer device to perform the data transmission method described in the first, second, or third aspects and any possible design of the above.
[0030] The technical effects of any of the design methods in aspects four through six can be found in the technical effects of different design methods in aspects one, two, and three, and will not be repeated here. Attached Figure Description
[0031] Figure 1 The diagram shown is an application scenario illustration of the data transmission method provided in an exemplary embodiment of this application.
[0032] Figure 2 The diagram shown is a flowchart illustrating a data transmission method provided in an exemplary embodiment of this application.
[0033] Figure 3 The diagram shown is a schematic representation of the mapping between physical ports and MAC addresses provided in an exemplary embodiment of this application.
[0034] Figure 4 The diagram shown is a flowchart illustrating a data transmission method provided in another exemplary embodiment of this application.
[0035] Figure 5 The diagram shown is a structural schematic of a data transmission device provided in an exemplary embodiment of this application. Detailed Implementation
[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0037] Application Overview As mentioned in the background section, with the continuous increase in the size of software upgrade packages, a series of operations based on the three-layer routing and forwarding mechanism result in a long transmission path for the software upgrade packages and a large number of data fragments, leading to long transmission times, high packet loss rates, and low transmission efficiency, which seriously affects the success rate of ECU software upgrades.
[0038] To address the aforementioned technical problems, embodiments of this application provide a data transmission method. The method includes: upon receiving a transmission channel establishment request from an electronic device, the vehicle establishes a target transmission channel with the electronic device, the target transmission channel being a channel for transmitting data based on a data link layer address and a physical port; then, upon receiving a first instruction sent from the electronic device, the vehicle determines a target physical port corresponding to the data link layer address based on the data link layer address in the first instruction, the first instruction including software upgrade data and the data link layer address of a target electronic control unit; finally, the vehicle transmits the software upgrade data to the target electronic control unit based on the target physical port.
[0039] In this embodiment, a dedicated target transmission channel based on a data link layer address is established, and the data transmission port is directly determined using this data link layer address. This achieves direct data transmission from the external device to the target electronic control unit (ECU). This method effectively avoids data fragmentation, IP addressing, and hop-by-hop transmission operations in traditional Layer 3 routing and forwarding mechanisms, shortening the transmission path and avoiding data fragmentation transmission. This reduces data transmission time and packet loss rate, thereby improving the success rate of ECU software upgrades.
[0040] Exemplary scenario The data transmission method provided in this application can be applied to various vehicles. Vehicles include various types of vehicles, such as sedans, SUVs, buses, and trucks. This application does not impose any special limitations on the specific form of the vehicle.
[0041] The following is an illustrative diagram illustrating an application scenario of a data transmission method. For example, Figure 1 The diagram illustrates an application scenario of the data transmission method provided in an exemplary embodiment of this application. Figure 1 As shown, the scenario includes a vehicle 100 and an electronic device 200. The electronic device 200 can be an external diagnostic tool or a mobile terminal, but is not limited to these. The mobile terminal can be a computer, tablet, etc., but is not limited to these.
[0042] Vehicle 100 may include a vehicle infotainment system 110 and one or more electronic control units, such as electronic control unit 120, electronic control unit 130, electronic control unit 140, and electronic control unit 150. The vehicle infotainment system 110 may include an in-vehicle infotainment system and an in-vehicle gateway, etc. The vehicle infotainment system 110 has multiple physical ports, each connected to a different electronic control unit. For example... Figure 1 The electronic control unit shown is 1, 2, 3, and 4. Each electronic control unit can be a dedicated embedded controller (such as an engine control module, body controller, etc.) that performs specific vehicle functions.
[0043] Electronic device 200 can establish a communication connection with vehicle infotainment system 110 of vehicle 100 via wireless or wired means. Wireless means can be Bluetooth, Wireless Fidelity (Wi-Fi), etc., while wired means can be Universal Serial Bus (USB), etc.
[0044] Electronic device 200 can be wired to vehicle 100 via on-board diagnostic (OBD) interface.
[0045] The vehicle-mounted unit 110 can establish a dedicated target transmission channel with the electronic equipment 200 for transmitting large amounts of data (such as software upgrade data). This channel operates at the data link layer, thereby avoiding data fragmentation, network IP addressing, and hop-by-hop transmission operations in traditional three-layer routing and forwarding mechanisms, and achieving efficient, low-latency, and low-packet-loss direct data transmission.
[0046] Specifically, upon receiving a transmission channel establishment request from electronic device 200, vehicle 100 establishes a target transmission channel with electronic device 200. This target transmission channel is a channel for transmitting data based on a data link layer address and a physical port. Then, upon receiving a first instruction from electronic device 200, vehicle 100 determines the target physical port corresponding to the data link layer address based on the data link layer address in the first instruction. This first instruction includes software upgrade data and the data link layer address of the target electronic control unit. For example, the target electronic control unit to receive the software upgrade data is electronic control unit 2. Then, vehicle 100 transmits the software upgrade data to electronic control unit 2 based on the target physical port.
[0047] It should be understood that the above application scenario examples are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited thereto. Rather, the embodiments of this application can be applied to any applicable scenario.
[0048] Exemplary methods Figure 2 The diagram shown is a flowchart illustrating a data transmission method provided in an exemplary embodiment of this application. Figure 3 The method can be executed by a data transmission system, which includes electronic devices and vehicles, such as... Figure 1 Vehicle 100 is shown in the image. (As shown in the image) Figure 2 As shown, the data transmission method may include the following steps: 210: The electronic device sends a transmission channel establishment request to the vehicle.
[0049] The transmission channel establishment request is used to instruct the vehicle to establish a target transmission channel, which is a channel for transmitting data based on data link layer addresses and physical ports.
[0050] The transmission channel establishment request may carry one or more physical ports, instructing the vehicle to establish a target transmission channel based on the aforementioned physical ports. In some embodiments, the transmission channel establishment request may carry all physical ports capable of receiving data. In other embodiments, the transmission channel establishment request does not carry all physical ports, but rather the physical ports that will subsequently receive software upgrade packages, to ensure the security of data transmission.
[0051] The transmission channel establishment request can be a command based on the Unified Diagnostic Services (UDS) protocol. The UDS protocol is an international standard protocol for automotive diagnostics and control. In the UDS protocol, there are some commonly used first commands, such as routine control.
[0052] 220: Upon receiving a transmission channel establishment request, the vehicle establishes a target transmission channel with the electronic equipment and sends a response message to the electronic equipment indicating that the target transmission channel has been successfully established.
[0053] After receiving a transmission channel establishment request from an electronic device, the vehicle can act as a gateway to negotiate and establish a target transmission channel with the electronic device. This target transmission channel is a direct connection channel for transmitting data based on data link layer addresses and physical ports, used for faster data transmission by the vehicle.
[0054] In some embodiments, if the transmission channel establishment request carries all physical ports that can receive data, then the target transmission channel is established based on all physical ports that can receive data.
[0055] In other embodiments, the transmission channel establishment request does not carry all physical ports, but rather the physical ports that need to receive software upgrade packages later, i.e., the target physical ports, and the target transmission channel is established based on the target physical ports.
[0056] In this embodiment of the application, the electronic device can specify the target physical port when initiating a transmission channel establishment request, and the vehicle can establish a target transmission channel based on the specified target physical port, so that the establishment of the target transmission channel has a clear direction, thereby improving the security of data transmission.
[0057] In some embodiments, when a vehicle receives a request to establish a transmission channel, it can execute the corresponding open direct connection routine to complete the initialization of the internal resources required for the channel. After the direct connection routine is successfully executed, the vehicle returns a response message to the electronic device indicating that the target transmission channel has been successfully established.
[0058] 230: The vehicle sends a response message to the electronic equipment indicating that the target transmission channel has been successfully established.
[0059] 240: Upon receiving the response information, the electronic device sends the first instruction to the vehicle.
[0060] 250: Upon receiving a first instruction from an electronic device, the vehicle determines the target physical port corresponding to the data link layer address based on the data link layer address in the first instruction.
[0061] The first instruction contains software upgrade data and the data link layer address of the target electronic control unit. Upon receiving the first instruction from the electronic equipment, the vehicle can parse it and extract the data link layer address of the target electronic control unit contained within it. Then, it determines the target physical port corresponding to that data link layer address; this target physical port is the physical output point from which the vehicle's infotainment system connects to the target electronic control unit.
[0062] The data link layer address can be a Media Access Control Address (MAC address). MAC addresses are used to identify and locate devices (such as electronic control units) in network communication. When data needs to be transmitted in a vehicle, the electronic device encapsulates the MAC address of the electronic control unit in the first instruction. This allows the vehicle to address and forward data based on the MAC address in the first instruction, ensuring that the data is accurately delivered to the target electronic control unit. A MAC address is 48 bits (6 bytes), typically represented as 12 hexadecimal numbers separated by colons, such as 08:00:20:0A:8C:6D.
[0063] In some embodiments, the target physical port can be determined based on a mapping table. Specifically, a preset mapping table is maintained internally within the vehicle, storing the mapping relationship between data link layer addresses and physical port numbers. When the vehicle extracts the data link layer address from the first instruction, it can obtain the target physical port by querying this preset mapping table. This preset mapping table can be pre-configured during vehicle production.
[0064] For example, Figure 3 The diagram shown is a schematic representation of the mapping between physical ports and MAC addresses provided in an exemplary embodiment of this application. Figure 3 As shown, the preset mapping table includes the following mapping relationships: Port 1 corresponds to MAC address 1 of Electronic Control Unit 1, Port 2 corresponds to MAC address 2 of Electronic Control Unit 2, Port 3 corresponds to MAC address 3 of Electronic Control Unit 3, Port 4 corresponds to MAC address 4 of Electronic Control Unit 4, and Port 5 corresponds to MAC address 5 of Electronic Control Unit 5. If the data link layer address in an instruction is MAC address 2, then the target physical port corresponding to MAC address 2 is determined to be Electronic Control Unit 2.
[0065] In this embodiment, the target physical port is determined by querying a preset mapping table, enabling the vehicle to quickly and accurately match the address with the port. This lookup mechanism is fast and reliable, avoiding the delays and uncertainties that may be caused by dynamic routing calculations, ensuring that the first instruction can be forwarded to the correct electronic control unit without errors, and enhancing the determinism and reliability of data transmission.
[0066] In response to a routine control command, the corresponding direct connection start routine is executed, and after the direct connection routine is successfully executed, a success response indicating that the target channel has been established is returned to the electronic device.
[0067] 260: Based on the target physical port, transmit the software upgrade data to the target electronic control unit.
[0068] The vehicle can transmit the first command to the target electronic control unit through a designated target physical port, completing the efficient direct transmission of data and significantly improving upgrade efficiency.
[0069] For example, the target electronic control unit is the engine control module, with a MAC address of 00-1A-2B-3C-4D-5E. The first command sent by the electronic device contains the target MAC address field as 00-1A-2B-3C-4D-5E, and the software upgrade data includes engine control software update data. The vehicle queries a preset mapping relationship based on this target MAC address field to determine the corresponding port 3. Therefore, the vehicle accurately delivers the first command from port 3 to the engine control module.
[0070] In some embodiments, the target transmission channel can be shut down if the software upgrade is successful.
[0071] In this embodiment of the application, when the software upgrade is successful, timely shutdown of the target transmission channel can reclaim the network bandwidth and port resources in the vehicle for use by other communication tasks, thus avoiding long-term idleness and waste of resources.
[0072] In some embodiments, a security authentication process may be performed before the electronic device establishes a target transmission channel with the vehicle, including the following steps 310 to 350: 310: Electronic devices send secure access requests to vehicles.
[0073] 320: When a vehicle receives a security access request from an electronic device, it generates a random number and generates a target key based on the random number, and then sends the random number back to the electronic device.
[0074] 330: Upon receiving a random number sent by the vehicle, the electronic device calculates the key to be verified based on the random number and sends the key to be verified to the vehicle.
[0075] 340: When the vehicle receives the key to be verified from the electronic device, it matches the key to be verified with the target key. If the key to be verified matches the target key, it sends a message to the electronic device that the authentication was successful.
[0076] The vehicle compares the target key it calculates with the key to be verified, which is calculated based on random numbers and sent by the electronic device. If they match, the authentication is successful, and the vehicle sends a message of successful authentication to the electronic device. If they do not match, the authentication fails, and the vehicle sends a message of authentication failure to the electronic device.
[0077] After receiving the authentication success information, the electronic device sends a transmission channel establishment request to the vehicle. Upon receiving the transmission channel establishment request from the electronic device, the target transmission channel is established with the electronic device.
[0078] In this embodiment of the application, before establishing a data transmission channel, two-way key authentication is performed based on random numbers to ensure that the electronic device initiating the connection (such as a diagnostic instrument) is an authorized and legitimate device. This effectively prevents malicious devices from accessing the vehicle and performing illegal data writing or control, thereby improving the security of the vehicle receiving data sent by external devices.
[0079] In other embodiments, when the software upgrade data is small, there is generally no data fragmentation problem and the packet loss rate is low. The vehicle's existing Layer 3 routing mechanism can be directly used. This Layer 3 routing mechanism transmits data based on network layer addresses, without needing to establish new Layer 2 routing channels. Layer 2 routing refers to transmitting data based on data link layer addresses, saving energy consumption associated with establishing and maintaining Layer 2 routing channels. When the software upgrade data is large, the vehicle's existing Layer 3 routing mechanism can be directly used. This ensures high performance for large data transmission while avoiding the waste of resources by using high-overhead direct connection channels for small data. This makes efficient use of data transmission methods, improving data transmission efficiency while also considering energy consumption.
[0080] Specifically, the following example illustrates a scheme for determining the vehicle's data transmission method based on the size of the software upgrade data to be transmitted. For example, Figure 4 The diagram shown is a flowchart illustrating a data transmission method provided in another exemplary embodiment of this application. Figure 4 The method can be executed by a data transmission system, which includes electronic devices and vehicles, such as... Figure 1 The vehicle 100 shown in the image. Figure 4 Zhongyu Figure 2 The repeated steps are detailed above and will not be repeated here. Figure 4 As shown, the data transmission method may include the following steps: 410: Determine whether the software upgrade data to be transmitted is greater than the preset threshold.
[0081] The electronic device can determine the target transmission mode for vehicle data transmission based on the size of the software upgrade data to be transmitted. Specifically, if the software upgrade data to be transmitted is less than or equal to a preset threshold, step 420 is executed. If the software upgrade data to be transmitted is greater than the preset threshold, step 440 is executed.
[0082] 420: Send a second instruction to the vehicle.
[0083] The second instruction is used to instruct the vehicle to transmit software upgrade data using a data transmission method based on network layer addresses. The second instruction contains the software upgrade data and the data link layer address of the target electronic control unit.
[0084] 430: Upon receiving the second instruction, transmit the software upgrade data in the second instruction using a data transmission method based on the network layer address.
[0085] 440: The electronic device sends a transmission channel establishment request to the vehicle.
[0086] 450: Upon receiving a transmission channel establishment request, the vehicle establishes a target transmission channel with the electronic equipment and sends a response message to the electronic equipment indicating that the target transmission channel has been successfully established.
[0087] 460: The vehicle sends a response message to the electronic equipment indicating that the target transmission channel has been successfully established.
[0088] 470: Upon receiving the response information, the electronic device sends the first instruction to the vehicle.
[0089] The first instruction directs the vehicle to transmit software upgrade data via the target transmission channel. The first instruction includes the software upgrade data and the data link layer address of the target electronic control unit. 480: Upon receiving a first instruction from an electronic device, the vehicle determines the target physical port corresponding to the data link layer address based on the data link layer address in the first instruction.
[0090] 490: The vehicle transmits software upgrade data to the target electronic control unit via the target physical port.
[0091] In some other embodiments, the target transmission channel is shut down upon detection of a preset abnormal event; wherein the abnormal event includes the target electronic control unit not responding to the software package upgrade data or generating a negative response after the software package upgrade data is sent to the target electronic control unit.
[0092] In some embodiments, a negative response may include a response that does not support the data, a response that the data is invalid, etc. No response may refer to not receiving a response from the electronic control unit within a set time.
[0093] In this application, when an abnormal event such as the target electronic control unit not responding to the software package upgrade data or generating a negative response is detected, the target transmission channel is shut down. This can release the occupied communication resources in a timely manner and avoid invalid data transmission in an error state.
[0094] Exemplary device Figure 5 The diagram shown is a structural schematic of a data transmission apparatus provided in an exemplary embodiment of this application. Figure 5 As shown, the data transmission device 500 includes: a channel establishment module 510, a determination module 520, and a data transmission module 530.
[0095] The channel establishment module 510 is used to establish a target transmission channel with the electronic device upon receiving a transmission channel establishment request from the electronic device; wherein the target transmission channel is a channel for transmitting data based on a data link layer address and a physical port; the determination module 520 is used to determine the target physical port corresponding to the data link layer address based on the data link layer address in the first instruction sent by the electronic device upon receiving a first instruction; wherein the first instruction includes software upgrade data and the data link layer address of the target electronic control unit; the data transmission module 530 is used to transmit the software upgrade data to the target electronic control unit based on the target physical port.
[0096] This application provides a data transmission device that establishes a dedicated target transmission channel based on a data link layer address and directly determines the data transmission port using this address. This achieves direct data transmission from the external device to the target electronic control unit (ECU). This method effectively avoids data fragmentation, IP addressing, and hop-by-hop transmission operations in traditional three-layer routing and forwarding mechanisms, shortening the transmission path and avoiding data fragmentation. This reduces data transmission time and packet loss rate, thereby improving the success rate of software upgrades in ECUs.
[0097] According to one embodiment of this application, the determining module 520 is used to determine the target physical port corresponding to the data link layer address from a preset mapping table based on the data link layer address in the first instruction; wherein, the preset mapping table includes the mapping relationship between the data link layer address and the physical port.
[0098] According to one embodiment of this application, a channel establishment module 510 is used to determine the target physical port carried in the transmission channel establishment request; and to establish a target transmission channel based on the target physical port.
[0099] According to one embodiment of this application, the data transmission device 500 further includes an authentication module 540, which is used to generate a random number and generate a target key based on the random number when receiving a security access request from an electronic device; send the random number back to the electronic device; receive the key to be verified calculated based on the random number sent by the electronic device; and if the key to be verified matches the target key, send a message of successful authentication back to the electronic device.
[0100] According to one embodiment of this application, the data transmission device 500 further includes a channel shut-off module 550, which is used to shut down the target transmission channel when a preset abnormal event is detected; wherein, the abnormal event includes the target electronic control unit not responding to the software package upgrade data or generating a negative response after sending software package upgrade data to the target electronic control unit.
[0101] According to one embodiment of this application, the channel closing module 550 is used to close the target transmission channel when the software upgrade is successful.
[0102] This application also provides a vehicle, including: a vehicle-mounted unit; and a memory for storing executable instructions of the vehicle-mounted unit, wherein the vehicle-mounted unit is used to execute the data transmission method provided in any of the above embodiments.
[0103] This application also provides a computer-readable storage medium storing a computer program for executing the data transmission method provided in any of the above embodiments.
[0104] This application also provides a computer program product, which includes a computer program. When the computer program is executed by the processor of a computer device, it enables the computer device to perform the data transmission method provided in any of the above embodiments.
[0105] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0106] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein 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.
[0107] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of 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 system, 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 apparatuses or units may be electrical, mechanical, or other forms.
[0109] 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.
[0110] In addition, the functional units in the various embodiments of this application 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.
[0111] 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 application, in essence, 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 application. The aforementioned storage medium includes various media capable of storing program verification codes, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0112] It should be noted that in the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0113] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0114] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications or equivalent substitutions made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data transmission method, characterized in that, The method is applied to a vehicle, and the method includes: Upon receiving a transmission channel establishment request from an electronic device, a target transmission channel is established with the electronic device; wherein, the target transmission channel is a channel for transmitting data based on a data link layer address and a physical port. Upon receiving a first instruction from the electronic device, a target physical port corresponding to the data link layer address is determined based on the data link layer address in the first instruction; wherein, the first instruction includes software upgrade data and the data link layer address of the target electronic control unit; Based on the target physical port, the software upgrade data is transmitted to the target electronic control unit.
2. The data transmission method according to claim 1, characterized in that, The step of determining the target physical port corresponding to the data link layer address based on the data link layer address in the first instruction includes: Based on the data link layer address in the first instruction, the target physical port corresponding to the data link layer address is determined from a preset mapping table; wherein, the preset mapping table includes the mapping relationship between data link layer addresses and physical ports.
3. The data transmission method according to claim 1, characterized in that, Establishing a target transmission channel with the electronic device includes: Determine the target physical port carried in the transmission channel establishment request; Establish a target transmission channel based on the target physical port.
4. The data transmission method according to claim 1, characterized in that, The method further includes: If the size of the software upgrade data exceeds a preset threshold, a transmission channel establishment request sent by the electronic device is received. If the size of the software upgrade data is less than or equal to a preset threshold, a second instruction sent by the electronic device is received; wherein, the second instruction contains the software upgrade data and a network layer address, and the second instruction is used to instruct the vehicle to transmit the software upgrade data based on the network layer address; The software upgrade data is transmitted to the target electronic control unit using a data transmission method based on network layer addresses.
5. The data transmission method according to claim 1, characterized in that, Before receiving the transmission channel establishment request from the electronic device, the method further includes: Upon receiving a security access request from the electronic device, a random number is generated and a target key is generated based on the random number. The random number is then fed back to the electronic device. Upon receiving a key to be verified from an electronic device, the key to be verified and the target key are matched. If the key to be verified matches the target key, a message indicating successful authentication is sent back to the electronic device.
6. The data transmission method according to claim 1, characterized in that, If a preset abnormal event is detected, the target transmission channel is shut down; wherein, the abnormal event includes the target electronic control unit not responding to the software package upgrade data or generating a negative response after sending software package upgrade data to the target electronic control unit.
7. A data transmission method, characterized in that, The method is applied to an electronic device, and the method includes: If the size of the software upgrade data to be transmitted is greater than a preset threshold, a transmission channel establishment request is sent to the vehicle; wherein, the transmission channel establishment request is used to instruct the vehicle to establish a target transmission channel, and the target transmission channel is a channel for transmitting data based on data link layer address and physical port; Upon receiving a response indicating that a target transmission channel has been successfully established, a first instruction is sent to the vehicle; wherein the first instruction contains software upgrade data and the data link layer address of the target electronic control unit, and the first instruction is used to instruct the vehicle to transmit the software upgrade data based on the target transmission channel; If the size of the software upgrade data to be transmitted is less than or equal to a preset threshold, a second instruction is sent to the vehicle; wherein the second instruction contains the software upgrade data and a network layer address, and the second instruction is used to instruct the vehicle to transmit the software upgrade data based on the network layer address.
8. The data transmission method according to claim 7, characterized in that, Before sending the transmission channel establishment request to the vehicle, the method further includes: Send a secure access request to the vehicle; Upon receiving a random number sent by the vehicle, a key to be verified is calculated based on the random number, and the key to be verified is sent to the vehicle.
9. A data transmission method, characterized in that, The method is applied to a data transmission system, the data transmission system including electronic devices and vehicles, and the method includes: When the size of the software upgrade data to be transmitted exceeds a preset threshold, the electronic device sends a transmission channel establishment request to the vehicle. Upon receiving the transmission channel establishment request, the vehicle establishes a target transmission channel with the electronic device and sends a response message to the electronic device indicating that the target transmission channel has been successfully established; wherein, the target transmission channel is a channel for transmitting data based on data link layer addresses and physical ports; Upon receiving the response information, the electronic device sends a first instruction to the vehicle; Upon receiving the first instruction, the vehicle determines the target physical port corresponding to the data link layer address based on the data link layer address in the first instruction; wherein, the first instruction includes software upgrade data and the data link layer address of the target electronic control unit; Based on the target physical port, the software upgrade data is transmitted to the target electronic control unit.
10. A vehicle, characterized in that, include: In-vehicle infotainment system; Memory used to store executable instructions of the vehicle system. The vehicle-mounted unit is used to execute the data transmission method according to any one of claims 1 to 6.