Method for detecting ecu data, detection device and electronic equipment
By comparing current and historical program data and analyzing flashing characteristic information when the ECU is powered on, the problem of rapid identification of ECU program data tampering is solved, ensuring detection efficiency and accuracy and protecting legitimate rights and interests.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEIFANG WEICHAI POWER TECH CO LTD
- Filing Date
- 2023-03-17
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies cannot quickly and accurately identify whether the program data in the ECU has been tampered with, which causes the ECU to be unable to control the device normally and affects the safety of use.
By comparing the current program data with historical program data when the ECU is powered on, the flashing characteristic information is obtained and analyzed. The flashing identifier is processed by a preset algorithm to determine whether the ECU has been tampered with, thus achieving automatic identification.
It achieves efficient and accurate automatic identification of ECU program data tampering, protecting the legitimate rights and interests of manufacturers, distributors and maintenance providers, and avoiding security risks and regulatory violations caused by tampering.
Smart Images

Figure CN116303037B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic control unit technology, and more specifically, to a method, device, and electronic device for detecting ECU data. Background Technology
[0002] The program and data in the engine's Electronic Control Unit (ECU) are typically programmed and flashed according to the customer's order specifications, and are finalized when the engine and vehicle roll off the production line. Different configurations result in different vehicle prices. However, many vehicles already on the market have exhibited cases of abnormally tampered ECU data. This includes instances where data has been used to increase engine power output, enable or disable certain vehicle functions, modify emissions and OBD data, or disable aftertreatment urea injection. Such alterations render the ECU unable to properly control the equipment, severely compromising its safety. Current technology relies on manual verification to detect whether the ECU program data has been modified using legitimate service tools. Manual verification suffers from low efficiency and the risk of missed detections, making it impossible to automatically identify ECU program data tampering. Summary of the Invention
[0003] The main objective of this application is to provide a method, device, and electronic equipment for detecting ECU data, so as to at least solve the problem in the prior art that it is impossible to quickly and accurately identify whether the program data in the ECU has been tampered with.
[0004] To achieve the above objectives, according to one aspect of this application, a method for detecting ECU data is provided, comprising: when the ECU is powered on, determining whether the ECU has been flashed; if the current data and historical data are inconsistent, determining that the ECU has been flashed, wherein the current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation; if the ECU has been flashed, acquiring current flashing feature information and historical flashing feature information, wherein the current flashing feature information is the flashing feature corresponding to the current operation, and the historical flashing feature is the flashing feature corresponding to the previous operation, wherein, upon receiving a flashing notification... In the case of a write identifier, the write feature is obtained by processing the currently received write identifier using a first preset algorithm. In the case of no write identifier, the write feature is obtained by processing the previously received write identifier using the first preset algorithm. Each normal write process corresponds to receiving a unique write identifier. Based on the current write feature information and the historical write feature information, it is determined whether the ECU has been tampered with. The ECU is determined to have been tampered with if one of the following conditions is met: the current write feature information is consistent with the historical write feature information; or the current write feature information does not meet the verification rules, where the verification rules are the processing rules of the first preset algorithm.
[0005] Optionally, determining whether the ECU has been flashed includes: acquiring the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm; processing the current data using the second preset algorithm to obtain current data feature information; determining whether the current data and the historical data are consistent based on the current data feature information and the historical data feature information; if the current data feature information and the historical data feature information are consistent, determining that the current data and the historical data are consistent, and determining that the ECU has not been flashed; if the current data feature information and the historical data feature information are inconsistent, determining that the current data and the historical data are inconsistent, and determining that the ECU has been flashed.
[0006] Optionally, obtaining the current flashing feature information includes: when receiving current flashing identifier information, processing the current flashing identifier information using the first preset algorithm to obtain the current flashing feature information, wherein the current flashing identifier information is the flashing identifier received after the ECU was normally flashed during the current operation; when not receiving the current flashing identifier information, reading historical flashing identifier information from the memory, wherein the historical flashing identifier information is the flashing identifier received after the ECU was normally flashed during the previous operation; determining the historical flashing identifier information as the current flashing identifier information, and processing the current flashing identifier information using the first preset algorithm to obtain the current flashing feature information.
[0007] Optionally, after obtaining the current write feature information, the method further includes: sending the current write identifier information, the current write feature information, and the current data feature information to the memory, wherein the current data feature information is obtained by processing the current data using a second preset algorithm; and obtaining historical data feature information, including: reading the historical data feature information from the memory.
[0008] Optionally, obtaining historical write feature information includes one of the following: reading the historical write feature information from the memory, reading the historical write identifier information from the memory, and processing the historical write identifier information using the first preset algorithm to determine the historical write feature information.
[0009] Optionally, the method further includes: generating a first alarm message indicating that the ECU has been tampered with, and controlling the ECU to perform functional degradation according to a preset fault degradation strategy; and generating a second alarm message indicating that the ECU has been flashed if the ECU has not been tampered with.
[0010] Optionally, the method further includes: generating a prompt message indicating that the ECU has been successfully verified if the ECU has not been flashed.
[0011] According to another aspect of this application, an ECU data detection device is provided, comprising: a first determining unit, configured to determine whether the ECU has been flashed when the ECU is powered on, and to determine that the ECU has been flashed if the current data and historical data are inconsistent, wherein the current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation; and an acquiring unit, configured to acquire current flashing feature information and historical flashing feature information when the ECU has been flashed, wherein the current flashing feature information is the flashing feature corresponding to the current operation, and the historical flashing feature is the flashing feature corresponding to the previous operation, wherein upon receiving a flashing notification... In the case of an identifier, the flashing feature is obtained by processing the currently received flashing identifier using a first preset algorithm. In the case of no flashing identifier, the flashing feature is obtained by processing the previously received flashing identifier using the first preset algorithm. Each normal flashing process corresponds to receiving a unique flashing identifier. The second determining unit is used to determine whether the ECU has been tampered with based on the current flashing feature information and the historical flashing feature information. The ECU is determined to have been tampered with if one of the following conditions is met: the current flashing feature information is consistent with the historical flashing feature information, or the current flashing feature information does not meet the verification rule, wherein the verification rule is the processing rule of the first preset algorithm.
[0012] According to another aspect of this application, an electronic device is provided, comprising: an ECU; a controller for the ECU, including one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any one of the methods described.
[0013] Optionally, the electronic device further includes: a flashing tool, which is communicatively connected to the ECU. The flashing tool is used to flash data onto the ECU and, after flashing is completed, sends a communication command carrying flashing identification information to the ECU.
[0014] Applying the technical solution of this application, when the ECU is powered on and running, it is first determined whether the ECU has been flashed based on the current program data and historical program data in the ECU. If the ECU has been flashed, it is then determined whether the ECU has been illegally tampered with based on the current flashing feature information and historical flashing feature information. Since each normal flashing process corresponds to a unique flashing feature, the current flashing feature information and historical flashing feature information should be different after the ECU has been flashed normally. Therefore, if the ECU has been flashed but the current flashing feature information is the same as the historical flashing feature information, it indicates that the ECU has been illegally tampered with. This method of joint verification using program data and flashing feature information achieves automatic identification of whether the ECU has been illegally tampered with, eliminating the need for manual verification, ensuring high detection efficiency and accurate results. It effectively solves the problem of existing technologies being unable to quickly and accurately identify whether the program data in the ECU has been tampered with, protecting the legitimate rights and interests of manufacturers, distributors, or maintenance providers, and preventing problems such as program data violations or security risks caused by ECU tampering. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for performing an ECU data detection method according to an embodiment of this application is shown;
[0017] Figure 2 A flowchart illustrating an ECU data detection method according to an embodiment of this application is shown.
[0018] Figure 3 Another schematic flowchart of an ECU data detection method according to an embodiment of this application is shown;
[0019] Figure 4 A further schematic flowchart of an ECU data detection method provided according to an embodiment of this application is shown;
[0020] Figure 5 This illustration shows yet another flowchart of a method for detecting ECU data according to an embodiment of the present application;
[0021] Figure 6 A structural block diagram of an ECU data detection device according to an embodiment of this application is shown.
[0022] The above figures include the following reference numerals:
[0023] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be used interchangeably where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] As described in the background section, existing technologies have the problem of being unable to quickly and accurately identify whether the program data in an ECU has been tampered with. To solve the above problem, embodiments of this application provide an ECU data detection method, detection device, and electronic device.
[0028] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0029] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for an ECU data detection method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0030] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the device information display method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the method described. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of such networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0031] This embodiment provides a method for detecting ECU data running on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0032] Figure 2 This is a flowchart of an ECU data detection method according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0033] Step S201: When the ECU is powered on, determine whether the ECU has been flashed. If the current data and historical data are inconsistent, determine that the ECU has been flashed. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation.
[0034] Specifically, the ECU is a device composed of integrated circuits used to perform data analysis and processing, and to control equipment. The controlled objects of the ECU include, but are not limited to, power output devices such as engines, system controllers, and electronic devices; this application does not impose excessive restrictions on the specific controlled objects of the ECU. The previous operating process refers to the last time the ECU was powered on and running during the current operating process. The end point of the previous operating process is when the ECU is powered off, and the start point of the current operating process is when the ECU is powered on again. ECU rewriting refers to an external data rewriting tool sending data information to the ECU through the ECU communication network to manage and update ECU data. The program data includes code data in the program code area and / or data in the data area of the ECU.
[0035] Step S202: When the ECU is flashed, current flashing feature information and historical flashing feature information are obtained. The current flashing feature information is the flashing feature corresponding to the current running process, and the historical flashing feature is the flashing feature corresponding to the previous running process. When a flashing identifier is received, the flashing feature is obtained by processing the currently received flashing identifier using a first preset algorithm. When the flashing identifier is not received, the flashing feature is obtained by processing the previously received flashing identifier using the first preset algorithm. Each normal flashing process corresponds to receiving a unique flashing identifier.
[0036] Specifically, there are two scenarios when an ECU is rewritten: First, a normal ECU rewrite refers to after-sales maintenance and program data upgrades performed by the manufacturer, distributor, or maintenance personnel according to standard operating procedures. Second, an ECU tampering refers to any rewriting of the ECU other than the first scenario. In this application, during each normal rewrite process, the ECU receives a rewrite identifier sent by the rewrite tool. This rewrite identifier is a unique identifier for a normal rewrite process, and the rewrite feature obtained by processing this identifier using the first preset algorithm is also a unique identifier representing the normal rewrite process. The rewrite identifier can be a unique identifier generated based on the ECU model, rewrite date, rewrite version, information about the ECU's controlled object, and other information. The rewrite identifier can be a number, an array, or other formatted information. It should be noted that if the ECU is tampered with, the rewrite identifier may not be received.
[0037] Specifically, when a write flag is received, the write feature is obtained by processing the currently received write flag using a first preset algorithm. When the write flag is not received, the write feature is obtained by processing the previously received write flag using the first preset algorithm. This means that: 1. When the write feature is the current write feature information, when a write flag is received in the current running process, the current write feature information is obtained by processing the write flag received in the current running process using the first preset algorithm. 2. When the write flag is not received in the current running process, the write feature is obtained by processing the write flag received in the previous running process using the first preset algorithm. Second, when the flashing feature is historical flashing feature information, when a flashing identifier is received in the previous running process, the historical flashing feature information is obtained by processing the flashing identifier received in the previous running process using a first preset algorithm. When the flashing identifier is not received in the previous running process, the flashing feature is obtained by processing the flashing identifier received in the running process two years ago using the first preset algorithm. The running process two years ago refers to the running process in which the ECU was flashed before the previous running process and is closest to the previous running process.
[0038] Step S203: Based on the current flashing feature information and the historical flashing feature information, determine whether the ECU has been tampered with. If one of the following conditions is met, the ECU is determined to have been tampered with: the current flashing feature information is consistent with the historical flashing feature information; or the current flashing feature information does not meet the verification rules, wherein the verification rules are the processing rules of the first preset algorithm.
[0039] Specifically, if the ECU is flashed and the current flashing feature information is consistent with the historical flashing feature information, it indicates that the flashing feature has not been updated accordingly. In other words, the ECU did not receive the flashing identification information sent by the flashing tool during the flashing process. However, the ECU should receive this flashing identification information during a normal flashing process. Therefore, if the ECU is flashed and the current flashing feature information is consistent with the historical flashing feature information, it indicates that the ECU flashing process is an illegal operation, the program data in the ECU has been tampered with, and it was not a normal flash.
[0040] When the ECU is flashed and the current flashing feature information does not meet the verification rules, it indicates that the tamper operator has deciphered the normal flashing process and knows that the ECU receives the flashing identifier during the normal flashing process. Based on the flashing identifier generated during the normal flashing process, the operator forged an illegal flashing identifier. There are two possibilities for this illegal flashing identifier: First, the illegal flashing identifier is the same as the flashing identifier corresponding to the normal flashing process. In this case, after the ECU is flashed, the current flashing feature information will be consistent with the historical flashing feature information, thus being identified as tampering. Second, the illegal flashing identifier is different from the flashing identifier corresponding to the normal flashing process. In this case, after processing by the first preset algorithm, a flashing feature that does not meet the verification rules will be obtained, thus being identified as tampering.
[0041] In the above embodiment, when the ECU is powered on and running, it is first determined whether the ECU has been flashed based on the current program data and historical program data in the ECU. If it is determined that the ECU has been flashed, it is then determined whether the ECU has been illegally tampered with based on the current flashing feature information and historical flashing feature information of the ECU. Since each normal flashing process corresponds to a unique flashing feature, after the ECU has been flashed normally, the current flashing feature information and the historical flashing feature information should be different. Therefore, if the ECU has been flashed but the current flashing feature information is the same as the historical flashing feature information, it indicates that the ECU has been illegally tampered with. In addition, since the current flashing feature information is obtained by processing the first preset algorithm and meets the verification rules of the first preset algorithm, if the current flashing feature information does not meet the verification rules, it indicates that the ECU has been illegally tampered with. By combining program data and flashing feature information for verification, the system can automatically identify whether an ECU has been illegally tampered with. This eliminates the need for manual verification, ensuring high detection efficiency and accurate results. It effectively solves the problem of existing technologies being unable to quickly and accurately identify whether the program data in the ECU has been tampered with, protecting the legitimate rights and interests of manufacturers, distributors, or maintenance providers. At the same time, it can prevent problems such as program data violations or security risks caused by ECU tampering.
[0042] In the embodiments described in this application, when the ECU is normally flashed, after the flashing is completed, the flashing tool generates a communication command carrying the flashing identifier and sends the communication command to the ECU. The ECU controller processes the flashing identifier using a first preset algorithm to obtain the current flashing feature information. However, if the ECU is tampered with, and the tampering operator is unaware that a communication command carrying the flashing identifier will be issued after a normal flash, then the ECU will not receive the flashing identifier after being tampered with. In this case, the current flashing feature information is the same as the historical flashing feature information, and the current flashing feature information is consistent with the historical flashing feature information. If the tampering operator knows that a communication command carrying the flashing identifier will be issued after a normal flash, and forges the flashing identifier, the forged flashing identifier will also be consistent with the historical flashing identifier, causing the current flashing feature information to be consistent with the historical flashing feature information, thus being identified as tampered with. Alternatively, the forged flashing identifier processed by the first preset algorithm may not meet the verification rules, thus being identified as tampered with. This ensures accurate identification of whether the ECU has been illegally tampered with.
[0043] The ECU described in this application and the controller of the ECU that executes the method can be applied to a vehicle, and one operation of the ECU corresponds to one driving cycle.
[0044] In one specific embodiment, such as Figure 3 As shown, determining whether the ECU has been flashed specifically includes the following steps:
[0045] Step S2011: Obtain the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm;
[0046] Specifically, the second preset algorithm can be of various types, including but not limited to: Message-Digest Algorithm 5 (MD5), MD4, MD2, Secure Hash Algorithm (SHA1), and Hash-based Message Authentication Code (HMAC). The specific preset algorithm selected depends on the actual application scenario requirements, and this application does not impose any restrictions on it.
[0047] Step S2012: Process the current data using the second preset algorithm to obtain current data feature information;
[0048] Step S2013: Based on the current data feature information and the historical data feature information, determine whether the current data and the historical data are consistent. If the current data feature information and the historical data feature information are consistent, determine that the current data and the historical data are consistent, and determine that the ECU has not been flashed.
[0049] Step S2014: If the current data feature information is inconsistent with the historical data feature information, determine that the current data is inconsistent with the historical data, and determine that the ECU has been flashed.
[0050] The embodiment described above determines whether the ECU has been rewritten by comparing the current data feature information obtained by encrypting the current data with the historical data feature information obtained by encrypting the historical data. This ensures that the data in the ECU can be rewritten relatively accurately, which facilitates subsequent detection of whether the ECU has been tampered with based on the result.
[0051] Specifically, the method further includes: generating a prompt message indicating successful ECU verification if the ECU has not been rewritten. The absence of rewriting on the ECU indicates that the ECU data is secure. Generating a prompt message indicating successful EUC verification facilitates the inspection personnel's view and understanding of the ECU's inspection status.
[0052] In one optional embodiment, the historical data feature information or the historical data is stored in a memory. Obtaining the historical data feature information includes one of the following: reading the historical data feature information from the memory; or reading the historical data from the memory and processing the historical data using the second preset algorithm to determine the historical data feature information. That is, if the historical data feature information is stored in the memory, it is read directly from the memory, ensuring a relatively simple and quick way to obtain the historical data feature information and simplifying the calculation process. If only the historical data is stored in the memory, regardless of whether the historical data feature information is also stored in the memory, the historical data read from the memory is encrypted to obtain the historical data feature information, ensuring that the obtained historical data feature information is relatively accurate. This process achieves a more flexible way to obtain historical data feature information, and by obtaining the historical data feature information from the information read from the memory, it further avoids manual data input and further realizes the automatic detection and identification of whether the ECU has been tampered with.
[0053] Of course, the acquisition of the historical data and / or the historical data feature information is not limited to reading from the memory, but can also be provided to the ECU controller by manual input.
[0054] Furthermore, obtaining the current data includes: reading the current program data in the ECU to obtain the current data.
[0055] In practical applications, the memory can be any suitable storage device, such as read-only memory, random access memory, main memory, semiconductor memory, and magnetic surface memory. In one specific embodiment, the memory is an electrically erasable programmable read-only memory (EEPROM). EEPROM has the characteristic of not losing data after power failure, ensuring the security of the data stored in the EEPROM.
[0056] According to an exemplary embodiment, such as Figure 4 As shown, the specific implementation method for obtaining the current brushing feature information includes the following steps:
[0057] Step S2021: Upon receiving the current flashing identifier information, the first preset algorithm is used to process the current flashing identifier information to obtain the current flashing feature information. The current flashing identifier information is the flashing identifier received after the ECU is flashed during the current operation.
[0058] Specifically, the first preset algorithm can be of various types. For example, the first preset algorithm includes, but is not limited to, message digest algorithms, MD4, MD2, secure hash algorithms, and hash message authentication algorithms. Furthermore, the first preset algorithm may also include anti-duplicate algorithms. The specific preset algorithm chosen for the verification rules depends on the actual application scenario requirements, and this application does not impose excessive restrictions in this regard.
[0059] Step S2022: If the current flashing identifier information is not received, read the historical flashing identifier information from the memory. The historical flashing identifier information is the flashing identifier received after the ECU was flashed in the previous operation.
[0060] Specifically, after the ECU is successfully flashed in the previous operation, it will receive historical flashing identification information sent by the flashing tool, and this application will store the historical flashing identification information in the memory. If no historical flashing identification information is received from the flashing tool in the previous operation, the flashing identification information corresponding to the operation two steps prior to that is determined to be the historical flashing identification information.
[0061] Step S2023: Determine the historical write identifier information as the current write identifier information, and process the current write identifier information using the first preset algorithm to obtain the current write feature information.
[0062] In this embodiment, if the current flashing identifier information is not received, historical flashing identifier information is read from the memory. This historical flashing identifier information is then identified as the current flashing identifier information. Upon receiving or identifying the current flashing identifier information, a first preset algorithm is used to process it, obtaining the current flashing feature information. This ensures that the obtained current flashing feature information conforms to the verification rules, providing accurate data support for subsequent determination of whether the current flashing feature information meets the verification rules. This further avoids missed detections of ECU tampering, thereby further ensuring the accuracy of ECU data detection.
[0063] In another exemplary embodiment, the historical flashing feature information or the historical flashing identification information is stored in a memory. Obtaining the historical flashing feature information includes one of the following: reading the historical flashing feature information from the memory; or reading the historical flashing identification information from the memory and processing the historical flashing identification information using the first preset algorithm to determine the historical flashing feature information. That is, if the historical flashing feature information is stored in the memory, it is read directly from the memory, ensuring a relatively quick and easy acquisition of the historical flashing feature information and simplifying the calculation process. If the historical flashing identification information is stored in the memory, regardless of whether the historical flashing feature information is still stored in the memory, the historical flashing identification information read from the memory is encrypted to obtain the historical flashing feature information, ensuring that the obtained historical flashing feature information is relatively accurate. This process achieves a more flexible acquisition of historical flashing feature information, and by obtaining the historical flashing feature information from the information read from the memory, it further avoids manual data input and further realizes automatic detection and identification of whether the ECU has been tampered with.
[0064] To further ensure automatic and continuous monitoring of ECU data, according to another embodiment of this application, after obtaining the current flashing feature information, the method further includes: sending the current flashing identifier information, the current flashing feature information, and the current data feature information to the memory, wherein the current data feature information is obtained by processing the current data using a second preset algorithm. Obtaining historical data feature information includes: reading the historical data feature information from the memory. The current flashing identifier information, the current flashing feature information, and the current data feature information corresponding to the current running process are stored in the memory to facilitate monitoring of whether the ECU has been tampered with in the next running process.
[0065] In one alternative approach, the method further includes the following specific steps:
[0066] Step S204: In the event that the ECU has been tampered with, generate a first alarm message indicating that the ECU has been tampered with, and control the ECU to perform a function degradation according to a preset fault degradation strategy.
[0067] Specifically, according to the preset fault degradation strategy, the ECU is controlled to perform functional degradation, which may include at least one of the following: anti-lock braking system (ABS), transmission control unit (TCU), retarder control unit (RCU), body control unit (BCU), and engine immobilizer system (IMMO).
[0068] Step S205: If the ECU has not been tampered with, generate a second alarm message indicating that the ECU has been rewritten.
[0069] In this embodiment, if the ECU is tampered with, a first alarm message is generated and function degradation control is performed, effectively improving the security of ECU data. It allows for timely detection, alarm, and intervention after ECU data tampering, further preventing losses caused by illegal ECU tampering and protecting the legitimate rights and interests of manufacturers, distributors, or maintenance providers. If the ECU has not been tampered with, a second alarm message is generated to alert testing personnel that the data in the ECU has been updated.
[0070] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the ECU data detection method of this application will be described in detail below with reference to specific embodiments.
[0071] This embodiment relates to a specific method for detecting ECU data, such as... Figure 5 As shown, the ECU operates in the vehicle, and the method includes the following steps:
[0072] Step S1: First, when the ECU is upgraded with a legitimate flashing tool by a qualified after-sales team, the flashing tool will automatically send a preset communication command to the ECU after the flashing is completed. The flashing identification information C2 is sent to the ECU. The ECU calculates the flashing feature information B2 according to the first preset algorithm and the flashing identification information C2, and stores the flashing identification C2 and the flashing feature information B2 into the EEPROM.
[0073] Step S2: Next, the ECU calculates the corresponding data feature information of the current program data according to the second preset algorithm and stores it in the EEPROM;
[0074] Step S3: Each time the ECU is powered on, it first reads the data feature information A1, flashing identification information C1, flashing feature information B1 and other parameters from the EEPROM of the previous driving cycle. At the same time, the ECU calculates the data feature information A2 and flashing feature information B2 of the current driving cycle according to the second preset algorithm. Then, it distinguishes different tampering situations by judging the difference between the feature information A1 and A2 and gives different fault downgrades.
[0075] Step S4: The flashing identifier information will only be updated when flashing with a legitimate service tool. When other illegal means update the program data in the ECU, the flashing identifier information remains unchanged. Therefore, the ECU needs to check whether there is a new flashing communication command after each power-on. If not, the flashing identifier information of the previous driving cycle will be used as the flashing identifier information of the current driving cycle.
[0076] Step S5: If the data characteristic information of the program data stored in the current driving cycle is different from that of the previous driving cycle, it means that the ECU program data has been modified and the ECU has been rewritten. At this time, it is necessary to judge the rewriting characteristic information. If the rewriting characteristic information has also changed at this time, it means that this program data upgrade is a legal upgrade, and only a "fault" reminder is required. If the rewriting characteristic information has not changed, it means that this program data upgrade is an abnormal tampering, the ECU reports a fault, and at the same time, the function is downgraded according to the preset fault downgrade plan to restrict the normal operation of the vehicle.
[0077] The process distinguishes between legitimate and compliant program data upgrades and those obtained through irregular means in the market using specific parameters and algorithms. It also combines characteristic parameters of the program data to effectively identify whether ECU program data has been modified. This allows it to identify both legitimate upgrades via official service tools and illegal program data tampering. Different fault downgrade solutions are developed for each. For customers who have engaged in illegal operations, whose non-compliant program data affects the engine, vehicle's operating status, and even emissions and OBD regulations, dealers have the right to refuse maintenance and warranty services. Simultaneously, the ECU automatically downgrades its function, rendering the tampered engine unable to operate normally, effectively protecting the legitimate rights and interests of engine manufacturers, vehicle manufacturers, and dealers.
[0078] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0079] This application also provides an ECU data detection device. It should be noted that the ECU data detection device of this application can be used to execute the ECU data detection method provided in this application. This device is used to implement the embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0080] The following describes the ECU data detection device provided in the embodiments of this application.
[0081] Figure 6 This is a schematic diagram of an ECU data detection device according to an embodiment of this application. Figure 6 As shown, the device includes:
[0082] The first determining unit 10 is used to determine whether the ECU has been flashed when the ECU is powered on, and to determine that the ECU has been flashed when the current data and historical data are inconsistent. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation.
[0083] Specifically, the ECU is a device composed of integrated circuits used to perform data analysis and processing, and to control equipment. The controlled objects of the ECU include, but are not limited to, power output devices such as engines, system controllers, and electronic devices; this application does not impose excessive restrictions on the specific controlled objects of the ECU. The previous operating process refers to the last time the ECU was powered on and running during the current operating process. The end point of the previous operating process is when the ECU is powered off, and the start point of the current operating process is when the ECU is powered on again. ECU rewriting refers to an external data rewriting tool sending data information to the ECU through the ECU communication network to manage and update ECU data. The program data includes code data in the program code area and / or data in the data area of the ECU.
[0084] The acquisition unit 20 is used to acquire current flashing feature information and historical flashing feature information when the ECU is flashed. The current flashing feature information is the flashing feature corresponding to the current running process, and the historical flashing feature is the flashing feature corresponding to the previous running process. When a flashing identifier is received, the flashing feature is obtained by processing the currently received flashing identifier using a first preset algorithm. When the flashing identifier is not received, the flashing feature is obtained by processing the previously received flashing identifier using the first preset algorithm. Each normal flashing process corresponds to receiving a unique flashing identifier.
[0085] Specifically, there are two scenarios when an ECU is rewritten: First, a normal ECU rewrite refers to after-sales maintenance and program data upgrades performed by the manufacturer, distributor, or maintenance personnel according to standard operating procedures. Second, an ECU tampering refers to any rewriting of the ECU other than the first scenario. In this application, during each normal rewrite process, the ECU receives a rewrite identifier sent by the rewrite tool. This rewrite identifier is a unique identifier for a normal rewrite process, and the rewrite feature obtained by processing this identifier using the first preset algorithm is also a unique identifier representing the normal rewrite process. The rewrite identifier can be a unique identifier generated based on the ECU model, rewrite date, rewrite version, information about the ECU's controlled object, and other information. The rewrite identifier can be a number, an array, or other formatted information. It should be noted that if the ECU is tampered with, the rewrite identifier may not be received.
[0086] Specifically, when a write flag is received, the write feature is obtained by processing the currently received write flag using a first preset algorithm. When the write flag is not received, the write feature is obtained by processing the previously received write flag using the first preset algorithm. This means that: 1. When the write feature is the current write feature information, when a write flag is received in the current running process, the current write feature information is obtained by processing the write flag received in the current running process using the first preset algorithm. 2. When the write flag is not received in the current running process, the write feature is obtained by processing the write flag received in the previous running process using the first preset algorithm. Second, when the flashing feature is historical flashing feature information, when a flashing identifier is received in the previous running process, the historical flashing feature information is obtained by processing the flashing identifier received in the previous running process using a first preset algorithm. When the flashing identifier is not received in the previous running process, the flashing feature is obtained by processing the flashing identifier received in the running process two years ago using the first preset algorithm. The running process two years ago refers to the running process in which the ECU was flashed before the previous running process and is closest to the previous running process.
[0087] The second determining unit 30 is used to determine whether the ECU has been tampered with based on the current flashing feature information and the historical flashing feature information. The ECU is determined to have been tampered with if one of the following conditions is met: the current flashing feature information is consistent with the historical flashing feature information, or the current flashing feature information does not meet the verification rule, wherein the verification rule is the processing rule of the first preset algorithm.
[0088] Specifically, if the ECU is flashed and the current flashing feature information is consistent with the historical flashing feature information, it indicates that the flashing feature has not been updated accordingly. In other words, the ECU did not receive the flashing identification information sent by the flashing tool during the flashing process. However, the ECU should receive this flashing identification information during a normal flashing process. Therefore, if the ECU is flashed and the current flashing feature information is consistent with the historical flashing feature information, it indicates that the ECU flashing process is an illegal operation, the program data in the ECU has been tampered with, and it was not a normal flash.
[0089] When the ECU is flashed and the current flashing feature information does not meet the verification rules, it indicates that the tamper operator has deciphered the normal flashing process and knows that the ECU receives the flashing identifier during the normal flashing process. Based on the flashing identifier generated during the normal flashing process, the operator forged an illegal flashing identifier. There are two possibilities for this illegal flashing identifier: First, the illegal flashing identifier is the same as the flashing identifier corresponding to the normal flashing process. In this case, after the ECU is flashed, the current flashing feature information will be consistent with the historical flashing feature information, thus being identified as tampering. Second, the illegal flashing identifier is different from the flashing identifier corresponding to the normal flashing process. In this case, after processing by the first preset algorithm, a flashing feature that does not meet the verification rules will be obtained, thus being identified as tampering.
[0090] In the aforementioned embodiment, when the ECU is powered on and running, the first determining unit determines whether the ECU has been flashed based on the current program data and historical program data in the ECU. If the ECU has been flashed, the second determining unit determines whether the ECU has been illegally tampered with based on the current flashing feature information and historical flashing feature information of the ECU. Since each normal flashing process corresponds to a unique flashing feature, after the ECU has been flashed normally, the current flashing feature information and the historical flashing feature information should be different. Therefore, if the ECU has been flashed but the current flashing feature information is the same as the historical flashing feature information, it indicates that the ECU has been illegally tampered with. In addition, since the current flashing feature information is obtained by processing the first preset algorithm and meets the verification rules of the first preset algorithm, if the current flashing feature information does not meet the verification rules, it indicates that the ECU has been illegally tampered with. By combining program data and flashing feature information for verification, the system can automatically identify whether an ECU has been illegally tampered with. This eliminates the need for manual verification, ensuring high detection efficiency and accurate results. It effectively solves the problem of existing technologies being unable to quickly and accurately identify whether the program data in the ECU has been tampered with, protecting the legitimate rights and interests of manufacturers, distributors, or maintenance providers. At the same time, it can prevent problems such as program data violations or security risks caused by ECU tampering.
[0091] The ECU described in this application and the controller of the ECU that executes the device can be applied to a vehicle, and one operation of the ECU corresponds to one driving cycle.
[0092] In one specific embodiment, the first determining unit specifically includes the following:
[0093] The acquisition module is used to acquire the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm;
[0094] Specifically, the second preset algorithm can be of various types, including but not limited to: Message-Digest Algorithm 5 (MD5), MD4, MD2, Secure Hash Algorithm (SHA1), and Hash-based Message Authentication Code (HMAC). The specific preset algorithm selected depends on the actual application scenario requirements, and this application does not impose any restrictions on it.
[0095] The first processing module is used to process the current data using the second preset algorithm to obtain current data feature information;
[0096] The first determining module is used to determine whether the current data and the historical data are consistent based on the current data feature information and the historical data feature information. If the current data feature information and the historical data feature information are consistent, the module determines that the current data and the historical data are consistent and determines that the ECU has not been flashed.
[0097] The second determining module is used to determine that the current data is inconsistent with the historical data when the current data feature information is inconsistent with the historical data feature information, and to determine that the ECU has been flashed.
[0098] The embodiment described above determines whether the ECU has been rewritten by comparing the current data feature information obtained by encrypting the current data with the historical data feature information obtained by encrypting the historical data. This ensures that the data in the ECU can be rewritten relatively accurately, which facilitates subsequent detection of whether the ECU has been tampered with based on the result.
[0099] Specifically, the device further includes a first generation unit, configured to generate a prompt message indicating successful ECU verification if the ECU has not been rewritten. The absence of rewriting on the ECU indicates that the ECU data is secure. Generating a prompt message indicating successful EUC verification facilitates the inspection personnel's view and understanding of the ECU's inspection status.
[0100] In one optional embodiment, the historical data feature information or the historical data is stored in a memory. The acquisition module includes one of the following: a first reading submodule, used to read the historical data feature information from the memory; and a second reading submodule, used to read the historical data from the memory and process the historical data using the second preset algorithm to determine the historical data feature information. That is, if the historical data feature information is stored in the memory, it is read directly from the memory, ensuring a relatively simple and quick acquisition of the historical data feature information and simplifying the calculation process. If only the historical data is stored in the memory, regardless of whether the historical data feature information is also stored in the memory, the historical data read from the memory is encrypted to obtain the historical data feature information, ensuring a relatively accurate acquisition of the historical data feature information. This process achieves a more flexible acquisition of historical data feature information, and by obtaining the historical data feature information from the information read from the memory, it further avoids manual data input and further realizes automatic detection and identification of whether the ECU has been tampered with.
[0101] Of course, the acquisition of the historical data and / or the historical data feature information is not limited to reading from the memory, but can also be provided to the ECU controller by manual input.
[0102] Furthermore, the acquisition module includes a third reading submodule, used to read the current program data in the ECU to obtain the current data.
[0103] In practical applications, the memory can be any suitable storage device, such as read-only memory, random access memory, main memory, semiconductor memory, and magnetic surface memory. In one specific embodiment, the memory is an electrically erasable programmable read-only memory (EEPROM). EEPROM has the characteristic of not losing data after power failure, ensuring the security of the data stored in the EEPROM.
[0104] According to an exemplary embodiment, the acquisition unit includes:
[0105] The second processing module is used to process the current flashing identifier information using the first preset algorithm when receiving the current flashing identifier information to obtain the current flashing feature information. The current flashing identifier information is the flashing identifier received after the ECU is flashed during the current operation.
[0106] Specifically, the first preset algorithm can be of various types. For example, the first preset algorithm includes, but is not limited to, message digest algorithms, MD4, MD2, secure hash algorithms, and hash message authentication algorithms. Furthermore, the first preset algorithm may also include anti-duplicate algorithms. The specific preset algorithm chosen for the verification rules depends on the actual application scenario requirements, and this application does not impose excessive restrictions in this regard.
[0107] The reading module is used to read historical flashing identifier information from the memory when the current flashing identifier information is not received. The historical flashing identifier information is the flashing identifier received after the ECU was flashed in the previous operation.
[0108] Specifically, after the ECU is successfully flashed in the previous operation, it will receive historical flashing identification information sent by the flashing tool, and this application will store the historical flashing identification information in the memory. If no historical flashing identification information is received from the flashing tool in the previous operation, the flashing identification information corresponding to the operation two steps prior to that is determined to be the historical flashing identification information.
[0109] The third determining module is used to determine that the historical write identification information is the current write identification information, and to process the current write identification information using the first preset algorithm to obtain the current write feature information.
[0110] In this embodiment, if the current flashing identifier information is not received, historical flashing identifier information is read from the memory. This historical flashing identifier information is then identified as the current flashing identifier information. Upon receiving or identifying the current flashing identifier information, a first preset algorithm is used to process it, obtaining the current flashing feature information. This ensures that the obtained current flashing feature information conforms to the verification rules, providing accurate data support for subsequent determination of whether the current flashing feature information meets the verification rules. This further avoids missed detections of ECU tampering, thereby further ensuring the accuracy of ECU data detection.
[0111] In another exemplary embodiment, the historical write feature information or the historical write identification information is stored in a memory. The acquisition unit includes one of the following: a fourth reading submodule, used to read the historical write feature information from the memory; and a fifth reading submodule, used to read the historical write identification information from the memory and process the historical write identification information using the first preset algorithm to determine the historical write feature information. That is, if the historical write feature information is stored in the memory, it is read directly from the memory, ensuring that the historical write feature information can be obtained quickly and easily, simplifying the calculation process; if the historical write identification information is stored in the memory, regardless of whether the historical write feature information is still stored in the memory, the historical write identification information read from the memory is encrypted to obtain the historical write feature information, thus ensuring that the obtained historical write feature information is relatively accurate. The process enables a more flexible acquisition of historical flashing feature information. Furthermore, by obtaining this historical flashing feature information from the memory, manual data input is avoided, and automatic detection and identification of whether the ECU has been tampered with is achieved.
[0112] To further ensure automatic and continuous monitoring of ECU data, according to another embodiment of this application, the device further includes: a sending unit, configured to send the current flashing identifier information, the current flashing feature information, and current data feature information to the memory after obtaining the current flashing feature information, wherein the current data feature information is obtained by processing the current data using a second preset algorithm. The acquisition module includes: a first reading submodule, configured to read the historical data feature information from the memory. The current flashing identifier information, the current flashing feature information, and the current data feature information corresponding to the current running process are stored in the memory to facilitate monitoring of whether the ECU has been tampered with in the next running process.
[0113] In one alternative embodiment, the device further includes the following modules:
[0114] The second generation unit is used to generate a first alarm message indicating that the ECU has been tampered with when the ECU is tampered with, and to control the ECU to perform functional degradation according to a preset fault degradation strategy.
[0115] Specifically, according to the preset fault degradation strategy, the ECU is controlled to perform functional degradation, which may include at least one of the following: anti-lock braking system (ABS), transmission control unit (TCU), retarder control unit (RCU), body control unit (BCU), and engine immobilizer system (IMMO).
[0116] The third generation unit is used to generate a second alarm message indicating that the ECU has been rewritten, provided that the ECU has not been tampered with.
[0117] In this embodiment, if the ECU is tampered with, a first alarm message is generated and function degradation control is performed, effectively improving the security of ECU data. It allows for timely detection, alarm, and intervention after ECU data tampering, further preventing losses caused by illegal ECU tampering and protecting the legitimate rights and interests of manufacturers, distributors, or maintenance providers. If the ECU has not been tampered with, a second alarm message is generated to alert testing personnel that the data in the ECU has been updated.
[0118] The ECU data detection device includes a processor and a memory. The first determining unit, the acquiring unit, and the second determining unit are all stored as program units in the memory. The processor executes the program units stored in the memory to achieve the corresponding functions. All modules are located in the same processor; alternatively, the modules may be located in different processors in any combination.
[0119] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can at least address the current limitations in quickly and accurately identifying whether program data in the ECU has been tampered with.
[0120] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0121] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device where the computer-readable storage medium is located to execute a method for detecting ECU data.
[0122] Specifically, the methods for detecting ECU data include:
[0123] Step S201: When the ECU is powered on, determine whether the ECU has been flashed. If the current data and historical data are inconsistent, determine that the ECU has been flashed. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation.
[0124] Step S202: When the ECU is flashed, current flashing feature information and historical flashing feature information are obtained. The current flashing feature information is the flashing feature corresponding to the current running process, and the historical flashing feature is the flashing feature corresponding to the previous running process. When a flashing identifier is received, the flashing feature is obtained by processing the currently received flashing identifier using a first preset algorithm. When the flashing identifier is not received, the flashing feature is obtained by processing the previously received flashing identifier using the first preset algorithm. Each normal flashing process corresponds to receiving a unique flashing identifier.
[0125] Step S203: Based on the current flashing feature information and the historical flashing feature information, determine whether the ECU has been tampered with. If one of the following conditions is met, the ECU is determined to have been tampered with: the current flashing feature information is consistent with the historical flashing feature information; or the current flashing feature information does not meet the verification rules, wherein the verification rules are the processing rules of the first preset algorithm.
[0126] Optionally, determining whether the ECU has been flashed includes: acquiring the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm; processing the current data using the second preset algorithm to obtain current data feature information; determining whether the current data and the historical data are consistent based on the current data feature information and the historical data feature information; if the current data feature information and the historical data feature information are consistent, determining that the current data and the historical data are consistent, and determining that the ECU has not been flashed; if the current data feature information and the historical data feature information are inconsistent, determining that the current data and the historical data are inconsistent, and determining that the ECU has been flashed.
[0127] Optionally, determining whether the ECU has been flashed includes: acquiring the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm; processing the current data using the second preset algorithm to obtain current data feature information; determining whether the current data and the historical data are consistent based on the current data feature information and the historical data feature information; if the current data feature information and the historical data feature information are consistent, determining that the current data and the historical data are consistent, and determining that the ECU has not been flashed; if the current data feature information and the historical data feature information are inconsistent, determining that the current data and the historical data are inconsistent, and determining that the ECU has been flashed.
[0128] Optionally, obtaining the current flashing feature information includes: when receiving current flashing identifier information, processing the current flashing identifier information using the first preset algorithm to obtain the current flashing feature information, wherein the current flashing identifier information is the flashing identifier received after the ECU was normally flashed during the current operation; when not receiving the current flashing identifier information, reading historical flashing identifier information from the memory, wherein the historical flashing identifier information is the flashing identifier received after the ECU was normally flashed during the previous operation; determining the historical flashing identifier information as the current flashing identifier information, and processing the current flashing identifier information using the first preset algorithm to obtain the current flashing feature information.
[0129] Optionally, after obtaining the current write feature information, the method further includes: sending the current write identifier information, the current write feature information, and the current data feature information to the memory, wherein the current data feature information is obtained by processing the current data using a second preset algorithm; and obtaining historical data feature information, including: reading the historical data feature information from the memory.
[0130] Optionally, obtaining historical write feature information includes one of the following: reading the historical write feature information from the memory, reading the historical write identifier information from the memory, and processing the historical write identifier information using the first preset algorithm to determine the historical write feature information.
[0131] Optionally, the method further includes: generating a first alarm message indicating that the ECU has been tampered with, and controlling the ECU to perform functional degradation according to a preset fault degradation strategy; and generating a second alarm message indicating that the ECU has been flashed if the ECU has not been tampered with.
[0132] Optionally, the method further includes: generating a prompt message indicating that the ECU has been successfully verified if the ECU has not been flashed.
[0133] This invention provides a processor for running a program, wherein the program executes a method for detecting ECU data during runtime.
[0134] Specifically, the methods for detecting ECU data include:
[0135] Step S201: When the ECU is powered on, determine whether the ECU has been flashed. If the current data and historical data are inconsistent, determine that the ECU has been flashed. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation.
[0136] Step S202: When the ECU is flashed, current flashing feature information and historical flashing feature information are obtained. The current flashing feature information is the flashing feature corresponding to the current running process, and the historical flashing feature is the flashing feature corresponding to the previous running process. When a flashing identifier is received, the flashing feature is obtained by processing the currently received flashing identifier using a first preset algorithm. When the flashing identifier is not received, the flashing feature is obtained by processing the previously received flashing identifier using the first preset algorithm. Each normal flashing process corresponds to receiving a unique flashing identifier.
[0137] Step S203: Based on the current flashing feature information and the historical flashing feature information, determine whether the ECU has been tampered with. If one of the following conditions is met, the ECU is determined to have been tampered with: the current flashing feature information is consistent with the historical flashing feature information; or the current flashing feature information does not meet the verification rules, wherein the verification rules are the processing rules of the first preset algorithm.
[0138] Optionally, determining whether the ECU has been flashed includes: acquiring the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm; processing the current data using the second preset algorithm to obtain current data feature information; determining whether the current data and the historical data are consistent based on the current data feature information and the historical data feature information; if the current data feature information and the historical data feature information are consistent, determining that the current data and the historical data are consistent, and determining that the ECU has not been flashed; if the current data feature information and the historical data feature information are inconsistent, determining that the current data and the historical data are inconsistent, and determining that the ECU has been flashed.
[0139] Optionally, determining whether the ECU has been flashed includes: acquiring the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm; processing the current data using the second preset algorithm to obtain current data feature information; determining whether the current data and the historical data are consistent based on the current data feature information and the historical data feature information; if the current data feature information and the historical data feature information are consistent, determining that the current data and the historical data are consistent, and determining that the ECU has not been flashed; if the current data feature information and the historical data feature information are inconsistent, determining that the current data and the historical data are inconsistent, and determining that the ECU has been flashed.
[0140] Optionally, obtaining the current flashing feature information includes: when receiving current flashing identifier information, processing the current flashing identifier information using the first preset algorithm to obtain the current flashing feature information, wherein the current flashing identifier information is the flashing identifier received after the ECU was normally flashed during the current operation; when not receiving the current flashing identifier information, reading historical flashing identifier information from the memory, wherein the historical flashing identifier information is the flashing identifier received after the ECU was normally flashed during the previous operation; determining the historical flashing identifier information as the current flashing identifier information, and processing the current flashing identifier information using the first preset algorithm to obtain the current flashing feature information.
[0141] Optionally, after obtaining the current write feature information, the method further includes: sending the current write identifier information, the current write feature information, and the current data feature information to the memory, wherein the current data feature information is obtained by processing the current data using a second preset algorithm; and obtaining historical data feature information, including: reading the historical data feature information from the memory.
[0142] Optionally, obtaining historical write feature information includes one of the following: reading the historical write feature information from the memory, reading the historical write identifier information from the memory, and processing the historical write identifier information using the first preset algorithm to determine the historical write feature information.
[0143] Optionally, the method further includes: generating a first alarm message indicating that the ECU has been tampered with, and controlling the ECU to perform functional degradation according to a preset fault degradation strategy; and generating a second alarm message indicating that the ECU has been flashed if the ECU has not been tampered with.
[0144] Optionally, the method further includes: generating a prompt message indicating that the ECU has been successfully verified if the ECU has not been flashed.
[0145] This invention provides an electronic device, which includes an ECU and a controller for the ECU. The controller includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0146] Step S201: When the ECU is powered on, determine whether the ECU has been flashed. If the current data and historical data are inconsistent, determine that the ECU has been flashed. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation.
[0147] Step S202: When the ECU is flashed, current flashing feature information and historical flashing feature information are obtained. The current flashing feature information is the flashing feature corresponding to the current running process, and the historical flashing feature is the flashing feature corresponding to the previous running process. When a flashing identifier is received, the flashing feature is obtained by processing the currently received flashing identifier using a first preset algorithm. When the flashing identifier is not received, the flashing feature is obtained by processing the previously received flashing identifier using the first preset algorithm. Each normal flashing process corresponds to receiving a unique flashing identifier.
[0148] Step S203: Based on the current flashing feature information and the historical flashing feature information, determine whether the ECU has been tampered with. If one of the following conditions is met, the ECU is determined to have been tampered with: the current flashing feature information is consistent with the historical flashing feature information; or the current flashing feature information does not meet the verification rules, wherein the verification rules are the processing rules of the first preset algorithm.
[0149] Optionally, the electronic device further includes: a flashing tool, which is communicatively connected to the ECU. The flashing tool is used to flash data onto the ECU and, after flashing is completed, sends a communication command carrying flashing identification information to the ECU.
[0150] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0151] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0152] Step S201: When the ECU is powered on, determine whether the ECU has been flashed. If the current data and historical data are inconsistent, determine that the ECU has been flashed. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation.
[0153] Step S202: When the ECU is flashed, obtain the current flashing feature information and the historical flashing feature information. The current flashing feature information is the flashing feature corresponding to the current running process, and the historical flashing feature is the flashing feature corresponding to the previous running process. The flashing feature is the feature information determined according to the flashing identifier information sent to the ECU by the flashing tool after the ECU is flashed normally. Each normal flashing process corresponds to a unique flashing identifier.
[0154] Step S203: Based on the current flashing feature information and the historical flashing feature information, determine whether the ECU has been tampered with. If the current flashing feature information is consistent with the historical flashing feature information, determine that the ECU has been tampered with.
[0155] Optionally, determining whether the ECU has been flashed includes: acquiring the current data and historical data feature information, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm; processing the current data using the second preset algorithm to obtain current data feature information; determining whether the current data and the historical data are consistent based on the current data feature information and the historical data feature information; if the current data feature information and the historical data feature information are consistent, determining that the current data and the historical data are consistent, and determining that the ECU has not been flashed; if the current data feature information and the historical data feature information are inconsistent, determining that the current data and the historical data are inconsistent, and determining that the ECU has been flashed.
[0156] Optionally, obtaining the current flashing feature information includes: when receiving current flashing identifier information, processing the current flashing identifier information using a first preset algorithm to obtain the current flashing feature information, wherein the current flashing identifier information is the flashing identifier received after the ECU was successfully flashed during the current operation; when not receiving the current flashing identifier information, reading historical flashing identifier information from the memory, wherein the historical flashing identifier information is the flashing identifier received after the ECU was successfully flashed during the previous operation; determining the historical flashing identifier information as the current flashing identifier information, and processing the current flashing identifier information using the first preset algorithm to obtain the current flashing feature information.
[0157] Optionally, after obtaining the current write feature information, the method further includes: sending the current write identifier information, the current write feature information, and the current data feature information to the memory, wherein the current data feature information is obtained by processing the current data using a second preset algorithm; and obtaining historical data feature information, including: reading the historical data feature information from the memory.
[0158] Optionally, obtaining historical write feature information includes one of the following: reading the historical write feature information from the memory, reading the historical write identifier information from the memory, and processing the historical write identifier information using the first preset algorithm to determine the historical write feature information.
[0159] Optionally, the method further includes: generating a first alarm message indicating that the ECU has been tampered with, and controlling the ECU to perform functional degradation according to a preset fault degradation strategy; and generating a second alarm message indicating that the ECU has been flashed if the ECU has not been tampered with.
[0160] Optionally, the method further includes: generating a prompt message indicating that the ECU has been successfully verified if the ECU has not been flashed.
[0161] It will be apparent to those skilled in the art that the modules or steps of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using device-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular hardware and software combination.
[0162] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0163] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0164] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0165] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0166] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0167] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0168] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0169] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0170] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for detecting ECU data, characterized in that, include: When the ECU is powered on, determine whether the ECU has been flashed. If the current data is inconsistent with the historical data, determine that the ECU has been flashed. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation. When the ECU is being flashed, current flashing feature information and historical flashing feature information are obtained. The current flashing feature information is the flashing feature corresponding to the current running process, and the historical flashing feature is the flashing feature corresponding to the previous running process. When a flashing identifier is received, the flashing feature is obtained by processing the currently received flashing identifier using a first preset algorithm. When the flashing identifier is not received, the flashing feature is obtained by processing the previously received flashing identifier using the first preset algorithm. Each normal flashing process receives a unique flashing identifier. Based on the current flashing feature information and the historical flashing feature information, it is determined whether the ECU has been tampered with. The ECU is determined to have been tampered with if one of the following conditions is met: the current flashing feature information is consistent with the historical flashing feature information, or the current flashing feature information does not meet the verification rules, wherein the verification rules are the processing rules of the first preset algorithm. When a write flag is received, the write feature is obtained by processing the currently received write flag using a first preset algorithm. When the write flag is not received, the write feature is obtained by processing the previously received write flag using the first preset algorithm. This means that when the write feature is the current write feature information, if a write flag is received in the current running process, the current write feature information is obtained by processing the write flag received in the current running process using the first preset algorithm. If the write flag is not received in the current running process, the write feature is obtained by processing the previously received write flag using the first preset algorithm. The flashing identifier is obtained by processing the first preset algorithm; when the flashing feature is historical flashing feature information, when the flashing identifier is received in the previous running process, the historical flashing feature information is obtained by processing the flashing identifier received in the previous running process using the first preset algorithm; when the flashing identifier is not received in the previous running process, the flashing feature is obtained by processing the flashing identifier received in the running process two years ago using the first preset algorithm, wherein the running process two years ago refers to the running process in which the ECU was flashed before the previous running process and is closest to the previous running process.
2. The method according to claim 1, characterized in that, Determining whether the ECU has been flashed includes: The current data and historical data feature information are obtained, wherein the historical data feature information is obtained by processing the historical data using a second preset algorithm; The current data is processed using the second preset algorithm to obtain current data feature information; Based on the current data feature information and the historical data feature information, determine whether the current data and the historical data are consistent. If the current data feature information and the historical data feature information are consistent, determine that the current data and the historical data are consistent, and determine that the ECU has not been flashed. If the current data feature information is inconsistent with the historical data feature information, it is determined that the current data is inconsistent with the historical data, and it is determined that the ECU has been flashed.
3. The method according to claim 1, characterized in that, Obtain current write characteristics information, including: Upon receiving current flashing identifier information, the first preset algorithm is used to process the current flashing identifier information to obtain the current flashing feature information. The current flashing identifier information is the flashing identifier received after the ECU is flashed during the current operation. If the current flashing identifier information is not received, the historical flashing identifier information is read from the memory. The historical flashing identifier information is the flashing identifier received after the ECU was flashed in the previous operation. The historical write identifier information is determined to be the current write identifier information, and the current write identifier information is processed using the first preset algorithm to obtain the current write feature information.
4. The method according to claim 3, characterized in that, After obtaining the current write feature information, the method further includes: sending the current write identifier information, the current write feature information, and the current data feature information to the memory, wherein the current data feature information is obtained by processing the current data using a second preset algorithm. Obtaining historical data feature information includes: reading the historical data feature information from the memory.
5. The method according to claim 3, characterized in that, Obtain historical write characteristics, including one of the following: Read the historical write feature information from the memory. The historical write identification information is read from the memory, and the historical write identification information is processed using the first preset algorithm to determine the historical write feature information.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: In the event that the ECU has been tampered with, a first alarm message indicating that the ECU has been tampered with is generated, and the ECU is controlled to perform a function degradation according to a preset fault degradation strategy. If the ECU has not been tampered with, a second alarm message indicating that the ECU has been rewritten is generated.
7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: If the ECU has not been flashed, a message indicating that the ECU verification was successful is generated.
8. A device for detecting ECU data, characterized in that, include: The first determining unit is used to determine whether the ECU has been flashed when the ECU is powered on, and to determine that the ECU has been flashed if the current data and historical data are inconsistent. The current data is the program data in the ECU during the current operation, and the historical data is the program data in the ECU during the previous operation. The acquisition unit is used to acquire current write feature information and historical write feature information. The current write feature information is the write feature corresponding to the current running process, and the historical write feature is the write feature corresponding to the previous running process. When a write identifier is received, the write feature is obtained by processing the currently received write identifier using a first preset algorithm. When the write identifier is not received, the write feature is obtained by processing the previously received write identifier using the first preset algorithm. Each normal write process receives a unique write identifier. The second determining unit is used to determine whether the ECU has been tampered with based on the current flashing feature information and the historical flashing feature information. The ECU is determined to have been tampered with if one of the following conditions is met: the current flashing feature information is consistent with the historical flashing feature information, or the current flashing feature information does not meet the verification rule, wherein the verification rule is the processing rule of the first preset algorithm. When a write flag is received, the write feature is obtained by processing the currently received write flag using a first preset algorithm. When the write flag is not received, the write feature is obtained by processing the previously received write flag using the first preset algorithm. This means that when the write feature is the current write feature information, if a write flag is received in the current running process, the current write feature information is obtained by processing the write flag received in the current running process using the first preset algorithm. If the write flag is not received in the current running process, the write feature is obtained by processing the previously received write flag using the first preset algorithm. The flashing identifier is obtained by processing the first preset algorithm; when the flashing feature is historical flashing feature information, when the flashing identifier is received in the previous running process, the historical flashing feature information is obtained by processing the flashing identifier received in the previous running process using the first preset algorithm; when the flashing identifier is not received in the previous running process, the flashing feature is obtained by processing the flashing identifier received in the running process two years ago using the first preset algorithm, wherein the running process two years ago refers to the running process in which the ECU was flashed before the previous running process and is closest to the previous running process.
9. An electronic device, characterized in that, include: ECU; The controller of the ECU includes one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any one of claims 1 to 7.
10. The electronic device according to claim 9, characterized in that, Also includes: A flashing tool is connected to the ECU for flashing data on the ECU. After the flashing is completed, the flashing tool sends a communication command carrying flashing identification information to the ECU.