Controller upgrading method, electronic equipment and storage medium
By selecting the main controller in the controller for program upgrade management of the target controller, the upgrade failure problem caused by abnormal situations such as voltage instability in the existing technology is solved, and the remote upgrade cost of multi-controller systems is reduced and the upgrade efficiency is improved.
Patent Information
- Application Number
- CN202411893752.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art is prone to failure in the upgrade process due to abnormal situations such as voltage instability during the controller upgrade process, and the remote upgrade of multi-controller systems is high and the efficiency is low.
By selecting the main controller in the controller, interacting with the upper computer to perform program upgrade management of the target controller, the upgrade file data is stored in the off-chip flash memory space of the main controller, and the program upgrade is performed according to the type of the target controller.
It effectively reduces the complexity of upgrades, reduces equipment cost investment, improves the upgrade efficiency of the controller, and can perform program upgrades under any time and conditions.
Smart Images

Figure CN119829105A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of remote software upgrade, and in particular to a controller upgrade method, electronic device and storage medium. Background Art
[0002] At present, controller upgrades are generally carried out through one-to-one data transmission between the host computer and the device-side controller to complete the software program upgrade. However, when abnormal conditions such as voltage instability occur during the upgrade of the device side, it will lead to problems such as being unable to restart and run the program in the controller. The only way is to re-write the underlying program and application program with the emulator. However, for the device side with a complex structure, manual disassembly and rewriting of the program are required, which increases the complexity of the upgrade.
[0003] In addition, the existing remote upgrade technology generally requires the host computer to upgrade only one controller based on a pre-agreed communication protocol. For complex system equipment with multiple controllers, each controller needs to be remotely upgraded through cloud upgrades and transplanted communication protocols, which increases the cost of the equipment and reduces the upgrade efficiency of the controller. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a controller upgrade method, electronic device and storage medium, by selecting a controller as the main controller from at least one controller, and managing the program upgrade of the target controller requested to be upgraded through communication interaction between the main controller and the host computer, storing the upgrade file data in the off-chip flash memory space corresponding to the main controller, and performing program upgrade on the target controller based on the controller type corresponding to the target controller, so as to perform program upgrade work at any time and under any conditions and effectively reduce the upgrade complexity. Through the above method, the cost investment of the equipment is reduced, thereby improving the upgrade efficiency of the controller.
[0005] Based on the above purpose, in a first aspect, the present application provides a controller upgrade method, comprising:
[0006] In response to determining a target controller for which an upgrade is requested in at least one controller, determining a file offset of the first upgrade file information based on first upgrade file information corresponding to the target controller received by a main controller among the controllers;
[0007] In response to the file offset satisfying the preset requirement, receiving the upgrade file data sent by the host computer, and storing the upgrade file data in the off-chip flash memory space corresponding to the main controller;
[0008] In response to the upgrade file data being stored, the target controller is program-upgraded using the upgrade file data based on the controller type corresponding to the target controller.
[0009] In a second aspect of the present application, a controller upgrade device is provided, comprising:
[0010] a data processing module, configured to determine, in response to determining a target controller for which an upgrade is requested in at least one controller, a file offset of the first upgrade file information based on first upgrade file information corresponding to the target controller received by a main controller among the controllers;
[0011] A data storage module, configured to receive the upgrade file data sent by the host computer in response to the file offset meeting the preset requirement, and store the upgrade file data in the off-chip flash memory space corresponding to the main controller;
[0012] A program upgrade module is used for performing a program upgrade on the target controller using the upgrade file data in response to the upgrade file data being stored and based on the controller type corresponding to the target controller.
[0013] In a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.
[0014] According to a fourth aspect of the present application, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect.
[0015] In a fifth aspect of the present application, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method described in the first aspect.
[0016] From the above, it can be seen that the controller upgrade method, electronic device and storage medium provided in the embodiments of the present application select a controller as the main controller from at least one controller, and manage the program upgrade of the target controller requested to be upgraded through communication interaction between the main controller and the host computer, store the upgrade file data in the off-chip flash memory space corresponding to the main controller, and upgrade the program of the target controller based on the controller type corresponding to the target controller, so as to perform program upgrade work at any time and under any conditions and effectively reduce the upgrade complexity.
[0017] Compared with the prior art method of one-to-one data transmission between the host computer and the device-side controller, and remote upgrading of each controller through cloud upgrade and transplantation communication protocol, the cost investment of the equipment is reduced, thereby improving the upgrade efficiency of the controller.
[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 One of the flowcharts of an exemplary controller upgrade method according to an embodiment of the present application is shown;
[0021] Figure 2 A second flowchart of an exemplary controller upgrade method according to an embodiment of the present application is shown;
[0022] Figure 3 A third flowchart of an exemplary controller upgrade method according to an embodiment of the present application is shown;
[0023] Figure 4 A fourth flowchart of an exemplary controller upgrade method according to an embodiment of the present application is shown;
[0024] Figure 5 A schematic structural diagram of an exemplary controller upgrade device according to an embodiment of the present application is shown;
[0025] Figure 6 A schematic structural diagram of an exemplary electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0027] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0028] According to research, at present, controller upgrades are generally carried out through one-to-one data transmission between the host computer and the device-side controller to complete the software program upgrade. However, when abnormal conditions such as voltage instability occur during the upgrade of the device side, it will lead to problems such as being unable to restart and run the program in the controller. The only option is to re-write the entire firmware including the BOOTLOADER program and the application program using an emulator. However, for devices with complex structures, manual disassembly and program flashing are required, which increases the complexity of the upgrade.
[0029] Here, when one-to-one data transmission is performed between the host computer and the controller on the device side, assuming that at least one device on the host computer and the device side has a power outage or voltage instability problem due to external reasons, the controller upgrade may fail. At this time, it is necessary to use an emulator to disassemble the device again and re-burn the entire firmware (BOOTLOADER program and application program) to reduce the loss caused by the upgrade failure.
[0030] In addition, since the existing remote upgrade technology generally requires the host computer to upgrade only one MCU controller based on a pre-agreed communication protocol, for complex system equipment with multiple MCU controllers, each MCU controller needs to be remotely upgraded through cloud upgrades and transplanted communication protocols, which increases the cost of the equipment and reduces the upgrade efficiency of the MCU controller.
[0031] Here, for complex system equipment with multiple MCU controllers, assuming that there are multiple MCU controllers that need program upgrades, each MCU controller needs to establish communication with the host computer, and a communication module needs to be installed on the hardware of the MCU controller, and the communication protocol needs to be transplanted in the software program of the MCU controller, so that the programs of multiple MCU controllers can be upgraded through cloud upgrades, which greatly increases the cost investment and reduces the upgrade efficiency.
[0032] Based on this, an embodiment of the present application provides a controller upgrade method, by selecting a controller as the main controller from at least one controller, and managing the program upgrade of the target controller requesting the upgrade through communication interaction between the main controller and the host computer, storing the upgrade file data in the off-chip flash memory space corresponding to the main controller, and performing a program upgrade on the target controller based on the controller type corresponding to the target controller, so that the program upgrade can be performed at any time and under any conditions and the upgrade complexity can be effectively reduced. Through the above method, the cost investment of the equipment is reduced, thereby improving the upgrade efficiency of the controller.
[0033] Figure 1 One of the flowcharts showing an exemplary controller upgrade method according to an embodiment of the present application
[0034] Through the controller upgrade method in this application, multiple MCU controllers in the photovoltaic system can be upgraded. This can avoid the problem in the related art that when one-to-one data transmission is performed between the host computer and the device-side controller, the program in the controller cannot be restarted and run due to abnormal conditions such as unstable voltage.
[0035] In the embodiment of the present application, the controller may include but is not limited to an MCU controller (Microcontroller Unit, MCU), and the main MCU controller and the target MCU controller establish communication connection through the serial port. All target MCU controllers can establish communication connection with the cloud through the main MCU controller. Here, there is no need for each MCU controller to install a Bluetooth communication module to interact with the cloud for data, so that the entire photovoltaic system equipped with multiple MCU controllers has the characteristics of small size, low power consumption and low cost.
[0036] like Figure 1 As shown in the figure, the controller upgrade method provided by the embodiment of the present application may include the following steps:
[0037] In step S100 , in response to determining a target controller for which an upgrade is requested in at least one controller, a file offset of the first upgrade file information is determined based on first upgrade file information corresponding to the target controller received by a main controller among the controllers.
[0038] It should be noted that before performing the controller upgrade method, it is necessary to determine the controller type of the controller in at least one controller in advance. Specifically, a main controller is determined in the controller for communicating and interacting with the host computer and managing program upgrades. When there are multiple controllers, other controllers except the main controller are determined as slave controllers.
[0039] Figure 2 A second flowchart of an exemplary controller upgrade method according to an embodiment of the present application is shown.
[0040] like Figure 2 As shown in , the step of determining the target controller for requesting an upgrade in at least one controller may further include the following steps:
[0041] In step S101, a first model parameter corresponding to at least one controller to be upgraded and requiring program upgrade sent by a host computer is obtained.
[0042] In step S102, the first model parameter is compared with the second model parameter stored in the controller to be upgraded, and at least one target controller for which an upgrade is requested is screened out from the controller to be upgraded based on the comparison result.
[0043] As an example of determining a target controller for requesting an upgrade in at least one controller, the host computer determines the first model parameter corresponding to the controller to be upgraded that requires a program upgrade based on the known firmware version of each controller, and uses code to distinguish the first model parameter, for example, the header model parameter and the model parameter of the digital signal processor; then, after each controller to be upgraded obtains the first model parameter, the first model parameter is compared with the second model parameter of each controller to be upgraded itself, so that each controller to be upgraded determines whether to accept the upgrade; finally, the target controller is screened out from the controllers to be upgraded that accept the upgrade.
[0044] like Figure 2 As shown in , the determining the file offset of the first upgrade file information based on the first upgrade file information corresponding to the target controller received by the main controller in the controller may further include the following steps:
[0045] In step S103, the upgrade program version number sent by the host computer is received, and it is determined whether the upgrade program version number is greater than the current program version number of the target controller.
[0046] In an embodiment of the present application, the host computer sends the latest upgrade program version number of the current controller, and each target controller compares the upgrade program version number with the current program version number so that the target controller that needs to be updated and upgraded can continue to be upgraded, avoiding waste of upgrade resources.
[0047] Furthermore, if the upgrade program version number is less than or equal to the current program version number of the target controller, it indicates that the target controller does not need to be upgraded at this time, and the target controller is controlled to exit this program upgrade.
[0048] In step S104, if it is greater than, the main controller in the controller receives the first upgrade file information sent by the host computer, and determines the second upgrade file information returned to the host computer based on the first upgrade file information.
[0049] In the embodiment of the present application, the first upgrade file information is the upgrade file information sent by the host computer to the main controller, and the second upgrade file information is the upgrade file information returned to the host computer by the main controller after receiving the first upgrade file information.
[0050] The upgrade file information refers to key attributes and metadata used to describe the upgrade file to ensure the accuracy and security of the upgrade process; the upgrade file information includes but is not limited to the file length value and cyclic redundancy check value of the upgrade file.
[0051] Here, the cyclic redundancy check value is a check value calculated by a cyclic redundancy check (CRC check). The cyclic redundancy check is a check method for detecting data transmission errors. Specifically, a check value is calculated and attached to the data and transmitted to the receiving end. After receiving the data, the receiving end recalculates the check code and compares it with the received check code to determine whether an error occurs in the data transmission process.
[0052] In step S105, based on the second upgrade file information, the file offset of the first upgrade file information is determined.
[0053] In an embodiment of the present application, the file offset refers to the distance of a certain position inside the file relative to the starting position of the file (usually the file header), and the distance is usually measured in bytes. For example, in programming and file operations, the file offset can be used to locate specific data or positions in the file.
[0054] In some embodiments, the second upgrade file information includes a second file length value and a second cyclic redundancy check value, and determining the file offset of the first upgrade file information based on the second upgrade file information may further include: converting and calculating the second file length value to obtain a third cyclic redundancy check value, and determining whether the third cyclic redundancy check value is the same as the second cyclic redundancy check value; if they are the same, determining the second file length value as the file offset of the first upgrade file information; if they are not the same, determining a preset value as the file offset of the first upgrade file information.
[0055] In one possible implementation of the present application, the preset value may be set to 0.
[0056] In an embodiment of the present application, the second file length value is converted and calculated by the following steps to obtain a third cyclic redundancy check value: first, the second file length value is converted into a binary number; then, a pre-selected generating polynomial is determined, and the binary number is supplemented to a supplementary binary number of the same length as the generating polynomial; finally, the supplementary binary number is divided by the generating polynomial until the length of the supplementary binary number is equal to the length of the generating polynomial, and the obtained remainder is determined as the third cyclic redundancy check value.
[0057] Here, when the third cyclic redundancy check value calculated based on the file length value is the same as the second cyclic redundancy check value returned by the main controller, it indicates that the file offset of the first upgrade file information during transmission to the main controller is the second file length value returned to the host computer.
[0058] Furthermore, when the third cyclic redundancy check value calculated based on the file length value is different from the second cyclic redundancy check value returned by the main controller, it indicates that the main controller starts transmitting from the file header of the first upgrade file information, that is, the file offset of the first upgrade file information is set to 0.
[0059] In summary, the target controller is determined by comparing the model parameters of the controller to be upgraded to ensure that the upgrade resources are fully utilized, and based on the second upgrade file information returned to the host computer, the cyclic redundancy check value is calculated and compared to ensure that the upgrade file avoids transmission deviation during the transmission process.
[0060] Furthermore, after the target controller is determined and the file offset of the communication between the main controller and the host computer is corrected, the main controller receives and stores the upgrade file data sent by the host computer to perform program upgrade on the target controller.
[0061] like Figure 1As shown in, in step S200, in response to the file offset satisfying the preset requirement, the upgrade file data sent by the host computer is received, and the upgrade file data is stored in the off-chip flash memory space corresponding to the main controller.
[0062] The preset requirement means that the file offset generated during the data communication and transmission between the main controller and the host computer is within the deviation range set by the main controller.
[0063] In an embodiment of the present application, the upgrade file data refers to a set of necessary information included in the program upgrade process to ensure the integrity and reliability of data transmission, which includes not only the actual upgrade file itself, but also other auxiliary information used to ensure the correct transmission of data.
[0064] Here, the upgrade file data includes an upgrade file package, a frame number and a second check value; wherein, the upgrade file package is the payload of the program upgrade, including data such as the upgrade firmware or software program version; the frame number is used to identify the location of the upgrade file data during the upgrade process; and the second check value is used to verify the security and integrity of the upgrade file data.
[0065] In the embodiment of the present application, the off-chip flash memory space corresponding to the main controller refers to a flash memory chip installed outside the main controller, which is used to locally store program code, data or other information.
[0066] Compared with the on-chip flash memory space (flash memory integrated inside the main controller), the off-chip flash memory space provides a larger storage capacity and is suitable for application scenarios that require a large amount of storage space. When power outages and voltage instability occur on the device side where the main controller is located, data transmission and use are not affected.
[0067] In some embodiments, in response to the file offset satisfying preset requirements, receiving upgrade file data sent by the host computer, and storing the upgrade file data in the off-chip flash memory space corresponding to the main controller may further include: in response to the file offset satisfying preset requirements, the main controller receives the upgrade file data sent by the host computer, and based on the upgrade file data, determines a first check value for security verification; determines whether the first check value is consistent with the second check value included in the upgrade file data; if they are consistent, stores the upgrade file data in the off-chip flash memory space corresponding to the main controller.
[0068] In an embodiment of the present application, the main controller determines a first verification value based on the upgrade file package and frame number included in the received upgrade file data, and determines whether the first verification value and the second verification value are consistent to determine whether the upgrade file data is complete and secure during the transmission process. If they are consistent, the upgrade file data is stored in the off-chip flash memory space corresponding to the main controller.
[0069] Specifically, before the main controller stores the upgrade file data in the off-chip flash memory space corresponding to the main controller, the off-chip flash memory space pre-allocates the upgrade program size and storage space range corresponding to each controller.
[0070] The storage space range may be set to a corresponding range according to the maximum memory space owned by the controller, thereby ensuring that each controller has enough space to store the upgrade file.
[0071] Exemplarily, an off-chip flash memory space is pre-allocated with the upgrade program size and storage space range corresponding to each controller as shown in the following table.
[0072] Controller name and type Upgrade program size Storage space range First controller (main controller) 100K 0~(256K-1) Second controller (slave controller) 90K 256K~(512K-1) The third controller (slave controller) 120K 512K~(768K-1)
[0073] In summary, by ensuring that the file offset meets the preset requirements and comparing the check values based on the upgrade file data, the security and integrity of the data transmission between the main controller and the host computer are ensured before the upgrade file data is downloaded and stored, and the location for storing the upgrade file is set to the off-chip flash memory space of the main controller, which is suitable for application scenarios that require a large amount of storage space. This allows the target controller to upgrade the program at any time, and when power outages and voltage instability occur on the device side where the main control is located, data transmission and use are not affected.
[0074] Figure 3 A third flowchart of an exemplary controller upgrade method according to an embodiment of the present application is shown.
[0075] like Figure 3 As shown in, in response to the file offset satisfying the preset requirement, receiving the upgrade file data sent by the host computer, and storing the upgrade file data in the off-chip flash memory space corresponding to the main controller may further include the following steps:
[0076] In step S301, in response to the upgrade file data being stored, it is checked whether the upgrade file data is completely correct.
[0077] In step S302, in response to determining that the upgrade file data is all correct, the target controller is controlled to perform a soft reset, and whether an upgrade mark exists in the upgrade file data is detected.
[0078] In the embodiment of the present application, when it is determined that the stored upgrade file data is all correct, it is necessary to do the preparation work before the upgrade, that is, control each target controller to perform a soft reset.
[0079] Here, soft reset is a method of restarting the controller without cutting off the power supply. Soft reset is consistent with hardware reset and will not cause data loss. As long as the data is stored in the off-chip flash memory space, the data will not be lost. Among them, soft reset is reset and restarted through instructions, and no one is required to operate the reset button, which improves the flexibility of reset.
[0080] Specifically, each target controller is controlled to perform a soft reset through the following steps: first, a soft reset is triggered by writing a specific value in a reset register set in each target controller, wherein the specific value and the reset register address can be determined according to the model and factory parameters of each target controller; then, wait for the reset operation to be completed; finally, the target controller will restart and execute its startup code or boot loader.
[0081] In step S303, in response to determining that there is an upgrade mark in the upgrade file data, based on the controller type corresponding to the target controller, the target controller is upgraded using the upgrade file data.
[0082] like Figure 3 As shown in , in some embodiments, when there is an error in the upgrade file data or there is no upgrade mark in the upgrade file data, the upgrade of the target controller is exited to allow the target controller to run other applications.
[0083] In some embodiments, the controller types include a master controller and a slave controller; the use of the upgrade file data to perform a program upgrade on the target controller based on the controller type corresponding to the target controller may further include: in response to determining that the controller type corresponding to the target controller is a master controller, obtaining the upgrade file data from the off-chip flash memory space, and performing a program upgrade on the target controller using the upgrade file data; in response to determining that the controller type corresponding to the target controller is a slave controller, obtaining the upgrade file data from the off-chip flash memory space by the master controller, and sending the upgrade file data to the target controller through the serial port; and performing a program upgrade on the target controller using the upgrade file data.
[0084] In an embodiment of the present application, when the controller type corresponding to the target controller is a master controller, the master controller can directly obtain the upgrade file data from the off-chip flash memory space, and use the upgrade file data to perform a program upgrade on the target controller serving as the master controller.
[0085] Furthermore, when the controller type corresponding to the target controller is a slave controller, first, the master controller obtains the upgrade file data from the off-chip flash memory space; then, the master controller sends the upgrade file data to the slave controller through the serial port between the master controller and the slave controller; finally, the slave controller uses the upgrade file data to upgrade the target controller serving as the slave controller.
[0086] In an embodiment of the present application, the use of the upgrade file data to upgrade the program of the target controller may specifically include: first, clearing the area where the old program is located in the memory of the target controller to make room for the upgrade file program; then, writing the received and verified upgrade file data into the memory of the target controller; thereafter, calculating the checksum of the upgrade file program again to ensure that there are no errors in the writing process; finally, restarting the target controller to load and run the new program firmware.
[0087] In the embodiment of the present application, during the process of upgrading the controller, each operation behavior such as data transmission, data verification and authentication is recorded and stored in the form of log records.
[0088] In summary, by determining the program upgrade method corresponding to the master controller or the slave controller according to the controller type of the target controller, and transmitting the upgrade file data to the target controller as the slave controller by serial communication, the problem in the prior art that all controllers need to communicate with the host computer to perform program upgrades is effectively avoided, thereby improving the upgrade efficiency.
[0089] Figure 4 A fourth flowchart of an exemplary controller upgrade method according to an embodiment of the present application is shown.
[0090] like Figure 4 As shown in, the controller upgrade method includes step S400 in addition to the upgrade method described in steps S100 to S300. Specifically, step S400 is used to illustrate the response method when the program upgrade of the target controller fails, so as to improve the data security and integrity of the controller.
[0091] In step S400, in response to a failure in program upgrade of the target controller, based on a preset rollback mechanism, the target controller is restored to a historical firmware version corresponding to the recovery file using a pre-stored recovery file.
[0092] The rollback mechanism refers to a method of restoring the controller to a previous stable state when an abnormality or failure to operate normally occurs during a program upgrade.
[0093] In an embodiment of the present application, when it is determined that the program upgrade of the target controller has failed and the upgrade cannot be restored, a pre-stored recovery file is utilized and container technology is used to quickly roll back the target controller to the historical firmware version corresponding to the previous image at the container level.
[0094] In addition, a recovery program may be automatically executed by utilizing a pre-stored recovery file and using an automated deployment tool to restore the target controller to the historical firmware version corresponding to the recovery file.
[0095] Furthermore, when the program upgrade is interrupted, since each controller has a breakpoint resume function, the target controller can start upgrading from the breakpoint instead of starting from the initial state.
[0096] The controller upgrade method provided in the embodiment of the present application selects a controller as the main controller from at least one controller, and manages the program upgrade of the target controller that requests the upgrade through communication interaction between the main controller and the host computer, stores the upgrade file data in the off-chip flash memory space corresponding to the main controller, and performs program upgrade on the target controller based on the controller type corresponding to the target controller, so as to perform program upgrade work at any time and under any conditions and effectively reduce the upgrade complexity. Through the above method, the cost investment of the equipment is reduced, thereby improving the upgrade efficiency of the controller.
[0097] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0098] Based on the same technical concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a controller upgrade device 500.
[0099] Figure 5 FIG. 1 is a schematic diagram showing a structure of an exemplary controller upgrade device according to an embodiment of the present application. Figure 5 , the upgrading device 500 comprises:
[0100] The data processing module 510 is configured to determine, in response to determining a target controller for which an upgrade is requested in at least one controller, a file offset of the first upgrade file information based on the first upgrade file information corresponding to the target controller received by a main controller among the controllers;
[0101] The data storage module 520 is used for receiving the upgrade file data sent by the host computer in response to the file offset meeting the preset requirement, and storing the upgrade file data in the off-chip flash memory space corresponding to the main controller;
[0102] The program upgrade module 530 is configured to perform a program upgrade on the target controller using the upgrade file data in response to the upgrade file data being stored and based on the controller type corresponding to the target controller.
[0103] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0104] The device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0105] Based on the same technical concept, corresponding to any of the above-mentioned embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the above embodiments when executing the program.
[0106] Figure 6 A schematic diagram of the structure of an exemplary electronic device according to an embodiment of the present application is shown, and the device may include: a processor 610, a memory 620, an input / output interface 630, a communication interface 640, and a bus 650. The processor 610, the memory 620, the input / output interface 630, and the communication interface 640 are connected to each other in communication within the device through the bus 650.
[0107] The processor 610 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0108] The memory 620 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 620 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 620 and are called and executed by the processor 610.
[0109] The input / output interface 630 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0110] The communication interface 640 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0111] The bus 650 comprises a pathway for transmitting information between the various components of the device (eg, the processor 610, the memory 620, the input / output interface 630, and the communication interface 640).
[0112] It should be noted that, although the above device only shows the processor 610, the memory 620, the input / output interface 630, the communication interface 640 and the bus 650, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0113] The electronic device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0114] Based on the same technical concept, corresponding to any of the above-mentioned embodiments, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in any of the above embodiments.
[0115] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0116] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0117] Based on the same inventive concept, corresponding to the method described in any of the above embodiments, the present application also provides a computer program product, including computer program instructions, which, when executed on a computer, enable the computer to execute the method described in any of the above embodiments. In some embodiments, the computer program instructions may be executed by one or more processors of a computer so that the computer and / or the processor execute the method. Corresponding to the execution subject corresponding to each step in each embodiment of the method, the processor that executes the corresponding step may belong to the corresponding execution subject.
[0118] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here.
[0119] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0120] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0121] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0122] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A controller upgrade method, characterized in that: The upgrading method comprises: In response to determining a target controller for which an upgrade is requested in at least one controller, determining a file offset of the first upgrade file information based on first upgrade file information corresponding to the target controller received by a main controller among the controllers; In response to the file offset satisfying the preset requirement, receiving the upgrade file data sent by the host computer, and storing the upgrade file data in the off-chip flash memory space corresponding to the main controller; In response to the upgrade file data being stored, the target controller is program-upgraded using the upgrade file data based on the controller type corresponding to the target controller.
2. The method according to claim 1, characterized in that The upgrading method further comprises: In response to a program upgrade failure of the target controller, based on a preset rollback mechanism, the target controller is restored to a historical firmware version corresponding to the recovery file using a pre-stored recovery file.
3. The method according to claim 1, characterized in that Determine the target controller for the upgrade request in at least one controller by following these steps: Acquire a first model parameter corresponding to at least one controller to be upgraded that needs to be program upgraded and is sent by the host computer; The first model parameter is compared with the second model parameter stored in the controller to be upgraded, and at least one target controller for which upgrade is requested is screened out from the controller to be upgraded based on the comparison result.
4. The method according to claim 1, characterized in that: The determining the file offset of the first upgrade file information based on the first upgrade file information corresponding to the target controller received by the main controller in the controller includes: Receive the upgrade program version number sent by the host computer, and determine whether the upgrade program version number is greater than the current program version number of the target controller; If it is greater than, the main controller in the controller receives the first upgrade file information sent by the host computer, and determines the second upgrade file information to be returned to the host computer based on the first upgrade file information; Based on the second upgrade file information, a file offset of the first upgrade file information is determined.
5. The method according to claim 4, characterized in that The second upgrade file information includes a second file length value and a second cyclic redundancy check value; The determining the file offset of the first upgrade file information based on the second upgrade file information includes: Convert and calculate the second file length value to obtain a third cyclic redundancy check value, and determine whether the third cyclic redundancy check value is the same as the second cyclic redundancy check value; If they are the same, determining the second file length value as the file offset of the first upgrade file information; If they are not the same, the preset value is determined as the file offset of the first upgrade file information.
6. The method according to claim 1, characterized in that The step of receiving the upgrade file data sent by the host computer in response to the file offset satisfying the preset requirement, and storing the upgrade file data in the off-chip flash memory space corresponding to the main controller includes: In response to the file offset meeting the preset requirement, the main controller receives the upgrade file data sent by the host computer, and determines a first check value for security verification based on the upgrade file data; Determining whether the first check value is consistent with a second check value included in the upgrade file data; If they are consistent, the upgrade file data is stored in the off-chip flash memory space corresponding to the main controller.
7. The method according to claim 1, characterized in that In response to the upgrade file data being stored, based on the controller type corresponding to the target controller, using the upgrade file data to perform a program upgrade on the target controller includes: In response to the upgrade file data being stored, checking whether the upgrade file data is all correct; In response to determining that the upgrade file data is all correct, controlling the target controller to perform a soft reset, and detecting whether there is an upgrade mark in the upgrade file data; In response to determining that there is an upgrade mark in the upgrade file data, based on the controller type corresponding to the target controller, the upgrade file data is used to perform a program upgrade on the target controller.
8. The method according to claim 7, characterized in that The controller types include master controller and slave controller; The step of performing a program upgrade on the target controller using the upgrade file data based on the controller type corresponding to the target controller includes: In response to determining that the controller type corresponding to the target controller is a main controller, acquiring the upgrade file data from the off-chip flash memory space, and performing a program upgrade on the target controller using the upgrade file data; In response to determining that the controller type corresponding to the target controller is a slave controller, the master controller obtains the upgrade file data from the off-chip flash memory space, and sends the upgrade file data to the target controller through the serial port; The target controller is program-upgraded using the upgrade file data.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 8.
Citation Information
Cited By
Data upgrading method and device and electronic equipment
CN120560700A