Software package integrity verification methods, devices, and storage media
By configuring the caching function to be enabled or disabled on the central gateway, the integrity verification of software packages is realized, which solves the problem of low verification efficiency caused by dependence on ECU suppliers in the existing technology, and improves the efficiency and flexibility of software package integrity verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2026-03-06
AI Technical Summary
In existing technologies, software package integrity verification relies on ECU suppliers, resulting in low testing efficiency and an inability to respond promptly to OEMs' integrity requirements.
By configuring caching functionality on the central gateway using the diagnostic equipment provided by the OEM, and controlling the enabling and disabling of this caching function, the integrity of software packages can be verified, ensuring the integrity of the software packages during transmission.
It improves the efficiency of software package integrity verification, reduces development costs, enables flexible and rapid response to OEM testing needs, and reduces dependence on suppliers.
Smart Images

Figure CN118606910B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software upgrade technology, and in particular to a software package integrity verification method, device and storage medium. Background Technology
[0002] Software package integrity refers to the state in which a software package has not been tampered with or damaged during transmission or storage. Maintaining software package integrity is crucial for ensuring security and reliability. Currently, the conventional integrity verification method involves the ECU development supplier extracting frames from the software package before sending it to the OEM. The OEM then tests the package using diagnostic tools. If the package is incomplete, the software upgrade functionality test will fail. This method of processing software packages relies excessively on the ECU supplier and often cannot immediately respond to the OEM's integrity requirements, resulting in low verification and testing efficiency. Summary of the Invention
[0003] To overcome the problems existing in the related technologies, this specification provides methods, apparatus, devices and storage media.
[0004] According to a first aspect of the embodiments of this specification, a method is provided for use in a device having diagnostic functions, the method comprising:
[0005] Receive a software package for upgrading the electronic control unit (ECU) of a vehicle, and determine the target ECU for the upgrade based on the information in the software package;
[0006] A cache test is performed on the central gateway configured to communicate with the device with diagnostic functions with the cache function disabled. After the central gateway passes the test, the central gateway forwards the software package to the target ECU when the cache function of the central gateway is enabled.
[0007] If feedback is received that the target ECU has successfully upgraded based on the software package, then the software package is determined to be complete.
[0008] According to the software package integrity verification method provided in this application, the method further includes:
[0009] The central gateway is configured with different parameters that are mapped to the state of the caching function, thereby controlling the opening and closing of the central gateway's caching function.
[0010] According to the software package integrity verification method provided in this application, the step of performing configuration word processing on the central gateway includes:
[0011] When the vehicle's diagnostic tool communicates with the central gateway, the configuration word corresponding to the caching function is determined;
[0012] The position bits in the configuration word used to indicate the enabling and disabling of the caching function are determined, and the position bits are modified accordingly; wherein, when the position bit is set to a first value, the caching function is controlled to be disabled, and when the position bit is set to a second value, the caching function is controlled to be enabled;
[0013] The modified configuration word is applied to the central gateway so that the central gateway controls the enabling and disabling of the caching function based on the modified configuration word.
[0014] According to a software package integrity verification method provided in this application, the cache test is performed when the caching function of the central gateway configured to communicate with the device with diagnostic functions is disabled, including:
[0015] The software package is sent to the central gateway so that the central gateway forwards the software package to the target ECU; wherein the forwarding rate of the central gateway is less than the transmission rate threshold of the target ECU, and when the position of the buffer function is set to the first value, the software package received by the target ECU is the first software package after discarding the first data frame that the central gateway did not forward in real time;
[0016] The system receives the upgrade result from the target ECU after it has been upgraded based on the first software package, and determines the result of the cache test based on the upgrade result.
[0017] According to the software package integrity verification method provided in this application, determining the result of the cache test based on the upgrade result includes:
[0018] If the upgrade result is an upgrade failure, the cache test result is determined to be a test pass;
[0019] If the upgrade result is successful, the cache test result is determined to be a failure.
[0020] According to the software package integrity verification method provided in this application, after the central gateway passes the test, with the caching function of the central gateway enabled, the central gateway forwards the software package to the target ECU, including:
[0021] After the central gateway passes the test, the software package is sent to the central gateway so that the central gateway forwards the software package to the target ECU; wherein, when the position bit of the caching function is the second value, all data frames in the software package are saved in the cache queue corresponding to the caching function based on the caching function of the central gateway, and the data frames are forwarded from the cache queue to the target ECU;
[0022] If feedback is received that the target ECU has successfully upgraded based on the software package, then the integrity of the software package is determined, including:
[0023] The system receives the upgrade result from the target ECU after upgrading based on the software package forwarded by the central gateway. If the system receives feedback that the target ECU has successfully upgraded based on the software package, then the system determines that the software package has integrity.
[0024] According to the software package integrity verification method provided in this application, before performing configuration word processing on the central gateway, the method further includes:
[0025] Service security authentication is performed on the diagnostically capable device used to perform configuration word operations on the central gateway;
[0026] After successful authentication, the step of configuring the central gateway is executed.
[0027] According to a second aspect of the embodiments of this specification, a method is provided for use in a central gateway, the method comprising:
[0028] After receiving a test result indicating that the caching function of the central gateway has passed, the system controls the caching function of the central gateway to be enabled; wherein, the test result is obtained by a device with diagnostic capabilities performing a caching test on the central gateway based on a software package for upgrading the vehicle's electronic control unit (ECU) while the caching function of the central gateway is disabled; the target ECU for the upgrade is determined from the information in the software package.
[0029] The software package is forwarded to the target ECU so that the target ECU can perform an upgrade based on the software package;
[0030] The upgrade result fed back after the target ECU upgrade process is forwarded to the device with diagnostic function, so that the device with diagnostic function can determine the integrity of the software package based on the upgrade result.
[0031] According to a software package integrity verification method provided in this application, the step of forwarding the software package to the target ECU so that the target ECU can perform an upgrade process based on the software package includes:
[0032] Based on the caching function of the central gateway, all data frames in the software package are stored in the cache queue corresponding to the caching function, and the data frames in the cache queue are forwarded to the target ECU so that the target ECU can perform upgrade processing based on the software package.
[0033] According to a software package integrity verification method provided in this application, the step of forwarding the data frame in the cache queue to the target ECU includes:
[0034] The data frames in the software package are forwarded from the cache queue to the target ECU in a specific order in which they are cached in the cache queue.
[0035] This application also provides a software package integrity verification device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the software package integrity verification methods described above.
[0036] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the software package integrity verification method as described above.
[0037] This specification describes a method, device, and storage medium for verifying software package integrity. It receives a software package for upgrading a vehicle's Electronic Control Unit (ECU). Based on the information in the software package, it determines the target ECU for the upgrade. With the caching function configured on the central gateway disabled, it performs frame extraction processing on the software package and conducts caching tests. The software package frame loss routing function can be implemented immediately, flexibly and quickly verifying whether the performance of the caching function meets expectations and achieves the desired effect. After the test passes, the software is forwarded to the target ECU using the central gateway's caching function enabled, ensuring the integrity of the software package transmission. The target ECU performs the upgrade process based on the transmitted software package, ultimately achieving software package integrity verification. This process does not rely excessively on the supplier's processing of the software package, can immediately respond to the OEM's needs, and improves verification testing efficiency.
[0038] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0039] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.
[0040] Figure 1 This is a schematic diagram of the software package flow of the software package integrity verification method illustrated in this specification according to an exemplary embodiment;
[0041] Figure 2 This is a flowchart illustrating a software package integrity verification method according to an exemplary embodiment of this specification;
[0042] Figure 3This is another flowchart illustrating a software package integrity verification method according to an exemplary embodiment of this specification;
[0043] Figure 4 This is a schematic block diagram of a computer device illustrated in this specification according to an exemplary embodiment. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions 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, 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.
[0045] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the application. Unless otherwise defined, the technical or scientific terms used in this application should be understood in their ordinary sense by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar words used in this application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, "a" or "one," and similar words do not indicate a quantity limitation, but rather indicate the presence of at least one. "A plurality" or "several" indicates two or more. The terms "comprising" or "including," and similar words mean that the elements or objects preceding "comprising" or "including" encompass the elements or objects listed following "comprising" or "including" and their equivalents, and do not exclude other elements or objects. The terms "connected," "linked," and similar words are not limited to physical or mechanical connections, and can include electrical connections, whether direct or indirect.
[0046] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0047] This application provides a method, apparatus, and storage medium for verifying the integrity of software packages. The following detailed description, in conjunction with the accompanying drawings, is provided. Unless otherwise specified, the features described in the embodiments and implementations can be combined with each other.
[0048] The software package described in this article is a collection of files used for upgrading a vehicle's ECU (Engine Control Unit). Based on the package's documentation or configuration files, the target ECU's information is determined, and the upgrade package is sent to the target ECU to allow the vehicle to complete the software upgrade. The vehicle described in this article has the standard structure and functions of commercially available vehicles, and will not be described in detail here.
[0049] The requirements necessitate that OEMs verify the integrity of the software package and provide an ECU integrity test report. Currently, the conventional method for verifying software package integrity is as follows: the ECU developer sends the software package to the OEM after frame extraction. The OEM then tests it using a diagnostic tool. If the received software package is incomplete, the software upgrade function test will fail; if the software package is complete, the software upgrade function test will succeed, thus achieving integrity verification. However, this method relies heavily on the ECU supplier, requiring the supplier to provide both the un-frame-extracted and the incomplete, frame-extracted software package for integrity verification. Furthermore, all ECU modifications require supplier cooperation, resulting in long lead times, slow response times, and often an inability to immediately respond to the OEM's testing needs, leading to low testing efficiency.
[0050] Compared to methods that rely on suppliers for software package integrity verification, this application proposes a software package integrity verification strategy. This strategy involves configuring a caching function on the central gateway using a diagnostic device from the OEM and controlling the enabling and disabling of the caching function during the forwarding of software packages from the central gateway to the ECU. This approach achieves software package integrity verification while simultaneously improving verification efficiency and reducing development costs.
[0051] The diagnostic devices described in this article are typically used to diagnose and test automotive ECUs, sensors, actuators, etc. Common diagnostic devices include diagnostic scanning tools, diagnostic instruments, oscilloscopes, diagnostic software, simulators, etc. The following description uses a diagnostic instrument as an example; other embodiments are basically the same and will not be repeated here.
[0052] Figure 1 This is a schematic diagram of the software package flow for a software package integrity verification method provided in this specification, as shown below. Figure 1As shown, the software package integrity verification system includes a diagnostic tool, a central gateway (CGW), and the vehicle's ECU. Specifically, the ECU supplier develops and tests software functions for a specific vehicle model or ECU, packaging it into a software package. This package contains new software, firmware, or configuration files to be installed on the target ECU. The ECU supplier sends the software package to the OEM. The OEM receives the package from the supplier via a diagnostic tool, connects it to the target vehicle's diagnostic interface, establishes communication with the vehicle's electronic system, and communicates with the CGW to send the software package. The CGW facilitates communication between the diagnostic tool and the target ECU, transmitting the supplier-provided software package to the target ECU. The CGW processes and parses the software package sent by the diagnostic tool, correctly routing and forwarding it to the target ECU to ensure software security and correctness. This process involves matching the CGW's caching function, forwarding the software package with and without caching enabled to verify its integrity. Once the software package is successfully transferred to the target ECU, the target ECU will load and execute the new software. The diagnostic tool can then perform software verification and activation operations, which typically include verifying the integrity of the software package to ensure that the software functions correctly on the target ECU.
[0053] The routing information described above can identify the target ECU through the unique identifier or address information of the ECU involved in the software package, and perform correct routing based on the target ECU of the software package.
[0054] This embodiment only configures the CGW caching function, requiring minimal development effort. Caching testing can be performed by disabling the central gateway's caching function, enabling immediate frame extraction processing of software packages. This is flexible and fast, eliminating the need for each ECU supplier to provide separately extracted software packages, thus resolving the issue of over-reliance on suppliers. Software package processing can be implemented at the OEM level, responding promptly to OEM needs and improving testing efficiency.
[0055] Figure 2 This is a flowchart illustrating a software package integrity verification method provided in this specification, including the following steps:
[0056] In step 101, a software package for upgrading the electronic control unit (ECU) of the vehicle is received, and the target ECU for the upgrade is determined based on the information in the software package.
[0057] In step 102, a cache test is performed on the central gateway configured to communicate with the device with diagnostic function when the cache function is turned off, so that the central gateway passes the test. Then, when the cache function of the central gateway is turned on, the central gateway forwards the software package to the target ECU.
[0058] In step 103, if feedback is received that the target ECU has successfully upgraded based on the software package, then it is determined that the software package has integrity.
[0059] exist Figure 2 In the illustrated method flow, the software package integrity verification method is applied to the OEM's diagnostic tool. By configuring the caching function of the CGW, the integrity of the upgraded software package is verified.
[0060] exist Figure 2 In the illustrated method flow, in step 101, the diagnostic tool receives a software package for upgrading the vehicle ECU sent by the supplier, and determines the target ECU to be finally distributed and used for the upgrade based on the information in the software package.
[0061] The software package described in this text may contain a unique identifier or address information for the target ECU. By comparing the identifier or address in the software package with the ECU in the vehicle, the target ECU to be upgraded can be determined. In other examples, the software package may provide information about the type of ECU to be upgraded; based on the type of the target ECU, the target ECU to be upgraded can be determined. In yet another example, it can also be determined whether an upgrade is needed by comparing it with the currently installed version of the target ECU, thus identifying the target ECU. It should be noted that other information in the software package can also be used to determine the target ECU for upgrade; specific limitations are not specified here.
[0062] In step 102, the activation and deactivation status control of the caching function configured in the CGW can be achieved through a configuration word. The parameters of the configuration word are mapped to the status of the caching function, so as to control the activation and deactivation of the caching function of the central gateway respectively.
[0063] Specifically, the process of configuring the central gateway includes the following steps a1-a3:
[0064] Step a1: When the vehicle's diagnostic tool communicates with the central gateway, determine the configuration word corresponding to the caching function;
[0065] Connect the diagnostic tool to the vehicle's OBD (On-Board Diagnostics) interface, ensuring normal communication with the vehicle's central gateway. On the diagnostic tool, select the appropriate diagnostic program or access the settings menu to modify the central gateway's configuration words. After selecting the central gateway, locate the configuration word controlling the caching function and enable or disable this function as needed. Generally, the values or states of these configuration words can be directly modified through the diagnostic tool to control the central gateway's caching function.
[0066] Step a2: Determine the position bits in the configuration word used to indicate the enabling and disabling of the caching function, and modify the position bits accordingly; wherein, when the position bit is set to a first value, the caching function is controlled to be disabled, and when the position bit is set to a second value, the caching function is controlled to be enabled;
[0067] Configuring the caching functionality of CGW typically involves encoding different configuration options or function states into a byte or a set of bits. This configuration word can contain different positions representing information such as the caching function's on / off state, cache size, and caching strategy. For example, different positions in the configuration word can be defined, each representing a different meaning: setting a bit to the first value controls the caching function to be off, and setting a bit to the second value controls the caching function to be on; for example, bit 0 indicates the caching function's on / off state (0 means off, 1 means on).
[0068] Step a3: Apply the modified configuration word to the central gateway so that the central gateway controls the enabling and disabling of the caching function based on the modified configuration word.
[0069] The modified configuration word is written to the appropriate register or memory location to convey the required configuration information to the central gateway. In this way, the central gateway can correctly control the enabling or disabling of the caching function based on the location information in the modified configuration word.
[0070] As an example, the CGW develops a UDS diagnostic function. The function configuration word DID (F101) defines all the functions that need to be configured. It can be set to a length of 64 bits, allowing for a maximum of 64 functions to be configured, with 1 bit reserved for cache function configuration. A diagnostic tool is used to write the configuration word to the CGW, and by setting different values, the cache function can be controlled to be enabled or disabled.
[0071] It should be noted that other functional configurations can be made for the vehicle if there are other requirements.
[0072] In one embodiment, before performing configuration word processing on the central gateway, the method further includes:
[0073] Step a4: Perform service security authentication on the device with diagnostic functions used to perform configuration word operations on the central gateway;
[0074] Step a5: After successful authentication, perform the configuration word processing step on the central gateway.
[0075] Before configuration writing, service security authentication is typically required to ensure the write operation is legitimate. Specifically, the user or device may first authenticate to confirm their identity and permissions. Once authentication is successful, the system will implement access control, checking whether the user or device has the right to perform the configuration write operation. These steps aim to ensure that only authorized users or devices can perform configuration write operations, and to maintain data security and traceability throughout the process.
[0076] Based on the above embodiments, in Figure 2 In the illustrated method flow, step 102, which involves performing a cache test on the central gateway configured to communicate with the diagnostic device while its caching function is disabled, follows these steps: steps b1-b2.
[0077] Step b1: Send the software package to the central gateway so that the central gateway forwards the software package to the target ECU; wherein, the forwarding rate of the central gateway is less than the transmission rate threshold of the target ECU, and when the position of the caching function is set to the first value, the software package received by the target ECU is the first software package after discarding the first data frame that the central gateway did not forward in real time.
[0078] The diagnostic tool sends the software package transmitted from the supplier to the central gateway, which then forwards the package to the target ECU. During ECU software upgrade development, the OEM issues a "Software Upgrade Requirements Specification" to the ECU supplier, defining that the ECU transmits the software package at a maximum rate, i.e., a transmission rate threshold, with a maximum continuous frame rate of 0.15ms / frame. This means the central gateway's forwarding rate is less than the target ECU's transmission rate threshold.
[0079] When the frame interval is short, the CGW cannot forward consecutive frames of the software package in real time. If the CGW itself does not have a caching function (for example, when the caching function is set to the first value, the caching function is turned off), the software package will drop frames and discard the high-speed frame, i.e. the first data frame that the central gateway does not forward in real time. In this case, the first software package received by the target ECU is incomplete and is defined as an invalid software package.
[0080] Step b2: Receive the upgrade result fed back by the target ECU after upgrading based on the first software package, and determine the result of the cache test based on the upgrade result.
[0081] After receiving the first software package, the target ECU performs a software upgrade based on the data within it. When the diagnostic tool sends a data transmission request service, the target ECU responds negatively based on the first software package, causing the software upgrade to be interrupted, and then sends the upgrade result back to the diagnostic tool. Upon receiving the upgrade result, the diagnostic tool determines the results of the cached tests based on that result.
[0082] As an example, determining the result of the cache test based on the upgrade result includes:
[0083] If the upgrade result is an upgrade failure, the cache test result is determined to be a successful test, and integrity verification can be performed.
[0084] If the upgrade result is successful, the cache test result is determined to be a failure, and package integrity verification cannot be performed.
[0085] In this embodiment, frame dropping processing of software packages is achieved by configuring the caching function of the central gateway. Specifically, when the caching function is disabled, the CGW routes software packages and drops frames. At this time, the target ECU performs a software upgrade based on the received software package to verify that the central gateway's caching function configuration meets expectations and achieves the desired effect. Subsequently, when the caching function is enabled, forwarding the software package ensures the integrity of the transmitted package, thereby verifying the integrity of the software packages provided by the supplier. In this embodiment, a flexible software package integrity verification method that can be led by the OEM is established. By writing configuration words through a diagnostic tool, the software package frame dropping function can be implemented immediately, offering flexibility, speed, and minimal development effort, enabling rapid response to OEM needs.
[0086] Based on the above embodiments, in Figure 2 In the illustrated method flow, step 102 involves performing a cache test on the central gateway configured to communicate with the diagnostic device while its cache function is disabled. After the central gateway passes the test, and its cache function is enabled, the process of the central gateway forwarding the software package to the target ECU is as follows: steps c1-c2.
[0087] Step c1: After the central gateway passes the test, the software package is sent to the central gateway so that the central gateway forwards the software package to the target ECU; wherein, when the position bit of the caching function is the second value, all data frames in the software package are saved in the cache queue corresponding to the caching function based on the caching function of the central gateway, and the data frames are forwarded from the cache queue to the target ECU.
[0088] After the central gateway's caching test passes, the caching function is set to the second value, enabling the central gateway's caching function and forwarding software packages to the target ECU via the central gateway. During this process, for cases where the frame interval is short and the CGW cannot forward consecutive frames of the software package in real time, the central gateway's caching function stores the frames locally and then routes them to the target ECU in a specific order.
[0089] As an example, the local storage of data frames can be a cache space or a cache queue corresponding to the caching function. Taking the cache queue as an example, the caching function of the central gateway saves all data frames in the software package in the cache queue, and then forwards all data frames to the target ECU in turn, ensuring the integrity of the data frames and preventing missing or lost frames.
[0090] In other examples, the caching function can also save only the data frames that fail to be forwarded in real time locally, and then route these data frames to the target ECU in a specific order.
[0091] The specific order can be a custom order or an order corresponding to the first-in-first-out principle of data frames, the purpose of which is to ensure the integrity of the data package during transmission.
[0092] If feedback is received that the target ECU has successfully upgraded based on the software package, step 103, which determines that the software package has integrity, includes:
[0093] Step c2 receives the upgrade result fed back by the target ECU after upgrading based on the software package forwarded by the central gateway. If feedback is received that the target ECU has successfully upgraded based on the software package, it is determined that the software package has integrity.
[0094] The diagnostic tool receives the upgrade result from the target ECU after upgrading the software package based on the received complete route, and determines the integrity verification result of the software package based on the upgrade result.
[0095] Because the integrity of the software package is ensured during transmission through the central gateway, the outcome of the upgrade performed by the target ECU based on the received software package depends on the integrity of the software package itself. If the target ECU receives a complete and valid software package, the software upgrade is successful; if the target ECU upgrade fails, it indicates that the software package provided by the supplier is incomplete, thus implementing integrity verification.
[0096] In this embodiment, by enabling and disabling the CGW caching function, the transmission of complete software packages or frame-extracted software packages can be controlled. The target ECU verifies the integrity of the package by judging its legality. Compared with existing methods where test engineers need to manage each ECU software package locally, software flow and storage are subject to information security constraints, and software package management is prone to compliance requirements, this embodiment does not require each ECU supplier to provide a separate frame-extracted software package. It only needs to receive the un-frame-extracted software package provided by the supplier. Other ECUs in the vehicle do not need to modify the software package, reducing manpower and development costs.
[0097] Figure 3 This is another flowchart illustrating a software package integrity verification method provided in this specification, including the following steps:
[0098] In step 201, after receiving a test result indicating that the caching function of the central gateway has passed, the caching function of the central gateway is enabled; wherein, the test result is obtained by a device with diagnostic function performing a caching test on the central gateway based on a software package for upgrading the vehicle's electronic control unit (ECU) while the caching function of the central gateway is disabled; the target ECU for the upgrade is determined from the information in the software package.
[0099] After receiving the result of the cache test corresponding to the cache function, the central gateway enables the cache function and routes the software package sent by the diagnostic tool to the target ECU.
[0100] In step 202, the software package is forwarded to the target ECU so that the target ECU can perform an upgrade based on the software package.
[0101] CGW cannot forward consecutive frames of the software package in real time. It uses a caching function to store the frames locally and then routes them to the target ECU in a specific order to ensure the integrity of the software package transmission process.
[0102] In step 203, the upgrade result fed back after the target ECU upgrade process is forwarded to the device with diagnostic function, so that the device with diagnostic function can determine the integrity of the software package based on the upgrade result.
[0103] After receiving the software package, the target ECU will perform a software upgrade or data processing based on the data within the package. The central gateway forwards the upgrade result to the diagnostic tool, which then determines whether the software upgrade is complete. If the upgrade is successful, the software package is considered complete; if the upgrade fails, the software package is considered incomplete.
[0104] exist Figure 3In the illustrated method flow, step 202, which involves forwarding the software package to the target ECU so that the target ECU can perform an upgrade based on the software package, is as follows: step c1:
[0105] Step c1: Based on the caching function of the central gateway, all data frames in the software package are saved in the cache queue corresponding to the caching function, and the data frames in the cache queue are forwarded to the target ECU so that the target ECU can perform upgrade processing based on the software package.
[0106] When the caching function is enabled, the CGW cannot forward continuous frames of the software package in real time. Instead, it stores the frames in a cache queue through the caching function of the central gateway, and then forwards the data frames in the cache queue to the target ECU in a specific order. This ensures that the ECU receives a complete and legitimate software package and performs upgrade processing based on the software package.
[0107] As an example, forwarding the data frame in the buffer queue to the target ECU includes:
[0108] The data frames in the software package are forwarded from the cache queue to the target ECU in a specific order in which they are cached in the cache queue. For example, the specific order may be the cache order of the data frames in the cache queue, i.e., the first-in, first-out (FIFO) order.
[0109] This application provides a software package integrity verification method, device, and storage medium. It receives a software package for upgrading a vehicle's Electronic Control Unit (ECU), and determines the target ECU for the upgrade based on the information in the software package. With the caching function configured on the central gateway disabled, frame extraction processing of the software package is performed, and caching tests are conducted. The software package frame loss routing function can be implemented immediately, flexibly and quickly verifying whether the performance of the caching function meets expectations and achieves the desired effect. After the test passes, the software is forwarded to the target ECU using the central gateway's caching function enabled, ensuring the integrity of the software package transmission. The target ECU performs the upgrade process based on the transmitted software package, ultimately achieving software package integrity verification. This process does not rely excessively on the supplier's processing of the software package, can immediately respond to the OEM's needs, and improves verification testing efficiency.
[0110] Based on the same application concept as the above method, and corresponding to the embodiments of the aforementioned method, this specification also provides an embodiment of a computer device.
[0111] like Figure 4The diagram shown is a schematic block diagram of a computer device for implementing the software package integrity verification method described above. In some embodiments, the computer device may include a processor 510, a network interface 520, memory 530, and non-volatile memory 540. The non-volatile memory 540 stores a software package integrity verification program that can be run on the processor 510. When executed by the processor 510, the software package integrity verification program can be used to implement the software package integrity verification methods of the various embodiments described above. In some embodiments, the computer device may also include other hardware depending on the actual functions of the computer device, which will not be described in detail here.
[0112] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0113] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not claimed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this specification are indicated by the following claims.
[0114] It should be understood that this specification is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this specification is limited only by the appended claims.
[0115] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
Claims
1. A software package integrity checking method, characterized by, The method is applied to a device with a diagnostic function, and comprises the following steps: receiving a software package for electronic control unit (ECU) upgrade of a vehicle, determining a target ECU for upgrade based on information of the software package; performing a cache test on a cache function of a central gateway connected in communication with the device with the diagnostic function in a closed state, so that after the central gateway passes the test, the software package is forwarded to the target ECU by the central gateway in an open state of the cache function of the central gateway; during the cache test on the cache function of the central gateway connected in communication with the device with the diagnostic function in the closed state, a forwarding rate of the central gateway is less than a transmission rate threshold of the target ECU, and the software package received by the target ECU is a first software package after discarding a first data frame that is not forwarded in real time by the central gateway; after the central gateway passes the test, during the forwarding of the software package to the target ECU by the central gateway in the open state of the cache function of the central gateway, all data frames in the software package are stored in a local cache of the central gateway based on the cache function of the central gateway, and the data frames are forwarded to the target ECU from the local cache; if feedback of successful upgrade of the target ECU based on the software package is received, it is determined that the software package is complete.
2. The software package integrity verification method of claim 1, wherein, The method further comprises the following steps: processing a configuration word of the central gateway; different parameters of the configuration word have a mapping relationship with a state of the cache function, so as to control opening and closing of the cache function of the central gateway.
3. The software package integrity verification method of claim 2, wherein, The processing of the configuration word of the central gateway comprises the following steps: determining a configuration word corresponding to the cache function when a diagnostic instrument of the vehicle communicates with the central gateway; determining a position bit in the configuration word for indicating opening and closing of the cache function, and modifying the position bit accordingly; when the position bit is set to a first value, the cache function is controlled to be closed, and when the position bit is set to a second value, the cache function is controlled to be opened; applying the modified configuration word to the central gateway, so that the central gateway controls opening and closing of the cache function based on the modified configuration word.
4. The software package integrity verification method of claim 3, wherein, The cache test on the cache function of the central gateway connected in communication with the device with the diagnostic function in the closed state comprises the following steps: sending the software package to the central gateway, so that the central gateway forwards the software package to the target ECU when the position bit of the cache function is the first value; wherein the software package received by the target ECU is a first software package after discarding a first data frame that is not forwarded in real time by the central gateway; receiving an upgrade result fed back by the target ECU after upgrade processing based on the first software package, and determining a result of the cache test based on the upgrade result.
5. The software package integrity verification method of claim 4, wherein, The determination of the result of the cache test based on the upgrade result comprises the following steps: if the upgrade result is upgrade failure, it is determined that the result of the cache test is test pass. If the upgrade result is upgrade success, it is determined that the result of the cache test is test failure.
6. The software package integrity verification method of claim 3, wherein, after the central gateway test passes, the software package is forwarded to the target ECU by the central gateway with the cache function of the central gateway turned on, including: after the central gateway test passes, the software package is sent to the central gateway, and when the position of the cache function is the second value, the central gateway forwards the software package to the target ECU; wherein all data frames in the software package are saved in the cache queue corresponding to the cache function of the central gateway by the central gateway based on the cache function of the central gateway, and the data frames are forwarded from the cache queue to the target ECU; if the feedback of upgrade success of the target ECU based on the software package is received, it is determined that the software package has integrity, including: the upgrade result fed back by the target ECU after upgrade processing based on the software package forwarded by the central gateway is received, and if the feedback of upgrade success of the target ECU based on the software package is received, it is determined that the software package has integrity.
7. The software package integrity verification method of claim 2, wherein, Before the configuration word processing on the central gateway, the method further includes: service security authentication is performed on the device with diagnostic function for configuration word operation on the central gateway; after authentication passes, the step of performing configuration word processing on the central gateway is executed.
8. A software package integrity checking method characterized by comprising: applied to a central gateway, including: after receiving the result of test pass of the cache function test on the central gateway, the cache function of the central gateway is controlled to be turned on; wherein the result of test pass is obtained by a device with diagnostic function based on a software package for electronic control unit (ECU) upgrade of a vehicle, by performing cache test on the central gateway with the cache function of the central gateway controlled to be turned off; the target ECU for upgrade is determined by information of the software package; wherein during the cache test on the central gateway, the forwarding rate of the central gateway is less than the transmission rate threshold of the target ECU, and the software package received by the target ECU is the first software package after discarding the first data frame not forwarded in real time by the central gateway; the software package is forwarded to the target ECU, so that the target ECU performs upgrade processing based on the software package; wherein during the process of forwarding the software package to the target ECU by the central gateway with the cache function of the central gateway turned on, all data frames in the software package are stored in the local by the central gateway based on the cache function of the central gateway, and the data frames are forwarded to the target ECU from the local; the upgrade result fed back by the target ECU after upgrade processing is forwarded to the device with diagnostic function, so that the device with diagnostic function determines the integrity of the software package according to the upgrade result.
9. The software package integrity verification method of claim 8, wherein, the software package is forwarded to the target ECU, so that the target ECU performs upgrade processing based on the software package; wherein during the process of forwarding the software package to the target ECU by the central gateway with the cache function of the central gateway turned on, all data frames in the software package are stored in the local by the central gateway based on the cache function of the central gateway, and the data frames are forwarded to the target ECU from the local; The cache function of the central gateway saves all data frames in the software package in a cache queue corresponding to the cache function, and forwards the data frames in the cache queue to the target ECU, so that the target ECU performs upgrade processing based on the software package.
10. The software package integrity verification method of claim 9, wherein, The forwarding of the data frames in the cache queue to the target ECU comprises: The data frames are forwarded to the target ECU from the cache queue in a specific order according to the order in which the data frames are cached in the cache queue.
11. A software package integrity checking apparatus characterized by comprising: The device comprises a memory, a processor, and a software package integrity verification method program stored in the memory and executable on the processor, and the processor implements the steps of the software package integrity verification method according to any one of claims 1-10 when executing the software package integrity verification method program.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a software package integrity verification method program, and the software package integrity verification method program implements the steps of the software package integrity verification method according to any one of claims 1-10 when executed.
Citation Information
Patent Citations
Method for realizing remote upgrading of vehicle ECU based on UDS communication protocol
CN111327689A
TBOX software upgrading method, TBOX and automobile
CN111651184A