Data flashing method and device, electronic equipment and storage medium

CN121597230APending Publication Date: 2026-03-03LAUNCH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511739160.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In existing technologies, ECU software flashing has low flexibility and lacks the flexibility to adapt to different vehicle models and network environments, resulting in high maintenance costs and long deployment cycles.

Method used

Through dynamic interaction between the diagnostic terminal and the server, a query request is generated based on vehicle attribute information. The server selects the optimal download strategy according to the query request, obtains the target data and writes it to the vehicle. It supports the optimal download method in multiple scenarios and decouples the query and download processes.

Benefits of technology

It improves the flexibility and maintainability of the data writing process, adapts to different diagnostic clients, and enhances the efficiency of data writing and the versatility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597230A_ABST
    Figure CN121597230A_ABST
Patent Text Reader

Abstract

The invention relates to a data flashing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining the vehicle attribute information of a target vehicle, generating a query request related to the target vehicle, and enabling the query request to carry the vehicle attribute information of the target vehicle; sending a query request associated with the target vehicle to a server to trigger the server to determine a target downloading strategy corresponding to the query request from a plurality of preset downloading strategies based on the query request, and generating a response message based on the target downloading strategy; obtaining response information returned by the server, wherein the response information comprises downloading indication information corresponding to the target downloading strategy; and obtaining to-be-written target data of the target vehicle according to downloading indication information in the response information so as to write the target data into the target vehicle. According to the method, the data flashing efficiency and adaptability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, specifically to a data writing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the continuous development of automotive electronics technology, Electronic Control Units (ECUs) have been widely used in modern automobiles. When a vehicle rolls off the production line, or when the ECU software changes or has defects requiring an upgrade, manufacturers or users need to rewrite the ECU software or data. Related technologies involve remotely obtaining and updating the vehicle's ECU software or modifying its configuration online. However, the firmware files used for rewriting are generally stored in a local database or FTP server, with a fixed transmission path and a lack of flexibility. Summary of the Invention

[0003] This application provides a data writing method, apparatus, electronic device, and storage medium to solve the problem of low flexibility in data writing.

[0004] To achieve the above objectives, according to a first aspect of this application, a data writing method is provided, applied to a diagnostic terminal, wherein the diagnostic terminal is communicatively connected to a target vehicle, the method comprising: Obtain the vehicle attribute information of the target vehicle, generate a query request associated with the target vehicle, and the query request carries the vehicle attribute information of the target vehicle; Send a query request associated with the target vehicle to the server to trigger the server to determine the target download strategy corresponding to the query request from a plurality of preset download strategies based on the query request, and generate a response message based on the target download strategy; Obtain the response information returned by the server, the response information including download indication information corresponding to the target download strategy; Based on the download instruction information in the response information, the target data to be written to the target vehicle is obtained, and the target data is written to the target vehicle.

[0005] Optionally, sending a query request associated with the target vehicle to the server to trigger the server to determine the target download strategy corresponding to the query request from a set of preset download strategies includes: Based on the query request and the first preset routing rule, the target query interface corresponding to the query request is determined from multiple query interfaces corresponding to the server, wherein different query interfaces are configured with different download strategies; The query request is sent to the server through the target query interface to trigger the server to determine the download strategy corresponding to the target query interface that received the query request as the target download strategy; The first preset routing rule includes: different query interfaces are corresponding to different amounts of data to be downloaded and / or different communication network information in the query request.

[0006] Optionally, sending a query request associated with the target vehicle to the server to trigger the server to determine the target download strategy corresponding to the query request from a set of preset download strategies includes: The query request is sent to the server through the preset query interface corresponding to the server, so as to trigger the server to determine the target download strategy corresponding to the query request from multiple preset download strategies based on the query request and the second preset routing rule; The second preset routing rule includes the following: different download strategies are applied depending on the amount of data to be downloaded and / or the communication network information in the query request.

[0007] Optionally, the query interface includes a first query interface and a second query interface. The first download strategy corresponding to the first query interface includes: downloading the data to be written to the target vehicle through a download link. The second download strategy corresponding to the second query interface includes: downloading the data to be written to the target vehicle through a preset download interface. When the target download strategy is the first download strategy, the download instruction information in the response information includes a download link; When the target download strategy is the second download strategy, the download instruction information in the response information includes a preset download interface.

[0008] Optionally, when the target download strategy is the first download strategy, the response information includes a first list of writable data, which includes a version identifier of at least one writable data and a download link corresponding to the writable data. Obtaining the target data to be written to the target vehicle based on the download instruction information in the response information includes: The first list of rewritable data is displayed on the diagnostic terminal. In response to a first trigger operation on the first writable data list, determine the target download link corresponding to the first trigger operation; The target data of the target vehicle can be downloaded via the target download link.

[0009] Optionally, if the target download strategy is the second download strategy, the response information further includes a second list of writable data, which includes version identifiers of at least one writable data. Obtaining the target data to be written to the target vehicle based on the download instruction information in the response information includes: The second list of rewritable data is displayed on the diagnostic terminal; In response to a second trigger operation on the second writable data list, determine the target version identifier corresponding to the second trigger operation; Based on the target version identifier and the vehicle attribute information, a download request is generated and sent to the corresponding server through the preset download interface to obtain the target data to be written to the target vehicle.

[0010] Optionally, the step of obtaining the target data to be written to the target vehicle based on the download instruction information in the response information, and then writing the target data to the target vehicle, includes: According to the download instruction information in the response information, the target ciphertext to be written to the target vehicle is obtained. The target ciphertext is obtained by the server encrypting the target data based on the encryption key, which is generated based on the preset key seed and the received vehicle attribute information. Determine the key seed of the server, and generate a decryption key based on the key seed and the vehicle attribute information of the target vehicle; The target ciphertext is decrypted based on the decryption key; If decryption is successful, the decrypted plaintext data will be used as the target data to be written to the target vehicle.

[0011] According to a second aspect of this application, embodiments of this application also provide a data writing device, the device comprising: The first acquisition module is used to acquire vehicle attribute information of the target vehicle and generate a query request associated with the target vehicle, wherein the query request carries the vehicle attribute information of the target vehicle. The request module is used to send a query request associated with the target vehicle to the server, so as to trigger the server to determine the target download strategy corresponding to the query request from a number of preset download strategies based on the query request, and generate a response message based on the target download strategy. The second acquisition module is used to acquire the response information returned by the server, the response information including download indication information corresponding to the target download strategy; The writing module is used to obtain the target data to be written to the target vehicle according to the download instruction information in the response information, so as to write the target data to the target vehicle.

[0012] According to a third aspect of this application, embodiments of this application also provide an electronic device, comprising: A memory on which computer programs are stored; A processor is configured to execute the computer program in the memory to implement the steps of any of the methods provided in the embodiments of this application.

[0013] According to a fourth aspect of this application, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the methods provided in embodiments of this application.

[0014] Some embodiments of this application include at least the following beneficial effects: by using a download strategy based on the response information of the target query interface, the optimal download method can be dynamically selected according to the content of the actual returned response information, which can effectively accommodate the differences in firmware distribution architecture between different vehicle models and manufacturers, and avoid the problems of adaptation failure or low flashing flexibility caused by a single download method.

[0015] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0017] Figure 1 These are application scenario diagrams of the data writing method provided in some embodiments of this application; Figure 2 This is a schematic flowchart of a data writing method provided in some embodiments of this application; Figure 3 This is a schematic diagram of a decryption process provided in some embodiments of this application; Figure 4 These are exemplary schematic diagrams of data writing devices provided in some embodiments of this application; Figure 5 These are exemplary schematic diagrams of electronic devices provided in some embodiments of this application. Detailed Implementation

[0018] 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 a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.

[0019] To facilitate understanding of the implementation schemes provided in this application, the relevant application background of the data writing method provided in this application will be explained first.

[0020] The firmware distribution services for ECUs from different car models, production platforms (such as Volkswagen and Toyota), or suppliers are often different. The same query request may also use different download methods due to different relevant information (such as VIN, ECU model, client version, amount of data to be written, communication network, etc.). When the download method indicated by the server changes or a new car model platform is added, the client software often needs to be upgraded synchronously, resulting in high maintenance costs, long deployment cycles, and difficulty in adapting to various complex application scenarios.

[0021] In view of this, some embodiments of this application provide a data writing method, which enables the diagnostic terminal to switch download strategies based on the response message returned by the server. When the response information contains a download link for writable data, the target encrypted text is directly obtained through the download link; when the response information only contains a version identifier, a corresponding download request is generated by combining vehicle attribute information, etc., and the target encrypted text is obtained from a preset download interface. This method, by decoupling query and download, supports optimal download methods in multiple scenarios, adapts to different diagnostic clients, and improves the flexibility and maintainability of the data writing process.

[0022] Figure 1 This is an application scenario diagram of the data writing method provided in some embodiments of this application.

[0023] The implementing entity of the technical solution in this application embodiment can be an electronic device, which can be a data writing device. This data writing device can be implemented in hardware and / or software, and can be configured in any electronic device with network communication capabilities. This electronic device can be a server, a terminal, or other similar device.

[0024] like Figure 1 As shown, the data writing method provided in this application embodiment can be applied to, for example... Figure 1The application environment shown can include a diagnostic terminal (only one is shown in the figure), a server, and a target vehicle. The diagnostic terminal and the server establish a data connection via a communication network, which includes, but is not limited to, cellular mobile networks (such as 4G / 5G), Wi-Fi LANs, or wired Ethernet. Simultaneously, the diagnostic terminal and the target vehicle establish a local connection via an on-board diagnostic interface (OBD-II) or wireless communication methods (such as Bluetooth or Wi-Fi Direct) to enable the reading of vehicle-related information and the issuance of flashing commands.

[0025] In some embodiments, the diagnostic terminal may be a fixed device, such as a terminal installed at a work station in an automotive sales and service organization (such as a 4S store or repair station); or it may be a portable device, such as a handheld diagnostic instrument, tablet computer, or smartphone, carried by the automotive diagnostic personnel. The diagnostic terminal may have diagnostic software installed to execute the data writing process described in the embodiments of this application.

[0026] In some embodiments, after initiating the flashing process, the diagnostic software first obtains the Vehicle Identification Number (VIN) and related vehicle attribute information, such as the target electronic control unit (ECU), through a communication link with the target vehicle. The vehicle attribute information includes at least one or more of the following: vehicle VIN, target ECU model or identifier, target ECU current firmware version number, and target ECU hardware serial number.

[0027] After obtaining the aforementioned vehicle attribute information, the diagnostic terminal can send a query request to the server for available versions. The server can be a back-end service system deployed by the automaker, a cloud platform, or a third-party OTA management platform. The server stores relevant information about available versions for each vehicle model and each ECU, as well as files containing writable data.

[0028] In some embodiments, the query request carries vehicle attribute information and user login information. The server can perform identity verification, permission verification, and vehicle matching based on the content of the query request, and return the corresponding response information.

[0029] It is important to note that the application scenarios for the data writing method are provided for illustrative purposes only and are not intended to limit the scope of this specification. Those skilled in the art can make various changes and modifications based on the description in this specification. For example, application scenarios may also include databases, information sources, etc. Furthermore, application scenarios may be implemented on other devices to achieve similar or different functions. However, these changes and modifications will not depart from the scope of this specification.

[0030] Figure 2This is a schematic flowchart of a data writing method provided in some embodiments of this application. In some embodiments, process 200 can be executed based on an electronic device. Figure 2 As shown, process 200 includes the following steps.

[0031] Step 210: Obtain the vehicle attribute information of the target vehicle, generate a query request associated with the target vehicle, and carry the vehicle attribute information of the target vehicle in the query request.

[0032] A query request is a data packet sent by a diagnostic terminal to a server to request software upgrade information applicable to a target vehicle. For example, a query request may specifically be a version query request to obtain the available versions of firmware packages applicable to the target vehicle.

[0033] The available version is a higher or patched version that has been released and is compatible with the firmware version currently running on the target electronic control unit. For example, the available version may include, but is not limited to, the major version (such as v2.0.0), the security patch version (such as v1.2.0), the feature enhancement version, or the recall fix version.

[0034] Vehicle attribute information is a set of parameters used to uniquely identify and describe the technical status of a target vehicle and its electronic control unit. For example, vehicle attribute information may include, but is not limited to, at least one of the following: the vehicle identifier of the target vehicle, the identifier of the target electronic control unit, the current firmware version, the hardware serial number, the model year, etc.

[0035] Among them, the vehicle identifier is a code used to identify the vehicle. For example, the vehicle identifier can be the Vehicle Identification Number (VIN).

[0036] The identifier of the target electronic control unit is the identification information of the specific electronic control unit targeted by the current firmware upgrade. For example, the target electronic control unit may include, but is not limited to, ECU model code, function name code (such as EMS engine management system, ABS anti-lock braking system), supplier part number or internal address identifier, etc.

[0037] The number of target electronic control units (ECUs) may include, but is not limited to, a single one, multiple ECUs, or all ECUs of the target vehicle. In some embodiments, the number of target ECUs can be determined in various ways, such as by statistically analyzing the ECU identifier list contained in the response information returned by the server; or by the diagnostic terminal scanning all ECU nodes on the vehicle communication bus during the initialization phase and filtering out the number of ECUs that need to be flashed based on the currently available version information; or by the repair technician manually entering multiple ECUs to be updated in the diagnostic interface.

[0038] The current firmware version is the software version number currently running on the target electronic control unit. For example, the current firmware version can be a string composed of, but is not limited to, major version number, minor version number, etc.

[0039] A hardware serial number is a unique physical identifier burned into the electronic control unit during the manufacturing process, used to bind the firmware package to the hardware device. For example, a hardware serial number may include, but is not limited to, a chip UID (Unique ID), a PCB board serial number, or a security chip certificate serial number.

[0040] In some embodiments, the diagnostic terminal can read vehicle attribute information from the target vehicle via the UDS (Unified Diagnostic Services) protocol.

[0041] Step 220: Send a query request associated with the target vehicle to the server to trigger the server to determine the target download strategy corresponding to the query request from multiple preset download strategies, and generate a response message based on the target download strategy.

[0042] The response information is a data packet returned by the server in response to the query request. It is used to provide the diagnostic terminal with the relevant data required for flashing. For example, the response information may include, but is not limited to, the target ciphertext, download strategy, key seed, digital signature, expiration time stamp, etc.

[0043] Download policies are used to indicate how to access the target data. For example, download policies may include, but are not limited to, direct download policies, authorized download policies, and rate-limited download policies.

[0044] The direct download strategy may include, but is not limited to, including carrying download instructions such as a download link for data that can be rewritten and the file size in the response information, so that the diagnostic terminal can initiate a download request without additional authentication operations.

[0045] Authorized download policies may include download instructions such as not including a download link in the response information, but requiring a specific authentication token to access a specific download interface, so that the diagnostic terminal needs to complete additional authentication operations before it can initiate a download request.

[0046] In some embodiments, the download strategy can be determined in various ways, such as matching based on vehicle brand, ECU safety level, network environment, etc. For example, upon receiving a query request, the server can determine the corresponding target download strategy based on the query request. Different query requests correspond to different download strategies, and their correspondence can be flexibly configured according to actual conditions. This approach ensures that the optimal download method can be obtained for different vehicle models, different terminals, and different network environments.

[0047] Step 230: Obtain the response information returned by the server. The response information includes download instruction information corresponding to the target download strategy.

[0048] Download instruction information is information contained in the response information that guides the method of obtaining the target data. For example, download instruction information may include, but is not limited to, download links for the target data, preset download interfaces, etc.

[0049] Step 240: Based on the download instruction information in the response information, obtain the target data to be written to the target vehicle, and write the target data to the target vehicle.

[0050] The target data is the original firmware package or configuration file to be written to the target vehicle's electronic control unit, used to achieve function upgrades, defect repairs, or performance optimizations. For example, the target data may include, but is not limited to, the executable code, parameter files, and bootloader of the target electronic control unit.

[0051] In some embodiments, the target data can be determined in a variety of ways. For example, the encrypted firmware package can be obtained through the download link in the download instruction information, or the encrypted firmware package returned by the corresponding server can be received after submitting a download request through a preset download interface. The diagnostic terminal can decrypt the encrypted firmware package after obtaining it to restore it to the decrypted plaintext data.

[0052] In some embodiments, the acquired target data can be burned into the memory of the target electronic control unit via a preset communication protocol.

[0053] In some embodiments of this application, a download strategy that matches the characteristics of the current vehicle is determined. For example, if the response information contains a downloadURL field, the target ciphertext is obtained directly through the download link corresponding to the downloadURL field, thereby improving download efficiency. If there is no downloadURL field, a predefined preset download interface is called and request parameters are carried to obtain the target ciphertext, so as to be compatible with different firmware upgrade scenarios and improve the versatility and flexibility of the system.

[0054] In some embodiments, a query request associated with the target vehicle is sent to the server to trigger the server to determine the target download strategy corresponding to the query request from a plurality of preset download strategies, including: Based on the query request and the first preset routing rule, the target query interface corresponding to the query request is determined from multiple query interfaces corresponding to the server. Different query interfaces are configured with different download strategies. Send a query request to the server through the target query interface to trigger the server to determine the download strategy corresponding to the target query interface that received the query request as the target download strategy; The first preset routing rule includes: different query interfaces are used depending on the amount of data to be downloaded and / or the communication network information in the query request.

[0055] The query interface can include, but is not limited to, communication interfaces such as RESTful APIs and GraphQL interfaces. The query interface can be pre-configured at the factory or dynamically loaded.

[0056] The first preset routing rule is a set of rules predefined in the diagnostic terminal to allocate query requests to appropriate query interfaces. For example, the first preset routing rule may include, but is not limited to, selecting a query interface based on the size of the data to be downloaded, selecting a query interface based on the type of communication network (such as 4G, 5G, Wi-Fi), or selecting a query interface based on the vehicle model or the safety level of the ECU.

[0057] In some embodiments, the first preset routing rule can be deployed in the diagnostic terminal in the form of a configuration file.

[0058] The amount of data to be downloaded indicates the size of the target data to be acquired, used to assess network transmission overhead and select a suitable communication path. For example, the amount of data to be downloaded can be, but is not limited to, values ​​in bytes, kilobytes, or megabytes, such as a 10MB ECU firmware package or a 500KB configuration update file.

[0059] In some embodiments, the amount of data to be downloaded can be obtained or determined in a variety of ways. For example, the server can register the file size of each version of the firmware package in the historical version repository and provide the relevant data in the response information; or the diagnostic terminal can query a preset mapping table based on the version identifier to obtain an approximate value of the amount of data to be downloaded.

[0060] It should be noted that when the diagnostic terminal has not yet obtained specific available version information, the amount of data to be downloaded can be estimated based on preset rules. For example, based on the type of the target electronic control unit and the current firmware version, the data volume range of similar ECUs in historical updates can be found in the local preset firmware feature database to obtain the amount of data to be downloaded.

[0061] Communication network information refers to information related to the current status of the communication link between the diagnostic terminal and the server. For example, communication network information may include, but is not limited to, network type (such as Wi-Fi, 4G, 5G, Ethernet), signal strength, available bandwidth, latency, etc.

[0062] The target query interface is the specific interface selected based on the current query request and the aforementioned pre-defined correspondence. The target query interface can be either the first query interface or the second query interface.

[0063] It should be noted that the method of having the diagnostic terminal determine the target query interface and then send a query request can be applied to new clients with strong computing capabilities. For example, new clients may include, but are not limited to, intelligent diagnostic instruments equipped with high-performance processors and operating systems, in-vehicle terminals integrating 5G or Wi-Fi 6 communication modules, and repair workstations with edge computing capabilities. In some embodiments, the new client can determine the status of the current operating environment in various ways, such as real-time reading of communication network information (e.g., network type 5G, signal strength -85dBm, available bandwidth 20Mbps), estimating the amount of data to be downloaded, and obtaining vehicle attribute information to generate a structured query request.

[0064] Based on the above information and combined with the first preset routing rules, the new client can select the most suitable target query interface from multiple query interfaces provided by the server for the current scenario. For example, when a large amount of data to be downloaded is detected and the network environment is high-speed Wi-Fi, the new client can choose the query interface of "direct download policy" to obtain a response message containing a direct download link; when the network environment is cellular and the amount of data to be downloaded is small, or when the target electronic control unit is a high-security component, the new client can choose the query interface of "authorized download policy" to trigger a download policy that requires authentication, thereby achieving the effect of reducing the number of communication round trips and improving response speed without relying on server feedback.

[0065] In some embodiments, a query request associated with the target vehicle is sent to the server to trigger the server to determine the target download strategy corresponding to the query request from a plurality of preset download strategies, including: A query request is sent to the server through the server's corresponding preset query interface, which triggers the server to determine the target download strategy corresponding to the query request from multiple preset download strategies based on the query request and the second preset routing rule. The second preset routing rule includes: different download strategies are applied depending on the amount of data to be downloaded and / or the communication network information requested in the query request.

[0066] The default query interface is a pre-configured communication interface used between the diagnostic terminal and the server to transmit query requests.

[0067] It should be noted that the method of sending query requests by the diagnostic terminal through a preset query interface is applicable to older clients. Older clients may include, but are not limited to, early models of OBD diagnostic tools, embedded flashing devices, and microcontroller systems running fixed firmware versions. In some embodiments, older clients can communicate with the server in various ways, such as sending query requests using the preset query interface.

[0068] Since older clients cannot independently select a query interface based on information such as the amount of data to be downloaded, the server can receive query requests sent by older clients through a preset query interface. Based on the information carried in the query request (such as vehicle identification, current firmware version, etc.) and context information (such as the location of the client's IP address, historical request frequency, network access type, etc.), combined with the second preset routing rules, the server can match the most suitable target download strategy among multiple download strategies.

[0069] In some embodiments, the query interface includes a first query interface and a second query interface. The first download strategy corresponding to the first query interface includes: downloading the data to be written to the target vehicle via a download link. The second download strategy corresponding to the second query interface includes: downloading the data to be written to the target vehicle via a preset download interface. When the target download strategy is the first download strategy, the download instruction information in the response message includes the download link; When the target download strategy is the second download strategy, the download instruction information in the response message includes the preset download interface.

[0070] In this context, a download link is a Uniform Resource Locator (URL) used to locate the storage location of the target encrypted text. For example, a download link can include, but is not limited to, HTTPS links, FTP paths, and CDN-accelerated links.

[0071] In some embodiments, the diagnostic terminal can extract specific fields (such as “download_url” or “firmware_link”) from the response information to determine the download link corresponding to the writable data.

[0072] The default download interface is a pre-configured communication interface used to request specific target ciphertext from the corresponding server when the version information is known.

[0073] The server corresponding to the preset download interface may be the same as or different from the server corresponding to the query interface; this application embodiment does not limit this.

[0074] In some embodiments, the preset download interface and the query interface are separated to decouple the "query and download" functions. The preset download interface can be pre-configured in the diagnostic terminal.

[0075] In some embodiments, when the diagnostic terminal cannot directly obtain a download link, it can construct a download request by combining locally stored vehicle attribute information and a preset download interface. Specifically, the diagnostic terminal encapsulates parameters such as the vehicle identifier, the target electronic control unit identifier, the current firmware version, the hardware serial number, and user login information from the vehicle attribute information into a download request, and sends it to the corresponding server through the preset download interface. Upon receiving the download request, the server verifies its legitimacy and returns the corresponding target encrypted text.

[0076] A download request is a network request initiated by the diagnostic terminal to the corresponding server to obtain an encrypted firmware package.

[0077] It should be understood that in high-security, high-speed scenarios, download links can be obtained directly through response information to achieve rapid distribution; in security-restricted, low-speed scenarios, download requests can be sent through vehicle attribute information, user login information, and other pre-set download interfaces to achieve controlled access, thus ensuring the flexibility of firmware package distribution.

[0078] In some embodiments of this application, by setting up multiple query interfaces and establishing a dynamic mapping relationship with query requests, targeted routing of different query requests can be achieved. The server can flexibly adjust the data distribution strategy according to the different types of response information returned by different query interfaces, thereby improving the flexibility and controllability of the vehicle software upgrade system.

[0079] In some embodiments, when the target download strategy is a first download strategy, the response information includes a first list of writable data, which includes a version identifier of at least one writable data and a download link corresponding to the writable data. Based on the download instruction information in the response information, the target data to be written to the target vehicle is obtained, including: The diagnostic terminal displays the first list of writable data. In response to the first trigger operation for the first list of writable data, determine the target download link corresponding to the first trigger operation; Download the target vehicle's data using the target download link.

[0080] In some embodiments, when the target download strategy is the second download strategy, the response information further includes a second writable data list, which includes version identifiers of at least one writable data. Based on the download instruction information in the response information, the target data to be written to the target vehicle is obtained, including: The diagnostic terminal displays a second list of writable data. In response to a second trigger operation on the second writable data list, determine the target version identifier corresponding to the second trigger operation; Based on the target version identifier and vehicle attribute information, a download request is generated and sent to the corresponding server through a preset download interface to obtain the target data to be written to the target vehicle.

[0081] The rewritable data list is a collection of data included in the response information, used to list information about one or more updatable firmware packages currently applicable to the target electronic control unit of the target vehicle. The rewritable data list may include, but is not limited to, multiple entries, each of which may contain fields such as the version identifier of the updatable firmware, file size, release date, and applicable ECU model.

[0082] The first list of writable data may include at least the version identifier and download link of the updatable firmware package.

[0083] The second list of writable data may include at least the version identifier of the updatable firmware package, but does not include download links.

[0084] Flashable data is a firmware package used to update a target electronic control unit. A flashable data entry indicates that a usable firmware version exists for the target vehicle. For example, flashable data may include, but is not limited to, firmware packages for the engine control module, body control module, and patch packages for the onboard communication unit (TCU).

[0085] Version identifiers are unique numbers used to distinguish different firmware packages, enabling users or systems to identify different flashable data. Version identifiers may include, but are not limited to, version numbers (e.g., v2.1.0), build numbers (e.g., Build20241008), and release codenames (e.g., "Firmware_A").

[0086] In some embodiments, the response information returned by the server can be presented to the operator in a visual manner for manual selection. For example, information such as the version identifier, release notes, and file size of each firmware version can be displayed in a list on the diagnostic terminal screen.

[0087] A trigger action is a selection action performed by the user on a specific item on the diagnostic terminal interface. Trigger actions may include, but are not limited to, tapping an item on the touchscreen, confirming the selection using a button, or selecting the firmware version using a voice command.

[0088] For example, a user can select the network address associated with the target data through a first trigger operation to uniquely determine the location of the target data. As another example, a user can select the version information associated with the target data through a second trigger operation to send a request to a preset download address to retrieve the target data.

[0089] In some embodiments, the diagnostic terminal can use the HTTP / HTTPS protocol to send a request to the target download link, receive the data stream and save it as a local file to obtain the target encrypted text of the target vehicle.

[0090] A download request is a data packet sent by the diagnostic terminal to a preset download interface to request access to the target encrypted text. Download requests may include, but are not limited to, fields such as target version identifier, vehicle identifier, ECU identifier, current firmware version, hardware serial number, timestamp, and authentication token.

[0091] In some embodiments, the target version identifier, along with the original vehicle attribute information, user login information, etc., can be encapsulated into a download request according to a preset data format (such as JSON) and sent to the corresponding server through a preset download interface.

[0092] Figure 3 This is a schematic diagram of a decryption process provided in some embodiments of this application. In some embodiments, process 300 can be executed based on an electronic device. Figure 3 As shown, process 300 includes the following steps.

[0093] Based on the download instruction information in the response message, obtain the target data to be written to the target vehicle, and write the target data to the target vehicle, including: Step 310: Obtain the target ciphertext to be written to the target vehicle according to the download instruction information in the response information.

[0094] In some embodiments, the target ciphertext is obtained by the server encrypting the target data based on an encryption key, which is generated based on a preset key seed and the received vehicle attribute information.

[0095] Step 320: Determine the key seed of the server to generate a decryption key based on the key seed and the vehicle attribute information of the target vehicle.

[0096] Step 330: Decrypt the target ciphertext based on the decryption key.

[0097] Step 340: If decryption is successful, use the decrypted plaintext data as the target data to be written to the target vehicle.

[0098] The target ciphertext is the encrypted data of the original firmware package. For example, the server can use symmetric encryption algorithms such as AES-256-GCM or SM4 to encrypt the original firmware package. The target ciphertext can be obtained directly from the target download link or obtained after authentication via a preset download interface.

[0099] An encryption key can be a key used by a server to encrypt target data. For example, an encryption key can include, but is not limited to, symmetric keys (such as AES keys) and public keys in asymmetric keys.

[0100] In some embodiments, an encryption key can be generated based on the key seed and vehicle attribute information received by the server (such as vehicle identification, serial number of the target electronic control unit, current firmware version, etc.) using a key derivation algorithm (such as HMAC-SHA256 or KDF), thereby ensuring that the encryption key used for each vehicle or each update is unique and time-sensitive.

[0101] A key seed can be a parameter provided by the server through a preset security interface for decryption operations, used to ensure the security and legitimacy of data transmission.

[0102] The decryption key is used by the diagnostic terminal to restore the target ciphertext to the target data, and it matches the encryption key used for encryption on the server side. The decryption key can include, but is not limited to, symmetric keys (such as AES keys) and private keys in asymmetric keys.

[0103] In some embodiments, the diagnostic terminal can take the received key seed and the vehicle attribute information of the target vehicle as input, and calculate the decryption key using the same key derivation algorithm (such as PBKDF2, HKDF, etc.) as the server.

[0104] It should be noted that when encrypting target data, the server can generate an encryption key based on the key seed and the received vehicle attribute information. After obtaining the target ciphertext, the diagnostic terminal uses the same key seed and locally acquired vehicle attribute information to generate a decryption key using the same key derivation algorithm. If the two keys are completely identical, the decryption process can correctly restore the original firmware package. Since it is impossible to directly compare whether the two keys are the same, the success of decryption is used to indirectly determine whether the keys match. After successfully decrypting and obtaining the decrypted plaintext data, the process may also include: checking whether the hash value of the decrypted plaintext data matches the checksum provided by the server, and verifying the validity of the digital signature built into the firmware package.

[0105] In some embodiments, if the hash value of the decrypted plaintext data matches the verification value provided by the server, the decrypted plaintext data is compressed to obtain the decompressed data as the target data, and then written into the non-volatile memory of the target electronic control unit through vehicle diagnostic communication protocols such as UDS (Unified Diagnostic Service) to complete the final flashing operation.

[0106] In some embodiments, the diagnostic terminal can decompose the target data into multiple target data blocks according to a preset communication protocol. The number of bytes contained in each target data block is less than or equal to the effective data length supported by the preset communication protocol. For example, the engine ECU of a vehicle communicates based on the CAN protocol, and the effective data length supported by the CAN protocol is 4096 bytes. Therefore, in this embodiment, the target data can be decomposed into a preset number of target data blocks, and the number of bytes contained in each target data block is less than or equal to 4096 bytes.

[0107] For example, from the target data, where 1M = 1,048,576 bytes, since the vehicle engine ECU is based on the CAN protocol for communication, the number of bytes included in each target data block cannot exceed 4,096 bytes. Understandably, as long as it does not exceed 4,096 bytes, it is acceptable, for example, each target data block includes 100 bytes.

[0108] In some embodiments, the diagnostic terminal can compress each target data block separately to obtain compressed data blocks.

[0109] In this embodiment, each target data block is compressed using a preset compression algorithm to compress the bytes contained in each target data block, resulting in a compressed data block. For example, the preset compression algorithm is a lossless compression algorithm, such as differential coding, RLE, Huffman coding, LZW coding, arithmetic coding, etc. This lossless compression algorithm can reconstruct the original data without distortion from the compressed data, accurately restoring the original data before compression. Typically, lossless compression algorithms are used in situations where data accuracy is critical. Understandably, depending on the data compression algorithm, the compressed data block size will vary, generally reaching 20%-40% of the original data size. For specific implementation details of each lossless compression algorithm, please refer to existing explanations; they will not be repeated here.

[0110] In some embodiments, the diagnostic terminal can generate flashing instructions for flashing each compressed data block according to a preset communication protocol and send them to the target electronic control unit.

[0111] In some embodiments of this application, the encryption key or decryption key is derived from the key seed and vehicle attribute information, which can ensure that only vehicles with matching characteristics can complete the decryption and form the target data bound to the hardware; at the same time, the decryption process can prevent the tampered firmware package from being flashed, thereby improving the security of vehicle firmware upgrades.

[0112] It should be noted that the above description of the process is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art can make various modifications and changes to the process under the guidance of this specification. However, these modifications and changes remain within the scope of this specification.

[0113] Figure 4 This is an exemplary schematic diagram of a data writing device provided in some embodiments of this application.

[0114] like Figure 4 As shown in the diagram, one or more embodiments of this specification also provide a structural schematic of a data writing device. This data writing device may include: The first acquisition module 401 is used to acquire the vehicle attribute information of the target vehicle, generate a query request associated with the target vehicle, and carry the vehicle attribute information of the target vehicle in the query request. The request module 402 is used to send a query request associated with the target vehicle to the server, so as to trigger the server to determine the target download strategy corresponding to the query request from a number of preset download strategies based on the query request, and generate a response message based on the target download strategy. The second acquisition module 403 is used to acquire the response information returned by the server, which includes download instruction information corresponding to the target download strategy. The writing module 404 is used to obtain the target data to be written to the target vehicle according to the download instruction information in the response information, so as to write the target data to the target vehicle.

[0115] The first acquisition module 401, the request module 402, the second acquisition module 403, and the writing module 404 can be used to execute the corresponding embodiments of the above data writing method. For the specific implementation of these modules and more details, please refer to the corresponding method section, which will not be elaborated here.

[0116] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0117] Figure 5 These are exemplary schematic diagrams of electronic devices provided in some embodiments of this application.

[0118] This application embodiment also provides an electronic device 500, which may include components such as a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, and an input unit 504. Those skilled in the art will understand that... Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 501 is the data writing center, connecting various parts of the electronic device via various interfaces and lines. It executes software programs and / or modules stored in the memory 502, and calls data stored in the memory 502, performing various functions and processing data to monitor the electronic device as a whole. It is understood that the processor 501 communicates with the controller via signal transmission. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 501.

[0119] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0120] In some embodiments of this application, the data writing device can be implemented as a computer program, and the computer program can be implemented as follows: Figure 5 The device operates on the electronic device shown. The memory of the electronic device can store various program modules that make up the data writing apparatus. The computer program composed of the various program modules causes the processor to execute the steps in the data writing methods of the various embodiments of this application described in this specification.

[0121] The electronic device also includes a power supply 503 that supplies power to the various components. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The electronic device may also include an input unit 504, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0122] Although not shown, electronic devices may also include display units, etc., which will not be described in detail here.

[0123] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.

[0124] It should be noted that, Figure 5 This is merely one implementation of the electronic device 500 provided in this application embodiment. In actual applications, the electronic device 500 may include more or fewer components, which is not limited here.

[0125] It should also be understood that, in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0126] Based on the above embodiments and the same concept, this application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method provided in the above embodiments.

[0127] Based on the above embodiments and the same concept, this application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to execute the method provided in the above embodiments.

[0128] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0129] The embodiments, implementation methods, and related technical features of this application can be combined and substituted for each other without conflict.

[0130] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although the descriptions of each embodiment in this application have different focuses, and the parts not described in detail in a certain embodiment can be referred to the relevant embodiments in other embodiments, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of this application without departing from the content of the technical solution of this application shall still fall within the scope of the technical solution of this application.

Claims

1. A data writing method, characterized in that, Applied to a diagnostic terminal, wherein the diagnostic terminal is communicatively connected to a target vehicle, the method includes: Obtain the vehicle attribute information of the target vehicle, generate a query request associated with the target vehicle, and the query request carries the vehicle attribute information of the target vehicle; Send a query request associated with the target vehicle to the server to trigger the server to determine the target download strategy corresponding to the query request from a plurality of preset download strategies based on the query request, and generate a response message based on the target download strategy; Obtain the response information returned by the server, the response information including download indication information corresponding to the target download strategy; Based on the download instruction information in the response information, the target data to be written to the target vehicle is obtained, and the target data is written to the target vehicle.

2. The method according to claim 1, characterized in that, Sending a query request associated with the target vehicle to the server to trigger the server to determine the target download strategy corresponding to the query request from a set of preset download strategies includes: Based on the query request and the first preset routing rule, the target query interface corresponding to the query request is determined from multiple query interfaces corresponding to the server, wherein different query interfaces are configured with different download strategies; The query request is sent to the server through the target query interface to trigger the server to determine the download strategy corresponding to the target query interface that received the query request as the target download strategy; The first preset routing rule includes: different query interfaces are corresponding to different amounts of data to be downloaded and / or different communication network information in the query request.

3. The method according to claim 1, characterized in that, Sending a query request associated with the target vehicle to the server to trigger the server to determine the target download strategy corresponding to the query request from a set of preset download strategies includes: The query request is sent to the server through the preset query interface corresponding to the server, so as to trigger the server to determine the target download strategy corresponding to the query request from multiple preset download strategies based on the query request and the second preset routing rule; The second preset routing rule includes the following: different download strategies are applied depending on the amount of data to be downloaded and / or the communication network information in the query request.

4. The method according to claim 2 or 3, characterized in that, The query interface includes a first query interface and a second query interface. The first download strategy corresponding to the first query interface includes: downloading the data to be written to the target vehicle through a download link. The second download strategy corresponding to the second query interface includes: downloading the data to be written to the target vehicle through a preset download interface. When the target download strategy is the first download strategy, the download instruction information in the response information includes a download link; When the target download strategy is the second download strategy, the download instruction information in the response information includes a preset download interface.

5. The method according to claim 4, characterized in that, When the target download strategy is the first download strategy, the response information includes a first list of writable data, which includes a version identifier of at least one writable data and a download link corresponding to the writable data. Obtaining the target data to be written to the target vehicle based on the download instruction information in the response information includes: The first list of rewritable data is displayed on the diagnostic terminal. In response to a first trigger operation on the first writable data list, determine the target download link corresponding to the first trigger operation; The target data of the target vehicle can be downloaded via the target download link.

6. The method according to claim 4, characterized in that, When the target download strategy is the second download strategy, the response information further includes a second writable data list, which includes version identifiers of at least one writable data item. Obtaining the target data to be written to the target vehicle based on the download instruction information in the response information includes: The second list of rewritable data is displayed on the diagnostic terminal; In response to a second trigger operation on the second writable data list, determine the target version identifier corresponding to the second trigger operation; Based on the target version identifier and the vehicle attribute information, a download request is generated and sent to the corresponding server through the preset download interface to obtain the target data to be written to the target vehicle.

7. The method according to claim 1, characterized in that, The step of obtaining the target data to be written to the target vehicle based on the download instruction information in the response information, and writing the target data to the target vehicle, includes: According to the download instruction information in the response information, the target ciphertext to be written to the target vehicle is obtained. The target ciphertext is obtained by the server encrypting the target data based on the encryption key, which is generated based on the preset key seed and the received vehicle attribute information. Determine the key seed of the server, and generate a decryption key based on the key seed and the vehicle attribute information of the target vehicle; The target ciphertext is decrypted based on the decryption key; If decryption is successful, the decrypted plaintext data will be used as the target data to be written to the target vehicle.

8. A data writing device, characterized in that, The device includes: The first acquisition module is used to acquire vehicle attribute information of the target vehicle and generate a query request associated with the target vehicle, wherein the query request carries the vehicle attribute information of the target vehicle. The request module is used to send a query request associated with the target vehicle to the server, so as to trigger the server to determine the target download strategy corresponding to the query request from a number of preset download strategies based on the query request, and generate a response message based on the target download strategy. The second acquisition module is used to acquire the response information returned by the server, the response information including download indication information corresponding to the target download strategy; The writing module is used to obtain the target data to be written to the target vehicle according to the download instruction information in the response information, so as to write the target data to the target vehicle.

9. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.