ECU flashing method, device, electronic device and storage medium
By using the first container object to retrieve the corresponding relationship between the flash file and the flash session during the ECU flashing process, the problem of long waiting time for the flashing job is solved, and the user experience and flashing efficiency are improved.
Patent Information
- Application Number
- CN202111636741.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-12-29
AI Technical Summary
During the ECU flashing process, after the user selects the target ECU, the waiting time for the flashing tool to create the flashing job is too long, resulting in a poor user experience.
By retrieving the corresponding relationship between the flash file and the flash session in the first container object, the waiting time for creating a flash job is shortened and the retrieval speed is improved. The specific method includes obtaining the flash file of the target ECU, parsing the data packet to generate a first container object, using the container object to retrieve to determine the target flash session, and creating a flash job based on the session.
The waiting time for creating a flash job is significantly shortened, the user experience is improved, and the response speed of the flash process is improved.
Smart Images

Figure CN114326674B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of automobile technology, and in particular relates to a method, device, electronic device and storage medium for flashing an ECU. Background Art
[0002] Electronic Control Unit (ECU) flashing is also called ECU data filling. The basic principle of ECU data flashing is to use an external data flashing tool to send data information to the ECU through the ECU communication network to achieve ECU data management and update.
[0003] During the ECU flashing operation, after the user selects the target ECU to be flashed, there is a problem that the waiting time for the flashing tool to create a flashing job is too long, resulting in a poor user experience. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for flashing an ECU, which can solve the problem of long waiting time for creating a job and improve user experience.
[0005] In a first aspect, an embodiment of the present application provides a method for flashing an ECU, comprising:
[0006] Obtain a flash file of a target ECU, where the target ECU is the ECU to be flashed;
[0007] Based on the flash file, a target flash session is determined by searching in a first container object, wherein the first container object includes a correspondence between the flash file and the flash session;
[0008] Creating a flash job based on the target flash session;
[0009] The flashing operation is executed to flash data to the target ECU.
[0010] Optionally, the correspondence between the flash file and the flash session is the correspondence between the keyword of the flash file and the flash session;
[0011] The step of searching the first container object based on the flash file to determine the target flash session includes:
[0012] Extracting keywords of the flash file;
[0013] Based on the keyword, the first container is used for searching to determine the target flash session.
[0014] Optionally, the first container object is obtained by the following steps:
[0015] Get the target data packet;
[0016] Parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU;
[0017] The first container object is generated based on the corresponding relationship.
[0018] Optionally, obtain the corresponding relationship between the flash file and the flash session of each ECU, including:
[0019] For each flashing session of each ECU, the short name reference relationship of the flashing session is parsed to determine the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
[0020] Optionally, executing the flashing operation to flash data to the target ECU includes:
[0021] For each flashing file of the target ECU, parsing the flashing file to obtain flashing data;
[0022] The flashing data is flashed in segments according to the order of the storage addresses of the target ECU from high to low.
[0023] In a second aspect, an embodiment of the present application provides a method for data processing, the method comprising:
[0024] A target container object is generated based on a target data packet; the target container object contains a correspondence between a flash file and a flash session; the target container object is used to determine a target flash session corresponding to the flash file of a target ECU; the target flash session is used to create a flash job to flash data to the target ECU.
[0025] In a third aspect, an embodiment of the present application provides a device for flashing an ECU, including:
[0026] A flash file acquisition module is used to acquire a flash file of a target ECU, where the target ECU is the ECU to be flashed;
[0027] a target flash session determination module, configured to determine a target flash session based on the flash file by searching in a first container object, wherein the first container object includes a correspondence between the flash file and the flash session;
[0028] A flash job creation module, configured to create a flash job based on the target flash session;
[0029] The ECU flashing module is used to execute the flashing operation and flash the data of the target ECU.
[0030] Optionally, the correspondence between the flash file and the flash session is the correspondence between the keyword of the flash file and the flash session;
[0031] The target flash session determination module includes:
[0032] A keyword extraction module, used to extract keywords of the flash file;
[0033] A retrieval module is used to perform a search based on the keyword and use the first container to determine the target flash session.
[0034] Optionally, the ECU flashing device is obtained through the following modules:
[0035] A target data packet acquisition module is used to acquire a target data packet;
[0036] A corresponding relationship acquisition module, used for parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU;
[0037] The first container object generating module is configured to generate the first container object based on the corresponding relationship.
[0038] Optionally, the corresponding relationship acquisition module is specifically used to:
[0039] For each flashing session of each ECU, the short name reference relationship of the flashing session is parsed to determine the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
[0040] Optional, ECU flashing module, including:
[0041] A flashing data acquisition module, for parsing each flashing file of the target ECU to obtain flashing data;
[0042] The segmented flashing module is used to flash the flashing data in segments according to the storage address of the target ECU in descending order.
[0043] In a fourth aspect, an embodiment of the present application provides a data processing device, including:
[0044] A target container object generation module is used to generate a target container object based on a target data packet; the target container object contains the correspondence between a flash file and a flash session; the target container object is used to determine the target flash session corresponding to the flash file of the target ECU; the target flash session is used to create a flash job to flash data to the target ECU.
[0045] In a fifth aspect, an embodiment of the present application provides an electronic device, including:
[0046] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method steps described in the first aspect and its optional embodiments, and the method steps described in the second aspect and its optional embodiments are implemented.
[0047] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising: the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in the first aspect and its optional implementation manner, and the method steps described in the second aspect and its optional implementation manner are implemented.
[0048] In a seventh aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method steps described in the first aspect and its optional implementation manner, and the method steps described in the second aspect and its optional implementation manner.
[0049] It should be understood that the embodiment of the present application retrieves the target flash session corresponding to the flash from the first container object, because the first container object contains the correspondence between the flash file and the flash session; the retrieval speed of searching using the container object is higher than that of searching for the target flash session corresponding to the flash file in the diagnostic data packet, which shortens the long waiting time for creating a flash job and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0051] Figure 1 This is a schematic diagram of an ECU flashing system provided by an embodiment of the present application;
[0052] Figure 2 It is a flowchart of a method for flashing an ECU provided in one embodiment of the present application;
[0053] Figure 3 It is a flowchart of a method for flashing an ECU provided in one embodiment of the present application;
[0054] Figure 4 It is a flowchart of a data processing method provided by an embodiment of the present application;
[0055] Figure 5 It is a flowchart of a method for flashing an ECU provided in one embodiment of the present application;
[0056] Figure 6 It is a structural schematic diagram of a device for flashing an ECU provided in an embodiment of the present application;
[0057] Figure 7 It is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0058] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0060] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0061] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0062] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0063] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0064] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0065] Before describing the ECU flashing method provided in the embodiment of the present application, in order to facilitate the understanding of the embodiment of the present application, the following Figure 1 The principles of the ECU flashing method provided in the embodiments of the present application and the related concepts involved in the embodiments of the present application are explained.
[0066] Container is a class template used to store data. Data structures such as variable-length arrays, linked lists, and balanced binary trees are all implemented as containers in STL. When programmers use containers, that is, when they instantiate container class templates as container classes, they will specify the type of elements stored in the container. Containers can store variables of basic types as well as objects.
[0067] Map, an associative array in computer science, is an abstract data structure that contains unique ordered pairs like (key, value), sorted by key, and the key is unique.<string,int> MyObject2TypeMap, the map stores a series of pairs<string,int> object.
[0068] The difference between multimap and map is that the key in multimap can be repeated, while the key in map is unique.
[0069] Open Test sequence eXchange (OTX) is a standardized exchange format, standardized in ISO 13209, for formally describing automated diagnostic sequences, such as system testing or guided debugging.
[0070] Diagnostic sequences are XML-based and can be exchanged between process partners with different platforms and diagnostic testers. Diagnostic test sequences are used whenever off-board test equipment diagnoses, tests, reprograms or initializes automotive components or functions with diagnostic capabilities.
[0071] The order of tests in a diagnostic sequence defines the order of interactions between the user (i.e., workshop or assembly line worker), the diagnostic application (test equipment), and the vehicle communication interface, as well as any calculations and decisions that must be performed. These test sequences are like a series of nodes in a flow chart that follow a certain order.
[0072] Open diagnostic data exchange (ODX) is a data file used by the standard architecture diagnostic instrument (MVCI, Modular Vehicle Communication Interface) developed by the Association for Standardisation of Automation and Measuring Systems (ASAM). ODX is a standardized diagnostic file. When diagnosing different vehicles or different ECUs, you only need to load the ODX file that is adapted to this vehicle model or ECU without making any changes to the diagnostic instrument. ODX unifies the format of diagnostic files, so when diagnostic files are transferred and exchanged in R&D, testing, production, after-sales and other departments, there is no need to convert the format.
[0073] Electronic Control Unit (ECU) data flashing is also called ECU data filling. The basic principle of ECU flashing is to use an external data flashing tool to send data information to the ECU through the ECU communication network to achieve ECU data management and update.
[0074] ECU flashing, also known as flashing ECU or flashing car computer boards, has three main applications: first, data packaging when the engine / car rolls off the assembly line, second, ECU updates and repairs at car repair stations, and third, engine modification applications. The engine ECU manages programs and data separately during software design, and they are separated in the physical Flash space of the microcontroller. ECU data can be divided into multiple data areas according to the different nature of the control task, such as component information configuration area, power parameter area, emission parameter area, fault diagnosis area, etc.
[0075] When the ECU is flashing data, in order to avoid destructive disassembly and assembly of the ECU, data interaction with the ECU is usually carried out through the OBD interface based on the CAN communication protocol (mostly ISO15765). The ECU contains two software packages, the application and the bootable program, to ensure that the application will not crash when it is updated.
[0076] Files containing EUC flashing data and / or flashing programs are usually called ECU flashing files.
[0077] ECU online flashing is a flashing method based on the open test sequence exchange format (Open Test sequence eXchange, OTX).
[0078] At present, the general online flashing process based on the OTX standard is that the automobile manufacturer configures the job-related parameters involved in the flashing process into the OTX file, and packages the automobile diagnostic data configured based on the ODX standard, including all ECU basic functions, special functions, action tests, flashing functions, and the JAR package of the implemented flashing process, into a PDX file and uploads it to the designated server. The ECU flashing device obtains the automobile PDX source file and flashing file online from the automobile manufacturer's server, and performs the flashing operation on the ECU that needs to be flashed.
[0079] During the operation of ECU data flashing, the applicant of this application found that after the user selects the target ECU to be flashed, the flashing tool takes too long to create a flashing job, resulting in a poor user experience. Through analysis and research on the ECU flashing process, the applicant of this application found that the reason for the long waiting time is that the user needs to create a Job after selecting the target ECU to start flashing. Each flashing session corresponds to a Job and also corresponds to a flashing file.
[0080] When creating each flashing job, you need to search the corresponding path in the ODX diagnostic file according to the flashing file, and then obtain the matching flashing session. Each time you flash an ECU, you need to repeat this search and matching process. Repeated searches in the ODX file result in a long waiting time for users.
[0081] Figure 1 The figure shows an ECU flashing system 10 provided in an embodiment of the present application. The system 10 comprises: a flashing device 110 and an online server 120 .
[0082] In some embodiments, the flashing device 110 may be a vehicle diagnostic device, or a computing device configured with an interface for ECU communication, such as a laptop, a PDA, or a smart phone.
[0083] In some embodiments, the online server 120 may be a server provided by an automobile manufacturer or a flash file service provider for storing diagnostic data packages and flash files. The online server 120 may also be a server providing flash interaction services.
[0084] In some embodiments, the flashing device 110 communicates with the online server 120 via a wired and / or wireless communication network.
[0085] Figure 2 The ECU flashing method provided in the embodiment of the present application is shown, which is applied to the above Figure 1 The flashing device 110 in the ECU flashing system 10 shown in the figure can be implemented by software and / or hardware of the flashing device 110. Figure 2 As shown, the method includes steps S110 to S140. The specific implementation principle of each step is as follows:
[0086] S110, obtaining a flash file of a target ECU, where the target ECU is the ECU to be flashed.
[0087] In some embodiments, the flashing device obtains the flashing file of the target ECU online, and online generally refers to the electronic device being in a network connection state. In the embodiments of the present application, online refers to the state in which the flashing device 110 communicates with the online server 120 via a network connection.
[0088] In some embodiments, the flash file may be in the form of a flash file package, which is a file package containing one or more ECU flash files.
[0089] In some embodiments, the flashing device can also obtain a diagnostic data packet online while obtaining the flashing file. The diagnostic data packet is a file package containing a vehicle diagnostic data file, and the diagnostic data packet can be the above-mentioned PDX file package. The diagnostic data packet is used to parse the correspondence between the flashing file and the flashing session to generate a first container object.
[0090] S120: Based on the flash file, determine a target flash session by searching in a first container object, where the first container object includes a correspondence between the flash file and the flash session.
[0091] In some embodiments, the correspondence between the flash file and the flash session may be a correspondence between a flash file keyword and the flash session. Specifically, the flash file keyword may be a wildcard corresponding to the flash file defined in a diagnostic file, such as an ODX file.
[0092] In some embodiments, the first container object may be a map type container. Specifically, the first container object may be a multimap type container.
[0093] In some specific examples, the keyword of the flash file is used as the key of the first container object, and the pointer to the session is used as the value of the first container object.<string,otxFlashSession*> mmFlashFileKeyWord2Session.
[0094] In some embodiments, the first container object may be generated by a flash device, or may be obtained from an online server, or may be obtained from a third-party device. The third-party device may be an online connection device provided by a service provider that provides the first container, or may be a storage device that is used to store the first container object. For a specific method of generating the first container, reference may be made to the following embodiments.
[0095] In some embodiments, based on the flash file, searching in the first container object to determine the target flash session may be based on a keyword in the flash file file name, searching in the first container to determine the target flash session. Specifically, the keyword may be a flash file wildcard.
[0096] For example, the file name of a flash file is "123ASW0123.bin", and the first container object contains the correspondence between the keyword (wildcard) and the flash session. The flash file is used to search for the keyword matching the file name in the container object, and the match "*ASW0*.*" is found. The flash session corresponding to this wildcard is the flash session corresponding to the flash file "123ASW0123.bin".
[0097] S130: Create a flashing job based on the target flashing session.
[0098] In some embodiments, a flashing job is also called a Job, which is a macro or a command combination for executing a flashing task. The flashing device creates a flashing job according to the flashing session description list and flashes the target ECU.
[0099] In a specific example, loop through the flash session description, obtain the specific flash session of each ECU, and create a flash job. Specifically, flash the driver first, then flash the application. According to the ODX file sorting, the order is: pre-flash, flash, post-write Job.
[0100] S140, executing the flashing operation to flash data to the target ECU.
[0101] In some embodiments, the flash file contains flash data and description information of the flash file. The flash device extracts the flash data contained in the flash file by parsing the description information of the flash file. The flash device flashes the flash data to the target ECU according to the process of the Job.
[0102] In some specific examples, the flashing operation is executed to flash data to the target ECU, including: for each flashing file of the target ECU, parsing the flashing file to obtain the flashing data; and flashing the flashing data in segments according to the storage address of the target ECU in order from high to low.
[0103] Target ECU <ecu-mem>In the object <phys-mems>The node contains <phys-segment>Node, used to describe the address arrangement of the ECU physical memory, for example, the physical starting addresses of the actual FlashDriver segment, Code segment, DataA segment, and DataB segment of the ECU memory.
[0104] When flashing, the flashing device is based on <phys-segment>The description of the node, flashes the flash data in segments in the order from high to low storage addresses of the target ECU.
[0105] When flashing the ECU of some vehicles, flashing failures may occur. After studying and analyzing the reasons for the failures, the applicant of this application found that the reason for these ECU flashing failures is that the order of writing the ECU flashing data is not controlled. Therefore, in response to this problem, this application adds a sequential control process for ECU flashing data, thereby improving the flashing success rate.
[0106] It should be understood that the applicant of this application has found that the reason for the long waiting time is that the user needs to create a Job when selecting the target ECU to start flashing. Each flashing session corresponds to a Job and also corresponds to a flashing file. When creating each flashing Job, it is necessary to find the corresponding path according to the flashing file to obtain a matching flashing session. Each time an ECU is flashed, it is necessary to repeat this search and matching process. Repeated searches in the ODX file result in a long waiting time for the user.
[0107] Therefore, in the embodiment of the present application, the correspondence between the flash file and the flash session is saved in the first container object in advance. In this way, the target flash session corresponding to the flash is retrieved in the first container object, because the first container object contains the correspondence between the flash file and the flash session; the retrieval speed of using the container object for retrieval is higher than that of searching the target flash session corresponding to the flash file in the diagnostic data packet, which shortens the waiting time for creating the flash job, improves the response speed, and enhances the user experience.
[0108] It should also be understood that using a map as the first container, using the keyword of the flash file as the key of the first container object, and the pointer to the session as the value of the first container object. Since the map search uses a balanced binary tree search, its search speed will be further improved.
[0109] It is also understandable that using a multimap type container, since it can use repeated key values, it can be applied in scenarios where keywords, such as wildcards, will be repeated.
[0110] In the above Figure 2 Based on the embodiment of the ECU flashing method shown, the first container object is obtained through the following steps S310 to S330, such as Figure 3 As shown, including:
[0111] S310, obtaining a target data packet.
[0112] In some embodiments, the target data packet may be data exchange data containing a description of a flashing session of the ECU, such as XML data, JSON data, etc. Specifically, it may be diagnostic data based on the ODX protocol.
[0113] In some embodiments, obtaining the target data packet may be obtaining a diagnostic data packet from an online server, where the diagnostic data packet is a file packet including a vehicle diagnostic data file, and the vehicle diagnostic data file may be a vehicle diagnostic data description file of the ODX protocol.
[0114] In some specific examples, the diagnostic data package may be a PDX file package including one or more ODX files.
[0115] S320, parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU.
[0116] In some embodiments, the correspondence between the flashing files and flashing sessions of each ECU is obtained, including: for each flashing session of each ECU, parsing the short name reference relationship of the flashing session, and determining the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
[0117] A flash data node is defined for ECU in ODX data for transmission between development, factory and customer. <ecu-mem> 。
[0118] <ecu-mem>Aggregates 2 main sub-nodes: <mems>and <phys-mems> 。
[0119] <mem>Three more child nodes are aggregated: <sessions> , <datablocks>and <flashdatas> 。
[0120] <mem>The correspondence between the three child nodes is as follows: each Session is a flash session, a Session will index one or more data blocks (DataBlocks), a DataBlock will index a flash data (FlashData), where the FlashData object contains wildcards for the flash file.
[0121] Parse the diagnostic data packet, through the above <ecu-mem>The index (reference) relationship between nodes can obtain the wildcard corresponding to the target session of the target ECU. Since the wildcard is the matching condition of the flash file, establishing the corresponding relationship between the flash session and the wildcard is equivalent to establishing the corresponding relationship between the flash session and the flash file.
[0122] S330: Generate the first container object based on the corresponding relationship.
[0123] In some embodiments, the first container object may be a map type container. Specifically, the first container object may be a multimap type container.
[0124] In some specific examples, generating the first container object based on the corresponding relationship includes: using a map as the first container, using a keyword of the flash file as a key of the first container object, and using a pointer to the session as a value of the first container object.
[0125] It should be pointed out that the implementation Figure 3 The execution subject of each step of the embodiment is shown, which can be the above-mentioned flash writing device, the above-mentioned online server, or a third-party device. The third-party device can be an online connection device provided by the service provider providing the first container, or a storage device used to store the first container object.
[0126] In some embodiments, executing Figure 3 It is shown that the execution subject of each step of the embodiment is the above-mentioned flash writing device.
[0127] In the flash device, two classes, ECU and ECU-MEM, are defined, and a multimap is defined in each class.<string,otxFlashSession*> mmFlashFileKeyWord2Session container object. The ECU-MEM class is used to parse ODX data, and the ECU class is used to perform flash operations on the ECU.
[0128] In the diagnostic data parsing phase, the flash file referenced in the flash session and its associated flash block is directly fuzzily matched with keywords, which are wildcards, and an association is established and stored in the multimap container object of ECU-MEM.
[0129] After parsing the ECU diagnostic data, the multimap container object in the ECU-MEM object is transferred to the multimap container object in the ECU object. Specifically, in response to the user selecting the target ECU operation, the multimap container object in the ECU-MEM object can be transferred to the multimap container object in the ECU object, and the multimap container object in the ECU object can be destroyed after flashing the target ECU, so as to isolate the user data from the underlying data.
[0130] In some embodiments, executing Figure 3 It is shown that the execution subject of each step of the embodiment is the above-mentioned online server or third-party device. In this case, the flashing device obtains the flashing file package online and also obtains the first container object from the online server or third-party device. When using the first container object, the first container object can also be transferred to the multimap container object in the ECU object, and the multimap container object in the ECU object is destroyed after flashing the target ECU, so as to isolate the user data from the underlying data.
[0131] The embodiment of the present application provides a data processing device, which may be the above-mentioned flash writing device, or the above-mentioned online server, or a third-party device. The third-party device may be a computer with data processing function. Figure 4 The data processing method provided in the embodiment of the present application is shown, which is applied to the above-mentioned data processing device and can be implemented by the software and / or hardware of the data processing device. Figure 4 As shown, the method includes step S410. The specific implementation principles of each step are as follows:
[0132] S410, generating a target container object based on a target data packet; the target container object includes a correspondence between a flash file and a flash session; the target container object is used to determine a target flash session corresponding to the flash file of the target ECU; the target flash session is used to create a flash job to flash data to the target ECU.
[0133] In some embodiments, generating a target container object based on a target data packet includes obtaining a target data packet; parsing the target data packet to obtain a corresponding relationship between a flash file and a flash session of each ECU; and generating the target container object based on the corresponding relationship.
[0134] In some embodiments, the correspondence between the flashing files and flashing sessions of each ECU is obtained, including: for each flashing session of each ECU, parsing the short name reference relationship of the flashing session, and determining the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
[0135] Figure 4 The specific implementation of the embodiment shown can refer to the above Figure 3 The embodiment shown.
[0136] It is understandable that the above examples can be logically combined and increased or decreased. As an example rather than a limitation, the present application provides a specific example to better understand the implementation of the embodiments of the present application.
[0137] like Figure 5 As shown:
[0138] The first step is to expand the ODX data types in the ECU and ECU-MEM classes and define multimap container objects in the two classes respectively.
[0139] The second step is to connect to the car manufacturer's server and obtain the PDX file package and flash file package provided by the car manufacturer online.
[0140] The third step is to parse the PDX file package and obtain the ECU list.
[0141] The fourth step is to parse and flash the diagnostic data.
[0142] Step 5: Associate the flash file fuzzy matching keyword with the flash session and store it in the multimap container object of ECU-MEM. The flash file fuzzy matching keyword is the flash file wildcard.
[0143] In the sixth step, the multimap container object of ECU-MEM is transferred to the multimap container object of ECU object.
[0144] The seventh step is to extract the keywords, i.e. wildcards, of the ECU flash file obtained online.
[0145] Step 8: Retrieve the flash session corresponding to the flash file from the multimap container object.
[0146] Step 9: Create a flash job for the flash session.
[0147] The tenth step is to execute the flashing operation and parse the flashing file to obtain the flashing data.
[0148] Step 11: Segment the flash data according to the storage address of the target ECU from high to low.
[0149] In the twelfth step, flash the selected ECU file by file.
[0150] It should be understood that when parsing the flash diagnostic data, the fuzzy matching keywords of the flash file are associated with the flash session and stored in the multimap container object of ECU-MEM. When creating a flash job for the flash session, it is not necessary to search for the flash session corresponding to the fuzzy matching keywords of the flash file in the ODX file containing the diagnostic data. Instead, the corresponding flash session can be quickly matched in the multimap container object of the ECU object, thereby improving the response speed and user experience.
[0151] Corresponding to the above Figure 2 The ECU flashing method shown is: Figure 6 The figure shows an ECU flashing device M100 provided in an embodiment of the present application, comprising:
[0152] The flash file acquisition module M110 is used to acquire the flash file of the target ECU, where the target ECU is the ECU to be flashed;
[0153] A target flash session determination module M120 is used to determine a target flash session based on the flash file by searching in a first container object, where the first container object contains a correspondence between the flash file and the flash session;
[0154] A flash job creation module M130, configured to create a flash job based on the target flash session;
[0155] The ECU flashing module M140 is used to execute the flashing operation and flash the data of the target ECU.
[0156] Optionally, the correspondence between the flash file and the flash session is the correspondence between the keyword of the flash file and the flash session;
[0157] The target flash session determination module includes:
[0158] A keyword extraction module, used to extract keywords of the flash file;
[0159] A retrieval module is used to perform a search based on the keyword and use the first container to determine the target flash session.
[0160] Optionally, the ECU flashing device is obtained through the following modules:
[0161] A target data packet acquisition module is used to acquire a target data packet;
[0162] A corresponding relationship acquisition module, used for parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU;
[0163] The first container object generating module is configured to generate the first container object based on the corresponding relationship.
[0164] Optionally, the corresponding relationship acquisition module is specifically used to: for each flashing session of each ECU, parse the short name reference relationship of the flashing session to determine the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
[0165] Optional, ECU flashing module, including:
[0166] A flashing data acquisition module, for parsing each flashing file of the target ECU to obtain flashing data;
[0167] The segmented flashing module is used to flash the flashing data in segments according to the storage address of the target ECU in descending order.
[0168] It can be understood that the various implementation modes and implementation combinations in the above embodiments and their beneficial effects are also applicable to this embodiment and will not be described in detail here.
[0169] Corresponding to the above Figure 4 The data processing method shown, Figure 7 The figure shows a data processing device M200 provided in an embodiment of the present application, including:
[0170] The target container object generation module M210 is used to generate a target container object based on a target data packet; the target container object contains the correspondence between the flash file and the flash session; the target container object is used to determine the target flash session corresponding to the flash file of the target ECU; the target flash session is used to create a flash job to flash data to the target ECU.
[0171] It can be understood that the various implementation modes and implementation combinations in the above embodiments and their beneficial effects are also applicable to this embodiment and will not be described in detail here.
[0172] Figure 8 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. The electronic device is used to implement the flash writing device in the above example, or the data processing device in the above example. Figure 8 As shown, the electronic device D10 of this embodiment includes: at least one processor D100 ( Figure 8 Only one processor, a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100 are shown in the figure. When the processor D100 executes the computer program D102, the steps in any of the above-mentioned method embodiments are implemented.
[0173] In some embodiments, when the processor D100 executes the computer program D102, the following steps are implemented: obtaining a flash file of a target ECU, where the target ECU is the ECU to be flashed; based on the flash file, searching in a first container object to determine a target flash session, where the first container object contains a correspondence between a flash file and a flash session; creating a flash job based on the target flash session; and executing the flash job to flash data to the target ECU.
[0174] Optionally, the correspondence between the flash file and the flash session is the correspondence between the keyword of the flash file and the flash session; when the processor D100 executes the computer program D102, it implements the method of searching in the first container object based on the flash file to determine the target flash session, specifically implementing: extracting the keyword of the flash file; based on the keyword, searching using the first container to determine the target flash session.
[0175] Optionally, when the processor D100 executes the computer program D102, the step of obtaining the first container object is implemented, specifically including: obtaining a target data packet; parsing the target data packet to obtain the correspondence between the flashing file and the flashing session of each ECU; and generating the first container object based on the correspondence.
[0176] Optionally, when the processor D100 executes the computer program D102, it implements the step of obtaining the correspondence between the flashing files and the flashing sessions of each ECU, and specifically implements the following steps: for each flashing session of each ECU, the short name reference relationship of the flashing session is parsed, and the keyword corresponding to the flashing session is determined; the keyword has a one-to-one correspondence with the flashing file.
[0177] Optionally, when the processor D100 executes the computer program D102, it implements the flashing operation and the step of flashing data to the target ECU, and specifically implements the following steps: for each flashing file of the target ECU, parsing the flashing file to obtain the flashing data; and flashing the flashing data in segments according to the order of the storage addresses of the target ECU from high to low.
[0178] In some embodiments, when the processor D100 executes the computer program D102, the following steps are implemented:
[0179] A target container object is generated based on a target data packet; the target container object contains a correspondence between a flash file and a flash session; the target container object is used to determine a target flash session corresponding to the flash file of a target ECU; the target flash session is used to create a flash job to flash data to the target ECU.
[0180] The electronic device D10 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor D100 and a memory D101. Those skilled in the art will appreciate that Figure 8 This is only an example of the electronic device D10 and does not constitute a limitation on the electronic device D10. The electronic device D10 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0181] The processor D100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0182] In some embodiments, the memory D101 may be an internal storage unit of the electronic device D10, such as a hard disk or memory of the electronic device D10. In other embodiments, the memory D101 may also be an external storage device of the electronic device D10, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device D10. Further, the memory D101 may also include both an internal storage unit of the electronic device D10 and an external storage device. The memory D101 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory D101 may also be used to temporarily store data that has been output or is to be output.
[0183] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0184] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0185] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0186] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0187] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0188] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0189] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0190] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0191] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0192] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application. < / mem> < / flashdatas> < / datablocks> < / sessions> < / mem> < / phys-mems> < / mems> < / ecu-mem>
Claims
1. A method for flashing an ECU, characterized in that: include: Obtain a flash file of a target ECU, where the target ECU is the ECU to be flashed; Based on the flash file, a target flash session is determined by searching in a first container object, wherein the first container object includes a correspondence between the flash file and the flash session; Creating a flash job based on the target flash session; Executing the flashing operation to flash data on the target ECU includes: parsing each flashing file of the target ECU to obtain flashing data; flashing the flashing data in segments according to the order of storage addresses of the target ECU from high to low; wherein the flashing file contains the flashing data and description information of the flashing file; The first container object is obtained by the following steps: Get the target data packet; Parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU; generating the first container object based on the corresponding relationship; Get the corresponding relationship between the flash files and flash sessions of each ECU, including: For each flashing session of each ECU, the short name reference relationship of the flashing session is parsed to determine the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
2. The method according to claim 1, characterized in that The correspondence between the flash file and the flash session is the correspondence between the keywords of the flash file and the flash session; The step of searching the first container object based on the flash file to determine the target flash session includes: Extracting keywords of the flash file; Based on the keyword, the first container is used for searching to determine the target flash session.
3. A method for data processing, characterized in that: The method comprises: Generate a target container object based on a target data packet; the target container object includes a correspondence between a flash file and a flash session; the target container object is used to determine a target flash session corresponding to a flash file of a target ECU; the target flash session is used to create a flash job to flash data to the target ECU, including: for each flash file of the target ECU, parse the flash file to obtain flash data; flash the flash data in segments according to the order of the storage address of the target ECU from high to low; wherein the flash file includes the flash data and description information of the flash file; The target container object is obtained by the following steps: Get the target data packet; Parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU; generating the target container object based on the corresponding relationship; The obtaining of the corresponding relationship between the flashing files and the flashing sessions of each ECU includes: For each flashing session of each ECU, the short name reference relationship of the flashing session is parsed to determine the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
4. A device for flashing an ECU, characterized in that: include: A flash file acquisition module is used to acquire a flash file of a target ECU, where the target ECU is the ECU to be flashed; a target flash session determination module, configured to determine a target flash session based on the flash file by searching in a first container object, wherein the first container object includes a correspondence between the flash file and the flash session; A flash job creation module, configured to create a flash job based on the target flash session; An ECU flashing module, used to execute the flashing operation and flash data to the target ECU; The ECU flashing module comprises: A flashing data acquisition module, for parsing each flashing file of the target ECU to obtain flashing data; A segmented flashing module, used to flash the flashing data in segments according to the storage address of the target ECU in descending order; wherein the flashing file contains the flashing data and description information of the flashing file; The first container object is obtained by the following steps: Get the target data packet; Parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU; generating the first container object based on the corresponding relationship; Get the corresponding relationship between the flash files and flash sessions of each ECU, including: For each flashing session of each ECU, the short name reference relationship of the flashing session is parsed to determine the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
5. A data processing device, characterized in that: include: A target container object generation module, used to generate a target container object based on a target data packet; the target container object includes a corresponding relationship between a flash file and a flash session; The target container object is used to determine the target flashing session corresponding to the flashing file of the target ECU; The target flash session is used to create a flash job and flash data to the target ECU, including: parsing each flash file of the target ECU to obtain flash data; flashing the flash data in segments according to the order of storage addresses of the target ECU from high to low; wherein the flash file contains the flash data and description information of the flash file; The target container object is obtained by the following steps: Get the target data packet; Parsing the target data packet to obtain the corresponding relationship between the flashing file and the flashing session of each ECU; generating the target container object based on the corresponding relationship; The obtaining of the corresponding relationship between the flashing files and the flashing sessions of each ECU includes: For each flashing session of each ECU, the short name reference relationship of the flashing session is parsed to determine the keyword corresponding to the flashing session; the keyword has a one-to-one correspondence with the flashing file.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
