Remote upgrade method of controller, controller and system
Through remote communication and wireless upgrade technology, it solves the problems of high cost and low efficiency of traditional street light controller upgrades, achieves low-cost, high-efficiency controller upgrades, and is suitable for rapid upgrades of large-scale street light controllers.
Patent Information
- Application Number
- CN202110967582.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-08-23
AI Technical Summary
Program upgrades for traditional street light controllers are costly and inefficient, affecting user experience.
Through remote communication, the host computer is used to obtain and transmit the upgrade file, and the controller clears the flash program location and runs the upgrade file to achieve wireless upgrade, reducing manpower and material costs and upgrade time.
A low-cost, high-efficiency controller upgrade is achieved, and a large number of controllers can be upgraded in a short time without affecting the normal use of users.
Smart Images

Figure CN113741933B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a remote upgrade method of a controller, a controller and a system. Background Art
[0002] Street light controller is a common controller using Cortex-M0 processor chip. A first-tier city has about 30,000 to 50,000 street lights (a super first-tier city can reach 50,000 to 100,000), and a second-tier or third-tier city has at least 10,000 street lights. Modern street lights generally need to be equipped with controllers to achieve energy saving and intelligent control.
[0003] However, when errors occur in the programs of such a large number of controllers or their functions need to be upgraded, the traditional approach is to return all controllers to the factory for program updates, or for staff to go to the site to disassemble the controllers and re-burn the programs, which consumes high manpower and material costs. At the same time, the program upgrade efficiency is low, affecting the user experience. Summary of the invention
[0004] The purpose of the present application is to provide a remote upgrade method for a controller, a street lamp and a remote upgrade system for a controller, aiming to solve the problem of high cost and low efficiency of program upgrades of traditional controllers.
[0005] In order to achieve the above objectives, in a first aspect, an embodiment of the present application provides a remote upgrade method of a controller, comprising:
[0006] Get the host computer command to clear the flash memory program at the upgrade location;
[0007] Obtain the remote upgrade file from the host computer and store it in the upgrade location;
[0008] The upgrade file is run according to the boot loader.
[0009] In a possible implementation manner of the first aspect, obtaining a host computer instruction to clear the flash memory program at the upgrade location includes:
[0010] After receiving the program file of the target application sent by the master station, the host computer sends a flash memory clearing instruction to the controller;
[0011] The controller clears the flash memory program at the upgrade location according to the flash memory clearing instruction.
[0012] In a possible implementation manner of the first aspect, the upgrade file is a plurality of communication frames obtained by parsing a program file received by the host computer from a master station.
[0013] In a possible implementation manner of the first aspect, before executing the upgrade file according to the boot loader, the step further includes:
[0014] The controller calculates a cyclic redundancy check code in the upgrade file;
[0015] When the cyclic redundancy check code in the upgrade file calculated by the controller is consistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is successful, and the upgrade flag bit in the electrically erasable programmable read-only memory in the controller is modified and the upgrade file is reset to run;
[0016] When the cyclic redundancy check code in the upgrade file calculated by the controller is inconsistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is unsuccessful, and errors in the upgrade process are checked and the upgrade is performed again.
[0017] In another possible implementation manner of the first aspect, before the controller calculates the cyclic redundancy check code in the upgrade file, the controller further includes:
[0018] The controller confirms whether the received upgrade file is complete;
[0019] When the upgrade file received by the controller is complete, a cyclic redundancy check code in the upgrade file is calculated.
[0020] In another possible implementation manner of the first aspect, the upgrade file includes a file information frame and a subsequent frame; before the controller confirms whether the received upgrade file is complete, the process further includes:
[0021] The controller receives the file information frame and confirms whether the program number in the file information frame is consistent with the program number of the current controller;
[0022] When the program number in the file information frame is consistent with the program number of the current controller, it is confirmed that the controller is upgraded and the subsequent frames are continuously received.
[0023] In another possible implementation manner of the first aspect, when there is one controller,
[0024] When the cyclic redundancy check code in the upgrade file calculated by the controller is inconsistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is unsuccessful, and the controller replies with an error code to the corresponding host computer;
[0025] When the upgrade file received by the controller is incomplete, the controller replies with an error code to the corresponding host computer.
[0026] In another possible implementation manner of the first aspect, the host computer is wirelessly connected to the plurality of controllers, and after running the upgrade file to perform the upgrade operation, the process further includes:
[0027] The host computer detects whether any of the controllers have failed to upgrade;
[0028] When the host computer detects that the controller has not been successfully upgraded, it resends the upgrade file to the corresponding controller to perform the upgrade operation again.
[0029] In a second aspect, an embodiment of the present application provides a controller, including:
[0030] Memory for storing computer programs;
[0031] A processor is used to implement the steps of the remote upgrade method of the controller when executing the computer program.
[0032] In a third aspect, an embodiment of the present application provides a remote upgrade system for a controller, including the controller,
[0033] A master station, wirelessly connected to one or more host computers, and configured to send an upgrade file to the one or more host computers;
[0034] The host computer is wirelessly connected to the controller and is configured to receive the program file sent by the master station, parse it into the upgrade file, and send it to the controller.
[0035] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the remote upgrade method of the controller described above obtains the host computer instruction to clear the flash memory program at the upgrade location; obtains the remote upgrade file from the host computer and stores it at the upgrade location; and runs the upgrade file according to the boot loader. The present application completes the upgrade process of the controller by remote communication, without consuming a large amount of manpower and material costs. At the same time, the upgrade process is short in time, has high upgrade efficiency, and does not affect the normal use of users. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 A flowchart of a remote upgrade system for a controller provided in an embodiment of the present application;
[0038] Figure 2 A specific flow chart of the remote upgrade method of the controller provided in the embodiment of the present application;
[0039] Figure 3A flowchart of program jump and interrupt processing of a remote upgrade method of a controller provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of the structure of a controller provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of the structure of a remote upgrade system for a controller provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0044] At present, when traditional street light controllers need to be upgraded, all controllers are generally returned to the factory for program update, or staff go to the site to disassemble the controllers and re-burn the programs. Both of these upgrade methods require a lot of manpower and material resources, and the upgrade efficiency is low.
[0045] To this end, the present application provides a remote upgrade method for a controller, wherein the host computer is a concentrator, one end of which is connected to the master station and the other end is connected to the street lamp controller, which plays the role of controlling the street lamp and collecting street lamp data; the master station is a PC software, one end of which is connected to the Internet to send and receive information, and the other end sends an upgrade command to the host computer, which plays the role of controlling the host computer and collecting the host computer data. The communication method between the controller and the host computer is a broadband carrier (all controllers under the host computer can be broadcast controlled, or one-to-one control can be performed).
[0046] This application obtains remote upgrade files from the host computer through the controller for upgrading, so that the upgrade process of the controller can be completed by remote communication. The upgrade of all controllers can be completed in a short time, with low cost, short time and high efficiency.
[0047] The following is an exemplary description of the remote upgrade method of the controller provided by the present application in conjunction with the accompanying drawings: Figure 1 A flowchart of a remote upgrade method for a controller provided in an embodiment of the present application, such as Figure 1For the sake of convenience, only the parts related to this embodiment are shown, which are described in detail as follows: Exemplarily, the remote upgrade method of the controller includes:
[0048] S1, obtain the flash memory program of the host computer instruction controller to clear the upgrade position;
[0049] S2, obtain the remote upgrade file from the host computer and store it in the upgrade location;
[0050] S3. Run the upgrade file according to the boot loader.
[0051] In this embodiment, an upgrade instruction is sent to the main station via the Internet, and a program file (for example, a program file with a suffix of ".bin" or ".hex") is sent to one or more host computers via the main station. One or more host computers receive the upgrade file sent by the main station and send a flash memory clear instruction to the controller. The controller uses the In Application Programming (IAP) function to clear the flash memory program at the upgrade location, thereby freeing up a storage location for the upgrade file. Then, the host computer parses the upgrade file into a pattern of multiple communication frames and sends it to the controller via the communication protocol. The controller receives the upgrade file and stores it in the upgrade location, and runs the upgrade file according to the boot loader to complete the upgrade process.
[0052] The communication protocol includes the frame header, the address of the lighting controller, the total frame length, the control bit, the data field, the checksum and the frame tail. The upgrade file is upgraded by changing the control bit and the data field each time.
[0053] The control bit performs the upgrade startup operation by setting the address to 0x1F. When the controller receives the control bit 0x1F address, it starts to execute the upgrade-related operations.
[0054] The data domain includes:
[0055] The first byte is the file identifier: clear the flash memory program at the location to be upgraded (that is, when the currently running program is at a low address, clear the high address program, and when the currently running program is at a high address, clear the low address program), represented by 0x00, and the upgrade file to be transferred is represented by 0x10.
[0056] The second byte is the file attribute: when the first byte is 0x10, the second byte indicates the attribute of the communication frame transmission file. When the second byte is 0x00, it indicates that the start frame and the middle frame of the file are transmitted. When the second byte is 0x01, it indicates that the last frame of the file is transmitted.
[0057] The third and fourth bytes are the total number of frames of the file to be transferred.
[0058] The fifth and sixth bytes are the frame number of the current transmission (starting from 0 and increasing).
[0059] The seventh byte is the length of the program file of this frame. (The file length of the start frame and the middle frame is fixed at 128 bytes, and the end frame tail is the remaining bytes less than 128 bytes), and the following bytes are the upgrade file content.
[0060] The communication protocol also includes the query controller upgrade status bit and the query controller upgrade file 16-bit cyclic redundancy check code (i.e., Cyclic Redundancy Check, CRC check code). Among them, the upgrade status bit is a 60-byte array, each byte represents the receiving status of a frame, and a total of 480 frames can be received. In the initial state, all bytes in the array are set to 1, indicating that no frame has been received. After a frame is successfully received, the corresponding byte is set to 0, indicating that the reception is successful.
[0061] In this embodiment, the controller includes:
[0062] The flash memory (i.e., Flash memory) is configured such that the total size of the Flash memory is 128K (0x00020000), the boot loader (i.e., BootLoader program) is located at the starting position of the Flash memory at 0x00000000 (maximum 8K), and the application (i.e., Application program) defaults to the starting address at 0x00002000 (maximum 60K). When upgrading, the application is transferred to the starting address of the upgrade program at 0x00011000 (maximum 60K). Among them, the basic functions of the application are responsible for controlling the lights, calculating and storing usage data, and communicating with the host computer.
[0063] The electrically erasable programmable read-only memory (EEPROM memory) is configured to store the upgrade flag (2 bytes). The upgrade flag determines the location where the boot loader starts the application and the location where the interrupt function needs to be mapped. If the application meets the requirement of starting at a low address (0x00002000), the interrupt function is mapped to the low address; if the application meets the requirement of starting at a high address (0x00011000), the interrupt function is mapped to the high address. Other spaces are used to store non-volatile data required by the application, such as power, usage time, etc.
[0064] Static memory (i.e. SRAM) is configured to reserve 2 bytes of space when compiling the application program to store the upgrade flag read by the boot loader from the electrically erasable programmable read-only memory. This is because the electrically erasable programmable read-only memory has a limited lifespan and its reading speed is slower than that of static memory, so it cannot be used in interrupt systems that require frequent mapping (usually interrupts with a cycle of several milliseconds). At the same time, in order to ensure that the positions of the two byte variables in the static memory are not changed, the two byte variables are fixed at the starting position of the static memory 0x10000000, so when compiling the application program, the starting position of the static memory is set to 0x10000002.
[0065] Exemplarily, obtaining a host computer instruction to clear the flash memory program at the upgrade location includes:
[0066] After receiving the program file of the target application sent by the master station, the host computer sends a flash memory clearing instruction to the controller;
[0067] The controller clears the flash memory program in the upgrade location according to the clear flash memory instruction.
[0068] In an embodiment of the present application, the master station sends a program file of the target application to the host computer, the host computer receives the program file and sends a clear flash memory instruction to the controller, the controller clears the flash memory program at the upgrade location according to the clear flash memory instruction, and vacates the storage location for the upgrade file; the host computer parses the program file into an upgrade file and sends it to the controller, the controller receives the upgrade file, stores it in the upgrade location, and then runs the upgrade file, thereby completing the upgrade operation.
[0069] Exemplarily, the upgrade file is a plurality of communication frames obtained by parsing a program file received by the host computer from the master station.
[0070] In the embodiment of the present application, the master station first sends a program file to the host computer, and then the host computer parses the program file into multiple communication frames so as to send them to the controller through the communication protocol.
[0071] Figure 2 A specific flow chart of the remote upgrade method of the controller provided in the embodiment of the present application, such as Figure 2 As shown, exemplarily, before running the upgrade file according to the boot loader, the method further includes:
[0072] The controller calculates the cyclic redundancy check code in the upgrade file;
[0073] When the cyclic redundancy check code in the upgrade file calculated by the controller is consistent with the cyclic redundancy check code pre-stored in the upgrade file, the upgrade is considered successful, the upgrade flag bit in the electrically erasable programmable read-only memory in the controller is modified, and the upgrade file is reset and run;
[0074] When the cyclic redundancy check code in the upgrade file calculated by the controller is inconsistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is unsuccessful, and errors in the upgrade process are checked and the upgrade is performed again.
[0075] In this embodiment, whether the controller is successfully upgraded is determined by judging whether the cyclic redundancy check code in the upgrade file calculated by the controller is consistent with the cyclic redundancy check code pre-stored in the upgrade file. When they are consistent, the upgrade is considered successful, the upgrade flag in the electrically erasable programmable read-only memory in the controller is modified and the upgraded file is reset and run. When they are inconsistent, the upgrade is considered unsuccessful, the upgrade file is resent to the corresponding controller, and the upgrade operation is performed again.
[0076] Exemplarily, before the controller calculates the cyclic redundancy check code in the upgrade file, the process further includes:
[0077] The controller confirms whether the received upgrade file is complete;
[0078] When the upgrade file received by the controller is complete, a cyclic redundancy check code in the upgrade file is calculated.
[0079] In this embodiment, the controller can determine whether the upgrade file is received completely based on the total number of file frames in the communication frame and the setting of the status bit. After successful reception, the corresponding status position will be set to 0. If the reception is complete, the cyclic redundancy check code in the upgrade file will be calculated. Otherwise, the upgrade will not be started.
[0080] Exemplarily, the upgrade file includes a file information frame and a subsequent frame; before the controller confirms whether the received upgrade file is complete, it also includes:
[0081] The controller receives the file information frame and confirms whether the program number in the file information frame is consistent with the program number of the current controller;
[0082] When the program number in the file information frame is consistent with the program number of the current controller, it is confirmed that the controller is upgraded and continues to receive subsequent frames.
[0083] In this embodiment, by determining whether the program number in the file information frame received by the controller is consistent with the program number of the current controller, it is confirmed whether the controller needs to be upgraded. If they are consistent, the controller is confirmed to be upgraded and subsequent frames continue to be received. Otherwise, the upgrade is not started.
[0084] Exemplarily, when the controller is one controller,
[0085] When the cyclic redundancy check code in the upgrade file calculated by the controller is inconsistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is unsuccessful, and the controller replies with an error code to the corresponding host computer;
[0086] When the upgrade file received by the controller is incomplete, the controller replies with an error code to the corresponding host computer.
[0087] In this embodiment, when a single controller is upgraded, if an error occurs, the controller will directly reply with an error code to indicate that the code is not received completely or is incorrect.
[0088] Exemplarily, the host computer is wirelessly connected to multiple controllers, and after running the upgrade file to perform the upgrade operation, it also includes:
[0089] The host computer detects whether there are controllers that have not been successfully upgraded;
[0090] When the host computer detects that a controller has not been successfully upgraded, it will resend the upgrade file to the corresponding controller to perform the upgrade operation again.
[0091] In this embodiment, after the batch broadcast upgrade is completed, the host computer queries the program numbers and upgrade status bits of all controllers this time, and reissues the upgrade file in a one-to-one manner to the controllers whose program numbers have not been successfully upgraded, and re-upgrades them.
[0092] In this embodiment, the controller includes a boot loader and an application program; after running the upgrade file to perform the upgrade operation, it also includes: first, the upgrade flag in the electrically erasable programmable read-only memory in the controller is read by the boot loader, and stored in the static memory in the controller, in this example, stored in the position of 0x10000000, and when compiling, it is ensured that the application program does not use the static memory space. Then the controller sets the main stack pointer to jump to the starting position of the application program (for example, APP_Adress), enters the reset function of the application program (for example, APP_Adress+4) through the function pointer, and starts running the application program.
[0093] Exemplarily, the boot loader also includes:
[0094] Align the locations of all interrupt functions to the starting location of the application program.
[0095] Figure 3 A flowchart of program jump and interrupt processing of a remote upgrade method of a controller provided in an embodiment of the present application, such as Figure 3 As shown, in this embodiment, the positions of all interrupt functions are offset in advance in the boot loader by the number of the starting positions of the application program. Specific embodiments include:
[0096] S41, the flag state of the boot loader jumps to the application;
[0097] S42, when the application generates an interrupt function request, finding the interrupt function in the boot loader;
[0098] S43. Find the interrupt function in the application (ie, the actual function address) according to the offset address of the interrupt function in the boot loader (ie, the starting address of the application plus the interrupt function arrangement order multiplied by four, plus the starting address of the application determined according to the status flag).
[0099] Figure 4 A schematic diagram of the structure of the controller provided in the embodiment of the present application, such as Figure 4 As shown, exemplarily, this embodiment discloses a controller, including: a memory for storing a computer program; a processor for implementing the steps of the remote upgrade method of the controller when executing the computer program.
[0100] In this embodiment, the controller may be a low-power product controller based on the Cortex-M0 chip, such as a wristband, light control, vacuum cleaner, etc. The controller may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 4 It is only an example of a controller and does not constitute a limitation of the controller. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0101] The processor may be based on a Cortex-M0 type processor from ARM.
[0102] In some embodiments, the memory may be an internal storage unit of the controller, such as a flash memory of the controller. In other embodiments, the controller may also be an external storage device of the controller, such as an internal flash memory (i.e., a FLASH chip) and an external flash memory (i.e., a FLASH chip). Furthermore, the memory may include both an internal storage unit of the controller and an external storage device. The memory is used to store a remote upgrade system, an application, a boot loader (BootLoader), data, and other programs of the operating controller, such as the program code of the computer program. The memory may also be used to temporarily store data that has been output or is to be output.
[0103] Figure 5 A schematic diagram of the structure of a remote upgrade system for a controller provided in an embodiment of the present application, such as Figure 5 As shown, illustratively, this embodiment discloses a remote upgrade system of a controller, including a controller,
[0104] A master station, wirelessly connected to one or more host computers, and configured to send program files to the one or more host computers;
[0105] The host computer is wirelessly connected to the controller and is configured to receive the program file sent by the master station, parse it into an upgrade file and send it to the controller.
[0106] In this embodiment, the remote upgrade system of the controller sends a flash memory clearing instruction to the controller according to the upgrade file sent by the host station received by the host computer in the controller, so that the controller clears the flash memory program at the upgrade position; the host computer parses the program file into an upgrade file and sends it to the controller, so that the controller runs the upgrade file to perform the upgrade operation. In this way, the upgrade process of the controller is completed by remote communication, without consuming a lot of manpower and material costs. At the same time, the upgrade process is short in time, the upgrade efficiency is high, and it does not affect the normal use of users.
[0107] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean 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 the present application.
[0108] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the controller can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the remote upgrade system of the above-mentioned controller can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0109] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0110] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0111] In the embodiments provided in the present application, it should be understood that the disclosed remote upgrade system and method of the controller can be implemented in other ways. For example, the remote upgrade system embodiment of the controller described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into the remote upgrade system of another controller, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of controllers or units, which can be electrical, mechanical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A remote upgrade method for a controller, It is characterized in that include: Get the host computer command to clear the flash memory program at the upgrade location; Obtain the remote upgrade file from the host computer and store it in the upgrade location; Run the upgrade file according to the boot loader; Before running the upgrade file according to the boot loader, the method further comprises: The controller calculates a cyclic redundancy check code in the upgrade file; When the cyclic redundancy check code in the upgrade file calculated by the controller is consistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is successful, and the upgrade flag bit in the electrically erasable programmable read-only memory in the controller is modified and the upgrade file is reset to run; When the cyclic redundancy check code in the upgrade file calculated by the controller is inconsistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is unsuccessful, and errors in the upgrade process are checked and the upgrade is performed again.
2. The remote upgrade method of the controller according to claim 1, It is characterized in that The step of obtaining a flash memory program of a host computer instruction to clear an upgrade position includes: After receiving the program file of the target application sent by the master station, the host computer sends a flash memory clearing instruction to the controller; The controller clears the flash memory program at the upgrade location according to the clear flash memory instruction.
3. The remote upgrade method of the controller according to claim 1, It is characterized in that The upgrade file is a plurality of communication frames obtained by parsing the program file received by the host computer from the main station.
4. The remote upgrade method of the controller according to claim 1, It is characterized in that Before the controller calculates the cyclic redundancy check code in the upgrade file, the method further includes: The controller confirms whether the received upgrade file is complete; When the upgrade file received by the controller is complete, a cyclic redundancy check code in the upgrade file is calculated.
5. The remote upgrade method of the controller as claimed in claim 4, It is characterized in that The upgrade file includes a file information frame and a subsequent frame; before the controller confirms whether the received upgrade file is complete, it also includes: The controller receives the file information frame and confirms whether the program number in the file information frame is consistent with the program number of the current controller; When the program number in the file information frame is consistent with the program number of the current controller, it is confirmed that the controller is upgraded and the subsequent frames are continuously received.
6. The remote upgrade method of the controller as claimed in claim 5, It is characterized in that When the controller is one, When the cyclic redundancy check code in the upgrade file calculated by the controller is inconsistent with the cyclic redundancy check code pre-stored in the upgrade file, it is considered that the upgrade is unsuccessful, and the controller replies with an error code to the corresponding host computer; When the upgrade file received by the controller is incomplete, the controller replies with an error code to the corresponding host computer.
7. The remote upgrade method of the controller according to claim 1, It is characterized in that The host computer is wirelessly connected to the plurality of controllers, and after the upgrade file is run to perform the upgrade operation, the process further includes: The host computer detects whether any of the controllers have failed to upgrade; When the host computer detects that the controller has not been successfully upgraded, it resends the upgrade file to the corresponding controller to perform the upgrade operation again.
8. A controller, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the remote upgrade method for a controller as described in any one of claims 1 to 7 when executing the computer program.
9. A remote upgrade system for a controller, It is characterized in that comprising the controller as claimed in claim 8, A master station, wirelessly connected to one or more host computers, and configured to send program files to the one or more host computers; The host computer is wirelessly connected to the controller and is configured to receive the program file sent by the master station, parse it into the upgrade file, and send it to the controller.
