Software flashing method, vehicle and computer readable storage medium

CN122984504APending Publication Date: 2026-10-27SUZHOU VOICE OF LOVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611143796.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

在诊断设备需要对目标控制单元执行软件刷写作业时,若刷写软件文件体量较大,经由CEM中转的数据传输模式会增加整体刷写耗时,从而降低用户的使用体验

Benefits of technology

[0008]通过上述技术方案,接收诊断设备发送的关于诊断设备与目标控制单元的直连请求的情况下,可通过动态调整第一发送端口对应的虚拟局域网标识符,实现诊断设备所属虚拟局域网的灵活切换,进而将诊断设备与目标控制单元之间的通信通道从第一通道切换为第二通道。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122984504A_ABST
    Figure CN122984504A_ABST
Patent Text Reader

Abstract

The application provides a software flashing method, a vehicle and a computer readable storage medium, and is applied to the field of vehicle communication. The software flashing method comprises the following steps: receiving a direct connection request about a diagnostic device and a target control unit sent by the diagnostic device; switching a communication channel between the diagnostic device and the target control unit from a first channel to a second channel, wherein the first channel comprises a channel directly connected from the diagnostic device to a central electronic control module and a channel directly connected from the central electronic control module to the target control unit, and the second channel is a channel directly connected from the diagnostic device to the target control unit; and sending a channel switching response to the diagnostic device in the case that the communication channel is switched from the first channel to the second channel, so that the diagnostic device sends to-be-flashed software to the target control unit through the second channel for software flashing. In this way, the diagnostic device directly sends the to-be-flashed software to the target control unit through the second channel, and the to-be-flashed software does not need to be transferred through the central electronic control module, so that the time consumption of software flashing is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle communication, and more specifically, to a software flashing method, a vehicle, and a computer-readable storage medium. Background Technology

[0002] Currently, diagnostic equipment is available on the market for vehicle fault detection and status monitoring. It can read fault codes stored in the vehicle's control units and collect real-time data during vehicle operation, helping repair personnel quickly locate the fault. After repair, the equipment can clear fault records and perform operations such as vehicle parameter matching and component adaptive settings. In addition, diagnostic equipment also supports reprogramming and upgrading vehicle control units and reading original factory information, making it an indispensable professional tool in vehicle inspection and maintenance.

[0003] For safety reasons, diagnostic equipment connects to the vehicle via the On-Board Diagnostics (OBD) interface. The equipment can only interact with the vehicle's Central Electronic Module (CEM). When the diagnostic equipment needs to communicate with other control units in the vehicle, the relevant data must be transmitted via the CEM: the diagnostic equipment sends command messages to the CEM, which then forwards them to the target control unit. When the diagnostic equipment needs to perform software flashing on the target control unit, if the software file is large, the data transmission via the CEM increases the overall flashing time, thus reducing the user experience. Summary of the Invention

[0004] This application provides a software flashing method, a vehicle, and a computer-readable storage medium. The software flashing method is applied to the scenario of a diagnostic device flashing a target control unit. The diagnostic device can send the software to be flashed directly to the target control unit through a second channel, eliminating the need for the central electronic control module to forward the software to be flashed from the diagnostic device to the target control unit for software flashing. This reduces the time spent on software flashing and improves the user experience.

[0005] The first aspect of this application provides a software flashing method applied to a central electronic control module. The software flashing method includes: receiving a direct connection request from a diagnostic device regarding the diagnostic device and a target control unit; switching the communication channel between the diagnostic device and the target control unit from a first channel to a second channel, wherein the first channel includes a channel directly connected from the diagnostic device to the central electronic control module and a channel directly connected from the central electronic control module to the target control unit, and the second channel is a channel directly connected from the diagnostic device to the target control unit; when the communication channel is switched from the first channel to the second channel, sending a channel switching response to the diagnostic device, so that the diagnostic device sends the software to be flashed to the target control unit via the second channel for software flashing.

[0006] Through the above technical solution, when software flashing is required for the target control unit in a vehicle, the central electronic control module can switch the communication channel between the diagnostic device and the target control unit from the first channel to the second channel. This allows direct interaction between the diagnostic device and the target control unit, enabling the software to be flashed sent by the diagnostic device directly to the target control unit via the second channel, eliminating the need for the central electronic control module to relay the software. Compared to existing flashing schemes that rely on the central electronic control module for data forwarding, this application shortens the transmission path between the diagnostic device and the target control unit from sending the software to be flashed from the diagnostic device to the central electronic control module, and then from the central electronic control module to the target control unit, to sending the software directly from the diagnostic device to the target control unit. This eliminates the central electronic control module as an intermediary node, avoiding the additional time consumption caused by data relay, thereby improving flashing efficiency and ultimately enhancing the user experience.

[0007] In conjunction with the first aspect, in some possible implementations, when the communication channel is switched to the first channel, the identifier of the virtual local area network of the first transmitting port to which the diagnostic device is connected is configured by the central electronic control module as the first identifier of the first type of network, and the identifier of the virtual local area network of the second transmitting port to which the target control unit is connected is configured by the central electronic control module as the second identifier of the second type of network. When the identifier of the virtual local area network of the first transmitting port is configured as the first identifier, the channel directly connected from the diagnostic device to the central electronic control module is connected; when the identifier of the virtual local area network of the first transmitting port is configured as the second identifier, the channel directly connected from the diagnostic device to the target control unit is connected. Switching the communication channel between the diagnostic device and the target control unit from the first channel to the second channel includes: maintaining the identifier of the virtual local area network of the second transmitting port as the second identifier, configuring the identifier of the virtual local area network of the first transmitting port as the second identifier, so as to connect the channel directly from the diagnostic device to the target control unit, thereby switching the communication channel from the first channel to the second channel.

[0008] With the above technical solution, when receiving a direct connection request from the diagnostic device regarding the connection between the diagnostic device and the target control unit, the virtual local area network to which the diagnostic device belongs can be flexibly switched by dynamically adjusting the virtual local area network identifier corresponding to the first sending port, thereby switching the communication channel between the diagnostic device and the target control unit from the first channel to the second channel.

[0009] In combination with the first aspect and the above implementation methods, in some possible implementation methods, after sending a channel switching response to the diagnostic device, the software flashing method further includes: if a request to close the direct connection between the diagnostic device and the target control unit is received from the diagnostic device, the communication channel is switched from the second channel to the first channel.

[0010] The above technical solution allows the diagnostic device to communicate directly with the target control unit only when necessary (e.g., when the target control unit needs to be flashed). When a request to close the direct connection between the diagnostic device and the target control unit is received, the communication channel of the diagnostic device is immediately switched back to the first channel, preventing direct data interaction between the diagnostic device and the target control unit, thereby improving the vehicle's communication security.

[0011] In combination with the first aspect and the above implementation methods, in some possible implementation methods, after sending a channel switching response to the diagnostic device, switching the communication channel from the second channel to the first channel includes: keeping the identifier of the virtual local area network of the second sending port as the second identifier, configuring the identifier of the virtual local area network of the first sending port as the first identifier, so as to connect the channel directly from the diagnostic device to the central electronic control module, thereby switching the communication channel from the second channel to the first channel.

[0012] With the above scheme, when a request to close the direct connection between the diagnostic device and the target control unit is received from the diagnostic device, the virtual local area network (VLAN) identifier corresponding to the first sending port can be dynamically adjusted to achieve flexible switching of the VLAN to which the diagnostic device belongs, thereby switching the communication channel between the diagnostic device and the target control unit from the second channel to the first channel.

[0013] In conjunction with the first aspect and the above implementation methods, in some possible implementation methods, the software flashing method further includes: receiving a first security authentication request sent by the diagnostic device; obtaining the first identity credential information of the diagnostic device in the first security authentication request; verifying the identity reliability of the diagnostic device based on the first identity credential information; if the identity reliability verification of the diagnostic device is successful, generating a second security authentication request based on the second identity credential information of the central electronic control module; sending the second security authentication request to the diagnostic device, so that the diagnostic device verifies the identity reliability of the central electronic control module based on the second security authentication request, and sending a direct connection request to the central electronic control module after the identity reliability of the central electronic control module is successful.

[0014] Through the above technical solution, before issuing a direct connection request, the diagnostic equipment can perform a secure authentication interaction with the central electronic control module to verify the legitimacy of both parties' identities in both directions, thereby reducing communication security risks and ensuring the data reliability and operational security of the subsequent second-channel direct connection transmission and software flashing process.

[0015] A second aspect of this application provides a software flashing method applied to a diagnostic device. The software flashing method includes: responding to a software flashing command from a target control unit, sending a direct connection request between the diagnostic device and the target control unit to a central electronic control module, so that the central electronic control module switches the communication channel between the diagnostic device and the target control unit from a first channel to a second channel, wherein the first channel includes a channel directly connected from the diagnostic device to the central electronic control module and a channel directly connected from the central electronic control module to the target control unit, and the second channel is a channel directly connected from the diagnostic device to the target control unit; upon receiving a channel switching response from the central electronic control module, sending the software to be flashed to the target control unit via the second channel, so that the target control unit performs software flashing.

[0016] Through the above technical solution, when software flashing is required for the target control unit in a vehicle, the central electronic control module can switch the communication channel between the diagnostic device and the target control unit from the first channel to the second channel. This allows direct interaction between the diagnostic device and the target control unit, enabling the software to be flashed sent by the diagnostic device directly to the target control unit via the second channel, eliminating the need for the central electronic control module to relay the software. Compared to existing flashing schemes that rely on the central electronic control module for data forwarding, this application shortens the transmission path between the diagnostic device and the target control unit from sending the software to be flashed from the diagnostic device to the central electronic control module, and then from the central electronic control module to the target control unit, to sending the software directly from the diagnostic device to the target control unit. This eliminates the central electronic control module as an intermediary node, avoiding the additional time consumption caused by data relay, thereby improving flashing efficiency and ultimately enhancing the user experience.

[0017] In combination with the second aspect and the above implementation methods, in some possible implementation methods, after the software to be flashed is sent to the target control unit via the second channel, the software flashing method further includes: upon receiving the flashing completion instruction from the target control unit, sending a direct connection shutdown request between the diagnostic device and the target control unit to the central electronic control module, so that the central electronic control module switches the communication channel from the second channel to the first channel.

[0018] The above technical solution allows direct communication between the diagnostic device and the target control unit only when the target control unit needs to be flashed. Once the target control unit is flashed, the communication channel of the diagnostic device is immediately switched back to the first channel, preventing direct data interaction between the diagnostic device and the target control unit, thereby improving vehicle communication security.

[0019] In conjunction with the second aspect and the above implementation methods, in some possible implementation methods, the software flashing method further includes: generating a first security authentication request based on the first identity credential information of the diagnostic device; sending the first security authentication request to the central electronic control module, so that the central electronic control module verifies the identity reliability of the diagnostic device based on the first security authentication request, and after the identity reliability of the diagnostic device is verified, sending a second security authentication request generated based on the second identity credential information of the central electronic control module to the diagnostic device; receiving the second security authentication request sent by the central electronic control module; verifying the identity reliability of the central electronic control module based on the second identity credential information in the second security authentication request; if the identity reliability of the central electronic control module is verified, sending a direct connection request to the central electronic control module.

[0020] Through the above technical solution, before issuing a direct connection request, the diagnostic equipment can perform a secure authentication interaction with the central electronic control module to verify the legitimacy of both parties' identities in both directions, thereby reducing communication security risks and ensuring the data reliability and operational security of the subsequent second-channel direct connection transmission and software flashing process.

[0021] A third aspect of this application provides a vehicle including a memory and a processor. The memory is used to store executable program code. The processor is used to call and run the executable program code from the memory, causing the vehicle to perform the software flashing method in any possible implementation of the first or second aspect.

[0022] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed, implements the software flashing method in either the first or second aspect. Attached Figure Description

[0023] Figure 1This is a diagram illustrating the communication channels between the central electronic control module, the target control unit, and the diagnostic equipment in existing technologies. Figure 2 This is a schematic diagram of the first interaction timing between the central electronic control module, the target control unit, and the diagnostic equipment, which are shared by existing technologies and embodiments of this application. Figure 3 This is a schematic diagram of the second interaction timing between the central electronic control module, the target control unit, and the diagnostic equipment in the prior art; Figure 4 This is a first schematic flowchart of a software flashing method provided in an embodiment of this application; Figure 5 This is a communication channel interaction diagram between the central electronic control module, the target control unit, and the diagnostic equipment provided in the embodiments of this application; Figure 6 This is a second schematic flowchart of a software flashing method provided in an embodiment of this application; Figure 7 This is a third illustrative flowchart of a software flashing method provided in an embodiment of this application; Figure 8 This is a fourth schematic flowchart of a software flashing method provided in an embodiment of this application; Figure 9 This is a fifth schematic flowchart of a software flashing method provided in an embodiment of this application; Figure 10 This is a sixth schematic flowchart of a software flashing method provided in an embodiment of this application; Figure 11 This is a seventh schematic flowchart of a software flashing method provided in an embodiment of this application; Figure 12 This is a schematic diagram of the third interaction timing between the diagnostic device, the central electronic control module, and the target control unit in the embodiments of this application; Figure 13 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application; Figure 14 This is a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

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

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

[0026] Currently, diagnostic equipment is available on the market for vehicle fault detection and status monitoring. It can read fault codes stored in the vehicle's control units and collect real-time data during vehicle operation, helping repair personnel quickly locate the fault. After repair, the diagnostic equipment can clear fault records and perform operations such as vehicle parameter matching and component adaptive settings. In addition, the diagnostic equipment also supports reprogramming and upgrading the vehicle's control units and reading original factory information, making it an indispensable professional tool in vehicle inspection and maintenance.

[0027] Due to vehicle network security design requirements, diagnostic equipment connects to the vehicle network via the On-Board Diagnostics (OBD) interface and can only establish direct diagnostic interaction with the vehicle's central electronic control module (CEM). If the diagnostic equipment needs to communicate with other control units (ECUs) within the vehicle, all interaction messages must be relayed through the CEM: the diagnostic equipment first sends diagnostic command messages to the CEM, which then forwards them to the target control unit. Figure 1 It can be seen that when the diagnostic device transmits data to the target control unit, the data transmission path is sequentially path ①→②→③→④.

[0028] Please combine Figure 2The central control module and the diagnostic equipment communicate using Internet Protocol (IP) addresses dynamically assigned by Dynamic Host Configuration Protocol (DHCP), and both belong to the same Virtual Local Area Network (VLAN) segment (e.g., VLAN X1). The target control unit to be flashed and the central control module are deployed in another independent VLAN segment (e.g., VLAN X2), and the central control module and each target control unit use pre-configured static IP addresses to achieve data interaction.

[0029] When the diagnostic equipment and the central control module directly exchange diagnostic data, the source Media Access Control (MAC) address, destination MAC address, source IP address, destination IP address, and logical addresses at both ends of the message correspond to the diagnostic equipment and the central control module, respectively. The communication IP of the central control module is dynamically assigned by DHCP.

[0030] Please combine Figure 3 The diagnostic equipment cannot directly establish diagnostic communication with the vehicle-mounted target control unit; all uplink and downlink packets must be forwarded through the central electronic control module. During the forwarding process, the central electronic control module needs to perform address translation on the packets sent by the diagnostic equipment to the target control unit and the response packets sent back by the target control unit to the diagnostic equipment. This involves modifying the source MAC address, destination MAC address, VLAN tag, source IP address, and destination IP address before forwarding the packets.

[0031] The message information between the diagnostic equipment and the central electronic control module is shown in Table (1), and the message information between the central electronic control module and the control unit is shown in Table (2).

[0032] Table (1)

[0033] Table (2)

[0034] Therefore, when diagnostic equipment needs to perform software flashing on the target control unit, if the software file size is large, the data transmission mode via the central electronic control module will increase the overall flashing time, thereby reducing the user experience.

[0035] To address the above problems, this application provides a software flashing method.

[0036] First, let me introduce the technical background of this application: The vehicle includes a central electronic control module, multiple control units, an on-board diagnostic (OBD) system, and corresponding OBD interfaces. The central electronic control module acts as a gateway and relay node for the vehicle network, responsible for routing and forwarding diagnostic messages, managing session permissions, and scheduling data interaction between control units. Control units are hardware controllers for different functional domains of the vehicle, executing the control logic of their respective domains and receiving software updates from diagnostic tools, such as the engine control unit, transmission control unit, or body control module. The on-board diagnostic (OBD) system is a built-in fault monitoring and electronic control communication system. Relying on the vehicle network and standardized OBD interfaces, it enables on-board diagnostic capabilities such as monitoring the operating status of each ECU, storing faults, and updating software. The OBD interface connects to the vehicle's ECU (ECU) computer. When diagnosing the vehicle, a diagnostic tool is plugged into this interface to scan for faults and fault codes. The diagnostic tool can also be used to control the updating of in-vehicle nodes. Diagnostic equipment is an external device used to detect faults and monitor the condition of a vehicle. It connects to the OBD interface via a wire and accesses the vehicle network through the OBD interface. According to standard diagnostic protocols, it reads and operates the fault data and data stream in the vehicle's built-in OBD on-board diagnostic system and issues flashing and configuration commands.

[0037] Please combine Figure 2 When the diagnostic device is connected to the OBD port, both the diagnostic device and the central electronic control module (CEMM) perform physical link detection and IP address configuration. Then, the diagnostic device sends a vehicle identification request, and the CEMM, upon receiving the request, replies with a vehicle identification response. Next, the diagnostic device can establish a connection with the CEMM, for example, through a Transmission Control Protocol (TCP) connection. The diagnostic device then sends a route activation request, and the CEMM, upon receiving this request, replies with a route activation response to activate the established connection. After the connection is activated, the diagnostic device and CEMM can begin exchanging diagnostic commands. The diagnostic device sends diagnostic requests to the CEMM, which acknowledges or denies the diagnostic messages and then returns a diagnostic response.

[0038] Simultaneously, the control unit can establish a connection with the central electronic control module, for example, by establishing a Transmission Control Protocol (TCP) connection. The central electronic control module then sends a route activation request. Upon receiving the request, the control unit replies with a route activation response to activate the established connection. At this point, the first channel described below is activated, enabling communication between the diagnostic device and the central electronic control module.

[0039] After the diagnostic equipment interacts with the central electronic control module (CEMM), it can obtain information about each control unit of the vehicle through the CEMM to determine the target control unit that needs to be flashed. When the operator determines that the target control unit needs to be flashed, a software flashing command for the target control unit is sent to the diagnostic equipment. Then, the diagnostic equipment and the CEMM begin the flashing-related interactions to execute the software flashing method of this application.

[0040] The software flashing method of this application will be described in detail below: Figure 4 This application provides a software flashing method applied to a central electronic control module, where the central electronic control module is the executing entity. The method includes the following steps: Step 011: Receive the direct connection request sent by the diagnostic device regarding the direct connection between the diagnostic device and the target control unit, and switch the communication channel between the diagnostic device and the target control unit from the first channel to the second channel. The first channel includes a channel directly connected from the diagnostic device to the central electronic control module and a channel directly connected from the central electronic control module to the target control unit. The second channel is a channel directly connected from the diagnostic device to the target control unit.

[0041] Specifically, the communication channel between the diagnostic device and the target control unit includes a first channel and a second channel. The first channel includes a channel directly connecting the diagnostic device to the central electronic control module and a channel directly connecting the central electronic control module to the target control unit. When the communication channel between the diagnostic device and the target control unit is the first channel, communication between the diagnostic device and the target control unit requires information relaying through the central electronic control module. The second channel is a direct connection from the diagnostic device to the target control unit. When the communication channel between the diagnostic device and the target control unit is the second channel, the diagnostic device and the target control unit can interact directly without information relaying through the central electronic control module.

[0042] For example, combining Figure 5 It can be seen that the first channel includes paths ①, ②, ③ and ④, and the second channel includes paths ⑤ and ⑥.

[0043] The central control module can switch the current communication channel of the diagnostic device according to its needs. For example, during routine diagnostics, the central control module can switch the current communication channel to the first channel; during a flashing task, it can switch to the second channel. Devices on the same virtual LAN can connect directly, so the central control module can adjust the communication channel of the diagnostic device by changing the identifier of the virtual LAN of the first transmitting port to which the diagnostic device is connected.

[0044] When certain flashing procedures are required, such as when replacing a brand-new electronic control component and needing to perform a corresponding software flashing procedure, the operator selects the target control unit in the diagnostic equipment and performs a programming flashing operation. The software flashing command for the target control unit is then triggered. Upon receiving the software flashing command for the target control unit, the diagnostic equipment can send a direct connection request to the central electronic control module regarding the connection between the diagnostic equipment and the target control unit. Upon receiving the direct connection request, the central electronic control module can switch the communication channel of the diagnostic equipment from the first channel to the second channel, enabling the diagnostic equipment to interact directly with the target control unit without the need for information relay by the central electronic control module.

[0045] Step 012: When the communication channel is switched from the first channel to the second channel, a channel switching response is sent to the diagnostic device so that the diagnostic device sends the software to be flashed to the target control unit via the second channel for software flashing.

[0046] Specifically, when the communication channel between the target control unit and the diagnostic device is switched from the first channel to the second channel, the central electronic control module can send a channel switching response to the diagnostic device to inform the diagnostic device that the communication channel has been switched to the second channel.

[0047] Upon receiving a channel switching response, the diagnostic equipment can send the software to be flashed to the target control unit via a second channel. The target control unit then receives the software and flashes it according to the flashing procedure. For example, if a brand-new engine control unit is replaced during repair, the target flashing unit is this new engine control unit. The software to be flashed includes the original engine's underlying control firmware, power calibration parameters adapted to the vehicle, and vehicle anti-theft matching data. This allows the newly replaced electronic control components to adapt to the vehicle's control logic and participate normally in vehicle operation.

[0048] It should be noted that the software flashing solution of this application supports multiple upgrade methods. The vehicle can be equipped with external diagnostic equipment to flash the firmware of each vehicle Ethernet node through the OBD interface. Alternatively, the vehicle can be equipped with the vehicle communication module to perform a remote online upgrade via Firmware Over-The-Air (FOTA). It can also be equipped with external storage media to perform local offline firmware flashing via the vehicle's Universal Serial Bus (USB) interface. The three flashing methods can be adapted to different application scenarios and flexibly complete the program update of each control unit in the vehicle.

[0049] Based on the software flashing method of this application, when software flashing of a target control unit in a vehicle is required, the central electronic control module can switch the communication channel between the diagnostic device and the target control unit from the first channel to the second channel. This allows the diagnostic device and the target control unit to interact directly, enabling the software to be flashed sent by the diagnostic device to be sent directly to the target control unit via the second channel, without the need for the central electronic control module to relay the software. Compared to existing flashing schemes that rely on the central electronic control module for data forwarding, this application shortens the transmission path between the diagnostic device and the target control unit from sending the software to be flashed from the diagnostic device to the central electronic control module, and then from the central electronic control module to the target control unit, to sending the software directly from the diagnostic device to the target control unit. This eliminates the central electronic control module as a relay node, avoiding the additional time consumption caused by data relay, thereby improving flashing efficiency and ultimately enhancing the user experience.

[0050] Please see Figure 6 In some implementations, when the communication channel is switched to the first channel, the identifier of the virtual local area network (VLAN) of the first transmitting port to which the diagnostic device is connected is configured by the central electronic control module as the first identifier of the first type of network, and the identifier of the VLAN of the second transmitting port to which the target control unit is connected is configured by the central electronic control module as the second identifier of the second type of network. When the identifier of the VLAN of the first transmitting port is configured as the first identifier, the channel directly connected from the diagnostic device to the central electronic control module is connected; when the identifier of the VLAN of the first transmitting port is configured as the second identifier, the channel directly connected from the diagnostic device to the target control unit is connected.

[0051] Step 011: Switch the communication channel between the diagnostic device and the target control unit from the first channel to the second channel, including: Step 0111: Keep the identifier of the virtual LAN of the second transmitting port as the second identifier, and configure the identifier of the virtual LAN of the first transmitting port as the second identifier to connect the channel directly from the diagnostic device to the target control unit, so that the communication channel is switched from the first channel to the second channel.

[0052] Specifically, a Virtual Local Area Network (VLAN) is a logical network segment created by a switch on top of a physical local area network (LAN). Multiple devices connected to the same physical switch can be grouped into different VLANs based on their services, functions, and device types without needing to replace network cables or adjust physical cabling. Only devices with the same VLAN identifier can directly communicate at Layer 2. Different VLANs are isolated from each other by default and cannot directly send or receive broadcast messages or exchange data; they must communicate through a router.

[0053] The Virtual Local Area Network (VLAN) includes a Type I network and a Type II network. The VLAN identifier of the central electronic control module's (CEMM) transmitting port includes the first identifier of the Type I network and the second identifier of the Type II network. Therefore, the CEMM can communicate with diagnostic equipment through the Type I network and with various control units of the vehicle through the Type II network. The VLAN identifier of the second transmitting port to which all control units in the vehicle are connected is configured by the CEMM as the second identifier of the Type II network (e.g., X2). This means that the target control unit can only communicate with the CEMM and the diagnostic equipment after the communication channel has been switched to the second channel through the Type II network.

[0054] The central control module can flexibly adjust the virtual local area network (VLAN) to which the diagnostic device belongs by adjusting the identifier of the VLAN of the first transmitting port to which the diagnostic device is connected, thereby completing the switching of communication modes between the first channel and the second channel.

[0055] When the communication channel is the first channel, the central electronic control module (CEMM) and the diagnostic device communicate via a first type of network. The identifier of the virtual local area network (VLAN) of the first transmitting port connected to the diagnostic device is configured by the CEMM as the first identifier of the first type of network (e.g., X1); the identifier of the VLAN of the second transmitting port connected to the target control unit is configured by the CEMM as the second identifier of the second type of network (e.g., X2). At this time, the CEMM and the diagnostic device can communicate via the first network, and the CEMM and the target control unit can communicate via the second network. When the channel directly connecting the diagnostic device to the CEMM is established, and the diagnostic device and the target control unit cannot directly interact, the CEMM needs to act as an intermediary to relay information before the diagnostic device's information can be sent to the target control unit.

[0056] When the communication channel is the second channel, the identifier of the virtual local area network (VLAN) of the second transmitting port connected to the target control unit is the second identifier (X2), and the identifier of the VLAN of the first transmitting port connected to the diagnostic device is also configured as the second identifier (X2). At this time, the VLAN corresponding to the diagnostic device switches to the second network, allowing the diagnostic device and the target control unit to communicate directly through the second network. Simultaneously, the central control module allows the diagnostic device to communicate based on the MAC address of the target control unit, restricting the diagnostic device to communicate only with the target control unit to avoid network congestion caused by message broadcasting across the entire network and to ensure stable writing and flashing communication.

[0057] When the central control module configures the identifier of the virtual LAN on the first transmitting port to the second identifier, the central control module can send a direct channel connection request feedback to the diagnostic device. Upon receiving the direct channel connection request feedback, the diagnostic device can initiate a TCP connection request with the target control unit. After receiving the TCP connection request, the target control unit can establish a TCP connection between the diagnostic device and the target control unit. Once the TCP connection is established, the diagnostic device can send a route activation request to activate the established TCP connection between the diagnostic device and the target control unit. After the TCP connection is activated, the channel directly connecting the diagnostic device to the target control unit is considered open, causing the communication channel to switch from the first channel to the second channel.

[0058] Thus, when receiving a direct connection request from the diagnostic device regarding the connection between the diagnostic device and the target control unit, the virtual local area network to which the diagnostic device belongs can be flexibly switched by dynamically adjusting the virtual local area network identifier corresponding to the first sending port, thereby switching the communication channel between the diagnostic device and the target control unit from the first channel to the second channel.

[0059] Please see Figure 7 In some implementations, after sending a channel switching response to the diagnostic device, the software flashing method further includes: Step 013: If a request to close the direct connection between the diagnostic device and the target control unit is received from the diagnostic device, switch the communication channel from the second channel to the first channel.

[0060] Specifically, if a request to shut down the direct connection between the diagnostic device and the target control unit is received from the diagnostic device, it means that the diagnostic device has completed the flashing task. At this time, the central electronic control module can switch the communication channel from the second channel to the first channel.

[0061] For example, the central control module can keep the identifier of the virtual local area network of the second transmitting port as the second identifier and configure the identifier of the virtual local area network of the first transmitting port as the first identifier. The virtual local area network corresponding to the diagnostic device is switched to the first network to connect the channel directly from the diagnostic device to the central control module and disconnect the channel directly from the diagnostic device to the target control unit, so that the communication channel is switched from the second channel to the first channel. At this time, the diagnostic device and the target control unit cannot communicate directly.

[0062] Upon receiving a request from the diagnostic device to close the direct connection between the diagnostic device and the target control unit, the virtual local area network (VLAN) to which the diagnostic device belongs can be flexibly switched by dynamically adjusting the VLAN identifier corresponding to the first sending port, thereby switching the communication channel between the diagnostic device and the target control unit from the second channel to the first channel.

[0063] In this way, the direct communication permission between the diagnostic device and the target control unit is only opened when necessary (such as when the target control unit needs to be flashed). When a request to close the direct connection between the diagnostic device and the target control unit is received from the diagnostic device, the communication channel of the diagnostic device is immediately switched back to the first channel, so that the diagnostic device and the target control unit cannot directly exchange data, thereby improving the communication security of the vehicle.

[0064] Please see Figure 8 In some implementations, the software flashing method further includes: Step 014: Receive the first security authentication request sent by the diagnostic device; Step 015: Obtain the first identity credential information of the diagnostic device from the first security authentication request; Step 016: Verify the identity reliability of the diagnostic device based on the first identity credential information; Step 017: If the identity reliability verification of the diagnostic device passes, generate a second security authentication request based on the second identity credential information of the central electronic control module; Step 018: Send the second security authentication request to the diagnostic device so that the diagnostic device can verify the identity and reliability of the central electronic control module based on the second security authentication request, and send a direct connection request to the central electronic control module after the identity and reliability of the central electronic control module are verified.

[0065] Specifically, both the diagnostic equipment and the central electronic control module store identity credentials that can prove their identity. For example, the diagnostic equipment stores the following primary identity credentials: its unique hardware identifier, manufacturer's authorization certificate, digital signature information, and validity period information. The central electronic control module stores the following secondary identity credentials: its unique vehicle identification number, central electronic control module hardware identifier, vehicle safety certificate, digital signature, and validity period verification information.

[0066] Once a connection is established between the central control module and the diagnostic equipment, and communication is possible between them, secure authentication can be performed. The secure authentication method can employ the 27-security unlocking algorithm.

[0067] Specifically, when the first channel between the diagnostic device and the central electronic control module is established, the diagnostic device can initiate a first security authentication request, which includes first identity credential information. After receiving the first security authentication request, the central electronic control module obtains the first identity credential information and verifies its legality, completeness, and timeliness against the local trusted authorization database and the pre-installed root certificate to verify the reliability of the diagnostic device's identity.

[0068] If the diagnostic device's identity and reliability verification passes, the central control module generates a second security authentication request based on the second identity credential information. The central control module then sends this second security authentication request to the diagnostic device.

[0069] The diagnostic equipment receives the second security authentication request and parses it to obtain the second identity credential information. It then verifies the authenticity of the central electronic control module's identity, the integrity of the message, and the validity of the credential using preset trusted verification rules, thereby verifying the reliability of the central electronic control module's identity. After the central electronic control module's identity reliability is verified, the diagnostic equipment sends a direct connection request to the central electronic control module.

[0070] Thus, before the diagnostic device sends a direct connection request to switch the communication channel to the second channel, the diagnostic device can perform secure authentication interaction with the central electronic control module to verify the legitimacy of both parties' identities in both directions, thereby reducing communication security risks and ensuring the data reliability and operational security of the subsequent direct connection transmission and software flashing process on the second channel.

[0071] In some embodiments, before initiating the first security authentication request, the diagnostic device first sends an extension session request to the central electronic control module. After the diagnostic device and the central electronic control module establish a first channel, the current communication session corresponding to the first channel is a regular default session. The regular default session only allows basic read-only diagnostic functions such as fault code reading, real-time data stream viewing, and sensor status monitoring, with a low permission level, and cannot perform high-risk advanced diagnostic operations such as software flashing of the target control unit. The purpose of the extension session request is to enhance the security permission level of the current communication session and unlock advanced diagnostic function permissions of the vehicle's electronic control system. It is an essential prerequisite for the target control unit to enter the flashing and programming mode.

[0072] After receiving the request to enter the extended session from the diagnostic equipment, the central electronic control module first determines whether the current vehicle operating status meets the prerequisite hardware conditions for entering the extended session. These prerequisite hardware conditions include whether the vehicle is in an ignition-on, non-driving state, whether the vehicle speed is 0, whether the engine is off, and whether there are no active fault alarms triggering session locking.

[0073] Assuming the vehicle's operating status meets the access requirements, the central electronic control module switches the current communication session from the default basic session to an advanced extended session mode, temporarily granting access to advanced diagnostic functions to ensure that the target control unit can subsequently enter the flashing and programming mode. Then, the central electronic control module sends feedback to the diagnostic equipment indicating entry into the extended session. Upon receiving this feedback, the diagnostic equipment initiates the first security authentication request.

[0074] In this way, by extending the session request to unlock the target control unit's access to the flashing and programming mode, the access of basic diagnostic functions and advanced flashing functions can be isolated, which can effectively prevent the risk of tampering with the vehicle's electronic control program caused by misoperation, unauthorized access and other behaviors.

[0075] Figure 9 This application provides a software flashing method applied to diagnostic devices, where the executing entity is the diagnostic device. The software flashing method includes: Step 021: In response to the software flashing command of the target control unit, a direct connection request between the diagnostic device and the target control unit is sent to the central electronic control module, so that the central electronic control module switches the communication channel between the diagnostic device and the target control unit from the first channel to the second channel. The first channel includes a channel directly connected from the diagnostic device to the central electronic control module and a channel directly connected from the central electronic control module to the target control unit, and the second channel is a channel directly connected from the diagnostic device to the target control unit.

[0076] Step 022: Upon receiving the channel switching response from the central electronic control module, the software to be flashed is sent to the target control unit via the second channel so that the target control unit can flash the software.

[0077] Specifically, when certain flashing procedures are required, such as when replacing a brand-new electronic control component and needing to perform a corresponding software flashing procedure, the operator selects the target control unit in the diagnostic equipment and performs a programming flashing operation. The software flashing command for the target control unit is then triggered. Upon receiving the software flashing command from the target control unit, the diagnostic equipment sends a direct connection request to the central electronic control module (ECU) regarding the connection between the diagnostic equipment and the target control unit. Upon receiving this request, the ECU can switch the communication channel of the diagnostic equipment from the first channel to the second channel. The first channel includes a channel directly connecting the diagnostic equipment to the ECU and a channel directly connecting the ECU to the target control unit; the second channel is the channel directly connecting the diagnostic equipment to the target control unit. Simultaneously, when the communication channel between the target control unit and the diagnostic equipment switches from the first channel to the second channel, the ECU can send a channel switching response to the diagnostic equipment to inform it that the communication channel has been switched to the second channel. This allows the diagnostic equipment to interact directly with the target control unit without the need for information relay by the ECU.

[0078] Upon receiving a channel switching response, the diagnostic equipment confirms that the second channel is active. At this point, the software to be flashed is sent to the target control unit via the second channel. After receiving the software, the target control unit flashes it according to the flashing procedure. For example, in the scenario of replacing a vehicle's body control module with a brand new one, the target flashing unit is this new body control module. The software to be flashed includes the original factory body electrical underlying driver firmware, calibration parameters for body electrical systems such as lights, door locks, and wipers adapted to this model, vehicle coding configuration data, and personalized configuration parameters for comfort functions. This allows the newly replaced body control components to match the vehicle's electrical architecture, accurately execute control commands for various electrical devices in the body, and stably realize various comfort and safety functions of the vehicle.

[0079] Based on the software flashing method of this application, when software flashing of a target control unit in a vehicle is required, the central electronic control module can switch the communication channel between the diagnostic device and the target control unit from the first channel to the second channel. This allows the diagnostic device and the target control unit to interact directly, enabling the software to be flashed sent by the diagnostic device to be sent directly to the target control unit via the second channel, without the need for the central electronic control module to relay the software. Compared to existing flashing schemes that rely on the central electronic control module for data forwarding, this application shortens the transmission path between the diagnostic device and the target control unit from sending the software to be flashed from the diagnostic device to the central electronic control module, and then from the central electronic control module to the target control unit, to sending the software directly from the diagnostic device to the target control unit. This eliminates the central electronic control module as a relay node, avoiding the additional time consumption caused by data relay, thereby improving flashing efficiency and ultimately enhancing the user experience.

[0080] Please see Figure 10 In some embodiments, after the software to be flashed is sent to the target control unit via the second channel, the software flashing method further includes: Step 023: Upon receiving the flashing completion instruction from the target control unit, send a request to the central electronic control module to shut down the direct connection between the diagnostic device and the target control unit, so that the central electronic control module switches the communication channel from the second channel to the first channel.

[0081] Specifically, once the target control unit confirms that the flashing process is complete, it can send a flashing completion command to the diagnostic device. Alternatively, the diagnostic device can monitor the flashing progress of the target control unit in real time, and upon determining that the flashing of the target control unit is complete based on the flashing progress, confirm receipt of the flashing completion command.

[0082] Upon receiving the flashing completion instruction from the target control unit, the diagnostic device sends a request to the central electronic control module to disable the direct connection between the diagnostic device and the target control unit, so that the central electronic control module switches the communication channel from the second channel to the first channel.

[0083] In some embodiments, upon receiving a write completion command from the target control unit, the diagnostic device can proactively disconnect the second channel with the target control unit. Simultaneously, the diagnostic device checks whether communication with the central electronic control module (ECU) is still established. If communication is still established, the diagnostic device can directly initiate a request to close the direct connection. If communication is disconnected, the diagnostic device re-establishes the communication channel with the ECU and sends a request to enter an extended session. Upon receiving the extended session request, the ECU replies with an extended session response. After receiving the extended session response, the diagnostic device and the ECU perform a security authentication interaction. After completing the security authentication, the diagnostic device then initiates a request to close the direct connection.

[0084] In this way, the direct communication permission between the diagnostic device and the target control unit is only opened when the target control unit needs to be flashed. Once the target control unit is flashed, the communication channel of the diagnostic device is immediately switched back to the first channel, so that the diagnostic device and the target control unit cannot directly exchange data, thereby improving the vehicle's communication security.

[0085] Please see Figure 11 In some implementations, the software flashing method further includes: Step 024: Generate a first security authentication request based on the first identity credential information of the diagnostic device; Step 025: Send the first security authentication request to the central electronic control module so that the central electronic control module can verify the identity reliability of the diagnostic device based on the first security authentication request, and after the identity reliability of the diagnostic device is verified, send the second security authentication request generated based on the second identity credential information of the central electronic control module to the diagnostic device; Step 026: Receive the second security authentication request sent by the central electronic control module; Step 027: Verify the identity reliability of the central electronic control module based on the second identity credential information in the second security authentication request; Step 028: If the identity and reliability of the central electronic control module are verified, send a direct connection request to the central electronic control module.

[0086] Specifically, the diagnostic device may store primary identity credential information that can prove its own identity. The primary identity credential information may include the diagnostic device's unique hardware identifier, manufacturer's authorization certificate, digital signature information, and credential validity period information.

[0087] With the first communication path between the diagnostic device and the central electronic control module (ECU) established, the diagnostic device can generate a first security authentication request based on the first identity credential information and send it to the ECU. Upon receiving the first security authentication request, the ECU retrieves the first identity credential information and verifies its legality, completeness, and timeliness against its local trusted authorization database and pre-installed root certificate to verify the diagnostic device's identity reliability. If the diagnostic device's identity reliability verification passes, the ECU generates a second security authentication request based on its own second identity credential information. This second identity credential information includes the vehicle unique identifier, the ECU hardware identifier, the vehicle security certificate, digital signature, and timeliness verification information. The ECU then sends the second security authentication request to the diagnostic device.

[0088] The diagnostic equipment receives the second security authentication request and parses it to obtain the second identity credential information. It then verifies the authenticity of the central electronic control module's identity, the integrity of the message, and the validity of the credential using preset trusted verification rules, thereby verifying the reliability of the central electronic control module's identity. After the central electronic control module's identity reliability is verified, the diagnostic equipment sends a direct connection request to the central electronic control module.

[0089] Thus, before the diagnostic device sends a direct connection request to switch the communication channel to the second channel, the diagnostic device can perform secure authentication interaction with the central electronic control module to verify the legitimacy of both parties' identities in both directions, thereby reducing communication security risks and ensuring the data reliability and operational security of the subsequent direct connection transmission and software flashing process on the second channel.

[0090] Please see Figure 4 and Figure 9 The vehicle described in this application includes a central electronic control module and a target control unit.

[0091] In response to the software flashing command from the target control unit, the diagnostic device sends a direct connection request between itself and the central electronic control module (CEModule). Upon receiving this request, the CEModule switches the communication channel between the diagnostic device and the target control unit from a first channel to a second channel. The first channel includes a direct connection from the diagnostic device to the CEModule and a direct connection from the CEModule to the target control unit; the second channel is a direct connection from the diagnostic device to the target control unit. When the communication channel is switched from the first to the second channel, the CEModule sends a channel switching response to the diagnostic device. Upon receiving the channel switching response from the CEModule, the diagnostic device sends the software to be flashed to the target control unit via the second channel, enabling the target control unit to perform the software flashing.

[0092] Figure 2 and Figure 12 This is a schematic diagram illustrating the interaction timing of the diagnostic device, central electronic control module, and target control unit at different stages in the embodiments of this application. Please refer to... Figure 2 and Figure 12 The following provides a detailed explanation of the interaction logic between the diagnostic device, the central electronic control module, and the target control unit in the software flashing method provided in this application.

[0093] Please combine Figure 2 After the diagnostic device and vehicle complete physical link testing and each configures its IP address, the diagnostic device sends a vehicle identification request to the central electronic control module (ECU). Upon receiving the vehicle identification response from the ECU and completing vehicle identification, a TCP communication connection is established between the diagnostic device and the ECU. Subsequently, the diagnostic device sends a route activation request to the ECU. After receiving the route activation response from the ECU, the first channel between the diagnostic device and the ECU is officially established, and both parties can exchange diagnostic commands. The identifier of the virtual local area network configured on the first sending port of the diagnostic device is the first network identifier X1 corresponding to the first type of network.

[0094] Please combine Figure 12 With the first channel between the diagnostic device and the central electronic control module (CEMM) established, the two devices interact to request entry into an extended session. Then, the CEMM and the diagnostic device can perform secure authentication interactions. The diagnostic device generates a first security authentication request based on its first identity credential information and sends it to the CEMM. The CEMM verifies the diagnostic device's identity reliability based on the first identity credential information in the first security authentication request. After successful identity reliability verification, the CEMM generates a second security authentication request based on its second identity credential information and sends it to the diagnostic device. Upon receiving the second security authentication request from the CEMM, the diagnostic device verifies its identity reliability based on the second identity credential information in the second security authentication request.

[0095] After successful security authentication between the diagnostic device and the central electronic control module (CEMM), the diagnostic device sends a direct connection request to the CEMM. At this time, the CEMM configures the identifier of the virtual local area network (VLAN) of the first transmitting port connected to the diagnostic device to a second identifier (X2) for a second type of network, thus establishing a direct connection between the diagnostic device and the target control unit. This switches the communication channel from the first channel to the second channel, while also restricting the diagnostic device to communicate only with the target control unit. Furthermore, the diagnostic message is switched to display the IP and MAC addresses of the target control unit.

[0096] The message information corresponding to the first channel is shown in Table (3), and the message information corresponding to the second channel is shown in Table (4).

[0097] Table (3)

[0098] Table (4)

[0099] When the communication channel is switched from the first channel to the second channel, the central electronic control module sends a channel switching response to the diagnostic equipment, so that the diagnostic equipment sends the software to be flashed to the target control unit via the second channel for software flashing.

[0100] Upon receiving the flashing completion command from the target control unit, the diagnostic device actively disconnects from the target control unit. The diagnostic device also checks the connection with the central electronic control module (CEModule). If the connection is still active, it directly sends a direct connection closure request to the CEModule. If the connection has been closed, the CEModule and the diagnostic device re-establish a TCP connection, and then sequentially execute the extended session request interaction and security authentication interaction. After successful security authentication between the CEModule and the diagnostic device, the diagnostic device sends a direct connection closure request to the CEModule. Upon receiving the direct connection closure request, the CEModule configures the identifier of the virtual LAN of the first sending port connected to the diagnostic device to the first identifier X1 of the first type of network, thereby switching the communication channel between the diagnostic device and the target control unit from the second channel to the first channel.

[0101] Please see Figure 13 The vehicle 100 in this embodiment further includes a memory 20 and a processor 10. The memory 20 is used to store executable program code; the processor 10 is used to call and run the executable program code from the memory, causing the vehicle to execute instructions of the software flashing method as described in any of the above embodiments.

[0102] Please see Figure 14 This application also provides a computer-readable storage medium 300 storing a computer program 310. When the computer program 310 is executed, it implements the steps of the software flashing method of any of the above embodiments. For the sake of brevity, these steps will not be repeated here.

[0103] In the description of this specification, the references to terms such as "some embodiments," "in one example," "exemplarily," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0104] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.

[0105] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A software flashing method, characterized in that, The software flashing method, applied to the central electronic control module, includes: The system receives a direct connection request from the diagnostic device regarding the direct connection between the diagnostic device and the target control unit, and switches the communication channel between the diagnostic device and the target control unit from a first channel to a second channel. The first channel includes a channel directly connected from the diagnostic device to the central electronic control module and a channel directly connected from the central electronic control module to the target control unit. The second channel is a channel directly connected from the diagnostic device to the target control unit. When the communication channel is switched from the first channel to the second channel, a channel switching response is sent to the diagnostic device so that the diagnostic device sends the software to be flashed to the target control unit via the second channel for software flashing.

2. The software flashing method according to claim 1, characterized in that, When the communication channel is switched to the first channel, the identifier of the virtual local area network (VLAN) of the first transmitting port connected to the diagnostic device is configured by the central electronic control module as the first identifier of a first type of network, and the identifier of the VLAN of the second transmitting port connected to the target control unit is configured by the central electronic control module as the second identifier of a second type of network. When the identifier of the VLAN of the first transmitting port is configured as the first identifier, the channel directly connected from the diagnostic device to the central electronic control module is connected; when the identifier of the VLAN of the first transmitting port is configured as the second identifier, the channel directly connected from the diagnostic device to the target control unit is connected. Switching the communication channel between the diagnostic device and the target control unit from the first channel to the second channel includes: Keep the identifier of the virtual local area network of the second transmitting port as the second identifier, and configure the identifier of the virtual local area network of the first transmitting port as the second identifier to connect the channel directly from the diagnostic device to the target control unit, so that the communication channel is switched from the first channel to the second channel.

3. The software flashing method according to claim 2, characterized in that, After sending a channel switching response to the diagnostic device, the software flashing method further includes: If a request to disable the direct connection between the diagnostic device and the target control unit is received, the communication channel is switched from the second channel to the first channel.

4. The software flashing method according to claim 3, characterized in that, After sending a channel switching response to the diagnostic device, switching the communication channel from the second channel to the first channel includes: Keep the identifier of the virtual local area network of the second transmitting port as the second identifier, and configure the identifier of the virtual local area network of the first transmitting port as the first identifier to connect the channel directly from the diagnostic device to the central electronic control module, so that the communication channel is switched from the second channel to the first channel.

5. The software flashing method according to claim 1, characterized in that, The software flashing method also includes: Receive the first security authentication request sent by the diagnostic device; Obtain the first identity credential information of the diagnostic device in the first security authentication request; The identity and reliability of the diagnostic device are verified based on the first identity credential information. If the identity reliability verification of the diagnostic device passes, a second security authentication request is generated based on the second identity credential information of the central electronic control module. The second security authentication request is sent to the diagnostic device so that the diagnostic device verifies the identity and reliability of the central electronic control module based on the second security authentication request, and sends the direct connection request to the central electronic control module after the identity and reliability of the central electronic control module are verified.

6. A software flashing method, characterized in that, The software flashing method, applied to diagnostic equipment, includes: In response to the software flashing command of the target control unit, a direct connection request between the diagnostic device and the target control unit is sent to the central electronic control module, so that the central electronic control module switches the communication channel between the diagnostic device and the target control unit from the first channel to the second channel. The first channel includes a channel directly connected from the diagnostic device to the central electronic control module and a channel directly connected from the central electronic control module to the target control unit, and the second channel is a channel directly connected from the diagnostic device to the target control unit. Upon receiving a channel switching response from the central electronic control module, the software to be flashed is sent to the target control unit via the second channel, so that the target control unit can perform software flashing.

7. The software flashing method according to claim 6, characterized in that, After sending the software to be flashed to the target control unit via the second channel, the software flashing method further includes: Upon receiving the flashing completion instruction from the target control unit, a request to the central electronic control module is sent to disable the direct connection between the diagnostic device and the target control unit, so that the central electronic control module switches the communication channel from the second channel to the first channel.

8. The software flashing method according to claim 6, characterized in that, The software flashing method also includes: A first security authentication request is generated based on the first identity credential information of the diagnostic device. The first security authentication request is sent to the central electronic control module, so that the central electronic control module verifies the identity reliability of the diagnostic device based on the first security authentication request, and after the identity reliability of the diagnostic device is verified, sends a second security authentication request generated based on the second identity credential information of the central electronic control module to the diagnostic device. Receive the second security authentication request sent by the central electronic control module; The identity reliability of the central electronic control module is verified based on the second identity credential information in the second security authentication request; If the identity of the central electronic control module is verified, the direct connection request is sent to the central electronic control module.

9. A vehicle, characterized in that, The vehicles include: Memory, used to store executable program code; and, A processor is configured to call and run the executable program code from the memory, causing the vehicle to perform the software flashing method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the software flashing method as described in any one of claims 1 to 8.