Flash file generation method and device, equipment and storage medium

By obtaining application layer code to generate compilation files and further generating flash files, the problem of low software update efficiency in existing technologies is solved, and efficient software updates are achieved.

CN115934134BActive Publication Date: 2026-06-26ZHEJIANG GEELY HLDG GRP CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG GEELY HLDG GRP CO LTD
Filing Date
2022-12-28
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, the files generated by the bootloader based on the UDS protocol cannot be directly used for automotive software updates, resulting in low software update efficiency.

Method used

By obtaining the application layer code of the software to be updated, the first script is controlled to generate a compilation file, and the second script is controlled to generate a flash file for the host computer to perform the update.

Benefits of technology

It simplifies the process of generating flash files and improves software update efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934134B_ABST
    Figure CN115934134B_ABST
Patent Text Reader

Abstract

The application discloses a flashing file generation method and device, equipment and a storage medium, and belongs to the computer technical field. The application obtains application layer code corresponding to to-be-updated software, controls first script running, generates a compilation file based on the application layer code, controls second script running, generates a flashing file based on the compilation file, and enables an upper computer to update the to-be-updated software based on the flashing file. Therefore, the application completes the compilation of the to-be-updated software through the first script, and on this basis, the flashing file which can be directly applied to the to-be-updated software update is obtained through the second script, the process of generating the flashing file is simplified, and the software updating efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for generating and writing files. Background Technology

[0002] With the development of new energy vehicle technology in China, the development of automotive controllers is accelerating, and the changes are becoming increasingly frequent. Electronic control software and calibration are being updated more and more often, resulting in a growing proportion of time spent on code generation. Bootloaders based on the UDS protocol (which use UDS protocol services to update application software and application data (including network configuration data and calibration data)) are currently the mainstream method for updating automotive software in the industry. However, files directly generated by the software compilation environment cannot be used directly for software updates; they require further processing before application, leading to low software update efficiency.

[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of this application is to provide a method, apparatus, device and storage medium for generating flash files, aiming to solve the technical problem of low software update efficiency.

[0005] To achieve the above objectives, this application provides a method for generating a flash file, comprising the following steps:

[0006] Obtain the application layer code corresponding to the software to be updated;

[0007] Control the execution of the first script to generate a compiled file based on the application layer code;

[0008] The second script is controlled to run and generate a flash file based on the compiled file, so that the host computer can update the software to be updated based on the flash file.

[0009] Optionally, the step of controlling the execution of the second script to generate a flash file based on the compiled file includes:

[0010] Control the second script to start, generating the first and second folders;

[0011] Obtain the a2l format file associated with the application layer code and store it in the first folder;

[0012] Obtain the compiled file and store it in the first folder in hex, elf, map, and mdf formats;

[0013] The CRC script and a2l script in the second script are invoked to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc and a2l formats based on the files stored in the first folder;

[0014] Move the compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, a2l, and map formats to the second folder, and clear all process files to generate a flashing file for the vflash flashing device or diagnostic flashing device.

[0015] Optionally, the step of calling the CRC script and the a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l formats based on the files stored in the first folder includes:

[0016] The CRC script in the second script is invoked to generate vFlash.hex, vFlash.crc, Calo.hex, and Calo.crc format compilation files based on the a2l format files, hex format compilation files, and mdf format compilation files stored in the first folder;

[0017] The a2l script in the second script is invoked to generate an a2l format compilation file based on the ELF format compilation file stored in the first folder.

[0018] Optionally, after the step of calling the CRC script and a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l formats based on the files stored in the first folder, the method further includes:

[0019] The Hexview script is controlled to run and generate a flashing file for the INCA flashing device based on the compiled files in Calo.hex and vFlash.hex formats.

[0020] Optionally, the step of controlling the execution of the first script and generating a compiled file based on the application layer code includes:

[0021] With the application layer code complete, the first script is controlled to run, and a compiled file is generated based on the application layer code.

[0022] Optionally, the compiled file and the flashing file are both stored in their respective directories after they are generated.

[0023] Optionally, both the first script and the second script are written in Python.

[0024] Furthermore, to achieve the above objectives, this application also provides a file generation apparatus for flashing, the apparatus comprising:

[0025] The acquisition module is used to acquire the application layer code corresponding to the software to be updated;

[0026] The compilation module is used to control the execution of the first script and generate compiled files based on the application layer code;

[0027] The flash file generation module is used to control the execution of the second script and generate a flash file based on the compiled file, so that the host computer can update the software to be updated based on the flash file.

[0028] In addition, to achieve the above objectives, this application also provides a file flashing generation device, the device comprising: a memory, a processor, and a file flashing generation program stored in the memory and executable on the processor, the file flashing generation program being configured to implement the steps of the file flashing generation method as described above.

[0029] In addition, to achieve the above objectives, this application also provides a storage medium storing a file flashing generation program, which, when executed by a processor, implements the steps of the file flashing generation method described above.

[0030] This application discloses a method, apparatus, device, and storage medium for generating flash files. Compared to existing technologies where files directly generated by the software compilation environment cannot be directly used for software updates and require further processing, resulting in low update efficiency, this application obtains the application-layer code corresponding to the software to be updated; controls the execution of a first script to generate a compiled file based on the application-layer code; and controls the execution of a second script to generate a flash file based on the compiled file, allowing a host computer to update the software based on the flash file. Therefore, this application completes the compilation of the software to be updated through a first script, and then obtains a flash file that can be directly applied to the software update through a second script, simplifying the flash file generation process and thus improving software update efficiency. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0032] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a flowchart illustrating the first embodiment of the file generation method of this application;

[0034] Figure 2 This is a diagram illustrating the application environment of the file generation method described in this application.

[0035] Figure 3 for Figure 1 A detailed flowchart of step S30;

[0036] Figure 4 This is a schematic diagram of the functional modules of the first embodiment of the file generation device of this application;

[0037] Figure 5 This is a schematic diagram of the structure of the flashing file generation device for the hardware operating environment involved in the embodiments of this application.

[0038] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0039] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0040] This application provides a method for generating a flash file, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the file generation method of this application.

[0041] In this embodiment, the method for generating the flash file includes:

[0042] Step S10: Obtain the application layer code corresponding to the software to be updated;

[0043] Step S20: Control the execution of the first script to generate a compiled file based on the application layer code;

[0044] Step S30: Control the second script to run, and generate a flash file based on the compiled file, so that the host computer can update the software to be updated based on the flash file.

[0045] It should be noted that the flash file generation method of this embodiment can be applied to, for example, Figure 2In the application environment shown, server 110 generates the flashing file corresponding to the software to be updated in vehicle control unit (VCU) 130. Flashing device 120 retrieves the flashing file from server 110 (copying the flashing file), then connects flashing device 120 to vehicle control unit 130 to update the software. Vehicle control unit 130 can be any vehicle's vehicle control unit, and server 110 can be a standalone server or a server cluster consisting of multiple servers 110.

[0046] Compared to existing technologies where files directly generated by the software compilation environment cannot be directly used for software updates and require further processing, resulting in low update efficiency, this embodiment obtains the application layer code corresponding to the software to be updated; controls the execution of a first script to generate a compiled file based on the application layer code; and controls the execution of a second script to generate a flash file based on the compiled file, allowing the host computer to update the software to be updated based on the flash file. Therefore, this embodiment completes the compilation of the software to be updated through the first script, and then obtains a flash file that can be directly applied to the software update through the second script, simplifying the flash file generation process and thus improving software update efficiency.

[0047] The specific steps are as follows:

[0048] Step S10: Obtain the application layer code corresponding to the software to be updated.

[0049] In this embodiment, the application layer code corresponding to the software to be updated is the updated application source code used to replace the application part of the original version.

[0050] In this embodiment, the server may have only one set of first script and second script, or it may have multiple sets of first script and second script.

[0051] When the server has only one set of first script and second script, after obtaining the application layer code corresponding to the software to be updated, it can be stored in the first script directory. The first script can then compile the application layer code sequentially according to its storage location or storage time in the first script directory. Alternatively, after obtaining the application layer code corresponding to the software to be updated, it can be stored in the first script directory. Once all the application layer codes corresponding to the software to be updated are stored in the first script directory (since the vehicle controller has multiple application software, and multiple application software needs to be updated simultaneously), the first script can integrate and compile the application layer code in the first script directory. This speeds up the compilation of the application layer code and reduces the probability of errors during the compilation process.

[0052] When the server has multiple sets of first scripts and second scripts, the application layer code corresponding to the software to be updated can be obtained and stored in the corresponding first script directory based on the association between the first script and the type of software to be updated. This allows the first script in that first script directory to compile the application layer code. Alternatively, based on the current running status of the first scripts in each first script directory, the application layer code corresponding to the software to be updated can be obtained and stored in the first script directory corresponding to the first script that is not currently running, or the first script directory corresponding to the first script with the shortest remaining running process. This allows the first script in that first script directory to compile the application layer code, thereby speeding up the compilation of the application layer code.

[0053] Step S20: Control the execution of the first script to generate a compiled file based on the application layer code.

[0054] As an example, after obtaining the application layer code corresponding to the software to be updated, step S10 stores the application layer code in the first script directory.

[0055] Once application-layer code is stored in the first script directory, the first script is controlled to run. Based on the storage location or storage time of the application-layer code in the first script directory, the application-layer code is compiled sequentially to generate a compiled file. If the first script is not running, this embodiment can use the storage action of storing application-layer code in the first script directory as a start signal; that is, when an application-layer code storage action occurs in the first script directory, the first script is controlled to start.

[0056] Once all the application layer code corresponding to the software to be updated is stored in the first script directory, the first script is controlled to compile the application layer code in the first script directory, thereby speeding up the compilation of the application layer code and reducing the probability of errors in the compilation process.

[0057] As an example, before controlling the execution of the first script, the application-layer code in the first script directory needs to be checked. If the application-layer code is complete, the first script is executed, the code is coded, and a compiled file is generated. Conversely, if the application-layer code is incomplete, the first script is not executed, and a report notification indicating incomplete application-layer code is generated to inform the user. This can be achieved by setting a start marker at the beginning of the application-layer code and an end marker at the end. During the check, if either the start or end marker is missing, or both are absent, the application-layer code is incomplete; conversely, if both the start and end markers are present, the application-layer code is complete.

[0058] As an example, after the compiled files are generated, they will be automatically stored in the compiled file directory to prevent them from being lost.

[0059] As an example, the names of the compiled files all include the project directory name of the software to be updated.

[0060] Step S30: Control the second script to run, and generate a flash file based on the compiled file, so that the host computer can update the software to be updated based on the flash file.

[0061] In this embodiment, the host computer is the vehicle controller.

[0062] Reference Figure 3 , Figure 3 for Figure 1 A detailed flowchart of step S30.

[0063] As an example, the steps of controlling the execution of the second script to generate a flash file based on the compiled file specifically include:

[0064] Step S301: Control the second script to start and generate the first folder and the second folder.

[0065] In this embodiment, the first folder is named "Project Directory Name_SrcFiles", and the second folder is named "Project Directory Name_FlsFiles". Each software to be updated represents a project, and each software has its corresponding project directory name.

[0066] Step S302: Obtain the a2l format file associated with the application layer code and store it in the first folder.

[0067] In this embodiment, the a2l format file associated with the application layer code is copied from the portion of the application layer code stored in the first script directory. The a2l format files associated with the application layer code include, but are not limited to: vcu_arch.a2l, BSW_Interface.a2l, and THCU.a2l.

[0068] Step S303: Obtain the compiled file and store the compiled file in the first folder in hex, elf, map and mdf formats.

[0069] In this embodiment, obtaining the compiled files involves copying the compiled files from the compiled file directory and storing the copied compiled files in hex, elf, map, and mdf formats in the first folder. Specifically, the compiled files in hex, elf, map, and mdf formats are TestSuit.hex, TestSuit.elf, TestSuit.map, and TestSuit.mdf, respectively.

[0070] Step S304: Call the CRC script and a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc and a2l formats based on the files stored in the first folder.

[0071] As an example, the steps of calling the CRC script and a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l formats based on the files stored in the first folder specifically include:

[0072] The CRC script in the second script is invoked to generate vFlash.hex, vFlash.crc, Calo.hex, and Calo.crc format compilation files based on the a2l format files, hex format compilation files, and mdf format compilation files stored in the first folder;

[0073] The a2l script in the second script is invoked to generate an a2l format compilation file based on the ELF format compilation file stored in the first folder.

[0074] In this embodiment, in order to distinguish the compiled files of different software to be updated, after generating compiled files in the formats of vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l, the compiled files of the above formats are renamed so that the file names of the compiled files of the above formats are: project directory name_vFlash.hex, project directory name_vFlash.crc, project directory name_Calo.hex, project directory name_Calo.crc, and project directory name.a2l.

[0075] In this embodiment, while renaming the compiled file in the above format, the compiled file TestSuit.map in step S303 is also renamed to the project directory name map.

[0076] Step S305: Move the compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, a2l, and map formats to the second folder, and clear all process files to generate a flashing file for the vflash flashing device or diagnostic flashing device.

[0077] In this embodiment, the compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l formats, as well as the compiled file in map format, are moved to the second folder, and all process files are cleared. At this point, the second script finishes running, generating a flashing file. This flashing file is suitable for vflash flashing devices or diagnostic flashing devices. That is, the vflash flashing device or diagnostic flashing device obtains the aforementioned flashing file from the server, and then connects the vflash flashing device or diagnostic flashing device to the vehicle controller to update the software to be updated on the vehicle controller.

[0078] Furthermore, after the step of calling the CRC script and a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l formats based on the files stored in the first folder, the method further includes:

[0079] Step S306: Control the Hexview script to run and generate a flashing file for the INCA flashing device based on the compiled files in Calo.hex and vFlash.hex formats.

[0080] In this embodiment, the flashing file generated in step S305 is only applicable to vflash flashing devices or diagnostic flashing devices. However, flashing devices are not limited to vflash flashing devices or diagnostic flashing devices, but also include INCA flashing devices. Therefore, in order to expand the application scope of the flashing file provided in this embodiment, this embodiment also controls the Hexview script to run, and generates a flashing file suitable for INCA flashing devices based on the Calo.hex format compilation file and the vFlash.hex format compilation file obtained in step S304. That is, the INCA flashing device obtains the flashing file generated in step S306 from the server, and then connects the INCA flashing device to the vehicle controller to update the software to be updated on the vehicle controller.

[0081] It should be noted that, and it should be understood, although Figure 3The steps are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows, unless explicitly stated otherwise. There is no strict order requirement for the execution of these steps; they can be performed in other orders. Furthermore, Figure 3 At least some steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps. For example, Figure 3 Steps S305 and S306 can be executed in other orders. For example, step S306 can be executed first, followed by step S305; or steps S305 and S306 can be executed at the same time; or, depending on the actual application requirements, only step S305 or only step S306 can be executed.

[0082] Furthermore, in this embodiment, the flash file is stored in the flash file directory after it is generated to prevent the flash file from being lost.

[0083] Furthermore, the first and second scripts used in the file generation method provided in this embodiment are written in a scripting language. These scripting languages ​​include, but are not limited to, sh, bash, csh, ksh, perl, or python. In this embodiment, Python is preferentially chosen as the language for writing the first and second scripts. Using Python in this embodiment allows for effective use of third-party libraries, results in less code, and facilitates later maintenance.

[0084] This application provides a brush file generation device, referring to... Figure 4 , Figure 4 This is a schematic diagram of the functional modules of the first embodiment of the file generation device of this application.

[0085] In this embodiment, the file generation device includes:

[0086] Module 10 is used to obtain the application layer code corresponding to the software to be updated;

[0087] Compilation module 20 is used to control the execution of the first script and generate a compiled file based on the application layer code;

[0088] The flash file generation module 30 is used to control the execution of the second script and generate a flash file based on the compiled file, so that the host computer can update the software to be updated based on the flash file.

[0089] Optionally, the flash file generation module includes:

[0090] The first generation unit is used to control the startup of the second script and generate the first folder and the second folder.

[0091] The first storage unit is used to obtain the a2l format file associated with the application layer code and store it in the first folder;

[0092] The second storage unit is used to obtain the compiled file and store the compiled file in hex, elf, map and mdf formats to the first folder;

[0093] The second generation unit is used to call the CRC script and the a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc and a2l formats based on the files stored in the first folder;

[0094] The third generation unit is used to move the compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, a2l, and map formats to the second folder, clear all process files, and generate a flashing file for the vflash flashing device or diagnostic flashing device.

[0095] Optionally, the second generation unit includes:

[0096] The first generation subunit is used to call the CRC script in the second script to generate vFlash.hex, vFlash.crc, Calo.hex and Calo.crc format compilation files based on the a2l format files, hex format compilation files and mdf format compilation files stored in the first folder;

[0097] The second generation subunit is used to call the a2l script in the second script to generate an a2l format compilation file based on the elf format compilation file stored in the first folder.

[0098] Optionally, the flash file generation module further includes:

[0099] The fourth generation unit is used to control the execution of the Hexview script and generate a flashing file for the INCA flashing device based on the compiled files in Calo.hex format and the compiled files in vFlash.hex format.

[0100] Optionally, the compilation module is specifically used to implement:

[0101] With the application layer code complete, the first script is controlled to run, and a compiled file is generated based on the application layer code.

[0102] Optionally, the file generation device further includes:

[0103] The storage module includes a directory corresponding to the compiled file for storing the generated compiled file; it also includes a directory corresponding to the flash file for storing the generated flash file.

[0104] Optionally, both the first script and the second script are written in Python.

[0105] The implementation principle and beneficial effects of the file generation device shown in the embodiments of this application can be found in the implementation principle and beneficial effects of the file generation method shown in any of the above embodiments, and will not be repeated here.

[0106] Reference Figure 5 , Figure 5 This is a schematic diagram of the device structure for generating flash files for the hardware operating environment involved in the embodiments of this application.

[0107] like Figure 5 As shown, the file generation device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0108] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the device for generating flash files and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0109] like Figure 5 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and a file generation program for flashing.

[0110] exist Figure 5 In the flash file generation device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and memory 1005 in the flash file generation device of this application can be set in the flash file generation device, and the flash file generation device calls the flash file generation program stored in the memory 1005 through the processor 1001 and executes the flash file generation method provided in the above embodiment.

[0111] The specific implementation of the file generation device in this application is basically the same as the embodiments of the file generation method described above, and will not be repeated here.

[0112] This application also provides a storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the above-described file generation method.

[0113] The specific implementation of the storage medium in this application is basically the same as the embodiments of the above-described file generation method, and will not be described again here.

[0114] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. 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 system that includes that element.

[0115] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0116] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0117] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for generating a flash file, characterized in that, The method for generating the flash file includes the following steps: Obtain the application layer code corresponding to the software to be updated; Control the execution of the first script to generate a compiled file based on the application layer code; The second script is controlled to run and generate a flashing file based on the compiled file, so that the host computer can update the software to be updated based on the flashing file; The step of controlling the execution of the second script and generating a flash file based on the compiled file includes: Control the second script to start, generating the first and second folders; Obtain the a2l format file associated with the application layer code and store it in the first folder; Obtain the compiled file and store it in the first folder in hex, elf, map, and mdf formats; The CRC script and a2l script in the second script are invoked to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc and a2l formats based on the files stored in the first folder; Move the compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, a2l, and map formats to the second folder, and clear all process files to generate a flashing file for the vflash flashing device or diagnostic flashing device. After the step of calling the CRC script and a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc and a2l formats based on the files stored in the first folder, the method further includes: The Hexview script is controlled to run and generate a flashing file for the INCA flashing device based on the compiled files in Calo.hex and vFlash.hex formats.

2. The method for generating a flash file as described in claim 1, characterized in that, The step of calling the CRC script and a2l script in the second script to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l formats based on the files stored in the first folder includes: The CRC script in the second script is invoked to generate vFlash.hex, vFlash.crc, Calo.hex, and Calo.crc format compilation files based on the a2l format files, hex format compilation files, and mdf format compilation files stored in the first folder; The a2l script in the second script is invoked to generate an a2l format compilation file based on the ELF format compilation file stored in the first folder.

3. The method for generating a flash file as described in claim 1, characterized in that, The step of controlling the execution of the first script and generating a compiled file based on the application layer code includes: With the application layer code complete, the first script is controlled to run, and a compiled file is generated based on the application layer code.

4. The method for generating a flash file as described in claim 1, characterized in that, After being generated, the compiled file and the flashing file are both stored in their respective directories.

5. The method for generating a flash file as described in claim 1, characterized in that, Both the first script and the second script were written in Python.

6. A file generation device for writing and flashing, characterized in that, The device includes: The acquisition module is used to acquire the application layer code corresponding to the software to be updated; The compilation module is used to control the execution of the first script and generate compiled files based on the application layer code; The flash file generation module is used to control the execution of the second script and generate a flash file based on the compiled file, so that the host computer can update the software to be updated based on the flash file; The file generation module is also used to control the startup of the second script to generate the first folder and the second folder; Obtain the a2l format file associated with the application layer code and store it in the first folder; Obtain the compiled file and store it in the first folder in hex, elf, map, and mdf formats; The CRC script and a2l script in the second script are invoked to generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc and a2l formats based on the files stored in the first folder; Move the compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, a2l, and map formats to the second folder, and clear all process files to generate a flashing file for the vflash flashing device or diagnostic flashing device. The file generation module is further configured to call the CRC script and the a2l script in the second script, and generate compiled files in vFlash.hex, vFlash.crc, Calo.hex, Calo.crc, and a2l formats based on the files stored in the first folder. The Hexview script is controlled to run and generate a flashing file for the INCA flashing device based on the compiled files in Calo.hex and vFlash.hex formats.

7. A file generation device for flashing and writing, characterized in that, The device includes: a memory, a processor, and a flash file generation program stored in the memory and executable on the processor, the flash file generation program being configured to implement the steps of the flash file generation method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium stores a file generation program for flashing, which, when executed by a processor, implements the steps of the file generation method for flashing as described in any one of claims 1 to 5.