Software program burning method, controller, storage medium and power supply device
Patent Information
- Application Number
- CN202211526438.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-11-30
AI Technical Summary
[0004]本申请提供了一种软件程序烧录方法、控制器、存储介质及电源装置,以解决因程序烧录错误导致设备运行时炸机的问题
[0014]本申请实施例提供一种软件程序烧录方法、控制器、存储介质及电源装置,该方法在软件程序烧录至当前控制器后,运行所述软件程序中的识别程序;所述软件程序包括识别程序和应用程序;在所述识别程序运行过程中,获取当前控制器的存储空间识别信息和所述软件程序的程序识别信息;若所述存储空间识别信息与所述程序识别信息相匹配,则运行所述应用程序;若所述存储空间识别信息与所述程序识别信息不匹配,则禁止运行所述应用程序。本实施例能够在应用程序运行前对软件程序进行验证,判断软件程序是否烧录正确,若不正确,则不运行应用程序,避免应用程序运行时炸机,从而保证设备正常运行。
Smart Images

Figure CN116126370B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a software program burning method, controller, storage medium and power supply device. Background Technology
[0002] In the existing technology, DC power supplies typically include two-stage circuits: ACDC circuit and DCDC circuit. Each stage corresponds to a controller. All the hardware circuits of the DC power supply are encapsulated in a chassis. Each controller has an external port, allowing for program burning and upgrades without disassembling the device.
[0003] In structural design, to simplify the design, technicians often integrate similar ports into a single port. However, when program flashing or upgrades are needed, staff errors may cause the program originally intended for controller A to be flashed onto controller B, resulting in the device failing to flash properly or even crashing. Summary of the Invention
[0004] This application provides a software program burning method, a controller, a storage medium, and a power supply device to solve the problem of equipment crashing during operation due to program burning errors.
[0005] Firstly, this application provides a method for burning software programs, including:
[0006] After the software program is burned into the current controller, the identification program in the software program is run; the software program includes the identification program and the application program;
[0007] During the operation of the identification program, the storage space identification information of the current controller and the program identification information of the software program are obtained;
[0008] If the storage space identification information matches the program identification information, then the application is run;
[0009] If the storage space identification information does not match the program identification information, then the application is prohibited from running.
[0010] Secondly, this application provides a controller, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the software program burning method as described in any possible implementation of the first aspect above.
[0011] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the software program burning method described in any possible implementation of the first aspect above.
[0012] Fourthly, this application provides a power supply device, including: an external port, multiple circuits, and a controller as described in the second aspect above for each circuit;
[0013] Each controller is connected to the external port, and each controller obtains the software program to be burned through the external port.
[0014] This application provides a software program burning method, a controller, a storage medium, and a power supply device. After the software program is burned to the current controller, the method runs an identification program within the software program. The software program includes an identification program and an application program. During the execution of the identification program, the storage space identification information of the current controller and the program identification information of the software program are acquired. If the storage space identification information matches the program identification information, the application program is run; if the storage space identification information does not match the program identification information, the application program is prevented from running. This embodiment can verify the software program before the application program runs, determining whether the software program is burned correctly. If incorrect, the application program is not run, preventing system crashes during application execution and ensuring normal device operation. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is an application scenario diagram of the software program burning method provided in the embodiments of this application;
[0017] Figure 2 This is a flowchart illustrating the implementation of the software program burning method provided in this application embodiment;
[0018] Figure 3 This is a schematic diagram of the structure of the software program burning device provided in the embodiments of this application;
[0019] Figure 4 This is a schematic diagram of the controller provided in an embodiment of this application. Detailed Implementation
[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.
[0022] Figure 1 This diagram illustrates an application scenario for the software program burning method provided in this embodiment. For example... Figure 1 As shown, the power supply device includes an ACDC circuit, a DCDC circuit, a controller A corresponding to the ACDC circuit, and a controller B corresponding to the DCDC circuit, and each controller is connected to an external port.
[0023] See Figure 2 The document illustrates a flowchart of the software program burning method provided in this embodiment, which is described in detail below:
[0024] S101: After the software program is burned into the current controller, the identification program in the software program is run; the software program includes the identification program and the application program.
[0025] S102: During the operation of the identification program, the storage space identification information of the current controller and the program identification information of the software program are obtained.
[0026] S103: If the storage space identification information matches the program identification information, then the application program is run;
[0027] S104: If the storage space identification information does not match the program identification information, then the application is prohibited from running.
[0028] The execution subject in this embodiment can be the controller corresponding to any stage of the circuit in the power supply device described above, and the controller can be a DSP (digital signal processor).
[0029] The software program consists of two parts: an identification program and an application program. After the software program is burned into the controller, the identification program is run first. The identification program is used to determine whether the software program is the current controller's software program. After determining that the software program is the current controller's software program, the application program is run.
[0030] Specifically, the burning referred to in this embodiment can be either full program burning or upgrade program burning.
[0031] Specifically, program identification information is used to represent the identity of a software program, and can be an identification ID (IdentityDocument). Each controller corresponds to a unique program identification information for its software program. Storage space identification information is used to represent the identity of the controller's storage space, and can also be an identification ID.
[0032] The identification program is used to obtain the software program information and the current controller's storage space identification information. When the software program information and storage space identification information match, the application is run; otherwise, the application is prohibited from running to avoid the system crashing due to an incorrect application.
[0033] In this embodiment, the program identification information may also include the software program's version number and device type; the storage space identification information may also include the software program's version number and device type. The controller determines whether the software program is the current controller's software program based on the program version number and device type.
[0034] It should be noted that the software programming method provided in this embodiment can be applied to the controller corresponding to any stage circuit in the power supply device, or to other terminal devices. No limitation is made to the application device here.
[0035] In one possible implementation, the software program burning method provided in this embodiment further includes:
[0036] If it is detected that the software program is not being run for the first time, the application program within the software program will be run directly.
[0037] Specifically, the identification program monitors the current number of times the software program has run. If the current number of runs is 0, it obtains the software program information and the current controller's storage space identification information. If the software program information and storage space identification information match, the application is run; otherwise, the application is prevented from running to avoid crashes caused by faulty applications. The identification program updates the current number of runs each time the application starts running and resets the current number of runs to zero when it detects a software burning completion instruction.
[0038] If the identification program detects that the current software program has not run zero times, meaning that the software program is not running for the first time, it will run the application directly, thereby simplifying the program and shortening the preparation time for the program to start running.
[0039] In one possible implementation, the specific implementation process of S102 includes:
[0040] Read the storage space identification information stored in the external memory of the current controller.
[0041] In one possible implementation, the specific implementation process of S102 includes:
[0042] Obtain the storage space identification information stored in the flash memory of the current controller.
[0043] In this embodiment, the controller can store storage space identification information to a specific storage space. This specific storage space can be an upgrade-non-erasable area planned on the DSP's flash memory FLASH, or it can be set on an external memory configured on the DSP.
[0044] Since the FLASH lifespan of a DSP is shorter than that of external memory, erasing and rewriting should be avoided as much as possible. DSPs do not require a separate area to be not erased. Furthermore, DSPs are usually equipped with external memory, which is used to store factory parameters, operation records, and other data. Therefore, in this embodiment, the storage space identification information is preferably stored in the external memory, which can realize the software program burning method without increasing the cost and ensure the safe operation of the device.
[0045] In one possible implementation, the specific implementation process of S103 includes:
[0046] If the storage space identification information matches the program identification information, then the application program is run.
[0047] Specifically, if the storage space identification information is 0x22, then the program identification information must also be 0x22 in order to determine that the software program is the software program corresponding to the controller and can run the application.
[0048] This embodiment can also determine whether the storage space identification information matches the program identification information using the following method, detailed below:
[0049] The controller pre-stores the correspondence between storage space identification information and software program identification information, and determines whether there is a correspondence between the storage space identification information obtained this time and the program identification information. If so, it determines that the storage space identification information and the program identification information match.
[0050] For example, if the storage space identification information is 0X11 and the program identification information is 0X22, then it is determined whether the controller has a pre-stored correspondence between 0X11 and 0X22. If it exists, it proves that the storage space identification information matches the program identification information; otherwise, it is determined that the storage space identification information does not match the program identification information.
[0051] In one possible implementation, the specific implementation process of S103 includes:
[0052] If the storage space identification information is factory identification information, then it is determined that the factory identification information matches the program identification information, the application is run, and the storage space identification information is updated to the program identification information.
[0053] In this embodiment, before the controller is first programmed with software, its storage space identification information is the factory identification information 0xFF. During software programming, staff need to manually verify whether the programmed software is the correct one for the controller. If so, the software is programmed to the controller. After the controller has finished programming the software, if the factory identification information matches the program identification information, the storage space identification information is updated to the program identification information, and the application is run.
[0054] Specifically, after the software program is burned for the first time, since the storage space identification information is the factory identification information, all program identification information matches the factory identification information, the software program can be run, and the storage space identification information is updated to the current software program's program identification information. Thereafter, each time the identification program is run, it is determined whether the storage space identification information is consistent with the program identification information of the currently burned software program. If they are consistent, the application program is run; otherwise, the application program is prohibited from running.
[0055] In one possible implementation, the software program burning method provided in this embodiment further includes:
[0056] If the storage space identification information does not match the program identification information, a warning message is generated; the warning message is used to indicate that the user software program has been burned incorrectly.
[0057] In this embodiment, if the storage space identification information is inconsistent with the program identification information, the application will be prohibited from running and a warning message will be generated. The warning message may be: The software program is not compatible with the current controller. Please update the software program.
[0058] As can be seen from the above embodiments, this embodiment executes the software program burning method after the software program is burned, and can directly obtain program identification information and storage space identification information from the controller. It does not require modification of the relevant terminal program, thereby simplifying the control process. Moreover, this embodiment determines whether to run the application by judging whether the program identification information of the software program matches the storage space identification information of the controller before running the application. This can avoid the situation where the controller runs the wrong application and the device crashes. Thus, it can achieve the upgrade of the device without disassembling it, and ensure the safe and stable operation of the controller.
[0059] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0060] The following are device embodiments of this application. For details not described in detail, please refer to the corresponding method embodiments described above.
[0061] Figure 3 A schematic diagram of the software program burning device provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown, and are described in detail below:
[0062] like Figure 3 As shown, the software programming device 100 includes:
[0063] The identification program execution module 110 is used to run the identification program in the software program after the software program is burned into the current controller; the software program includes the identification program and the application program.
[0064] The information acquisition module 120 is used to acquire the storage space identification information of the current controller and the program identification information of the software program during the operation of the identification program;
[0065] The program execution module 130 is used to run the application if the storage space identification information matches the program identification information;
[0066] The program prohibition module 140 is used to prohibit the running of the application if the storage space identification information does not match the program identification information.
[0067] In one possible implementation, the information acquisition module 120 specifically includes:
[0068] Read the storage space identification information stored in the external memory of the current controller.
[0069] In one possible implementation, the information acquisition module 120 specifically includes:
[0070] Obtain the storage space identification information stored in the flash memory of the current controller.
[0071] In one possible implementation, the program execution module 130 specifically includes:
[0072] If the storage space identification information matches the program identification information, then the application program is run.
[0073] In one possible implementation, the program execution module 130 further includes:
[0074] If the storage space identification information is factory identification information, then it is determined that the factory identification information matches the program identification information, the application is run, and the storage space identification information is updated to the program identification information.
[0075] As can be seen from the above embodiments, the software program burning device provided in this application embodiment can verify the application before the application runs, determine whether the application is burned correctly, and if it is not correct, the application will not run, thereby avoiding the device crashing when the program runs, thus ensuring the normal operation of the device.
[0076] In one possible implementation, the software programming device 100 further includes:
[0077] The power-on operation module is used to directly run the application program in the software program if it is detected that the software program is not running for the first time.
[0078] In one possible implementation, the software programming device 100 further includes:
[0079] The warning module is used to generate a warning message if the storage space identification information does not match the program identification information; the warning message is used to indicate that the user software program has been burned incorrectly.
[0080] Figure 4 This is a schematic diagram of the controller provided in an embodiment of this application. Figure 4 As shown, the controller 4 in this embodiment includes a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. When the processor 40 executes the computer program 42, it implements the steps in the various software program burning method embodiments described above, for example... Figure 2 Steps S101 to S104 are shown. Alternatively, when the processor 40 executes the computer program 42, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 3 The functions of modules 110 to 140 are shown.
[0081] For example, the computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete / implement the solution provided in this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 42 in the controller 4.
[0082] The controller 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will understand that... Figure 4 This is merely an example of controller 4 and does not constitute a limitation on controller 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, the controller may also include input / output devices, network access devices, buses, etc.
[0083] The processor 40 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), 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.
[0084] The memory 41 can be an internal storage unit of the controller 4, such as a hard disk or memory of the controller 4. The memory 41 can also be an external storage device of the controller 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the controller 4. Furthermore, the memory 41 can include both internal storage units and external storage devices of the controller 4. The memory 41 is used to store the computer program and other programs and data required by the controller. The memory 41 can also be used to temporarily store data that has been output or will be output.
[0085] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to 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 embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0086] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0087] This application provides a power supply device, including: an external port, multiple circuits, and a controller 4 as described above for each circuit;
[0088] Each controller is connected to the external port, and each controller obtains the software program to be burned through the external port.
[0089] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0090] In the embodiments provided in this application, it should be understood that the disclosed devices / controllers and methods can be implemented in other ways. For example, the device / controller embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0091] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0092] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0093] If the integrated module / unit is implemented as 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, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various software program burning method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.
[0094] Furthermore, the features of the embodiments shown in the accompanying drawings or the various embodiments mentioned in this specification should not be construed as independent embodiments. Rather, each feature described in one example of an embodiment can be combined with one or more other desired features from other embodiments to produce other embodiments not described in words or with reference to the accompanying drawings.
[0095] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for burning software programs, characterized in that, include: After the software program is burned into the current controller, the identification program in the software program is run; The software program includes the identification program and the application program; During the operation of the identification program, the storage space identification information of the current controller and the program identification information of the software program are obtained; If the storage space identification information matches the program identification information, then the application is run; If the storage space identification information does not match the program identification information, then the application is prohibited from running; If the storage space identification information matches the program identification information, then the application is run, including: If the storage space identification information is factory identification information, then it is determined that the factory identification information matches the program identification information, the application is run, and the storage space identification information is updated to the program identification information; The method further includes: If it is detected that the software program is not being run for the first time, the application program within the software program will be run directly.
2. The software program burning method according to claim 1, characterized in that, The step of obtaining the current controller's storage space identification information includes: Read the storage space identification information stored in the external memory of the current controller.
3. The software program burning method according to claim 1, characterized in that, The step of obtaining the current controller's storage space identification information includes: Obtain the storage space identification information stored in the flash memory of the current controller.
4. The software program burning method according to claim 1, characterized in that, If the storage space identification information matches the program identification information, then the application is run, including: If the storage space identification information matches the program identification information, then the application program is run.
5. The software program burning method according to claim 1, characterized in that, The method further includes: If the storage space identification information does not match the program identification information, a warning message is generated; the warning message is used to indicate that the user software program has been burned incorrectly.
6. A controller comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the software program burning method as described in any one of claims 1 to 5.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the software program burning method as described in any one of claims 1 to 5.
8. A power supply device, characterized in that, include: External ports, multiple circuits, and the controllers corresponding to each circuit as described in claim 6; Each controller is connected to the external port, and each controller obtains the software program to be burned through the external port.
Citation Information
Patent Citations
ECU application program write-in method and system
CN106528240A
Motor control program encryption method and device and terminal equipment
CN112579990A