Method, device, medium and product for flashing power domain control board
By integrating multiple vehicle power control function modules on the power domain control board and sharing the unified diagnostic service UDS, efficient firmware upgrades for the entire vehicle power system are achieved, solving the problem of cumbersome traditional flashing processes and improving upgrade efficiency and security.
Patent Information
- Application Number
- CN202611277355.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-20
AI Technical Summary
In the existing technology, the firmware upgrade process of the whole vehicle power system is cumbersome, lengthy and time-consuming, resulting in low firmware upgrade efficiency. This is mainly because each electronic control unit is independent and needs to be connected to the session channel one by one for flashing.
The system uses a power domain control board to configure a single electronic control unit, integrates multiple vehicle power control function modules, shares a unified diagnostic service (UDS), and simplifies the process and improves efficiency by distributing the integrated firmware image as a whole and combining it with segmented and partitioned flashing.
It significantly shortens firmware upgrade time, improves firmware flashing efficiency, reduces bill of materials costs, and ensures the accuracy and security of flashing through dual matching verification and partition write lock mechanism.
Smart Images

Figure CN123137675A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle control technology, specifically to a method, device, medium, and product for flashing a power domain control board. Background Technology
[0002] With the continuous development of the integrated architecture of the power domain in new energy vehicles, the vehicle is gradually integrating multiple power management functions, and the traditional distributed multi-electric control layout is gradually being replaced by integrated power domain control boards. Vehicle electronic control programs need to be upgraded regularly, with defects fixed and functions iterated. Therefore, online firmware flashing technology based on Unified Diagnostic Services (UDS) has become an essential basic function of vehicle electronic control systems.
[0003] Currently, in existing technologies, most vehicle powertrain systems adopt a distributed architecture with multiple independent electronic control units (ECUs). Multiple vehicle powertrain control modules are housed by different controllers, each equipped with its own UDS (Unified Device Controller), operating independently. Firmware upgrades for each independent ECU require accessing each controller's session channel individually and sending a firmware image to complete the flashing operation.
[0004] However, each electronic control unit has an independent UDS, and firmware upgrades require establishing diagnostic sessions multiple times and flashing each controller individually. The flashing process is cumbersome, lengthy, and time-consuming, resulting in low firmware upgrade efficiency. Summary of the Invention
[0005] In view of this, this application aims to provide a method, device, medium and product for flashing a power domain control board, so as to solve the problem that the flashing process in traditional related technologies is cumbersome, time-consuming and results in low firmware upgrade efficiency.
[0006] The first aspect of this application provides a method for flashing a powertrain domain control board. The powertrain domain control board is equipped with a single electronic control unit (ECU), which carries a unified diagnostic service (UDS) and integrates multiple vehicle powertrain control function modules. The multiple vehicle powertrain control function modules share the UDS. The method includes: when receiving a UDS diagnostic request sent by an external diagnostic device, switching to a programming session mode; while in the programming session mode, if the UDS diagnostic request is identified as a flashing request, obtaining the firmware image to be written carried in the flashing request; wherein the firmware image to be written includes multiple segmented firmware data, as well as the storage start address and UDS data identifier of each segmented firmware data; each segmented firmware data is a program package of each vehicle powertrain control function module; verifying whether the vehicle powertrain control function module to which the storage start address belongs is consistent with the vehicle powertrain control function module corresponding to the UDS data identifier; if the verification result is consistent, writing each segmented firmware data into the storage partition of the vehicle powertrain control function module corresponding to the storage start address to complete the flashing of the firmware image.
[0007] In one possible implementation of this application, verifying whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier includes: querying a preset mapping table based on the storage start address to determine the corresponding first target vehicle power control function module; wherein, the preset mapping table is a pre-established one-to-one mapping relationship between each vehicle power control function module, storage address range and UDS data identifier; querying the preset mapping table based on the UDS data identifier to determine the corresponding second target vehicle power control function module; determining whether the first target vehicle power control function module and the second target vehicle power control function module are the same; if they are the same, it is determined that the verification is consistent.
[0008] In one possible implementation of this application, each segment of firmware data carries a checksum for that segment. Correspondingly, writing each segment of firmware data into the storage partition of the vehicle power control function module corresponding to the storage start address includes: recalculating the checksum for each segment of firmware data during the process of writing each segment of firmware data into the storage partition of the vehicle power control function module corresponding to the storage start address; comparing the carried checksum with the recalculated checksum to obtain a comparison result; if the comparison result is consistent, then dividing each segment of firmware data into multiple data blocks; and using a partition write lock mechanism to sequentially write the multiple data blocks into the storage partition of the vehicle power control function module corresponding to the storage start address. The partition write lock mechanism refers to applying write permission lock to the storage partition of each vehicle power control function module, allowing only a single vehicle power control function module's storage partition to be written to at any given time.
[0009] In one possible implementation of this application, the method further includes: during the process of sequentially writing multiple data blocks into the storage partition of the vehicle power control function module corresponding to the storage start address, recording the number of the currently written data block; if the writing is interrupted, the remaining data blocks are continued to be written according to the number of the written data block during the next writing.
[0010] In one possible implementation of this application, after switching to programming session mode, the method further includes: performing secure access authentication on the firmware image to be written and obtaining the authentication result; when the authentication result is successful, allowing the execution of a step to verify whether the vehicle power control function module to which the storage starting address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier.
[0011] In one possible implementation of this application, after the firmware image is flashed, the method further includes: reading the firmware image that has been written to the storage partition; verifying the digital signature of the firmware image, verifying the consistency of the firmware versions of each vehicle power control function module in the firmware image, and verifying the data integrity in the storage partition of each vehicle power control function module, and obtaining the verification results; if all verification results are passed, then each vehicle power control function module is run.
[0012] In one possible implementation of this application, the method further includes: integrating fault entries from multiple vehicle power control function modules to construct an initial fault diagnostic code dictionary; removing duplicate fault diagnostic codes from the fault diagnostic code dictionary to obtain a final fault diagnostic code dictionary; wherein the fault diagnostic code dictionary is used to manage fault information generated by multiple vehicle power control function modules.
[0013] A second aspect of this application also provides a flashing device for a powertrain domain control board, comprising: a switching module for switching to a programming session mode upon receiving a UDS diagnostic request from an external diagnostic device; an acquisition module for acquiring, when in programming session mode, a firmware image to be written carried in the flashing request if the UDS diagnostic request is identified as a flashing request; wherein the firmware image to be written includes multiple segmented firmware data, and the storage start address and UDS data identifier of each segmented firmware data; each segmented firmware data is a program package of each vehicle powertrain control function module; a verification module for verifying whether the vehicle powertrain control function module to which the storage start address belongs is consistent with the vehicle powertrain control function module corresponding to the UDS data identifier; and a flashing module for writing each segmented firmware data to the storage partition of the vehicle powertrain control function module corresponding to the storage start address if the verification results are consistent, thereby completing the flashing of the firmware image.
[0014] A third aspect of this application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform a power domain control board flashing method as described in the first aspect and possible implementations thereof.
[0015] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement a method for flashing a power domain control board as described in the first aspect and possible implementations thereof.
[0016] The fifth aspect of this application provides a computer program product, comprising: a computer program that, when executed by a processor, implements a method for flashing a power domain control board as described in the first aspect and possible implementations of the first aspect.
[0017] The application provides a method, device, medium, and product for flashing a power domain control board. The power domain control board is equipped with a single electronic control unit (ECU), which carries a unified diagnostic service (UDS) and integrates multiple vehicle power control function modules. These modules share the UDS. Upon receiving a UDS diagnostic request from an external diagnostic device, the system switches to a programming session mode. If the UDS diagnostic request is identified as a flashing request, the system obtains the firmware image to be written carried in the flashing request. The firmware image includes multiple segments of firmware data, the storage start address of each segment, and a UDS data identifier. The system verifies whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier. If the verification results are consistent, the system writes each segment of firmware data to the storage partition of the vehicle power control function module corresponding to the storage start address to complete the firmware image flashing. The power domain control board is equipped with a single electronic control unit (ECU). By integrating multiple vehicle power control function modules within this single ECU, and enabling these modules to share a single UDS (Unified Device Storage), the program packages of multiple power control function modules are integrated into a single firmware image to be written. This is achieved by using an integrated firmware image for overall distribution and by performing dual matching and verification during the flashing process using the storage start address of segmented firmware data and the UDS data identifier. After successful verification, a segmented and partitioned flashing method is adopted. This eliminates the need to establish multiple diagnostic sessions and perform flashing operations in stages, effectively simplifying the overall firmware image flashing process, significantly reducing upgrade time, and improving firmware flashing efficiency. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this application, the drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart illustrating the flashing method for the power domain control board provided in this application embodiment. Figure 1 .
[0020] Figure 2 A flowchart illustrating the flashing method for the power domain control board provided in this application embodiment. Figure 2 .
[0021] Figure 3 This is a schematic diagram of the writing device for the power domain control board provided in an embodiment of this application.
[0022] Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0023] 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.
[0024] Currently, most vehicle powertrain systems employ a distributed architecture with multiple independent electronic control units (ECUs). Multiple vehicle powertrain control modules are housed by different controllers, each equipped with its own unique device oscillator (UDS), operating independently. Upgrading the firmware of each independent ECU requires individually connecting to the session channel of each controller and sending the firmware image to complete the flashing operation. However, since each ECU has its own independent UDS, firmware upgrades necessitate establishing multiple diagnostic sessions and flashing each controller individually. This cumbersome and time-consuming process results in low firmware upgrade efficiency.
[0025] To address the aforementioned technical issues, this application proposes the following technical concept: integrating multiple vehicle power control function modules within a single electronic control unit (ECU), with these modules sharing a single UDS (Unified Device Storage). The program packages of these multiple power control function modules are integrated into a single firmware image to be written. By adopting an integrated firmware image distribution and segmented partitioning flashing method, the overall firmware image flashing process is effectively simplified, eliminating the need for multiple diagnostic sessions and separate flashing operations. This significantly reduces the time required for firmware upgrades in the vehicle's power domain and improves the efficiency of firmware flashing.
[0026] Figure 1 A flowchart illustrating the flashing method for the power domain control board provided in this application embodiment. Figure 1 In this embodiment, the power domain control board is equipped with a single electronic control unit, which carries a unified diagnostic service (UDS) and integrates multiple vehicle power control function modules; the multiple vehicle power control function modules share the UDS.
[0027] A single electronic control unit (ECU) refers to a control entity that carries multiple vehicle power control function modules on a single physical control chip or a single physical control board-level computing core. It can be a single high-performance microcontroller chip. Replacing multiple independent ECUs with a single ECU reduces the bill of materials cost by at least 30% and reduces hardware redundancy and wiring complexity.
[0028] This electronic control unit (ECU) is equipped with Unified Diagnostic Services (UDS) and integrates multiple vehicle powertrain control function modules. These multiple vehicle powertrain control function modules refer to software functional units or logical task units that undertake different control responsibilities within the powertrain domain, and may include a vehicle controller module, a battery management module, and a motor control module. In other embodiments, the multiple vehicle powertrain control function modules may also include other functional modules related to vehicle powertrain control. Integrating the vehicle controller module, battery management module, and motor control module into the same ECU allows them to share a communication interface and power management unit, while simultaneously enabling independent operation of functions through memory partitioning and task isolation mechanisms. This improves integration while ensuring functional isolation of each module.
[0029] In this context, multiple vehicle power control function modules sharing a UDS means that multiple function modules provide services such as diagnostic session control, data identifier access, download requests, data transmission, and transmission exit to the outside world through the same set of diagnostic protocol stacks, rather than deploying multiple isolated sets of diagnostic protocol instances.
[0030] like Figure 1 As shown, the method includes: S101: When a UDS diagnostic request is received from an external diagnostic device, switch to programming session mode.
[0031] In this embodiment, the external diagnostic device can be an external diagnostic instrument, and the UDS diagnostic request can be a diagnostic service request sent through a vehicle communication interface (such as a Controller Area Network with Flexible Data-rate (CANFD) interface).
[0032] In this embodiment, the power domain control board shares a single diagnostic ID. Compared to the case of a single module, the diagnostic interface is unified, with higher concurrent processing capabilities and real-time response speed, in order to avoid diagnostic timeouts.
[0033] The programming session mode refers to a diagnostic session state that allows software downloads, program updates, configuration writing, or flashing-related control operations. It can be a programming session under the standard UDS or a dedicated flashing session extended from the standard session by the system. Switching to programming session mode activates the electronic control unit's flashing permissions. Activating flashing permissions by switching to programming session mode ensures that firmware image flashing operations can only be performed in a controlled session state, preventing accidental writing to storage partitions in an unauthorized state.
[0034] S102: When in programming session mode, if the UDS diagnostic request is identified as a flashing request, the firmware image to be written carried by the flashing request is obtained; wherein, the firmware image to be written includes multiple segmented firmware data, as well as the storage start address and UDS data identifier of each segmented firmware data; each segmented firmware data is the program package of each vehicle power control function module.
[0035] A flashing request refers to a data request that triggers software downloads, program updates, firmware image writing, or program reprogramming.
[0036] In this embodiment, the flashing request can be sent through the 0x34 service (request download service) in the UDS protocol; the firmware image to be written is a single firmware image, which contains the program packages for all vehicle power control function modules. Flashing the entire firmware image improves flashing efficiency compared to flashing each vehicle power control function module independently, and supports atomic updates for multiple vehicle power control function modules, ensuring the consistency of firmware versions across all vehicle power control function modules.
[0037] In this embodiment, the firmware image to be written includes multiple segments of firmware data, as well as the storage start address and UDS data identifier (DID) for each segment. Each segment of firmware data is a program package for a vehicle power control function module; that is, the firmware image is segmented according to function modules, and each segment corresponds to a complete program package for a vehicle power control function module. The storage start address is mapped to a predefined module partition in the firmware image. For example, different storage address ranges correspond to the vehicle controller module area, battery management module area, and motor control module area, respectively. Through the predefined mapping relationship between storage address ranges and function modules, the storage partition of the target function module can be accurately located based on the storage start address. The UDS DID is used to identify the operating range of each vehicle power control function module. Different DIDs correspond to different vehicle power control function modules (e.g., 0x0500–0x05FF corresponds to the battery management module, and 0x0300–0x03FF corresponds to the vehicle controller module). By assigning independent DIDs to each vehicle power control function module, logical-level permission isolation is achieved, ensuring that diagnostic and flashing operations can accurately locate the target vehicle power control function module.
[0038] S103: Verify whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier.
[0039] In this embodiment, after obtaining the firmware image to be written, the vehicle power control function module to which the storage starting address belongs is verified to see if it matches the vehicle power control function module corresponding to the UDS data identifier. This is a dual verification mechanism, that is, confirming the target vehicle power control function module from both the physical address and logical identifier dimensions, and comparing whether the two point to the same vehicle power control function module. Through dual cross-verification of physical address and logical identifier, it prevents segmented firmware data from being written to the wrong storage partition due to address configuration errors or identifier misuse, avoids data cross-interference, and ensures the accuracy and security of the flashing operation.
[0040] In this embodiment, if the verification results are consistent, the segmented firmware data can be written to the corresponding flash memory area. In this way, external diagnostic equipment only needs to use a single diagnostic channel to perform firmware flashing operations on all vehicle power control function modules, eliminating the communication conflicts caused by sequential access in traditional multi-electronic control unit architectures. Simultaneously, consistency verification ensures that each segmented firmware data is accurately written to the corresponding function module storage partition, achieving safe and reliable multi-module firmware flashing within a single electronic control unit architecture.
[0041] The overall logic of consistency verification has been explained above. The implementation method of consistency verification will be further explained below. Consistency verification can be implemented through a pre-defined mapping table. This pre-defined mapping table enables deterministic queries from the storage start address and UDSDID to the vehicle power control function module, providing a clear basis for the consistency verification process. This avoids the uncertainty caused by fuzzy matching or manual judgment, improving the reliability and automation of the verification.
[0042] Specifically, the first target vehicle power control function module is determined by querying a preset mapping table based on the storage start address; the preset mapping table is a pre-established one-to-one mapping relationship between each vehicle power control function module, storage address range and UDS data identifier; the second target vehicle power control function module is determined by querying the preset mapping table based on the UDS data identifier; it is then determined whether the first target vehicle power control function module and the second target vehicle power control function module are the same; if they are the same, the verification is considered consistent.
[0043] The preset mapping table is a pre-established one-to-one mapping relationship between each vehicle power control function module, storage address range, and UDS data identifier. That is, in this mapping table, each vehicle power control function module uniquely corresponds to a storage address range and a DID (or DID range). This one-to-one mapping relationship ensures that the result is uniquely deterministic when querying from both the storage start address and DID dimensions, eliminating ambiguity that may be caused by many-to-one or one-to-many mappings.
[0044] In this embodiment, the starting storage address is matched with the storage address range corresponding to each vehicle power control function module in a preset mapping table to determine which vehicle power control function module's storage address range the starting storage address falls into, thereby identifying the first target vehicle power control function module. The target function module is located from the physical address dimension to ensure that the physical write location of the firmware data is consistent with the expected function module storage partition.
[0045] Then, the UDS DID is matched with the DIDs corresponding to each vehicle power control function module in the preset mapping table to determine which vehicle power control function the DID belongs to, thereby identifying the second target vehicle power control function module. The target function module is located from the logical identifier dimension to ensure that the function module pointed to by the flashing request at the logical level is consistent with the function module pointed to at the physical address level.
[0046] Finally, it is determined whether the first target vehicle power control module and the second target vehicle power control module are the same. If they are the same, the verification is considered consistent, and subsequent firmware data writing operations are allowed. If they are different, the verification is considered inconsistent, and the flashing operation can be refused, returning a negative response. When the query results of the two dimensions are inconsistent, it indicates that there is a contradiction between the address and the identifier in the flashing request. Refusing to execute the flashing operation can prevent firmware data from being mistakenly written to the storage partition of a non-target functional module, ensuring system security.
[0047] S104: If the verification results are consistent, write the firmware data of each segment to the storage partition of the vehicle power control function module corresponding to the storage start address to complete the firmware image flashing.
[0048] Each segment of firmware data carries a checksum for that segment.
[0049] In this embodiment, the checksum can be a Cyclic Redundancy Check (CRC) code, such as a CRC32 checksum. CRC32 has a high error detection capability, effectively detecting errors such as bit flips and data loss that occur during data transmission or storage, ensuring that the written firmware data is consistent with the original data.
[0050] Alternatively, alternative methods to achieve the same purpose include using CRC16, CRC64, hash digests, or error-correcting codes as check codes.
[0051] Specifically, step S104 includes S1041 to S1044: S1041: During the process of writing each segment firmware data into the storage partition of the vehicle power control function module corresponding to the storage start address, the checksum of each segment firmware data is recalculated.
[0052] In this embodiment, the same verification algorithm as the sending end is re-executed on each received segment of firmware data to generate a new checksum. Verification is performed during the writing phase, ensuring data integrity is confirmed during the writing process, rather than waiting until all data has been written. This allows for timely detection of transmission errors and cessation of the writing process, preventing erroneous data from being written to the storage partition.
[0053] S1042: Compare the carried check code with the recalculated check code to obtain the comparison result.
[0054] S1043: If the comparison result is consistent, then the firmware data of each segment will be divided into multiple data blocks.
[0055] In this embodiment, if the comparison is consistent, it indicates that the firmware data of each segment has not been corrupted during transmission; if the comparison is inconsistent, it indicates that there are errors in the firmware data of each segment. In this case, the write operation can be stopped and an error response returned. By comparing the consistency of the checksum, corrupted firmware data is filtered out before writing, preventing erroneous data from being written to the storage partition and causing abnormal operation of the functional module.
[0056] In this embodiment, the firmware data of each segment is divided into multiple data blocks according to a preset block size, which facilitates fine-grained progress management and error recovery during the writing process, while adapting to the page writing characteristics of storage media (such as Flash).
[0057] S1044: A partition write lock mechanism is adopted to write multiple data blocks sequentially to the storage partition of the vehicle power control function module corresponding to the storage start address; wherein, the partition write lock mechanism means that write permission lock is applied to the storage partition of each vehicle power control function module, and only write operations are allowed to be performed on the storage partition of a single vehicle power control function module at the same time.
[0058] In this embodiment, the partition write lock mechanism ensures that only one vehicle power control function module's storage partition is writable at any given time, preventing resource contention or data cross-interference when multiple segmented firmware data are written to different storage partitions simultaneously, thus guaranteeing the data isolation and atomicity of the write operations of each vehicle power control function module's storage partition.
[0059] Alternatively, mutexes, semaphores, hardware arbitration bits, or transaction tokens can be used as write locking mechanisms.
[0060] In this embodiment, a single firmware image and partition flashing mechanism are adopted, and overall image integrity verification is used instead of independent module authentication to ensure that the flashing process is safe and reliable and meets the security requirements of AUTOSAR and ISO 21434 for software updates.
[0061] In this embodiment, after all segment firmware data has been written, the external diagnostic device sends a 0x37 service termination message to terminate data transmission. The power domain control board performs a system reset and starts the bootloader for startup verification. The bootloader startup verification process will be described in subsequent embodiments.
[0062] In this embodiment, UDS also supports the following core services: 0x27: Secure access (supports seed-key algorithm, independent keys for different sub-services); 0x22: Read data identifier, supporting the data identifier range of each vehicle power control function module (e.g., 0x0500–0x05FF for battery management module, 0x0300–0x03FF for vehicle controller module); 0x31: Programming session (activated only after secure access is granted); 0x34: Request download; 0x36: Transfer data.
[0063] In this embodiment, the power domain control board is equipped with a single electronic control unit (ECU). This ECU carries a unified diagnostic service (UDS) and integrates multiple vehicle power control function modules. The UDS provides stricter and more unified management of secure access (service 0x27). Whether configuring motor parameters, calibrating control strategies, or resetting high-voltage contactors, all operations require unified session control (service 0x10) and a login mechanism to ensure that high-risk operations can only be performed after authorization.
[0064] In this embodiment, during the process of sequentially writing multiple data blocks into the storage partition of the vehicle power control function module corresponding to the storage start address, the number of the currently written data block is recorded; if the writing is interrupted, the remaining data blocks are continued to be written according to the number of the written data block during the next writing.
[0065] In this embodiment, after each data block is successfully written to the storage partition, the number of the data block (such as a sequence number) is persistently recorded. The persistent record of the data block number allows for accurate tracking of the write progress in the event of an unexpected interruption (such as a power outage or communication interruption), providing a basis for resuming writing from a breakpoint.
[0066] In this embodiment, when the write process is unexpectedly interrupted, the recorded data block number is read upon the next write initiation, and writing continues from the data block after the interruption point, instead of rewriting all data blocks from the beginning. This breakpoint-resume mechanism avoids repeatedly writing successfully written data blocks, reduces unnecessary write operations, shortens the write time after interruption recovery, and reduces the number of erase / write cycles on the storage medium, thus helping to extend the storage medium's lifespan. By recording the numbers of the written data blocks and continuing to write the remaining data blocks based on these numbers after a write interruption, a write interruption recovery mechanism is implemented, avoiding the problem of needing to rewrite from the beginning due to unexpected interruptions, and improving the robustness and efficiency of the write process.
[0067] As described above, the powertrain domain control board is equipped with a single electronic control unit (ECU), which carries a unified diagnostic service (UDS) and integrates multiple vehicle powertrain control function modules. These modules share the UDS. Upon receiving a UDS diagnostic request from an external diagnostic device, the system switches to programming session mode. If the UDS diagnostic request is identified as a flashing request, the system obtains the firmware image to be written carried in the flashing request. The firmware image includes multiple segments of firmware data, the storage start address of each segment, and a UDS data identifier. The system verifies whether the vehicle powertrain control function module to which the storage start address belongs is consistent with the vehicle powertrain control function module corresponding to the UDS data identifier. If the verification results are consistent, the system writes each segment of firmware data to the storage partition of the vehicle powertrain control function module corresponding to the storage start address to complete the firmware image flashing. The power domain control board is equipped with a single electronic control unit (ECU). By integrating multiple vehicle power control function modules within this single ECU, and enabling these modules to share a single UDS (Unified Device Storage), the program packages of multiple power control function modules are integrated into a single firmware image to be written. This is achieved by using an integrated firmware image for overall distribution and by performing dual matching and verification during the flashing process using the storage start address of segmented firmware data and the UDS data identifier. After successful verification, a segmented and partitioned flashing method is adopted. This eliminates the need to establish multiple diagnostic sessions and perform flashing operations in stages, effectively simplifying the overall firmware image flashing process, significantly reducing upgrade time, and improving firmware flashing efficiency.
[0068] The above embodiments have described the processing flow after identifying the flush request in programming session mode. The following further describes the secure access authentication after switching to programming session mode and before performing consistency verification.
[0069] Specifically, secure access authentication is performed on the firmware image to be written, and an authentication result is obtained. If the authentication result is successful, the step of verifying whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier is allowed.
[0070] In this embodiment, if the authentication result is successful, the step of verifying whether the vehicle power control function module to which the storage starting address belongs is consistent with the vehicle power control function module corresponding to the UDS DID is allowed; if the authentication result is unsuccessful, the subsequent flashing operation is refused and a negative response may be returned. Using secure access authentication as a pre-gating condition for the flashing process ensures that subsequent consistency checks and data writing operations are only executed after secure authentication is successful, forming a layered security protection mechanism from authentication to verification to writing.
[0071] In this embodiment, secure access authentication can be implemented through a seed-key authentication mechanism via the 0x27 service (secure access service) in the UDS protocol. The seed-key authentication mechanism uses a dynamically generated seed and a pre-shared key algorithm for bidirectional verification, ensuring that only legitimate diagnostic devices holding the correct key can pass authentication, thus preventing unauthorized devices from flashing or rewriting the electronic control unit.
[0072] In addition, as another implementation method, secure access authentication can also employ asymmetric cryptographic signature verification (such as the Elliptic Curve Digital Signature Algorithm (ECDSA)) to verify the firmware image signature. Asymmetric cryptographic signature verification can ensure that the firmware image has not been tampered with and that its source is trustworthy. Compared with symmetric encryption methods, it has higher security and meets the requirements of automotive cybersecurity standards for software update security.
[0073] In this embodiment, secure access authentication is performed on the entire firmware image as the authentication unit. That is, a unified secure access authentication is performed on the entire firmware image to be written, rather than authenticating each vehicle power control function module independently. Using the entire firmware image as the authentication unit simplifies the authentication process, avoiding the complexity and time overhead of authenticating multiple vehicle power control function modules independently. At the same time, it ensures that the integrity and legality of the firmware image as a whole are verified, preventing unauthorized or tampered firmware images from being written to the electronic control unit, thus improving the security of the flashing process.
[0074] refer to Figure 2 , Figure 2 A flowchart illustrating the flashing method for the power domain control board provided in this application embodiment. Figure 2 The above embodiments have illustrated the complete process of firmware image flashing. The following section further explains the boot verification process after firmware image flashing is complete. Figure 2 As shown, the details are as follows: S201: Read the firmware image that has been written to the storage partition.
[0075] In this embodiment, after the firmware image is flashed, the firmware image already written to the storage partition can also be read. This can be done by the bootloader reading the firmware image from the storage partition for boot verification after a system reset. The bootloader performs boot verification after a system reset to ensure that the firmware image is securely verified every time the system starts, preventing tampered or corrupted firmware images from being loaded and run.
[0076] S202: Verify the digital signature of the firmware image, verify the consistency of the firmware versions of each vehicle power control function module in the firmware image, and verify the data integrity in the storage partition of each vehicle power control function module to obtain the verification result.
[0077] In this embodiment, verifying the digital signature of the firmware image refers to performing signature verification on the written firmware image to confirm that the firmware image has not been tampered with and its source is legitimate. Digital signature verification ensures the integrity and source credibility of the firmware image, prevents maliciously tampered firmware images from running in the system, and meets the requirements of automotive cybersecurity standards.
[0078] In this embodiment, verifying the consistency of firmware versions of each vehicle power control function module in the firmware image refers to checking whether the firmware versions of each vehicle power control function module conform to a preset combination relationship, ensuring version compatibility between modules. Version consistency verification ensures version compatibility between function modules integrated in the same firmware image, preventing communication abnormalities or functional conflicts between modules due to version mismatch.
[0079] In this embodiment, verifying the data integrity within the storage partition of each vehicle power control function module refers to performing integrity verification on the data in the storage partition of each vehicle power control function module to ensure that no errors such as bit flips or data loss occur after the firmware data of each vehicle power control function module is written to the storage partition, thus ensuring that each function module can operate based on the correct firmware data.
[0080] In this embodiment, the purpose of verification is to ensure that successful flashing does not necessarily guarantee safe operation; issues such as partial firmware image corruption after transmission, version incompatibility between modules, or unauthorized replacement may still occur. Therefore, performing multiple verifications before operation can shift the fault detection point to the startup stage. Its advantage is that it prevents the power domain control board from directly entering operation if it does not meet the preset safety policies.
[0081] S203: If all verification results pass, then run each vehicle power control function module.
[0082] In this embodiment, if all verification results pass, each vehicle power control function module is run. If any verification fails, the system enters a security degradation mode or diagnostic mode, disallowing operation. This ensures the system will not operate normally if there are security vulnerabilities in the firmware, complying with functional safety and cybersecurity standards. By performing triple verification—digital signature verification, version consistency verification, and data integrity verification—after the firmware image is flashed, the system ensures that the written firmware image meets security policy requirements before startup, preventing potential errors during the flashing process from causing abnormal operation of functional modules, thus improving the security and reliability of system startup.
[0083] As described above, after the firmware image is flashed, the firmware image already written to the storage partition is read. The digital signature of the firmware image, the consistency of the firmware versions of each vehicle power control function module, and the integrity of the data within each storage partition are verified. Only when all verifications pass are the individual vehicle power control function modules run. By performing multiple verifications on the firmware image before startup—including digital signature verification, version consistency verification, and partition data integrity verification—incomplete or inconsistent firmware caused by transmission errors, flashing anomalies, or malicious tampering can be detected before the system runs. This prevents the system from starting in a state that does not meet security policies, ensuring the stability and reliability of the control board's functions.
[0084] In addition to the above-described flashing process, in some embodiments, this application also relates to fault code management.
[0085] Specifically, fault entries from multiple vehicle power control function modules are integrated to construct an initial fault diagnostic code dictionary; duplicate fault diagnostic codes in the fault diagnostic code dictionary are removed to obtain the final fault diagnostic code dictionary; the fault diagnostic code dictionary is used to manage fault information generated by multiple vehicle power control function modules.
[0086] In this embodiment, since multiple vehicle powertrain control function modules are integrated into the same electronic control unit, the diagnostic trouble code (DTC) entries defined by each function module when operating independently may be duplicated or conflicting. Therefore, the fault entries of multiple vehicle powertrain control function modules can be integrated to construct an initial DTC dictionary. Alternatively, the DTC entries of each vehicle powertrain control function module can be aggregated and merged to form an initial DTC dictionary containing fault information from all function modules. Identifying and integrating the original independent fault entries of each vehicle powertrain control function module provides a complete data source for constructing a unified DTC dictionary.
[0087] Based on the initial fault code dictionary, duplicate fault codes are removed to obtain the final fault code dictionary. Alternatively, it involves identifying and eliminating identical or conflicting fault code entries between different functional modules in the initial fault code dictionary, resulting in a final, non-duplicate fault code dictionary. Removing duplicate fault codes eliminates conflicts and ambiguities between different functional modules, ensuring that each fault code uniquely corresponds to a fault type. This allows external diagnostic equipment to accurately pinpoint the source and type of fault when reading fault codes, improving diagnostic efficiency.
[0088] In this embodiment, duplicate fault diagnostic codes can be identified based on fault diagnostic codes, fault names, triggering conditions, or fault semantic tags.
[0089] In this embodiment, the final fault code dictionary is used for unified management of fault information generated by multiple vehicle power control function modules. For example, external diagnostic equipment can read fault information from the fault code dictionary through the 0x19 service (fault code reading service) in the UDS protocol. The unified fault code dictionary allows external diagnostic equipment to obtain fault information from all function modules through a single diagnostic channel, without having to access the independent fault code tables of each module separately, thus simplifying the diagnostic process and improving diagnostic efficiency.
[0090] As can be seen from the above description, by integrating the fault entries of multiple vehicle power control function modules and performing deduplication, a unified fault diagnosis code dictionary is constructed, eliminating the duplication or conflict problems that exist when each vehicle power control function module independently maintains its fault code table in the traditional multi-electronic control unit architecture, thereby improving the efficiency and accuracy of fault diagnosis.
[0091] Figure 3 A schematic diagram of the writing device for the power domain control board provided in this application embodiment. Figure 1 .like Figure 3 As shown, the power domain control board's writing device is used in electronic devices and includes: a switching module 301, an acquisition module 302, a verification module 303, and a writing module 304.
[0092] The switching module 301 is used to switch to programming session mode when a UDS diagnostic request is received from an external diagnostic device.
[0093] The acquisition module 302 is used to acquire the firmware image to be written carried in the flashing request if the UDS diagnostic request is identified as a flashing request when it is in programming session mode. The firmware image to be written includes multiple segmented firmware data, as well as the storage start address and UDS data identifier of each segmented firmware data. Each segmented firmware data is a program package of each vehicle power control function module.
[0094] The verification module 303 is used to verify whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier.
[0095] The flashing module 304 is used to write the firmware data of each segment to the storage partition of the vehicle power control function module corresponding to the storage start address if the verification results are consistent, so as to complete the flashing of the firmware image.
[0096] In one possible implementation of this application, the verification module 303 is specifically used for: querying a preset mapping table based on the storage start address to determine the corresponding first target vehicle power control function module; wherein, the preset mapping table is a pre-established one-to-one mapping relationship between each vehicle power control function module, storage address range and UDS data identifier; querying the preset mapping table based on the UDS data identifier to determine the corresponding second target vehicle power control function module; determining whether the first target vehicle power control function module and the second target vehicle power control function module are the same; if they are the same, then determining that the verification is consistent.
[0097] In one possible implementation of this application, each segment of firmware data carries a checksum for that segment. Correspondingly, the flashing module 304 is specifically used to: recalculate the checksum for each segment of firmware data during the process of writing each segment of firmware data to the storage partition of the vehicle power control function module corresponding to the storage start address; compare the carried checksum with the recalculated checksum to obtain a comparison result; if the comparison result is consistent, then divide each segment of firmware data into multiple data blocks; and use a partition write lock mechanism to sequentially write the multiple data blocks to the storage partition of the vehicle power control function module corresponding to the storage start address. The partition write lock mechanism refers to applying write permission locks to the storage partitions of each vehicle power control function module, allowing only a single vehicle power control function module's storage partition to be written to at any given time.
[0098] In one possible implementation of this application, the power domain control board's writing device further includes a recording module. Specifically, the recording module is used to: record the number of the currently written data block during the process of sequentially writing multiple data blocks to the storage partition of the vehicle power control function module corresponding to the storage start address; if the writing is interrupted, the remaining data blocks are continued to be written based on the numbers of the already written data blocks during the next writing operation.
[0099] In one possible implementation of this application, the power domain control board flashing device further includes an authentication module. The authentication module is specifically used for: performing secure access authentication on the firmware image to be written, obtaining an authentication result; and, if the authentication result is successful, allowing the execution of a step to verify whether the vehicle power control function module to which the storage starting address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier.
[0100] In one possible implementation of this application, the power domain control board flashing device further includes a running module. The running module is specifically used for: reading the firmware image already written to the storage partition; verifying the digital signature of the firmware image, verifying the consistency of the firmware versions of each vehicle power control function module in the firmware image, and verifying the data integrity within the storage partition of each vehicle power control function module, to obtain verification results; if all verification results pass, then running each vehicle power control function module.
[0101] In one possible implementation of this application, the power domain control board writing device further includes a construction module. The construction module is specifically used to: integrate fault entries from multiple vehicle power control function modules to construct an initial fault diagnostic code dictionary; remove duplicate fault diagnostic codes from the fault diagnostic code dictionary to obtain a final fault diagnostic code dictionary; wherein the fault diagnostic code dictionary is used to manage fault information generated by multiple vehicle power control function modules.
[0102] The apparatus provided in this application embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0103] Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device of this embodiment includes a processor 401 and a memory 402.
[0104] The memory 402 stores computer execution instructions; the processor 401 executes the computer execution instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiments. For details, please refer to the relevant descriptions in the foregoing method embodiments.
[0105] Alternatively, the memory 402 can be either standalone or integrated with the processor 401.
[0106] When the memory 402 is set up independently, the electronic device also includes a bus 403 for connecting the memory 402 and the processor 401.
[0107] This application embodiment also provides a vehicle, which includes: a vehicle body, the vehicle body being equipped with the aforementioned electronic device, the electronic device being used to execute the aforementioned power domain control board flashing method.
[0108] This application also provides a computer-readable storage medium storing computer-executable instructions. When the processor executes the computer-executable instructions, the above-described method for flashing the power domain control board is implemented.
[0109] This application also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-described method for flashing the power domain control board.
[0110] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0111] The modules described as separate components may or may not be physically separate. The components shown as modules 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 modules can be selected to implement the solution of this embodiment according to actual needs.
[0112] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0113] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0114] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0115] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0116] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0117] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0118] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0119] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for writing a power domain control board, characterized in that, The powertrain control board is equipped with a single electronic control unit (ECU), which carries a unified diagnostic service (UDS) and integrates multiple vehicle powertrain control function modules; the multiple vehicle powertrain control function modules share the UDS; the method includes: Upon receiving a UDS diagnostic request from an external diagnostic device, switch to programming session mode; When in the programming session mode, if the UDS diagnostic request is identified as a flashing request, the firmware image to be written carried by the flashing request is obtained; wherein, the firmware image to be written includes multiple segmented firmware data, as well as the storage start address and UDS data identifier of each segmented firmware data; each segmented firmware data is a program package of each vehicle power control function module. Verify whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier. If the verification results are consistent, the firmware data of each segment is written to the storage partition of the vehicle power control function module corresponding to the storage start address to complete the firmware image flashing.
2. The method according to claim 1, characterized in that, The step of verifying whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier includes: The first target vehicle power control function module is determined by querying a preset mapping table based on the storage start address; wherein, the preset mapping table is a pre-established one-to-one mapping relationship between each vehicle power control function module, storage address range and UDS data identifier; The corresponding second target vehicle power control function module is determined by querying the preset mapping table based on the UDS data identifier. Determine whether the power control function module of the first target vehicle is the same as the power control function module of the second target vehicle; If they are the same, then the verification is considered consistent.
3. The method according to claim 1, characterized in that, Each segment of firmware data carries a verification code for that segment of firmware data. Accordingly, writing the segmented firmware data into the storage partition of the vehicle power control function module corresponding to the storage start address includes: During the process of writing the firmware data of each segment into the storage partition of the vehicle power control function module corresponding to the storage start address, the checksum of the firmware data of each segment is recalculated. The carried check code is compared with the recalculated check code to obtain the comparison result; If the comparison result is consistent, then the firmware data of each segment is divided into multiple data blocks; A partition write lock mechanism is adopted to sequentially write the multiple data blocks to the storage partition of the vehicle power control function module corresponding to the storage start address; wherein, the partition write lock mechanism refers to applying write permission lock to the storage partition of each vehicle power control function module, allowing only a single vehicle power control function module's storage partition to be written to at the same time.
4. The method according to claim 3, characterized in that, The method further includes: During the process of sequentially writing the multiple data blocks into the storage partition of the vehicle power control function module corresponding to the storage start address, the number of the data block currently written is recorded. If the write operation is interrupted, the remaining data blocks will continue to be written on the next write operation based on the numbers of the data blocks that have already been written.
5. The method according to claim 1, characterized in that, After switching to programming session mode, the following is also included: Perform secure access authentication on the firmware image to be written, and obtain the authentication result; When the authentication result is successful, the step of verifying whether the vehicle power control function module to which the storage start address belongs is consistent with the vehicle power control function module corresponding to the UDS data identifier is allowed to be executed.
6. The method according to claim 1, characterized in that, After the firmware image flashing is completed, the process also includes: Read the firmware image that has already been written to the storage partition; The verification results are obtained by verifying the digital signature of the firmware image, verifying the consistency of the firmware versions of each vehicle power control function module in the firmware image, and verifying the data integrity in the storage partition of each vehicle power control function module. If all the verification results pass, then each vehicle power control function module is executed.
7. The method according to claim 1, characterized in that, Also includes: Integrate fault entries from multiple vehicle power control function modules to construct an initial fault diagnostic code dictionary; Duplicate fault diagnostic codes are removed from the fault diagnostic code dictionary to obtain the final fault diagnostic code dictionary. The fault diagnostic code dictionary is used to manage fault information generated by the multiple vehicle power control function modules.
8. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the flashing method of the power domain control board according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the flashing method of the power domain control board as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the flashing method of the power domain control board as described in any one of claims 1 to 7.
