Data packet brushing-in method and device, vehicle and storage medium
By comparing the target application data packet with the unique part instruction information of the control device, it is ensured that the data packet is flashed into the correct control device, which solves the problem of data packet flashing errors in the prior art and improves the accuracy of application updates. performance and reliability.
Patent Information
- Application Number
- CN202410546786.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2024-09-17
AI Technical Summary
Existing packet flashing methods frequently suffer from errors, resulting in an inability to accurately flash the correct controls when applications are updated.
By obtaining the first unique part indication information from the target application data package and comparing it with the pre-stored second unique part indication information, if the verification passes, the target application data package is flashed into the corresponding control device to ensure that the data The package is flashed with the correct controls.
It greatly reduces the frequency of application data packet flushing errors, ensures that data packets are flushed to the correct control device, and improves the accuracy and reliability of updates.
Smart Images

Figure CN118656090A
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and more specifically, to a data packet flashing method, device, vehicle and computer-readable storage medium. Background Art
[0002] At present, the control device in the vehicle can be driven by the corresponding application program. When the application program used to drive the control device needs to be updated, the data packet of the updated application program can be obtained, and then the data packet of the updated application program can be flashed into the control device to implement the update of the application program of the control device. However, using the existing data packet flashing method, data packet flashing errors frequently occur. Summary of the invention
[0003] The present application proposes a data packet flashing method, device, vehicle and computer-readable storage medium to improve the above-mentioned defects.
[0004] In a first aspect, an embodiment of the present application provides a method for flashing a data packet, the method comprising:
[0005] Acquire first unique part indication information from the target application data packet; the first unique part indication information is used to indicate a unique part identifier of the second control device to which the target application data packet is applicable;
[0006] The first unique part indication information is compared with the second unique part indication information to obtain a verification result of the software and hardware dependency of the target application data packet; the second unique part indication information is used to indicate a unique part identification of the first control device;
[0007] If the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed, the target application data packet is flushed into the first control device.
[0008] In a second aspect, an embodiment of the present application further provides a data packet flashing device, the device comprising:
[0009] An acquisition module, used for acquiring first unique part indication information from a target application data packet; the first unique part indication information is used for indicating a unique part identification of a second control device to which the target application data packet is applicable;
[0010] A comparison module, used to compare the first unique part indication information with the second unique part indication information to obtain a verification result of the software and hardware dependency relationship of the target application data packet; the second unique part indication information is used to indicate a unique part identification of the first control device;
[0011] The data packet flushing module is used to flush the target application data packet into the first control device if the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed.
[0012] In a third aspect, an embodiment of the present application further provides a vehicle, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above method.
[0013] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.
[0014] The present application provides a data packet flashing method, device, vehicle and computer-readable storage medium. In the present application, the first unique part indication information in the target application data packet is determined based on the unique part identification of the second control device to which the target application data packet is applicable, and the pre-stored second unique part indication information is determined based on the unique part identification of the first control device. When the dependency verification result determined based on the comparison result of the first unique part indication information and the second unique part indication information indicates that the software and hardware dependency verification of the target application data packet has passed, it means that the second control device to which the target application data packet is applicable is the same control device as the first control device, and the target application data is applicable to the first control device. At this time, by flashing the target application data packet into the first control device, it can be ensured that the target application data packet is flashed into the correct control device, thereby greatly reducing the occurrence of the application data packet being flashed into the wrong control device, and greatly reducing the frequency of data packet flashing errors.
[0015] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1A flow chart of a data packet flushing method proposed according to an embodiment of the present application is shown.
[0018] Figure 2 Shows Figure 1 The steps before step S101, step S101 and step S103 in the corresponding embodiment are flowcharts in one embodiment.
[0019] Figure 3 Shows Figure 1 The steps before step S101 in the corresponding embodiment and the flowchart of step S101 in another embodiment.
[0020] Figure 4 A schematic diagram of a data packet flushing process in an embodiment of the present application is shown.
[0021] Figure 5 A structural block diagram of a data packet flushing device proposed in an embodiment of the present application is shown.
[0022] Figure 6 A structural block diagram of a vehicle provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0024] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0025] See also Figure 1 , Figure 1 A flow chart of a data packet flashing method proposed in one embodiment of the present application is shown, which is used in a vehicle, and the method includes:
[0026] S101. Acquire first unique part indication information from a target application data packet.
[0027] The first unique part indication information is used to indicate the unique part identification of the second control device to which the target application data packet is applicable.
[0028] The control device in the present application (including the following first control device and second control device) can be a controller in a vehicle, for example, the control device can be an electronic control unit (ECU) in the vehicle. The vehicle can be an electric vehicle or a fuel vehicle, or a car, SUV, bus, truck, etc.
[0029] The control device may have a unique part identification, and different control devices may have different unique part identifications; the unique part identification of the control device may be the name of the control device, the number of the control device, the size of the control device, the location of the control device in the vehicle, the function of the control device in the vehicle, and the manufacturer of the control device, etc.
[0030] It is worth mentioning that different control devices refer to at least one different information including the name of the control device, the number of the control device, the size of the control device, the position of the control device in the vehicle, the function of the control device in the vehicle and the manufacturer of the control device.
[0031] The unique part indication information of the control device refers to the information used to indicate the unique part identification of the control device, which is unique like the unique part identification, that is, the unique part indication information of different control devices is also different.
[0032] In some implementations, a unique part identification of the control device may be obtained, and then a calculation may be performed on the unique part identification of the control device to obtain unique part indication information of the control device, wherein the calculation may be a hash calculation or the like.
[0033] The first control device refers to any control device in the vehicle, and the target application data packet refers to the application data packet that needs to be flashed into (or to be flashed into) the first control device. For example, the first control device needs to flash an application data packet, and at this time, the vehicle obtains the application data packet that needs to be flashed into the first control device as the target application data packet.
[0034] It is understandable that the target application data packet is the application data packet that needs to be flashed into the first control device, and it is not necessarily the application data packet applicable to the first control device. For example, the first control device is the control device of the left turn signal of the vehicle, and the acquired target application data packet is the control device applicable to the right turn signal of the vehicle.
[0035] Based on the foregoing, it can be known that the target application data packet is not necessarily an application data packet suitable for the first control device. Therefore, in order to avoid flashing errors, it is necessary to flash the data packet in accordance with the method of the present application.
[0036] The manufacturer of the application data package can determine the unique part indication information as the first unique part indication information according to the unique part identification of the second control device to which the target application data package is applicable, and then combine the first unique part indication information and the function code of the second control device to which the target application data package is applicable into one data package to obtain the target application data package. That is, the target application data package includes the first unique part indication information and the function code of the second control device to which the target application data package is applicable.
[0037] S102: Compare the first unique component indication information with the second unique component indication information to obtain a verification result of the software and hardware dependency of the target application data package.
[0038] The second unique part indication information is used to indicate the unique part identification of the first control device.
[0039] The vehicle can store the second unique part indication information corresponding to the first control device. Similarly to the above, the unique part identification corresponding to the first control device can be obtained, and then the unique part identification corresponding to the first control device can be calculated to obtain the unique part indication information as the second unique part indication information. The second unique part indication information is then stored in the vehicle to facilitate comparison with the first unique part indication information in the target application data packet.
[0040] In some embodiments, the unique part indication information is in the form of a string, and the first unique part indication information can be directly compared with the second unique part indication information. If the first unique part indication information is consistent with the second unique part indication information, it is determined that the dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed. If the first unique part indication information is inconsistent with the second unique part indication information, it is determined that the dependency verification result indicates that the software and hardware dependency verification of the target application data packet has failed.
[0041] In some embodiments, S102 may also include: comparing the first unique part identification string in the first unique part indication information with the second unique part identification string in the second unique part indication information to obtain a string comparison result; and determining a software and hardware dependency verification result of the target application data packet based on the string comparison result.
[0042] The unique part indication information may include a unique part identification string for indicating the unique part identification, and the unique part identification string may be obtained by calculating the unique part identification; the unique part indication information may also include attribute information indicating the flashing attribute of the control device to which it belongs.
[0043] In the present application, the attribute information of the flashed attribute may include the application data packet flashing record of the control device to which the unique part indication information belongs, the application data packet flashing time, and the version number of the application currently driving the control device.
[0044] Generally speaking, different flashing processes of the same control device correspond to different attribute information of the flashing attributes. For example, the attribute information of the flashing attributes corresponding to the first flashing process of the control device a1 is different from the attribute information of the flashing attributes corresponding to the second flashing process.
[0045] The unique part identification string corresponding to the control device and the attribute information of the flashed attribute can be combined into one string to obtain the unique part indication information of the control device. For example, the unique part identification string is concatenated before the attribute information of the flashed attribute.
[0046] Generally speaking, in order to accurately obtain the second unique part identification string from the second unique part indication information and the first unique part identification string from the first unique part indication information, a fixed length can be set for the unique part identification string and the unique part indication information, so that the unique part identification string can be obtained from the unique part indication information based on the fixed length of the unique part identification string and the fixed length of the unique part indication information.
[0047] For example, the length of the unique part indication information is L1, the length of the unique part identification string is L2, L2<L1, and the unique part identification string in the unique part indication information is spliced before the attribute information of the attribute is flushed. At this time, the first L1 bits of the unique part indication information are obtained as the unique part identification string.
[0048] The unique part identification string may be obtained from the second unique part indication information as the second unique part identification string. Similarly, the unique part identification string may be obtained from the first unique part indication information as the first unique part identification string.
[0049] Then the first unique part identification string and the second unique part identification string are directly compared, and the comparison result is used as the string comparison result. The string comparison result can be that the first unique part identification string is consistent with the second unique part identification string, or that the first unique part identification string is inconsistent with the second unique part identification string.
[0050] Among them, if the string comparison result is that the first unique part identification string and the second unique part identification string are consistent, the software and hardware dependency verification result is determined to indicate that the software and hardware dependency verification of the target application data packet has passed; if the string comparison result is that the first unique part identification string and the second unique part identification string are inconsistent, the software and hardware dependency verification result is determined to indicate that the software and hardware dependency verification of the target application data packet has failed.
[0051] S103: If the result of the software and hardware dependency verification indicates that the software and hardware dependency verification of the target application data packet has passed, the target application data packet is flashed into the first control device.
[0052] If the result of the software and hardware dependency check indicates that the software and hardware dependency check of the target application data packet has passed, it means that the second control device to which the target application data packet is applicable is the first control device. At this time, the target application data packet can be directly flashed into the first control device to realize the flashing of the application data packet of the first control device, thereby completing the update or restoration of the application that drives the first control device.
[0053] If the result of the software and hardware dependency check indicates that the software and hardware dependency check of the target application data packet fails, it means that the second control device to which the target application data packet is applicable is not the first control device. At this time, the application software data packet of the first control device is not flashed, and the target application data packet that needs to be flashed into the first control device can be re-acquired, or a prompt message can be output to prompt the user that the target application data packet is wrong.
[0054] As mentioned above, the unique part indication information may include a unique part identification string and attribute information of the flash-in attribute. Correspondingly, the second unique part indication information may include a second unique part identification string and second attribute information indicating the flash-in attribute of the first control device. The first unique part indication information may include a first unique part identification string and second attribute information indicating the flash-in attribute of the first control device. At this time, after S103, the method may further include: after the target application data packet is successfully flashed into the first control device, replacing the second unique part indication information according to the first unique part indication information.
[0055] After the first control device is successfully flashed, the second unique part indication information may be replaced by the first unique part indication information, thereby implementing an update of the first unique part indication information.
[0056] As mentioned above, the unique part indication information may include a unique part identification string and attribute information of the flashed attributes. When the hardware and software dependency check result indicates that the hardware and software dependency check of the target application data packet has passed, it means that the first unique part identification string is consistent with the second unique part identification string (the first control device and the second control device are the same control device). As mentioned above, different flashing processes correspond to different attribute information of the flashed attributes. Therefore, replacing the second unique part indication information with the first unique part indication information actually completes the replacement of the first attribute information with the second attribute information, so as to determine the change of the attribute information of the flashed attributes of the first control device according to the second attribute information.
[0057] In this embodiment, the first unique part indication information in the target application data packet is determined based on the unique part identification of the second control device to which the target application data packet is applicable, and the pre-stored second unique part indication information is determined based on the unique part identification of the first control device. When the dependency verification result determined based on the comparison result of the first unique part indication information and the second unique part indication information indicates that the software and hardware dependency verification of the target application data packet has passed, it means that the second control device to which the target application data packet is applicable is the same control device as the first control device, and the target application data is applicable to the first control device. At this time, by flashing the target application data packet into the first control device, it can be ensured that the target application data packet is flashed into the correct control device, thereby greatly reducing the occurrence of the application data packet being flashed into the wrong control device, and greatly reducing the frequency of data packet flashing errors.
[0058] In another embodiment, if Figure 2 As shown, before S101, the method may further include:
[0059] S201 . Sending target diagnostic information including a unique diagnostic identifier corresponding to the first control device to the first control device via a target communication link with the first control device.
[0060] After receiving the target diagnostic information, the first control device responds to the unique diagnostic identifier in the target diagnostic information being consistent with the unique diagnostic identifier corresponding to the first control device, and returns the link normal indication information through the target communication link. The unique diagnostic identifiers of different control devices may be different, that is, the unique diagnostic identifier is unique information, and the unique diagnostic identifier may be determined based on the unique part identifier of the control device.
[0061] In this embodiment, when the first control device receives the target diagnostic information, it indicates that the target communication link is normal. The unique diagnostic identifier in the target diagnostic information is consistent with the unique diagnostic identifier corresponding to the first control device, indicating that the target diagnostic information is sent to the correct control device (the control device is a control device that needs to upgrade the application). At this time, normal link indication information can be returned through the target communication link.
[0062] If the first control device does not receive the target diagnostic information, it indicates that the target communication link is faulty. At this time, the first control device cannot respond. That is, if the normal link indication information is not received, it can be determined that the target communication link is faulty, and a prompt message can be output to notify the user of the target communication link failure.
[0063] If the first control device receives the target diagnostic information, it indicates that the target communication link is normal. At this time, if the unique diagnostic identifier in the target diagnostic information is inconsistent with the unique diagnostic identifier corresponding to the first control device, it indicates that the target diagnostic information is sent to the wrong control device (the control device is a control device that needs to perform an application upgrade). At this time, the first control device does not respond. Correspondingly, the vehicle can determine that the first control device is not a control device that needs to perform an application upgrade based on the first control device's non-response behavior. At this time, a prompt message is output to prompt the user that the control device that needs to perform an application upgrade has been selected incorrectly.
[0064] In order to accurately diagnose the target communication link, the first control device can be accessed through the target communication link based on the unique diagnostic identifier corresponding to the first control device, thereby avoiding access to the wrong control device. For example, the unique diagnostic identifier of control device b1 is defined as 0x111, and the unique diagnostic identifier of control device b2 is defined as 0x222. When a diagnostic communication is initiated to control device b1 using the unique diagnostic identifier 0x222, control device b1 will not respond or process.
[0065] The vehicle accesses different control devices through different communication links, and the communication link between the vehicle and the first control device serves as a target communication link.
[0066] Target diagnostic information including at least the unique diagnostic identifier corresponding to the first control device can be generated based on the unique diagnostic identifier corresponding to the first control device, and then the target diagnostic information is sent to the first control device, so that the first control device returns normal link indication information when receiving the target diagnostic information, and the normal link indication information indicates that the target communication link is normal and can communicate with the first control device through the target communication link.
[0067] Accordingly, S101 may include: in response to receiving the link normal indication information, acquiring the first unique part indication information from the target application data packet.
[0068] Receiving the normal link indication information indicates that the target communication link is communicating normally and can communicate with the first control device through the target communication link. At this time, in response to receiving the normal link indication information, the first unique part indication information can be obtained from the target application data packet.
[0069] Accordingly, S103 may include: if the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed, flashing the target application data packet into the first control device through the target communication link.
[0070] The result of the software and hardware dependency verification indicates that the software and hardware dependency verification of the target application data packet has passed, and the target application data can be sent to the first control device through the target communication link. The first control device performs a flash operation based on the target application data packet to realize the flashing of the target application data packet into the first control device.
[0071] In this embodiment, before the target application data packet is flashed into the first control device, it is verified whether the target communication link is normal. When the normal link indication information is received, it is determined that the target communication link is normal, and then the step of obtaining the first unique part indication information from the target application data packet is performed, thereby avoiding the waste of resources caused by executing the step of obtaining the first unique part indication information from the target application data packet when the target communication link is abnormal.
[0072] At the same time, the target communication link is diagnosed, and when the target communication link is normal, the target application data packet is flashed into the first control device through the target communication link, thereby achieving smooth flashing of the target application data packet.
[0073] In one embodiment, if Figure 3 As shown, before S101, the method may further include:
[0074] S301, perform integrity check and authenticity check on the target application data packet.
[0075] In this embodiment, the target application data packet can be checked for integrity by methods such as parity check, CRC cyclic redundancy check, MD5 check and digital signature.
[0076] Authenticity verification may refer to verifying that the provider of the target application data package is the correct provider.
[0077] In this embodiment, the target application data packet may include first application verification information, and authenticity verification is achieved by verifying the first application verification information. The first application verification information may be verification information set by an actual provider of the target application data packet for the target application data packet, used to indicate that the target application data packet is provided by the actual provider.
[0078] For example, the first application verification information may be obtained by performing a hash operation on a unique provider identifier of an actual provider of a target application data packet, wherein the unique provider identifier of the provider may be the provider's name, number, address information, business license information, and the like.
[0079] In this embodiment, the vehicle can store the second application verification information corresponding to the correct provider of the target application, obtain the first application verification information from the target application data packet, and compare whether the first application verification information is consistent with the second application verification information. If so, it is determined that the authenticity verification has passed; if not, it is determined that the authenticity verification has failed.
[0080] Accordingly, S101 may include: if the integrity check and the authenticity check of the target application data packet pass, obtaining the first unique part indication information from the target application data packet.
[0081] If the target application data packet integrity check passes, it is determined that the data in the target application data packet is not lost; if the target application data packet integrity check fails, it is determined that the data in the target application data packet is lost.
[0082] If the authenticity verification of the target application data packet passes, it is determined that the target application data packet is provided by the correct provider and is safe; if the authenticity verification of the target application data packet fails, it is determined that the target application data packet is not provided by the correct provider and may be unsafe.
[0083] If the target application data packet passes the integrity check and the authenticity check, it is determined that the data in the target application data packet is not lost and the target application data packet is provided by the correct provider, and the first unique part indication information is obtained from the target application data packet.
[0084] If the integrity check of the target application data packet fails, it is determined that the data in the target application data packet is lost, and a prompt message can be output to remind the user that data loss has occurred in the target application data packet; if the authenticity check of the target application data packet fails, it is determined that the target application data packet is not provided by the correct provider. At this time, a prompt message can be output to remind the user that the target application data is not a data packet provided by the correct provider.
[0085] If the target application data packet fails the integrity check and the target application data packet fails the authenticity check, a merge prompt message may be output to prompt that data loss occurs in the target application data packet and that the target application data packet is not provided by the correct provider.
[0086] In this embodiment, the data flushing process is as follows: Figure 4 As shown, unique part indication information d1 is generated according to the unique part identification of control device c1, and function code e1 of control device c1 is generated, then the result of merging the unique part indication information d1 and function code e1 is digitally signed to obtain digital signature f1, then based on the unique part indication information d1, function code e1 and digital signature f1, application data packet g1 is obtained, similarly, unique part indication information d2 is generated according to the unique part identification of control device c2, and function code e2 of control device c2 is generated, then the result of merging the unique part indication information d2 and function code e2 is digitally signed to obtain digital signature f2, then based on the unique part indication information d2, function code e2 and digital signature f2, application data packet g2 is obtained.
[0087] The communication link between the vehicle and the control device c1 is diagnosed by the unique diagnostic identifier h1 of the control device c1. When it is determined that the communication link between the vehicle and the control device c1 is normal, the digital signature f1 is used for verification to verify the integrity of the application data packet g1. When the integrity verification of the application data packet g1 passes, the unique part indication information d1 is compared with the unique part indication information d11 stored for the control device c1. Based on the comparison result of the unique part indication information d1 and the unique part indication information d12, it is determined that the result of the software and hardware dependency verification indicates that the software and hardware dependency verification of the target application data packet has passed. Then, the refresh process is started and the code of the refresh tool is started to refresh the application data packet g1 into the control device c1.
[0088] Similarly, the communication link between the vehicle and the control device c2 is diagnosed through the unique diagnostic identifier h2 of the control device c2. When it is determined that the communication link between the vehicle and the control device c2 is normal, the digital signature f2 is used for verification to verify the integrity of the application data packet g2. When the integrity verification of the application data packet g2 passes, the unique part indication information d2 is compared with the unique part indication information d22 stored for the control device c2. Based on the comparison result of the unique part indication information d2 and the unique part indication information d22, it is determined that the result of the software and hardware dependency verification indicates that the software and hardware dependency verification of the target application data packet has passed. Then, the refresh process is started and the code of the refresh tool is started to refresh the application data packet g2 into the control device c2.
[0089] When the flashing tool is boot, the flashing process of this application is as follows:
[0090] S1: BOOT software designs the boot code. The boot code refers to the boot program after the control device is powered on. This program is mainly related to the control device. For different control devices of the same type, this part of the code is the same.
[0091] S2: BOOT software design refresh process. The process is as follows:
[0092] a) Enter the extended mode of BOOT, the corresponding command can be 10 03;
[0093] b) Check the programming conditions, corresponding to the instruction 31 01XX XX (where XXXX is the value required by the refresh specification of the application provider);
[0094] c) Shield fault code records, corresponding to instruction 85 02;
[0095] d) prohibiting bus application messages from being sent to the control device including the application data to be flashed; corresponding to instruction 2803 01;
[0096] e) Enter BOOT programming session, corresponding to instruction 10 02;
[0097] f) Security unlock request seed, corresponding to instruction 27XX (XX is the value required by the refresh specification of the application provider);
[0098] g) Send the secret key for secure unlocking, corresponding to instruction 67XX (XX is the value required by the refresh specification of the application provider);
[0099] h) Write refresh fingerprint information, corresponding to instruction 2E XX XX (XX is the value required by the refresh specification of the application provider); refresh fingerprint information refers to refresh records and other information.
[0100] i) Download the application data package that needs to be flashed, corresponding to instructions 34 service, 36 service, and 37 service (consistent with the OEM flash specification requirements, no further details are given here);
[0101] j) Check the data integrity of the application data packet, corresponding to instruction 31 01XX (XX is the value required by the refresh specification of the application provider);
[0102] k) Checking the software and hardware dependencies, corresponding to instruction 31 01XX (XX is the value required by the refresh specification of the application provider); checking the software and hardware dependencies is actually the aforementioned steps of determining the software and hardware dependencies in S101 and S102, which will not be repeated here.
[0103] l) Write refresh success information, corresponding to instruction 2E XX (XX is the value required by the refresh specification of the application provider); wherein, write refresh success information refers to the prompt information generated after the application data packet is successfully received by the corresponding control device to prompt the successful refresh.
[0104] m) The control device into which the application data has been successfully flashed is reset, corresponding to instruction 11 01.
[0105] In this embodiment, the target application data packet is checked for integrity and authenticity, and is flashed in if both the integrity and authenticity checks are passed. This avoids the situation where the target application data packet is lost or is not provided by the correct provider, resulting in a flash failure or an unsafe data packet being flashed, thereby improving the success rate and security of flashing the application data packet.
[0106] See attached Figure 5 , Figure 5 The structure block diagram of a data packet flushing device proposed in one embodiment of the present application is shown. The device 1200 includes:
[0107] The acquisition module 1210 is used to acquire first unique part indication information from the target application data packet; the first unique part indication information is used to indicate a unique part identifier of the second control device to which the target application data packet is applicable;
[0108] The comparison module 1220 is used to compare the first unique part indication information with the second unique part indication information to obtain a verification result of the software and hardware dependency relationship of the target application data packet; the second unique part indication information is used to indicate a unique part identification of the first control device;
[0109] The data packet flushing module 1230 is configured to flush the target application data packet into the first control device if the software / hardware dependency verification result indicates that the software / hardware dependency verification of the target application data packet has passed.
[0110] Optionally, the comparison module 1220 is also used to compare the first unique part identification string in the first unique part indication information with the second unique part identification string in the second unique part indication information to obtain a string comparison result; based on the string comparison result, determine the software and hardware dependency verification result of the target application data packet.
[0111] Optionally, the comparison module 1220 is also used to determine that the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed if the string comparison result is that the first unique part identification string is consistent with the second unique part identification string; and to determine that the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has failed if the string comparison result is that the first unique part identification string is inconsistent with the second unique part identification string.
[0112] Optionally, the first unique part indication information also includes first attribute information indicating the flash-in attribute of the second control device; the second unique part indication information also includes second attribute information indicating the flash-in attribute of the first control device; the data packet flashing module 1230 is also used to replace the second unique part indication information according to the first unique part indication information after the target application data packet is successfully flashed into the first control device.
[0113] Optionally, the device also includes a diagnostic module, which is used to send target diagnostic information including a unique diagnostic identifier corresponding to the first control device to the first control device through a target communication link between the first control device, so that after receiving the target diagnostic information, the first control device responds to the unique diagnostic identifier in the target diagnostic information being consistent with the unique diagnostic identifier corresponding to the first control device, and returns link normal indication information through the target communication link; accordingly, the acquisition module 12310 is also used to obtain the first unique part indication information from the target application data packet in response to receiving the link normal indication information; accordingly, the data packet flushing module 1230 is also used to flush the target application data packet into the first control device through the target communication link.
[0114] Optionally, the acquisition module 1210 is also used to perform integrity verification and authenticity verification on the target application data packet; if the integrity verification and authenticity verification of the target application data packet pass, the first unique part indication information is obtained from the target application data packet.
[0115] See also Figure 6, which shows a structural block diagram of a vehicle 900 provided in an embodiment of the present application. The vehicle 900 may be a vehicle or a partial module in the vehicle for implementing the data labeling method in an embodiment of the present application, etc. The vehicle 900 in the present application may include one or more of the following components: a processor 910, a memory 920, and one or more applications, wherein the one or more applications may be stored in the memory 920 and configured to be executed by one or more processors 910, and the one or more programs are configured to execute the method as described in the aforementioned method embodiment.
[0116] The processor 910 may include one or more processing cores. The processor 910 uses various interfaces and lines to connect various parts of the entire vehicle 900, and executes various functions of the vehicle 900 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 920, and calling data stored in the memory 920. Optionally, the processor 910 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 910 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communication. It is understandable that the above-mentioned modem may not be integrated into the processor 910, but may be implemented separately through a communication chip.
[0117] The memory 920 may include a random access memory (RAM) or a read-only memory (ROM). The memory 920 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the vehicle 900 during use (such as a phone book, audio and video data, chat record data), etc.
[0118] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0119] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0120] On the other hand, the present application also provides a computer-readable storage medium, in which program code is stored. The program code can be called by a processor to execute the method described in the above method embodiment.
[0121] The computer readable storage medium can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a cluster of ROMs. Alternatively, the computer readable storage medium includes a non-transitory computer-readable storage medium. The computer readable storage medium has a storage space for the program code of any method step in the above method. These program codes can be read from or written into one or more computer program products. The program code can be compressed, for example, in an appropriate form.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for flashing a data packet, characterized in that: The method comprises: Acquire first unique part indication information from a target application data packet; the first unique part indication information is used to indicate a unique part identifier of a second control device to which the target application data packet is applicable; Comparing the first unique part indication information with the second unique part indication information to obtain a verification result of the software and hardware dependency of the target application data packet; the second unique part indication information is used to indicate a unique part identification of the first control device; If the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed, the target application data packet is flushed into the first control device.
2. The method according to claim 1, characterized in that The comparing the first unique part indication information with the second unique part indication information to obtain the software and hardware dependency verification result of the target application data package includes: Comparing the first unique part identification string in the first unique part indication information with the second unique part identification string in the second unique part indication information to obtain a string comparison result; According to the string comparison result, a software and hardware dependency verification result of the target application data packet is determined.
3. The method according to claim 2, characterized in that Determining the software and hardware dependency verification result of the target application data packet according to the string comparison result includes: If the string comparison result is that the first unique part identification string is consistent with the second unique part identification string, determining that the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed; If the string comparison result is that the first unique part identification string is inconsistent with the second unique part identification string, it is determined that the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has failed.
4. The method according to claim 2, characterized in that: The first unique part indication information further includes first attribute information indicating a flash-in attribute of the second control device; the second unique part indication information further includes second attribute information indicating a flash-in attribute of the first control device; If the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed, after the target application data packet is flushed into the first control device, the method further includes: After the target application data packet is successfully flashed into the first control device, the second unique part indication information is replaced according to the first unique part indication information.
5. The method according to claim 1, characterized in that Before obtaining the first unique part indication information from the target application data packet, the method further includes: sending target diagnostic information including a unique diagnostic identifier corresponding to the first control device to the first control device via a target communication link with the first control device, so that after receiving the target diagnostic information, the first control device returns link normal indication information via the target communication link in response to the unique diagnostic identifier in the target diagnostic information being consistent with the unique diagnostic identifier corresponding to the first control device; The step of obtaining first unique part indication information from a target application data packet includes: In response to receiving the link normal indication information, acquiring first unique part indication information from the target application data packet; The step of flashing the target application data packet into the first control device includes: The target application data packet is flushed into the first control device via the target communication link.
6. The method according to claim 1, characterized in that Before obtaining the first unique part indication information from the target application data packet, the method further includes: Performing integrity check and authenticity check on the target application data packet; The step of obtaining first unique part indication information from a target application data packet includes: If the target application data packet passes the integrity check and the authenticity check, the first unique part indication information is obtained from the target application data packet.
7. The method according to any one of claims 1 to 6, characterized in that: The first control device and the second control device are both electronic control units of the vehicle.
8. A data packet flashing device, characterized in that: The device comprises: An acquisition module, used for acquiring first unique part indication information from a target application data packet; the first unique part indication information is used for indicating a unique part identification of a second control device to which the target application data packet is applicable; a comparison module, used for comparing the first unique part indication information with the second unique part indication information to obtain a verification result of the software and hardware dependency of the target application data packet; the second unique part indication information is used to indicate a unique part identification of the first control device; The data packet flushing module is used to flush the target application data packet into the first control device if the software and hardware dependency verification result indicates that the software and hardware dependency verification of the target application data packet has passed.
9. A vehicle, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 7.
