Program upgrading method and system for single-chip microcomputer, single-chip microcomputer and computer program product

By combining wireless communication modules and extended storage modules with high-speed analog switches, the problems of complex and slow microcontroller program upgrade operations have been solved, achieving an efficient and convenient program upgrade process, and improving user experience and system stability.

CN120929109APending Publication Date: 2025-11-11LAUNCH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511136220.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing microcontroller program upgrade methods are complex, rely on external tools, are slow, and result in a poor user experience.

Method used

The upgrade file is directly obtained by the wireless communication module and stored in the expansion storage module. The storage access right is dynamically switched by a high-speed analog switch, so that the microcontroller can read the upgrade file from the expansion storage module to update the program.

Benefits of technology

It improves the efficiency of downloading and storing upgrade files, simplifies the operation process, enhances user experience and device maintenance efficiency, and avoids the speed bottleneck of traditional serial port transmission and dependence on external tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929109A_ABST
    Figure CN120929109A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a program upgrading method and system for a single-chip microcomputer, the single-chip microcomputer and a computer program product. The program upgrading method and system are used for improving the program upgrading speed of the single-chip microcomputer and avoiding inconvenience caused by the fact that program upgrading needs to depend on an external computer. The program upgrading method for the single-chip microcomputer is applied to a program upgrading system of the single-chip microcomputer. The program upgrading system comprises the single-chip microcomputer, a wireless communication module and an expansion storage module. The single-chip microcomputer is electrically connected with the wireless communication module and the expansion storage module, and the wireless communication module is electrically connected with the single-chip microcomputer and the expansion storage module. The method comprises the following steps: responding to a file downloading signal, receiving an upgrading file for upgrading a single chip microcomputer program by utilizing a wireless communication module, and storing the upgrading file in an expansion storage module; and transmitting the upgrading file in the expansion storage module to the single-chip microcomputer, so that the single-chip microcomputer completes program upgrading of the single-chip microcomputer according to the upgrading file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microcontroller technology, and in particular to a method, system, microcontroller, and computer program product for upgrading microcontroller programs. Background Technology

[0002] Existing microcontroller platform products typically connect directly to the microcontroller's serial port via a computer's built-in serial port. Upgrades are then performed by writing the program to the microcontroller using a dedicated programming tool or upgrade software. However, this method requires users to prepare a computer, drivers, a serial cable, and programming software, making it a complex and cumbersome process. Furthermore, serial communication bandwidth is limited, making the transfer of large files (especially programs or data exceeding tens of megabytes) very time-consuming, resulting in low upgrade efficiency.

[0003] To improve upgrade efficiency, current technologies often use TF cards as extended storage. Users need to insert the TF card into their computer using a USB card reader, write the upgrade files to the TF card using dedicated upgrade software on the computer, and then insert the TF card back into the device to complete the upgrade. While this method speeds up file writing, users still need to prepare a card reader and install dedicated software on their computer, making the operation complex, cumbersome, and resulting in a poor user experience.

[0004] Therefore, existing technologies suffer from drawbacks such as slow upgrade speed, complex operation, and reliance on external tools and software, and there is an urgent need for a faster and more convenient upgrade solution to improve user experience. Summary of the Invention

[0005] Based on the above problems, this application provides a method, system, microcontroller, and computer program product for upgrading microcontroller programs. It aims to solve the problems of slow upgrade speed, complex operation, and reliance on external tools and special software in the prior art, so as to realize efficient, convenient, driver-free, and dedicated programming software-free upgrade of microcontroller programs and improve user experience.

[0006] In a first aspect, embodiments of this application provide a program upgrade method for a microcontroller, applied to a program upgrade system for a microcontroller. The program upgrade system includes a microcontroller, a wireless communication module, and an extended storage module. The microcontroller is electrically connected to both the wireless communication module and the extended storage module, and the wireless communication module is electrically connected to both the microcontroller and the extended storage module. The method includes:

[0007] In response to a file download signal, the wireless communication module receives an upgrade file for microcontroller program upgrade and stores the upgrade file in the extended storage module.

[0008] The upgrade file in the extended storage module is transferred to the microcontroller so that the microcontroller can complete the program upgrade based on the upgrade file.

[0009] In one embodiment, the wireless communication module is electrically connected to the extended storage module via the high-speed analog switch, and the microcontroller is electrically connected to the extended storage module via the high-speed analog switch; the method further includes:

[0010] Based on the indication signal of the current operation stage of the microcontroller's program upgrade system, the high-speed analog switch is switched to adjust the connectivity status of the extended storage module.

[0011] In one embodiment, the step of receiving an upgrade file for microcontroller program upgrade using the wireless communication module in response to a file download signal, and storing the upgrade file in the extended storage module, includes:

[0012] In response to a file download signal, the high-speed analog switch is controlled to connect the first side path between the extended storage module and the wireless communication module;

[0013] The wireless communication module is used to obtain the upgrade file for microcontroller program upgrade, and the upgrade file is stored in the extended storage module through the first side path.

[0014] In one embodiment, the step of transferring the upgrade file from the extended storage module to the microcontroller, so that the microcontroller can complete the microcontroller program upgrade according to the upgrade file, includes:

[0015] In response to the download completion signal sent by the wireless communication module, the high-speed analog switch is controlled to connect the second side path between the extended storage module and the microcontroller;

[0016] The upgrade file in the extended storage module is transmitted to the microcontroller through the second side path, so that the microcontroller can complete the program upgrade of the microcontroller according to the upgrade file.

[0017] In one embodiment, before receiving an upgrade file for microcontroller program upgrade using the wireless communication module in response to a file download signal and storing the upgrade file in the extended storage module, the method further includes:

[0018] In response to a program upgrade detection signal, the program version of the microcontroller is checked to see if it is the latest version; wherein the program upgrade detection signal carries latest version information; when checking whether the program version of the microcontroller is the latest version, the second side path between the extended storage module and the microcontroller is connected.

[0019] If the program version of the microcontroller is not the latest version, the latest version information is sent to the wireless communication module to trigger the generation of a file download signal.

[0020] In one embodiment, the triggering method for generating the program upgrade detection signal includes at least one of the following:

[0021] In response to the user triggering the program upgrade button on the corresponding operation interface of the microcontroller, the program upgrade detection signal is generated.

[0022] When a wireless communication terminal is detected to have entered the preset sensing range of the wireless communication module, the program upgrade detection signal is generated.

[0023] The program upgrade detection signal is generated at a preset time point.

[0024] In one embodiment, the wireless communication module includes a WIFI module, a Bluetooth module, or a near-field communication module; the extended storage module includes a TF card or an SD card.

[0025] Secondly, embodiments of this application also provide a microcontroller program upgrade system, including: a microcontroller, a high-speed analog switch, a wireless communication module, and an extended storage module;

[0026] In response to a file download signal, the wireless communication module receives an upgrade file for microcontroller program upgrade and transmits the upgrade file to the extended storage module through a first side path between the extended storage module and the wireless communication module connected by the high-speed analog switch.

[0027] The extended storage module is used to store the upgrade file;

[0028] The microcontroller obtains the upgrade file in the extended storage module through the second side path between the extended storage module and the microcontroller connected by the high-speed analog switch, and completes the program upgrade according to the upgrade file.

[0029] Thirdly, embodiments of this application also provide a microcontroller, including:

[0030] Central processing unit, memory, and input / output interfaces;

[0031] The memory is either a short-term storage memory or a persistent storage memory;

[0032] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform any of the above-described program upgrade methods for a microcontroller.

[0033] Fourthly, embodiments of this application also provide a computer program product having a computer program stored thereon. When the computer program is executed by a processor, it performs the program upgrade method for a microcontroller described in any of the above-mentioned embodiments.

[0034] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0035] This application embodiment directly acquires the upgrade file and stores it in the extended storage module via the wireless communication module, avoiding the speed bottleneck caused by relying on the microcontroller's serial port for downloading in existing technologies, thus significantly improving the download and storage efficiency of the upgrade file. Simultaneously, the microcontroller reads the upgrade file from the extended storage module and completes the program update, achieving a reliable and efficient program upgrade process without affecting the normal download of the wireless communication module, thereby improving the system's concurrency and stability. Compared to existing technologies that rely on low-speed serial port transmission or manually copying TF cards using a card reader and computer, this application utilizes the high-speed and convenient characteristics of wireless communication to achieve rapid download and automatic upgrades, simplifying the operation process, reducing user complexity, and improving user experience and equipment maintenance efficiency. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0037] Figure 1 A schematic flowchart of a program upgrade method for a microcontroller provided in an embodiment of this application;

[0038] Figure 2 A schematic diagram of a microcontroller program upgrade system provided in this application embodiment;

[0039] Figure 3 A schematic flowchart of another program upgrade method for a microcontroller provided in this application embodiment;

[0040] Figure 4 This is a schematic diagram of a single-chip microcomputer structure provided in an embodiment of this application. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] Existing microcontroller platform products generally use serial ports to upgrade the device's program. That is, the user connects the microcontroller's serial port interface to the computer, uses programming software to transmit the upgrade file to the microcontroller via the serial port, and the microcontroller receives and stores it in its internal or external memory to complete the upgrade.

[0043] To address the slow speed of serial port upgrades, a common solution in existing technology is to expand storage using a TF card. The process involves copying the upgrade file to the TF card, inserting the TF card into the device, and then having a microcontroller read the TF card to complete the upgrade. Since the TF card copies files via the computer's USB interface, the transfer speed is significantly faster than serial port transfer, thus improving the upgrade file writing speed. However, this method also has drawbacks. Users need an additional card reader, must remove the TF card from the device, insert it into the card reader, copy the upgrade file using dedicated software on the computer, and then reinsert it into the device to complete the upgrade. The entire process is cumbersome, relies on external tools and software, increases the user's burden, and is not conducive to ordinary users completing upgrades quickly and conveniently.

[0044] In summary, existing technologies present a significant contradiction between upgrade efficiency and user convenience. On the one hand, serial port upgrades require no additional hardware but are slow, resulting in long waiting times for users; on the other hand, TF cards can improve speed but require user removal, are complex to operate, and offer a poor user experience. Therefore, this application proposes a new upgrade scheme that avoids the speed bottleneck caused by microcontroller-intermediate serial port transmission and eliminates the need for external card readers and computers, thereby improving upgrade efficiency, simplifying user operations, and optimizing the user experience. This application directly controls the extended storage and writes the upgrade file through an external communication module. The microcontroller obtains the upgrade file and completes the program upgrade by accessing the extended storage, effectively avoiding the aforementioned shortcomings of existing technologies.

[0045] The various embodiments of this application will now be described in further detail with reference to the accompanying drawings.

[0046] This application provides a method for upgrading a microcontroller's program, applied to a microcontroller program upgrade system. The system includes a microcontroller, a wireless communication module, and an extended storage module. The microcontroller, as the core controller of the system, is responsible for running the application program and managing device functions. The wireless communication module communicates with external devices to obtain the upgrade files required for the program upgrade. The extended storage module, as external storage, is typically a large-capacity non-volatile memory used to store the microcontroller's program upgrade files and other data. The microcontroller is electrically connected to both the wireless communication module and the extended storage module, and the wireless communication module is also electrically connected to both the microcontroller and the extended storage module, thereby enabling collaborative work among the three components to complete the program upgrade process. This method for upgrading a microcontroller's program is as follows: Figure 1 As shown, the specific steps include S101-S102.

[0047] S101: In response to the file download signal, the wireless communication module receives the upgrade file for microcontroller program upgrade and stores the upgrade file in the extended storage module.

[0048] Specifically, upon receiving a user's instruction to upgrade the program, or when the microcontroller detects the need for an upgrade, the microcontroller generates a file download signal to initiate the download process. Upon receiving this download signal, the wireless communication module automatically establishes a wireless communication connection and communicates with the terminal containing the upgrade file to retrieve it. During file retrieval, the upgrade file is not directly written to the microcontroller; instead, it is written to the extended storage module by the wireless communication module. This fully utilizes the network bandwidth of the wireless communication module and the write speed of the extended storage module, avoiding the speed bottleneck and high load caused by the microcontroller transmitting large files via serial port, thus improving the efficiency of upgrade file retrieval and storage. Simultaneously, this method of directly storing the file in the extended storage module via the wireless communication module reduces the processing load on the microcontroller during the program upgrade process, improving overall system performance and user experience.

[0049] S102: The upgrade file in the extended storage module is transferred to the microcontroller so that the microcontroller can complete the program upgrade according to the upgrade file.

[0050] Specifically, after the wireless communication module completes the acquisition of the upgrade file and stores it entirely in the extended storage module, the system will notify the microcontroller that the upgrade file is ready through a preset signal or status confirmation mechanism, such as the wireless communication module sending a download completion signal. Upon receiving the download completion signal, the microcontroller will access the extended storage module and read the upgrade file from it.

[0051] During the reading process, the microcontroller extracts the upgrade file content from the extended storage module step by step according to a predetermined protocol and writes the data to the corresponding program storage area in its internal memory. During the writing process, the microcontroller parses and verifies the upgrade file to ensure data integrity and correctness. Once the upgrade file has been fully written and verified, the microcontroller completes its program update.

[0052] The upgrade file transmission path in this application involves first obtaining the upgrade file via an external communication module and temporarily storing it in an extended storage module. Only after obtaining the complete upgrade file is the file transferred from the extended storage module to the microcontroller, instead of directly writing the upgrade file to the microcontroller via a wireless communication module. This ensures that the download and upgrade processes are independent, improving download efficiency and avoiding data conflicts or interference during the upgrade, or excessive workload on the microcontroller. Furthermore, storing the upgrade file in the extended storage module allows for easy re-reading and re-upgrading even in case of an anomaly, enhancing the reliability and security of the microcontroller program upgrade.

[0053] This application embodiment directly acquires the upgrade file and stores it in the extended storage module via the wireless communication module, avoiding the speed bottleneck caused by relying on the microcontroller's serial port for downloading in existing technologies, thus significantly improving the download and storage efficiency of the upgrade file. Simultaneously, the microcontroller reads the upgrade file from the extended storage module and completes the program update, achieving a reliable and efficient program upgrade process without affecting the normal download of the wireless communication module, thereby improving the system's concurrency and stability. Compared to existing technologies that rely on low-speed serial port transmission or manually copying TF cards using a card reader and computer, this application utilizes the high-speed and convenient characteristics of wireless communication to achieve rapid download and automatic upgrades, simplifying the operation process, reducing user complexity, and improving user experience and equipment maintenance efficiency.

[0054] In existing technologies, microcontrollers directly download upgrade programs via serial ports, requiring users to prepare a computer, drivers, serial cables, and programming software to complete the upgrade. This process is cumbersome and has a high barrier to entry. To improve user convenience, some microcontroller products have added Wi-Fi modules. The microcontroller controls the Wi-Fi module to connect to the network via a serial port, downloads the upgrade file from the server, and then transmits the file to the microcontroller via the serial port of the Wi-Fi module for storage. However, this method still relies on serial port transmission. Whether directly through a computer or via a Wi-Fi module, the upgrade speed is limited by the serial port bandwidth and the microcontroller's processing power. When the file size is large or the expanded storage capacity is large, the upgrade takes a long time, is inefficient, and provides a poor user experience. Furthermore, the applicant's actual testing revealed that with the addition of wireless communication modules such as Wi-Fi, the expanded storage module needs to be accessed by both the wireless communication module and the microcontroller. The Wi-Fi module and the microcontroller may share an access interface, easily causing data contention or access failures, resulting in poor system stability. To address the aforementioned issues, the applicant proposes dynamically switching extended storage access rights between the wireless communication module and the microcontroller, fundamentally resolving access conflicts and transmission efficiency problems. The key technological means to achieve this goal is the introduction of a high-speed analog switch. High-speed analog switches offer high electrical isolation, ensuring data remains undistorted and free from crosstalk during switching, while also consuming minimal hardware resources.

[0055] Therefore, the applicant positioned a high-speed analog switch between the extended storage module and the two main controllers (a microcontroller and a wireless communication module). It connects to the wireless communication module via a first side path and to the microcontroller via a second side path. Before the upgrade begins, the analog switch connects the storage module to the Wi-Fi module, allowing the Wi-Fi module to directly download and write the upgrade file at high speed. After the download is complete, the connection is switched to the microcontroller to complete the upgrade. Each stage ensures that only one main controller has access to the storage, preventing concurrent conflicts.

[0056] Please refer to Figure 2The microcontroller is connected to peripheral circuits such as displays and buttons via general-purpose input / output (GPIO) interfaces. These peripheral circuits, including displays and buttons, are electronic circuits connected to the microcontroller for human-computer interaction or auxiliary functions. The display circuit displays information to the user; for example, LED digital tubes and LCD screens are connected to the microcontroller via display driver circuits, and the microcontroller controls their display content. The button circuit uses a button matrix or individual buttons for user input; common button circuits include mechanical push-button switches and touch push-button switches. Other peripheral circuits may include interface circuits such as buzzers, indicator lights, and knobs. The microcontroller is connected to the extended storage via a high-speed analog switch. The microcontroller is directly connected to the WIFI module via a serial port. The WIFI module is also connected to the extended storage via a high-speed analog switch. In practical applications, the WIFI module can be replaced with other wireless communication modules.

[0057] Therefore, in a feasible embodiment, the wireless communication module is electrically connected to the extended storage module through the high-speed analog switch, and the microcontroller is electrically connected to the extended storage module through the high-speed analog switch; the method further includes: switching the high-speed analog switch according to the indication signal of the current operation stage of the microcontroller's program upgrade system to adjust the connectivity state of the extended storage module.

[0058] In this embodiment, both the wireless communication module and the microcontroller are electrically connected to the extended storage module via a high-speed analog switch. The function of the high-speed analog switch is to dynamically switch the access object of the extended storage module according to the current operating stage of the system, thereby avoiding high-speed signal conflicts caused by two main controllers accessing the memory simultaneously. The high-speed analog switch is a low-impedance, high-speed electronic switching device that supports bidirectional signal transmission. It can quickly and stably switch the connection path of the extended storage module, while also ensuring the integrity and high speed of data transmission.

[0059] Specifically, in this step, the system generates corresponding indicator signals at different operational stages, such as signals indicating entry into the program upgrade detection stage, file download stage, or other working stages. Upon receiving these indicator signals, the high-speed analog switch controls its on / off state, transferring access to the extended storage module to the wireless communication module or microcontroller. For example, under normal operating conditions, the high-speed analog switch defaults to connecting the extended storage module and the microcontroller, enabling the microcontroller to read or write data normally.

[0060] In one embodiment, the step of receiving an upgrade file for microcontroller program upgrade using the wireless communication module in response to a file download signal and storing the upgrade file in the extended storage module includes: controlling the high-speed analog switch to connect a first side path between the extended storage module and the wireless communication module in response to a file download signal; obtaining the upgrade file for microcontroller program upgrade using the wireless communication module and storing the upgrade file in the extended storage module through the first side path.

[0061] In this embodiment, after the system detects or receives a file download signal (e.g., a file download request from a user, a file download indication signal pushed by an external server, or the microcontroller automatically triggering the download of the latest version file when it detects that the local file is not the latest version), the system switches the access control of the extended storage module to the wireless communication module, so that the wireless communication module can exclusively access the extended storage for file writing. Therefore, by controlling the high-speed analog switch, the path originally connected between the microcontroller and the extended storage module by default is switched to a first side path connected between the wireless communication module and the extended storage module. At this time, the connection between the microcontroller and the extended storage module is disconnected, which can avoid data conflicts or storage errors caused by two main controllers accessing the storage module simultaneously.

[0062] Subsequently, the wireless communication module, in wireless communication connection mode, downloads the latest upgrade file through its communication link with the external terminal. During the download process, the wireless communication module directly writes the acquired upgrade file data to the extended storage module through the established first side path, instead of writing the acquired upgrade file to the microcontroller through the serial port connection between the wireless communication module and the microcontroller. This fully utilizes the data transmission capability of the wireless communication module and the high-speed writing capability of the extended storage module, enabling dynamic allocation of access rights for the extended storage module at different operation stages, significantly improving download speed and storage efficiency. At the same time, it avoids the low-speed and high-load problems caused by traditional serial port data transfer.

[0063] In one embodiment, the step of transmitting the upgrade file in the extended storage module to the microcontroller, so that the microcontroller can complete the microcontroller program upgrade according to the upgrade file, includes: responding to a download completion signal sent by the wireless communication module, controlling the high-speed analog switch to connect the second bypass path between the extended storage module and the microcontroller; transmitting the upgrade file in the extended storage module to the microcontroller through the second bypass path, so that the microcontroller can complete the microcontroller program upgrade according to the upgrade file.

[0064] Once the wireless communication module has finished downloading the upgrade file and writing it completely to the extended storage module, it sends a download completion signal to the system to notify the microcontroller that the file download phase has ended and the upgrade file is ready. Upon receiving this signal, the system first needs to switch access rights of the extended storage module to the microcontroller. Therefore, by controlling a high-speed analog switch, the first bypass path connecting the wireless communication module and the extended storage module is disconnected, while the second bypass path connecting the extended storage module and the microcontroller is connected. This way, the extended storage module is exclusively accessed by the microcontroller to avoid conflicts caused by simultaneous access from both the wireless communication module and the microcontroller.

[0065] The microcontroller reads the upgrade file from the extended storage module through the established second side path, parses and verifies it according to the predetermined upgrade process, and writes the contents of the upgrade file into its own program storage area (such as the internal Flash memory) to complete the program update and replacement. Throughout the process, the microcontroller reads the upgrade file directly from the extended storage module without needing to go through the wireless communication module, ensuring the reliability of data transmission and the independence of the upgrade process.

[0066] This application embodiment uses a dynamic switching high-speed analog switch to rationally allocate storage access rights between the wireless communication module and the microcontroller, enabling conflict-free and interference-free sequential access to the extended storage module between the two main controllers. This efficiently completes the entire process from download to upgrade, improving system reliability, upgrade speed, and user experience.

[0067] In one embodiment, before receiving an upgrade file for microcontroller program upgrade using the wireless communication module in response to a file download signal and storing the upgrade file in the extended storage module, the method further includes: detecting whether the microcontroller's program version is the latest version in response to a program upgrade detection signal; wherein the program upgrade detection signal carries latest version information; when checking whether the microcontroller's program version is the latest version, a second side path between the extended storage module and the microcontroller is connected; if the microcontroller's program version is not detected to be the latest version, then sending the latest version information to the wireless communication module to trigger the generation of a file download signal.

[0068] Specifically, when the system receives a program upgrade detection signal, it indicates that the microcontroller's program version status needs to be checked. This detection signal carries the latest version information sent by the server or other external terminal, used as a basis for version comparison. After receiving the upgrade detection signal, the system can control a high-speed analog switch to connect the second side path between the extended storage module and the microcontroller, allowing the microcontroller to access the extended storage module and read the currently stored version information (such as the program version number or checksum). Alternatively, the microcontroller can also determine whether the current program needs to be updated by comparing the local program version with the latest version information carried in the detection signal.

[0069] If the detection result indicates that the microcontroller's currently running program version is already the latest version, the download operation will not be triggered, and the system will continue to operate normally. If the detection result indicates that the microcontroller's current program version is not the latest version, the microcontroller will send the latest version information to the wireless communication module. This allows the wireless communication module to establish a connection with an external server or other terminal based on the latest version information and initiate an upgrade file download request, thereby generating a file download signal and formally entering the file download phase.

[0070] This application embodiment effectively avoids unnecessary upgrade operations and reduces network burden and system load by pre-detecting the program version. Simultaneously, by appropriately switching the high-speed analog switch during the detection phase, it ensures that the extended storage module always operates under the correct access control, avoiding access conflicts and data errors, thereby guaranteeing the efficiency and reliability of the version detection and upgrade process.

[0071] To accommodate the needs of user-initiated control, automatic sensing, and scheduled maintenance, in one embodiment, the triggering and generation method of the program upgrade detection signal includes at least one of the following: triggering the generation of the program upgrade detection signal in response to a program upgrade button triggered by the user on the corresponding operation interface of the microcontroller; triggering the generation of the program upgrade detection signal when a wireless communication terminal enters the preset sensing range of the wireless communication module; or triggering the generation of the program upgrade detection signal at a preset time point.

[0072] The first method can be referenced. Figure 3 The corresponding program upgrade process allows users to manually click or select the "Program Upgrade" button on the microcontroller's interface (e.g., menus, buttons, or touchscreen) when they wish to upgrade the device. Upon detecting the user's action, the system generates a program upgrade detection signal and initiates the upgrade detection process, fulfilling the user's proactive upgrade needs in a convenient, direct, and easy-to-operate manner.

[0073] The second method can be wireless sensing triggering. For example, when a microcontroller device is not equipped with a display panel or physical operation buttons, the upgrade process can be triggered through wireless sensing methods (such as Near Field Communication (NFC)). Specifically, users can run a matching upgrade application on an external terminal device (such as a smartphone or tablet), and when the system detects that a wireless communication terminal (such as a mobile phone, tablet, or other terminal device with NFC functionality) has entered the preset sensing range of the wireless communication module, it automatically triggers the generation of a program upgrade detection signal. Based on the access detection of the wireless communication module or the range sensing of Bluetooth, WiFi, and NFC, an automated upgrade experience of "detecting upon proximity" is achieved, reducing user intervention, further improving the level of intelligence, and making operation simpler. This method is also applicable to microcontroller systems without display circuitry or display requirements.

[0074] The third method is timed triggering. The system can preset a certain time point or time interval (such as early morning every day, once a week, etc.) to automatically generate a program upgrade detection signal and start the upgrade detection process. This method can automatically maintain the device in the latest version without user access or operation, thus improving operation and maintenance efficiency.

[0075] The above-mentioned multiple triggering mechanisms enable the system to flexibly and promptly initiate program version checks in different scenarios, which not only ensures the timeliness and proactivity of upgrades, but also improves user experience and the system's intelligence level.

[0076] In the above embodiments, the wireless communication module is used to establish a wireless connection with an external server or wireless communication terminal, thereby downloading upgrade files and transmitting control signals. Depending on the characteristics of different application environments, the wireless communication module can adopt any of the following implementation methods: a WIFI module, a Bluetooth module, or a Near Field Communication (NFC) module. The extended storage module is used to store the upgrade files downloaded by the wireless communication module and to allow the microcontroller to read the update program. Depending on the storage capacity and interface requirements, the following storage media can be selected: a TF card (MicroSD card) or an SD card.

[0077] To implement the microcontroller program upgrade method of this application embodiment, this application embodiment also provides a microcontroller program upgrade system, which includes: a microcontroller, a high-speed analog switch, a wireless communication module, and an extended storage module.

[0078] The wireless communication module responds to a file download signal, receives an upgrade file for microcontroller program upgrade, and transmits the upgrade file to the extended storage module through a first side path connected to the extended storage module and the wireless communication module via the high-speed analog switch; the wireless communication module includes a WIFI module, a Bluetooth module, or a near-field communication module; the extended storage module includes a TF card or an SD card;

[0079] The extended storage module is used to store the upgrade file;

[0080] The microcontroller obtains the upgrade file in the extended storage module through the second side path between the extended storage module and the microcontroller connected by the high-speed analog switch, and completes the program upgrade according to the upgrade file.

[0081] It should be noted that the above embodiments of the microcontroller program upgrade system are only illustrated by the division of the above program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. Furthermore, the microcontroller program upgrade system provided in the above embodiments and the program upgrade method embodiments for microcontrollers belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0082] Based on the hardware implementation of the above program modules, and in order to implement the program upgrade method for a microcontroller provided in this application embodiment, this application embodiment also provides a microcontroller, such as... Figure 4 As shown, the microcontroller 400 includes:

[0083] Central processing unit 401, memory 402, and input / output interface 403;

[0084] The memory 402 is a short-term storage memory or a persistent storage memory;

[0085] The central processing unit 401 is configured to communicate with the memory 402 and execute the instructions in the memory 402 to perform any of the above-mentioned program upgrade methods for microcontrollers.

[0086] Of course, in practical applications, the various components in the microcontroller 400 are coupled together through the bus system 404. It can be understood that the bus system 404 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 404 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 4 The general designated all buses as Bus System 404.

[0087] The memory 402 in this embodiment is used to store various types of data to support the operation of the microcontroller 400. Examples of such data include any computer program used to operate on the microcontroller 400.

[0088] It is understood that when the processor in the microcontroller described above executes the computer program, it can also realize the functions of each unit in the corresponding device embodiments described above, which will not be repeated here. Exemplarily, the computer program can be divided into one or more modules / units, one or more modules / units are stored in memory and executed by the processor to complete the various embodiments of this application. One or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the microcontroller. For example, the computer program can be divided into units in the microcontroller described above, and each unit can realize the specific functions described in the corresponding microcontrollers above.

[0089] A processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the microcontroller, connecting all parts of the microcontroller through various interfaces and circuits.

[0090] Memory can be used to store computer programs and / or modules. The processor implements various functions of the microcontroller by running or executing the computer programs and / or modules stored in the memory, and by calling data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital cards (SD), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.

[0091] This application also provides a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it performs any of the above-described program upgrade methods for a microcontroller.

[0092] This application also provides a computer program product storing a computer program / instruction, which, when executed by a processor, is used to implement the program upgrade method for a microcontroller described in the first aspect or any specific implementation of the first aspect of this application.

[0093] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0095] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0097] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a microcontroller device to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for upgrading a program in a microcontroller, characterized in that, A program upgrade system for a microcontroller, the program upgrade system comprising a microcontroller, a wireless communication module, and an extended storage module; the microcontroller is electrically connected to both the wireless communication module and the extended storage module, and the wireless communication module is electrically connected to both the microcontroller and the extended storage module; the method includes: In response to a file download signal, the wireless communication module receives an upgrade file for microcontroller program upgrade and stores the upgrade file in the extended storage module. The upgrade file in the extended storage module is transferred to the microcontroller so that the microcontroller can complete the program upgrade based on the upgrade file.

2. The method according to claim 1, characterized in that, The wireless communication module is electrically connected to the extended storage module via the high-speed analog switch, and the microcontroller is electrically connected to the extended storage module via the high-speed analog switch; the method further includes: Based on the indication signal of the current operation stage of the microcontroller's program upgrade system, the high-speed analog switch is switched to adjust the connectivity status of the extended storage module.

3. The method according to claim 2, characterized in that, In response to a file download signal, the wireless communication module receives an upgrade file for microcontroller program upgrades and stores the upgrade file in the extended storage module, including: In response to a file download signal, the high-speed analog switch is controlled to connect the first side path between the extended storage module and the wireless communication module; The wireless communication module is used to obtain the upgrade file for microcontroller program upgrade, and the upgrade file is stored in the extended storage module through the first side path.

4. The method according to claim 2, characterized in that, The step of transferring the upgrade file from the extended storage module to the microcontroller, so that the microcontroller can complete the program upgrade according to the upgrade file, includes: In response to the download completion signal sent by the wireless communication module, the high-speed analog switch is controlled to connect the second side path between the extended storage module and the microcontroller; The upgrade file in the extended storage module is transmitted to the microcontroller through the second side path, so that the microcontroller can complete the program upgrade of the microcontroller according to the upgrade file.

5. The method according to claim 1, characterized in that, Before receiving the upgrade file for microcontroller program upgrade using the wireless communication module in response to the file download signal and storing the upgrade file in the extended storage module, the method further includes: In response to a program upgrade detection signal, the program version of the microcontroller is checked to see if it is the latest version; wherein the program upgrade detection signal carries latest version information; when checking whether the program version of the microcontroller is the latest version, the second side path between the extended storage module and the microcontroller is connected. If the program version of the microcontroller is not the latest version, the latest version information is sent to the wireless communication module to trigger the generation of a file download signal.

6. The method according to claim 5, characterized in that, The triggering and generation methods for the program upgrade detection signal include at least one of the following: In response to the user triggering the program upgrade button on the corresponding operation interface of the microcontroller, the program upgrade detection signal is generated. When a wireless communication terminal is detected to have entered the preset sensing range of the wireless communication module, the program upgrade detection signal is generated. The program upgrade detection signal is generated at a preset time point.

7. The method according to claim 1, characterized in that, The wireless communication module includes a WIFI module, a Bluetooth module, or a near-field communication module; the extended storage module includes a TF card and an SD card.

8. A microcontroller program upgrade system, characterized in that, include: Microcontroller, high-speed analog switch, wireless communication module, expansion storage module; In response to a file download signal, the wireless communication module receives an upgrade file for microcontroller program upgrade and transmits the upgrade file to the extended storage module through a first side path between the extended storage module and the wireless communication module connected by the high-speed analog switch. The extended storage module is used to store the upgrade file; The microcontroller obtains the upgrade file in the extended storage module through the second side path between the extended storage module and the microcontroller connected by the high-speed analog switch, and completes the program upgrade according to the upgrade file.

9. A microcontroller, characterized in that, include: Central processing unit, memory, and input / output interfaces; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 7.

10. A computer program product having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1 to 7.