WO2023066233A1 - Procédé et appareil de mise à jour de programme pour dispositif de commande, et dispositif de commande et support de stockage - Google Patents

Procédé et appareil de mise à jour de programme pour dispositif de commande, et dispositif de commande et support de stockage Download PDF

Info

Publication number
WO2023066233A1
WO2023066233A1 PCT/CN2022/125868 CN2022125868W WO2023066233A1 WO 2023066233 A1 WO2023066233 A1 WO 2023066233A1 CN 2022125868 W CN2022125868 W CN 2022125868W WO 2023066233 A1 WO2023066233 A1 WO 2023066233A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
memory
flashed
space
code
Prior art date
Application number
PCT/CN2022/125868
Other languages
English (en)
Chinese (zh)
Inventor
周添
王宇
张建
李春善
公博健
侯殿龙
Original Assignee
中国第一汽车股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国第一汽车股份有限公司 filed Critical 中国第一汽车股份有限公司
Publication of WO2023066233A1 publication Critical patent/WO2023066233A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Definitions

  • the embodiments of the present application relate to the technical field of automation control, for example, a method, device, controller and storage medium for flashing a program of a controller.
  • Embedded controllers gradually enrich people's daily life, and embedded controllers need to write programs corresponding to functions before performing functions.
  • the embedded development engineer When writing the program into the controller, it is necessary for the embedded development engineer to manually write the program operating parameters such as the start address, code segment, data segment, calibration segment, and memory usage of the program.
  • This kind of controller development mode leads to cumbersome development process.
  • embedded development engineers need to repeatedly determine the operating parameters of the control program, which greatly affects Improve the development efficiency of the controller.
  • the embodiment of the present application provides a controller program flashing method, device, controller and storage medium, so as to realize accurate flashing of the program, reduce the test workload of operating parameters, and improve the stability of the controller operation.
  • An embodiment of the present application provides a method for flashing a program of a controller, the method comprising:
  • An embodiment of the present application provides a program flashing device for a controller, and the device includes:
  • the program receiving module is configured to obtain the program to be flashed according to the preset storage structure
  • a space information module configured to determine the running space occupancy information of the code content of the program to be flashed
  • the program flashing module is configured to write the program to be flashed into the memory space based on the flashing start address and the running space occupation information.
  • An embodiment of the present application provides a controller, and the controller includes:
  • memory configured to store one or more programs
  • the one or more central processors When the one or more programs are executed by the one or more central processors, the one or more central processors implement the program flashing method for the controller as described in the embodiment of the present application.
  • the embodiment of the present application provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a central processing unit, the method for flashing the program of the controller as described in the embodiment of the present application is implemented.
  • Fig. 1 is a flow chart of a program flashing method for a controller provided in Embodiment 1 of the present application;
  • Fig. 2 is a flow chart of a program flashing method for a controller provided in Embodiment 2 of the present application;
  • Fig. 3 is a flow chart of determining the memory usage of a code content provided in Embodiment 2 of the present application;
  • Fig. 4 is an implementation effect diagram of a program flashing method for a controller provided in Embodiment 2 of the present application;
  • FIG. 5 is an example diagram of a program flashing method for a controller provided in Embodiment 2 of the present application.
  • Fig. 6 is a structural block diagram of a program flashing device for a controller provided in Embodiment 3 of the present application;
  • FIG. 7 is a schematic structural diagram of a controller provided in Embodiment 4 of the present application.
  • Fig. 1 is a flow chart of a method for flashing a program of a controller provided in Embodiment 1 of the present application. This embodiment is applicable to the case of flashing a code of a controller.
  • the program flashing device executes, the device can be realized by software and/or hardware, and the device can be configured in the controller.
  • a program flashing method for a controller includes the following steps:
  • the preset storage structure may be a data structure for storing the program to be flashed, and the data structure may store a code segment, a data segment, a calibration segment and a data segment of the interrupt memory size of the flashing program.
  • the embodiment of the present application does not limit the type of stored data.
  • the program to be flashed may be a program to realize the function of the controller, for example, a code to realize the function of updating or deleting the controller, and the embodiment of the present application does not limit the functions realized by the program to be flashed.
  • the preset storage structure may include a code segment, a data segment, a calibration segment, and a data segment of the interrupt memory size.
  • the code of the program to be flashed may be stored in the code segment
  • the global variable can be stored in the data segment
  • the calibration value can be stored in the calibration segment
  • the interrupt data can be stored in the data segment of the interrupt memory size.
  • the code content can be the program text that constitutes the processing logic of the program to be flashed, and can include global variables, calibration quantities, and interrupts.
  • the running space occupation information may reflect the size of the memory space required by the above-mentioned code content when the program is running, and may include the information of the memory stored in the program to be flashed and the memory information occupied by the program when running.
  • the information of the memory stored in the program to be flashed can be determined through the code segment stored in the pre-storage structure, as well as the data segment, calibration segment and interrupt memory size data stored in the pre-storage structure Sections determine the information occupied by global variables, calibration quantities, interrupts, etc. when the program is running.
  • the memory occupied by the global variable at runtime may be 10 bytes. If there are 8 calibration quantities in the code content of the program to be flashed, and the memory size occupied by each calibration quantity at runtime can be up to 2 bytes, then the memory occupied by the calibration quantity of the program to be flashed at runtime The size can be 8*2 bytes, which is 16 bytes.
  • the depth of the interrupt in the code content of the program to be flashed is 2, and the memory size occupied by an interrupt at runtime can be 10 kilobytes (Kbytes, KB), then the interrupt in the code content of the program to be flashed is The memory size occupied by the runtime can be 2*10KB, that is, 20KB.
  • An address can refer to a number that can identify a part of a space.
  • the starting address for flashing may be the starting address for storing the program to be flashed in the memory space, and the starting address for flashing may point to an unoccupied area in the memory space.
  • the running space occupation information may represent information on the memory space used by the program to be flashed, and may include information on the size of the space stored by the program to be flashed and information on the size of the space occupied by the program when it is running.
  • the memory space may be a storage area in the controller, and the memory space may be used to save programs and data when the process is running.
  • the memory space can be an area in the unoccupied memory space or an area in the occupied memory space.
  • the program to be flashed can be written to any location in the memory space, and the size of the memory space is sufficient for the complete and accurate storage of the program to be flashed.
  • the area to be written by the program to be flashed may be the frontmost area of the memory space
  • the start address of the program to be flashed in the memory space may be 0,
  • the end address of the program to be flashed in the memory space may be The sum of 0 and the value of the memory space size corresponding to the running space occupation information of the program to be flashed.
  • the area to be written by the program to be flashed can be the last area of the memory space, and the last area can completely and accurately store the program to be flashed, and the starting address of the program to be flashed in the memory space can be the memory The end address of the space minus the size of the memory space corresponding to the running space occupation information of the program to be flashed.
  • the program to be flashed after determining the running space occupation information of the program to be flashed, the program to be flashed can be written into the memory space from the flashing start address of the program to be flashed, and according to the flashing start address
  • the storage location of the program to be flashed in the memory space can be accurately controlled, the accuracy of the program flashing control can be improved, the space waste of the memory space can be reduced, and the degree of fragmentation of the memory space can be reduced.
  • the running space occupation information of the code content of the program to be flashed is determined, and then based on the flashing start address and the running space occupied information, the The program to be flashed is written into the memory space pointed to by the flashing start address.
  • the program to be flashed is written into the memory space based on the estimated running memory size and starting address of the program to be flashed, which effectively saves memory space and can improve the success rate of program flashing, thereby Improving the stability of the controller operation can reduce the test time for determining the operating parameters of the program to be flashed, and improve the development efficiency of the controller.
  • the method further includes: updating the flashing start address according to the running space occupation information of the program to be flashed.
  • the sum of the values of the initial address of the flashing and the size of the memory space corresponding to the running space occupation information of the program to be flashed can be It is recorded as the flashing end address, and the original flashing start address can be updated with the flashing end address.
  • the end address of flashing can be reduced by 1 as a new start address of flashing, and for a memory stored in little endian, the end address of flashing can be added by 1 as a new start address of flashing.
  • Fig. 2 is a flow chart of a method for flashing a program of a controller provided in Embodiment 2 of the present application, and the embodiment of the present application is described based on the foregoing embodiments.
  • a method for flashing a controller program provided by Embodiment 2 of the present application includes the following steps:
  • S210 call the data structure class to receive and store the code segment, data segment, calibration segment and interrupt data of the program to be flashed.
  • the data structure class can be program processing logic for receiving and storing data according to different data structures, such as get() and set() methods that can be written in a programming language, and can be used to access the properties of the program to be flashed and/or method.
  • the method name of the specific data structure class can be defined by yourself.
  • the code segments may be different logic codes corresponding to the flashing program data structure.
  • the data segment may be a data area required for running the flashed program, and the data segment is composed of global variables in different codes of the flashed program.
  • the calibration section may be a calibration section composed of calibration quantities in different codes of the flashing program. Interruption can mean that during the operation of the computer, when an unexpected situation occurs that requires the intervention of the host, the machine can automatically stop the running program and switch to the program that handles the new situation. After the new situation is processed, it returns to the original suspended program to continue running. Exemplarily, each code has a different execution sequence. When the current code is executed, another code is executed. Then the situation at this time is interrupted for the current code. However, the current code needs to be saved to save the current code. After another code is executed, it can return to continue executing the current code. Then the size of the space required by the interrupt code can be the interrupt data.
  • Different data structures have different data structure classes for pre-flashing.
  • different data structure classes can be called in turn to process the code to be flashed, and obtain and store the code segment of the code to be flashed. , data segment, calibration segment, and interrupt data structures.
  • the data structure class can be flashed in the controller in advance, and the data structure class is called and executed when the program to be flashed is written.
  • Code text may refer to the source code in a program, the processing logic with which the function is performed, and code text may be human-readable text written in a programming language.
  • Global variables are external variables defined outside the function. Global variables can be created by object functions or anywhere in the program. Global variables can be referenced by all objects or functions of the program to be flashed. A scalar can be understood as a constant, and a constant can refer to a quantity that will not be modified by the program when the computer program is running. Interruption can mean that the program to be flashed is running, and the codes of the program to be flashed have different execution sequences. When the current code is executed, another code is executed, so the situation at this time is interrupted for the current code.
  • the code content of the program to be flashed can be extracted, and the code text, global variables, calibration quantities, interrupts and other content in the code content can be extracted. It can be understood that the code content can be read into the register of the controller in advance, and the code content can be read by operating the register.
  • the memory usage can be the memory overhead required to support the storage and operation of flashing programs, and the corresponding memory usage can be estimated for code text, global variables, calibration quantities, and interrupts, and the determined memory usage can be used as a pending Flash the running space occupation information of the program.
  • the code written in a programming language can be used to read the number of meaningful lines of all codes in the program to be flashed, and then calculate the required memory space after conversion into a binary file, and use it as the memory usage of the code text.
  • the number of meaningful lines of all codes in the program to be flashed can be 100 lines, and the maximum memory space size of each line can be 1KB.
  • the memory space required after converting all the codes in the program to be flashed into binary files can be 100KB. It is also possible to read all the global variables in the program to be flashed through the code written in the programming language.
  • the memory space required by all global variables in the program to be flashed can be 2KB. It is also possible to read all the calibration quantities in the program to be flashed through the code written in the programming language. For example, if there are 2 calibration quantities to be read in the program to be flashed, if the memory space required for the largest of all calibration quantities is 1KB, then the memory space required for all calibration quantities in the program to be flashed can be 2KB .
  • the priority of the interrupt vector table set in the program to be flashed is also possible to read the priority of the interrupt vector table set in the program to be flashed, the parameters involved in the function in the code, and the memory size required when the temporary variable is triggered and interrupted by the code written in the programming language. All the interrupts in the program to be flashed are stored in the interrupt vector table. If the highest priority in the interrupt vector table is 8, it can be considered that the deepest number of interrupt layers in the interrupt vector table is 8, and the interrupt layer with the deepest number of interrupt layers needs to be The interrupt memory size of the program is used as the benchmark value of the interrupt memory size required by the program to be flashed. Due to the interrupt, the memory size required by the parameters involved and temporary variables can be 2KB, and the memory occupation required by the interrupt in the program to be flashed The size is 16KB.
  • the memory space size required by code text, global variables, calibration quantities and interrupts can be expressed as the memory footprint required by code text, global variables, calibration quantities and interrupts, and the code text, global variables, calibration quantities The sum of the memory usage required by the interrupt and the interrupt is used as the running space occupation information.
  • the remaining space in the memory space may be space that has not been occupied in the memory space.
  • the preset area can be a pre-agreed memory area in the memory space for storing the start address of flashing.
  • the preset area can be located at the beginning or end of the memory space, or it can be a memory area corresponding to a fixed address in the memory space.
  • the flashing start address in the setting area can be used to identify the location of the remaining space in the memory space.
  • the flashing start when the remaining space is greater than the size of the memory space corresponding to the running space occupation information of the program to be flashed, it can be determined that the remaining space meets the running space occupation information, and the flashing start can be read in the preset area. address, you can use the flashing start address as the starting point to sequentially flash the data of the code to be flashed to the memory space.
  • the flashing failure information when the remaining space is smaller than the size of the memory space corresponding to the running space occupation information of the program to be flashed, it can be determined that the remaining space does not meet the running space occupied information, and the flashing failure information is generated and fed back, for example, generating
  • the flashing failure information may be information such as "current chip performance is insufficient", and the failure information is returned to the user.
  • the technical solution of the embodiment of the present application receives and stores the code segment, data segment, calibration segment and interrupt data of the program to be flashed by calling the data structure class, and reads the code text, global Variables, calibrations and interrupts, and then use the code text, global variables, calibrations and interrupts as the running space occupation information to calculate the running memory space required by the program to be flashed; and through the calculated to-be
  • the size of the running memory space required to flash the program is compared with the remaining space in the memory space. If the remaining space of the memory space meets the size of the running memory space required by the program to be flashed, the program to be flashed is written into the memory space to Guarantee the correct flashing of the program to be flashed. If it is judged that the remaining space of the memory space does not meet the size of the running memory space required by the program to be flashed, the flashing failure information will be given for the user to readjust according to the flashing failure information. Work.
  • Fig. 3 is a flow chart of determining the memory usage of a code content provided by Embodiment 2 of the present application. Referring to Fig. 3, in the embodiment of the present application, the memory usage of the code text, global variables, calibrations and interrupts are respectively determined, including :
  • S2301. Determine the number of effective code lines of the code text, and use the product of the number of effective code lines and the space occupation coefficient of the code lines as the memory usage of the code text.
  • the number of effective code lines can refer to the number of lines of logic codes with actual meaning in the program to be flashed, which can be obtained by subtracting the number of blank lines from the total number of lines of all codes and then subtracting the number of comment lines.
  • the number of valid code lines in the code text may not include the number of blank lines and comment lines.
  • the code line space occupation coefficient can refer to the maximum length of the memory space occupied by each line of code, which can be set according to the developer's experience, or can be determined by the average memory occupation length of the binary line code of the program to be flashed, which can be determined more reasonably The memory footprint of code text.
  • the number of effective code lines in the code text can be counted, and the code line space occupation coefficient can be extracted, the product of the effective code line number and the code line space occupation coefficient can be determined, and the product can be used as the memory of the code text occupancy.
  • the total number of lines of code text is 500 lines, including 20 lines of comments and blank lines
  • the effective number of code lines of code text is 480 lines
  • the average memory occupation length of the binary line code of the program to be flashed can be 2KB
  • the memory usage of the code text is the product of the number of effective code lines and the space occupation coefficient of the code lines, that is, the memory usage of the code text is 960KB.
  • S2302 determine the data structure corresponding to each global variable in all global variables and the data structure corresponding to each calibration quantity in all calibration quantities, and use the sum of all data structures corresponding to all global variables as the memory usage of all global variables , and, the sum of all data structures corresponding to all calibration quantities is used as the memory usage of all calibration quantities.
  • the data structure can reflect the information of the global variable and the data type of the calibration quantity.
  • the length of the memory space occupied by different data structures can be different.
  • there are 2 global variables in the program to be flashed and the data structures of the 2 global variables are respectively Integer and character type
  • the length of the memory space required for integer storage can be 4 bytes
  • the length of the memory space required for character type storage can be 2 bytes
  • the memory usage of global variables can be 4 bytes and 2 bytes
  • the sum of bytes, that is, the memory footprint of a global variable can be 6 bytes.
  • the calibration quantity includes 3 integers
  • the sum of the memory footprint required by the structure is the memory footprint of all global variables, and the sum of all data structures corresponding to all calibration quantities can be used as the memory footprint of all calibration quantities.
  • Interruption can mean that during the normal execution of the program, the processor temporarily interrupts the currently running program due to internal or external event triggers or pre-arranged by the program, and then transfers to execute the internal or external event or program pre-arranged.
  • the service subroutine of the arranged event after the execution of the interrupt service subroutine, the processor returns to the temporarily interrupted program (breakpoint) and continues to execute the original program. This process is called interruption.
  • the interrupt vector table can be regarded as storing all interrupt type codes in the system and all interrupt vectors corresponding to all interrupt type codes in a storage area according to certain rules. This storage area is called the interrupt vector table.
  • the interrupt type in the interrupt vector table The code can be an 8-bit binary number, which can be considered as the entry address of the interrupt service program. Among them, the deepest priority can be the priority corresponding to the highest priority interrupt type code of the code to be flashed, and the number of interrupts can be the Write the number of different interrupt type codes in the code.
  • the controller When the controller handles interrupts, it responds to higher-level interrupt requests and shields interrupt requests of the same level or lower levels. Therefore, the memory usage of interrupts is related to the number of interrupts and the priority of interrupts, and the number of interrupts can be used
  • the product of the interrupt priority determines the memory footprint of the interrupt. Exemplarily, if there are 8 interrupt priorities, the deepest priority of the interrupt can be the highest priority, and the memory occupied by the program of this priority can be 10KB, then the memory size corresponding to the deepest priority interrupt and the interrupt
  • the product of the number of interrupts is used as the memory usage of the interrupt, that is, the memory usage of the interrupt is 80KB.
  • the product of the number of effective code lines and the space occupation coefficient of code lines is used as the memory usage of the code text
  • the sum of all data structures corresponding to all global variables is used as the memory usage of all global variables
  • the sum of all data structures corresponding to all calibration quantities is used as the memory usage of multiple calibration quantities
  • the product of the memory size corresponding to the deepest priority interrupt and the number of interrupts is taken as the interrupt memory usage, which can effectively calculate the code text
  • the memory usage of the program, the memory usage of the global variable, the memory usage of the calibration amount, and the memory usage of the interrupt can effectively calculate the memory usage of the program to be flashed.
  • Fig. 4 is the implementation effect diagram of the program flashing method of a kind of controller provided by the embodiment of the present application, as shown in Fig. 4, the integral class that realizes the program flashing method of the present application includes MCUStruct_Class class, ReadMCU class , Disposition_Chip class and Generation_LinkFile class.
  • the MCUStruct_Class class is a data structure class.
  • the MCUStruct_Class class can be used to receive and store the code segment, data segment, calibration segment and interrupt memory size data in the program to be flashed.
  • Use the get_CodeSize() function in this class to obtain the value of the code segment of the program to be flashed, use the set_CodeSize() function in this class to set the value of the code segment of the program to be flashed; use the get_DataSize() function in this class to obtain For the value of the data segment of the program to be flashed, use the set_DataSize() function in this class to set the value of the data segment of the program to be flashed; use the get_Calib_DataSize() function in this class to obtain the value of the calibration segment of the program to be flashed, Use the set_Calib_DataSize() function in this class to set the value of the calibration segment of the program to be flashed; use the get_Interrupt_Memen
  • ReadMCU class this class can be used to read all the codes in the program to be flashed, and then calculate the memory size required by all the current codes, and can also read the memory space required by all global variables and the memory space required by all calibration quantities size and the amount of memory space required by the current code in the event of an interrupt.
  • the Cal_CodeSize() function in this class reads the number of meaningful lines of all codes in the current program, and then calculates the size of the memory space required after converting to a binary file;
  • the Cal_DataSize() function in this class reads the code to be written Global variables in the program, calculate the size of the memory space required by the global variables
  • the Cal_Calib_DataSize() function can read the calibration amount of the program to be flashed, and calculate the memory space size required by the calibration amount
  • the Cal_Interrupt_Memory_Size() function reads the size of the memory space to be flashed Write the priority of the interrupt vector table set in the program, calculate the priority of the interrupt vector table set in the program to be flashed, the parameters involved in the function, and the size of the memory space required when the temporary variable involved in the function is triggered and interrupted.
  • Disposition_Chip class which stores the start and end address information related to the specific pflash and dflash of the current chip. Use the set_ChipSetting() function in this class to set the specific pflash and dflash related start and stop address values of the current chip, and use the get_ChipSetting() function in this class to obtain the current chip specific pflash and dflash related start and stop address values.
  • Generation_LinkFile class this class calculates the memory size data required by the program to be flashed according to the ReadMCU class and obtains the chip data according to the Disposition_Chip class, and generates a LinkFile file.
  • the Generation_File() function in this class writes the program to be flashed into pflash according to the start address and size of the current chip pflash and the end address of the bootloader, and writes the program to be flashed according to the start address and size of dflash Write the global variables, calibration values and interrupts in dflash, and ensure that the addresses are continuous to reduce space fragmentation.
  • Fig. 5 is an example diagram of a program flashing method of a controller provided by the embodiment of the present application.
  • the program flashing in the controller may include the following steps: first, configure the memory size of the current chip pflash and dflash and start Then read all the source code of the program to be flashed, and judge whether the source code of the program to be flashed is empty. If the source code of the program to be flashed is empty, print that the code of the program to be flashed is empty and end the entire process.
  • the source code of the program to be flashed is not empty, then calculate the occupied space required for the program code to be flashed, calculate the occupied space required for global variables in the program to be flashed, and calculate the occupied space required for the calibration amount in the program to be flashed Space size and estimate the occupied space required for interrupts in the program to be flashed, then calculate the sum of the memory space required by the program to be flashed, and compare the sum of the required memory space with the pfash and dflash of the current chip Compare and judge whether the sum of the memory space required by the program to be flashed exceeds the chip size. If it exceeds the chip size, it will print that the current chip performance is insufficient and end the entire process. If it does not exceed the chip size, generate the corresponding LinkFile file , and end the entire process.
  • Fig. 6 is a structural block diagram of a program flashing device for a controller provided in Embodiment 3 of the present application.
  • the device can execute the program flashing method for a controller provided in any embodiment of the present application, and has corresponding functional modules for executing the method and effects.
  • the device is configured in the controller to implement the program flashing method of the controller in the embodiment of the present application.
  • the device includes: a program receiving module 610 , a spatial information module 620 and a program flashing module 630 .
  • the program receiving module 610 is configured to obtain the program to be flashed according to the preset storage structure.
  • the space information module 620 is configured to determine the running space occupation information of the code content of the program to be flashed.
  • the program flashing module 630 is configured to write the program to be flashed into the memory space based on the flashing start address and the running space occupation information.
  • the program receiving module obtains the program to be flashed according to the preset storage structure
  • the space information module determines the running space occupation information of the code content of the program to be flashed
  • the program flashing module starts based on the flashing Write the program to be flashed into the memory space according to the starting address and the running space occupation information.
  • the above technical solution writes the program to be flashed into the memory space based on the estimated running memory size and starting address of the program to be flashed, which effectively saves memory space, improves the success rate of program flashing, and thereby improves control
  • the stability of the operation of the controller can reduce the test time for determining the operating parameters of the program to be flashed, and can improve the development efficiency of the controller.
  • the program receiving module 610 is configured to: call the data structure class to receive and store the code segment, data segment, calibration segment and interrupt data of the program to be flashed.
  • the spatial information module 620 includes a code reading unit and a memory determining unit.
  • the code reading unit is configured to read the code content of the program to be flashed, wherein the code content includes: code text, global variables, calibration quantities and interrupts.
  • the memory determination unit is configured to respectively determine the memory usage of the code text, the memory usage of the global variable, the memory usage of the calibration amount and the memory usage of the interrupt, and combine the memory usage of the code text, the memory usage of the The memory usage of the global variable, the memory usage of the calibration amount and the memory usage of the interrupt are used as the running space usage information.
  • the number of the global variable is at least one
  • the number of the calibration quantity is at least one
  • the memory determination unit includes a row number determination subunit, a structure determination subunit and a search subunit.
  • the line number determination subunit is configured to determine the effective code line number of the code text, and use the product of the effective code line number and the code line space occupation coefficient as the memory footprint of the code text.
  • the structure determination sub-unit is configured to determine the data structure corresponding to each global variable in all global variables and the data structure corresponding to each calibration quantity in all the calibration quantities, and the data structure corresponding to all the data structures corresponding to all global variables The sum is used as the memory usage of all global variables, and the sum of all data structures corresponding to all calibrations is used as the memory usage of all calibrations.
  • the search subunit is configured to search the deepest priority of the interrupt in the preset interrupt vector table, and use the product of the memory size corresponding to the deepest priority interrupt and the number of interrupts as the memory occupation of the interrupt quantity.
  • the code line space occupation coefficient includes: the average memory occupation length of the binary line codes of the program to be flashed.
  • the program flashing module 630 is configured to: determine whether the remaining space of the memory space satisfies the operating space occupancy information; in response to the determination result that the remaining space of the memory space satisfies the operating space occupancy information, Read the flash start address of the program to be flashed in the preset area of the memory space, and write the program to be flashed into the memory space according to the flash write start address; in response to the If the remaining space of the above memory space does not meet the determination result of the operation space occupation information, the flashing failure information is generated and fed back.
  • an update module is further included, configured to update the flashing start address according to the running space occupation information of the program to be flashed.
  • the above-mentioned products can execute the program flashing method of the controller provided in the embodiment of the present application, and have corresponding functional modules and effects for executing the method.
  • Embodiment 4 of the present application provides a controller.
  • FIG. 7 is a schematic structural diagram of a controller provided in Embodiment 4 of the present application.
  • this embodiment provides a controller, which may include: a central processing unit and a memory. At least one instruction is stored in the memory, and the instruction is executed by the central processing unit, so that the controller executes the method for flashing the program of the controller as described in the above method embodiment.
  • this controller can comprise: central processing unit 720, memory 710, input device 730 and output device 740;
  • the quantity of central processing unit 720 in this controller can be one or more, in Fig.
  • the controller 720 is taken as an example; the number of memory 710 in the controller may be one or more, and one memory 710 is taken as an example in FIG. 7 .
  • the central processing unit 720, the memory 710, the input device 730 and the output device 740 in the controller can be connected through a bus or in other ways. In FIG. 7, connection through a bus is taken as an example.
  • the central processing unit 720 executes one or more programs stored in the memory 710, the following operations can be implemented: obtain the program to be flashed according to the preset storage structure; determine the running space of the code content of the program to be flashed occupancy information: write the program to be flashed into the memory space based on the flashing start address and the running space occupation information.
  • the controller program flashing method, device, controller, and storage medium provided in the above embodiments can execute the controller program flashing method provided in any embodiment of the present application, and have corresponding functional modules and effects for executing the method.
  • the method for flashing the program of the controller provided in any embodiment of the present application.
  • Embodiment 5 of the present application provides a computer-readable storage medium on which a program is stored.
  • the method for flashing the program of the controller as provided in all the invention embodiments of the present application is implemented.
  • the method includes : Acquiring the program to be flashed according to the preset storage structure; determining the running space occupancy information of the code content of the program to be flashed; writing the program to be flashed based on the starting address of the flashing and the running space occupancy information memory space.
  • the computer storage medium in the embodiments of the present application may use any combination of one or more computer-readable media.
  • the computer readable medium may be a computer readable signal medium or a computer readable storage medium.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of systems, devices, or devices.
  • the computer-readable storage medium may include: an electrical connection having one or more conductors, a portable computer disk, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an erasable Type programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM) or flash memory, optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or the above any combination of .
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal in baseband or propagated as a carrier wave, and the computer-readable signal medium carries computer-readable program code thereon. Such propagated data signals may take many forms, including - but not limited to - electromagnetic signals, optical signals, or any combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can be sent, propagated, or transported for use by or in conjunction with an instruction execution system, apparatus, or device. Programs used in conjunction with the device.
  • the program code contained on the computer readable medium can be transmitted by any medium, including—but not limited to—wireless, electric wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any combination of the above.
  • Computer program code for carrying out the operations of the present application may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, as well as conventional procedural programming languages Design Language—such as "C” or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer ( For example, use an Internet service provider to connect via the Internet).
  • LAN Local Area Network
  • WAN Wide Area Network

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

Sont divulgués dans la présente demande un procédé et un appareil de mise à jour de programme pour un dispositif de commande, et un dispositif de commande et un support de stockage. Le procédé consiste : selon une structure de stockage prédéfinie, à acquérir un programme à mettre à jour ; à déterminer des informations d'occupation d'espace de fonctionnement de contenu de code dudit programme ; et à écrire ledit programme dans un espace de mémoire sur la base d'une adresse de début de mise à jour et des informations d'occupation d'espace de fonctionnement.
PCT/CN2022/125868 2021-10-18 2022-10-18 Procédé et appareil de mise à jour de programme pour dispositif de commande, et dispositif de commande et support de stockage WO2023066233A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111208423.9A CN113885917A (zh) 2021-10-18 2021-10-18 控制器的程序刷写方法、装置、控制器和存储介质
CN202111208423.9 2021-10-18

Publications (1)

Publication Number Publication Date
WO2023066233A1 true WO2023066233A1 (fr) 2023-04-27

Family

ID=79003212

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/125868 WO2023066233A1 (fr) 2021-10-18 2022-10-18 Procédé et appareil de mise à jour de programme pour dispositif de commande, et dispositif de commande et support de stockage

Country Status (2)

Country Link
CN (1) CN113885917A (fr)
WO (1) WO2023066233A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885917A (zh) * 2021-10-18 2022-01-04 中国第一汽车股份有限公司 控制器的程序刷写方法、装置、控制器和存储介质
CN115185615B (zh) * 2022-09-09 2022-12-02 湖南三湘银行股份有限公司 基于内存空间优化的插件程序调用方法

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010032288A1 (en) * 2000-04-13 2001-10-18 Honda Giken Kogyo Kabushiki Kaisha Rewriting system for vehicle controller
CN1904853A (zh) * 2006-08-21 2007-01-31 北京中星微电子有限公司 一种嵌入式软件装载调试方法及其系统
CN103745153A (zh) * 2013-12-30 2014-04-23 北京控制工程研究所 一种航天器软件空间使用安全性检查方法
CN105302618A (zh) * 2015-12-05 2016-02-03 中国航空工业集团公司洛阳电光设备研究所 一种asaac标准数字信号处理模块快速烧写方法
CN109324813A (zh) * 2018-08-16 2019-02-12 深圳市元征科技股份有限公司 电子控制系统刷写方法、装置及计算机介质
US20200034134A1 (en) * 2018-07-30 2020-01-30 Ford Global Technologies, Llc Over The Air Ecu Update
CN111722864A (zh) * 2020-06-24 2020-09-29 深圳市元征科技股份有限公司 一种ecu数据刷写方法及相关装置
CN112579135A (zh) * 2020-12-22 2021-03-30 潍柴动力股份有限公司 用于车辆控制单元的刷写控制方法、系统及车辆
CN113885917A (zh) * 2021-10-18 2022-01-04 中国第一汽车股份有限公司 控制器的程序刷写方法、装置、控制器和存储介质

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010032288A1 (en) * 2000-04-13 2001-10-18 Honda Giken Kogyo Kabushiki Kaisha Rewriting system for vehicle controller
CN1904853A (zh) * 2006-08-21 2007-01-31 北京中星微电子有限公司 一种嵌入式软件装载调试方法及其系统
CN103745153A (zh) * 2013-12-30 2014-04-23 北京控制工程研究所 一种航天器软件空间使用安全性检查方法
CN105302618A (zh) * 2015-12-05 2016-02-03 中国航空工业集团公司洛阳电光设备研究所 一种asaac标准数字信号处理模块快速烧写方法
US20200034134A1 (en) * 2018-07-30 2020-01-30 Ford Global Technologies, Llc Over The Air Ecu Update
CN109324813A (zh) * 2018-08-16 2019-02-12 深圳市元征科技股份有限公司 电子控制系统刷写方法、装置及计算机介质
CN111722864A (zh) * 2020-06-24 2020-09-29 深圳市元征科技股份有限公司 一种ecu数据刷写方法及相关装置
CN112579135A (zh) * 2020-12-22 2021-03-30 潍柴动力股份有限公司 用于车辆控制单元的刷写控制方法、系统及车辆
CN113885917A (zh) * 2021-10-18 2022-01-04 中国第一汽车股份有限公司 控制器的程序刷写方法、装置、控制器和存储介质

Also Published As

Publication number Publication date
CN113885917A (zh) 2022-01-04

Similar Documents

Publication Publication Date Title
WO2023066233A1 (fr) Procédé et appareil de mise à jour de programme pour dispositif de commande, et dispositif de commande et support de stockage
CN108694075B (zh) 处理报表数据的方法、装置、电子设备和可读存储介质
CN110990019B (zh) 一种Java类分析方法、装置、存储介质及电子设备
CN108205469B (zh) 一种基于MapReduce的资源分配方法及服务器
CN103970520A (zh) MapReduce架构中的资源管理方法、装置和架构系统
KR101835604B1 (ko) 메모리를 위한 스케줄러
CN112905472A (zh) 内核调试系统及方法
CN111737564B (zh) 一种信息查询方法、装置、设备及介质
CN113010470B (zh) 边缘节点远程控制系统、方法、设备及存储介质
KR20200135717A (ko) 액세스 요청 처리 방법, 장치, 기기 및 저장 매체
US9740618B2 (en) Memory nest efficiency with cache demand generation
US20200371827A1 (en) Method, Apparatus, Device and Medium for Processing Data
CN115827250A (zh) 一种数据存储方法、装置及设备
CN109521970B (zh) 一种数据处理方法及相关设备
US9251107B2 (en) Immediate direct memory access descriptor-based write operation
CN116467235B (zh) 一种基于dma的数据处理方法、装置、电子设备及介质
CN111625180B (zh) 数据写入方法及装置、存储介质
US6675238B1 (en) Each of a plurality of descriptors having a completion indicator and being stored in a cache memory of an input/output processor
CN111913812B (zh) 一种数据处理方法、装置、设备及存储介质
CN112230964A (zh) 应用程序开发、应用程序运行方法、装置、设备及介质
KR20210108466A (ko) 시퀀스 프로세싱 유닛이 있는 메모리 제어 시스템
CN117389685B (zh) 虚拟机热迁移标脏方法及其装置、后端设备、芯片
CN116931954B (zh) 一种嵌入式软件包编译构建方法、装置、设备及介质
CN111222295B (zh) 基于布线资源的布局布线控制方法及装置、系统
US11989420B2 (en) Memory allocation method and apparatus, electronic device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22882838

Country of ref document: EP

Kind code of ref document: A1