Unified differential OTA method and system for dot matrix pen, product and medium
Through the unified differential OTA method, the server generates a differential upgrade package and packages it into a unified upgrade package. The dot-matrix pen terminal verifies and distributes it to the functional chip, solving the problem of low firmware upgrade efficiency of dot-matrix pen, realizing unified update of multiple chips, significantly improving the upgrade efficiency.
Patent Information
- Application Number
- CN202411624864.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the firmware upgrade efficiency of dot matrix pen is low, especially when multiple dot matrix pens are upgraded simultaneously, traditional methods lead to too long overall upgrade time.
Using the unified differential OTA method, the server generates a differential upgrade package and packages it into a unified upgrade package, transmits it to the main control chip, and verifies the version information of the dot-matrix pen terminal, generates the target firmware and writes it to the unused partition, and distributes it to the functional chip to achieve unified update of multi-chip firmware.
By reducing the amount of data transmitted, improving transmission efficiency, and ensuring the accuracy and applicability of the upgrade package, unified update of multi-chip firmware is achieved, significantly improving the update efficiency of dot matrix pen firmware.
Smart Images

Figure CN119690491A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of firmware upgrade, and in particular to a unified differential OTA method, system, product and medium for a dot matrix pen. Background Art
[0002] With the development of smart office and education informatization, smart writing devices are becoming more and more widely used. As a smart writing device, dot pen can accurately identify and record writing tracks by optically recognizing dot patterns on paper, playing an important role in teaching, meeting and other scenarios.
[0003] In related technologies, firmware can be updated in a wired manner, connected to a computer via a USB interface or a dedicated interface cable, and then the firmware is written into the dot matrix pen using a dedicated flashing software. When some products update their firmware via Bluetooth, a mobile phone APP is required for a one-to-one connection upgrade, and only the firmware of a single chip can be updated each time.
[0004] However, since dot pen products usually use BLE Bluetooth for data transmission with a low transmission rate, the firmware upgrade of a single chip often takes tens of seconds or even minutes. At the same time, in scenarios such as classrooms and conference rooms, it is often necessary to upgrade the firmware of multiple dot pens at the same time. The method of upgrading them one by one results in an overall long upgrade time, resulting in reduced update efficiency of the dot pen firmware. Summary of the invention
[0005] The present application provides a unified differential OTA method, system, product and medium for a dot matrix pen, which are used to improve the update efficiency of the dot matrix pen firmware.
[0006] In the first aspect, the present application provides a unified differential OTA method for a dot matrix pen, which is applied to a unified differential OTA system, wherein the unified differential OTA system includes a server and a dot matrix pen terminal, and the method includes: the server generates a differential upgrade package for the firmware of each functional chip, and packages the differential upgrade package with the current version information to form a unified upgrade package; the server transmits the unified upgrade package to the main control chip, and the main control chip includes a dual-partition storage space, and the dual-partition storage space includes a used partition and an unused partition, and the used partition includes the currently running firmware; after receiving the unified upgrade package, the dot matrix pen terminal verifies the current version information in the unified upgrade package; if the verification passes, the dot matrix pen terminal generates a target firmware according to the differential upgrade package; the dot matrix pen terminal writes the target firmware into the unused partition, and distributes the target firmware to each of the functional chips corresponding to the target firmware.
[0007] By adopting the above technical solution, the server generates a differential upgrade package and packages it into a unified upgrade package, which reduces the amount of transmitted data and improves transmission efficiency. The dual-partition storage space design of the main control chip ensures that the used partition where the currently running firmware is located is not affected during the upgrade process. The dot pen terminal verifies the version information of the received unified upgrade package to ensure the accuracy and applicability of the upgrade package. The target firmware is generated according to the differential upgrade package, written into the unused partition and distributed to the functional chip, realizing the unified update of multi-chip firmware and improving the update efficiency of the dot pen firmware.
[0008] In combination with some embodiments of the first aspect, in some embodiments, after the step of the dot matrix pen terminal writing the target firmware into the unused partition and distributing the target firmware to each of the functional chips corresponding to the target firmware, the method further includes: the dot matrix pen terminal verifies the target firmware in the functional chip; if the verification passes, the dot matrix pen terminal marks the unused partition as a used partition, marks the original used partition as an unused partition, and updates the partition table information in the main control chip; the dot matrix pen terminal sends an update success message to the server; when the dot matrix pen terminal receives a system restart instruction, the target firmware in the used partition is used as the current running firmware.
[0009] By adopting the above technical solution, the terminal verifies the firmware to ensure its completeness and correctness, and the partition mark and table information are updated to achieve orderly switching, ensuring that the new firmware takes effect after restart. The success message is sent to facilitate the server to manage records, improve the success rate and stability of firmware upgrades, reduce failures, and optimize user experience.
[0010] In combination with some embodiments of the first aspect, in some embodiments, after the step of the dot matrix pen terminal verifying the target firmware in the functional chip, the method also includes: if the verification fails, the dot matrix pen terminal keeps the current running firmware in the used partition running, and records the firmware upgrade status and communication interface information of the functional chip that failed the verification; the dot matrix pen terminal sends an update failure message containing the firmware upgrade status and the communication interface information to the server.
[0011] By adopting the above technical solution, the system can keep running to ensure basic functions when verification fails, record information and send failure messages to help the server locate the problem, the server generates some upgrade packages for targeted repairs, and the terminal operates again to effectively handle the failed chip, saving overall upgrade time and improving flexibility and adaptability.
[0012] In combination with some embodiments of the first aspect, in some embodiments, after the step of if the verification fails, the dot pen terminal keeps the current running firmware in the used partition running and sends an update failure message to the server, the method also includes: when the server receives the update failure message, the server regenerates a partial upgrade package for the functional chip that has not been updated according to the firmware upgrade status and the communication interface information; when receiving the partial upgrade package, the dot pen terminal verifies the current version information in the partial upgrade package; if the verification passes, the dot pen terminal generates partial firmware according to the partial upgrade package; the dot pen terminal writes the partial firmware to the unused partition, and distributes the partial firmware to the functional chip that has not been updated.
[0013] By adopting the above technical solution, the server generates partial upgrade packages based on the information, accurately locates and repairs the problem. The terminal verifies and processes, efficiently repairs the single chip upgrade failure, improves the overall upgrade success rate, and reduces delays.
[0014] In combination with some embodiments of the first aspect, in some embodiments, after the dot pen terminal takes the step of using the target firmware in the used partition as the currently running firmware when receiving a system restart instruction, the method further includes: when an operating abnormality is detected in the target firmware, the dot pen terminal loads the currently running firmware stored in the used partition; the dot pen terminal distributes the currently running firmware to the functional chip, and sends a rollback success message to the server.
[0015] By adopting the above technical solution, when an abnormal operation occurs, the terminal loads the original firmware and distributes it to the chip to resume normal operation. At the same time, it provides feedback to the server to achieve a quick rollback, avoiding the long-term outage of the device due to abnormal new firmware and enhancing the ability to deal with abnormalities.
[0016] In combination with some embodiments of the first aspect, in some embodiments, after the dot pen terminal distributes the currently running firmware to the functional chip and sends a rollback success message to the server, the method also includes: upon receiving a confirmation message from the server, the dot pen terminal clears the target firmware in the unused partition.
[0017] By adopting the above technical solution, the terminal clears the partition after receiving the confirmation message, ensuring the effective use of storage space, avoiding residual data affecting subsequent upgrades, and cooperating with the rollback mechanism to improve the firmware management process.
[0018] In combination with some embodiments of the first aspect, in some embodiments, before the server generates a differential upgrade package for the firmware of each functional chip and packages the differential upgrade package with the current version information to form a unified upgrade package, the method also includes: the dot matrix pen terminal sends a firmware upgrade request to the server, and the firmware upgrade request includes the device identification information of the dot matrix pen terminal, the identification information of the functional chip and the firmware version information currently running on each of the functional chips; the server confirms the device type of the dot matrix pen terminal based on the device identification information, and obtains the target firmware corresponding to the device type from the firmware library based on the identification information of the functional chip; the server compares the firmware version information currently running on all chips with the version information of the target firmware, and determines the chip with inconsistent firmware version information as the functional chip.
[0019] By adopting the above technical solution, the dot pen terminal sends a firmware upgrade request containing multiple information, providing the server with accurate device and chip information, so that the server can accurately locate the target firmware. The server confirms the device type and obtains the target firmware based on this, and then determines the functional chip by comparing the version information, ensuring the targeted upgrade.
[0020] In a second aspect, an embodiment of the present application provides a unified differential OTA system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the unified differential OTA system to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions. When the above-mentioned computer program product runs on a unified differential OTA system, the above-mentioned unified differential OTA system executes the method described in the first aspect and any possible implementation method of the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions. When the instructions are executed on a unified differential OTA system, the unified differential OTA system executes the method described in the first aspect and any possible implementation method of the first aspect.
[0023] It can be understood that the unified differential OTA system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. This application generates differential upgrade packages through the server and packages them into a unified upgrade package, which reduces the amount of transmitted data and improves transmission efficiency. The dual-partition storage space design of the main control chip ensures that the used partition where the currently running firmware is located is not affected during the upgrade process. The dot pen terminal verifies the version information of the received unified upgrade package to ensure the accuracy and applicability of the upgrade package. The target firmware is generated according to the differential upgrade package, written into the unused partition and distributed to the functional chip, realizing the unified update of multi-chip firmware and improving the update efficiency of the dot pen firmware.
[0025] 2. This application ensures basic functions by keeping running when verification fails, recording information and sending failure messages to help the server locate the problem. The server generates some upgrade packages for targeted repairs, and the terminal operates again to effectively handle the failed chip, saving overall upgrade time and improving flexibility and adaptability.
[0026] 3. This application provides the server with accurate device and chip information by sending a firmware upgrade request containing various information, so that the server can accurately locate the target firmware. The server confirms the device type and obtains the target firmware based on this, and then determines the functional chip by comparing the version information, ensuring the targeted upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flow chart of a unified differential OTA method of a dot matrix pen in an embodiment of the present application; Figure 2 is another flow chart of the unified differential OTA method of the dot matrix pen in the embodiment of the present application; Figure 3 It is a schematic diagram of a physical device structure of a unified differential OTA system in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.
[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0030] For ease of understanding, the application scenarios of the embodiments of the present application are introduced below.
[0031] In the field of smart office and education informatization, the application of dot matrix pens is becoming more and more widespread. The dot matrix pen realizes its functions through the collaborative work of multiple chips, such as MCU chip responsible for image acquisition and decoding, Bluetooth chip for data transmission, ARMCortexM0 chip for power management, DSP chip for auxiliary image pre-processing, etc. These chips run independent firmware respectively. With the upgrade of system functions and bug fixes, the demand for firmware updates is frequent. However, the line brushing method is extremely inconvenient in the user environment. Although Bluetooth OTA update is feasible, because the dot matrix pen uses BLE Bluetooth and the total firmware size is hundreds of K, the transmission takes a long time, affecting the user experience. In addition, the current firmware may be damaged due to abnormal power failure during the OTA process.
[0032] Take a certain existing dot matrix pen product as an example. When updating the firmware, if a wired method is used, such as connecting to a computer through a USB interface and using the flash software to update, for some chips, a separate wire needs to be connected, which is complicated and not suitable for daily user scenarios. If Bluetooth is used, it is common to connect and upgrade through a mobile phone APP one-to-one, and only a single chip firmware can be updated each time. In addition, if an abnormal situation occurs during the update process, such as the Bluetooth connection is interrupted or the device suddenly runs out of power, the firmware may be damaged and cannot be used normally, and it is difficult to restore to the state before the update, which seriously affects the normal use of users.
[0033] In the dot matrix pen using this solution, the NORFLASH of the main control MCU has A / B partitions for the firmware of each chip. During the initial production, the firmware of the chips other than the main control MCU is flashed online, and the main control chip flashes the firmware of each chip into the A area. When the system firmware needs to be updated, the server determines the target firmware based on the device identification and other information, generates a differential upgrade package for the functional chip after comparing the versions, and packages it into a unified upgrade package and transmits it to the main control chip. After receiving, the dot matrix pen terminal verifies the version information, generates the target firmware through the differential reconstruction algorithm, writes it to the unused partition, and distributes it to the functional chip. After the verification is successful, the partition identifier is switched and the new firmware is loaded when restarting. For example, in the classroom scenario with the same 30 dot matrix pens, using this solution, the server can generate and transmit differential upgrade packages for multiple chips of multiple pens at one time, and each pen quickly completes the update process after receiving it, which greatly shortens the overall time. At the same time, the A / B partition mode effectively avoids firmware damage caused by abnormal power failure, etc., and improves user experience and device reliability.
[0034] For ease of understanding, the following describes the process of the method provided by this implementation in combination with the above scenario. Figure 1 , which is a flow chart of a unified differential OTA method of a dot matrix pen in an embodiment of the present application.
[0035] S101: The server generates a differential upgrade package for the firmware of each functional chip, and packages the differential upgrade package with current version information to form a unified upgrade package.
[0036] Among them, the server refers to the server or computer system responsible for managing and distributing firmware upgrade packages. It has powerful computing and storage capabilities, can process a large amount of firmware data and communicate with many dot pen terminals, such as the firmware management server within the enterprise. Functional chip refers to the integrated circuit chip that performs specific functions in the dot pen, such as the MCU chip for image acquisition and decoding, the Bluetooth chip responsible for data transmission, etc. The firmware of different functional chips is independent of each other and is specially designed for their functions. Firmware refers to the program code written into the functional chip to control the operation of the chip and realize its functions. It determines the working mode and performance of the chip. The differential upgrade package is a data packet that compares the target firmware with the current firmware through a specific algorithm and only contains the difference between the two. It is used to reduce the amount of transmitted data. For example, if a certain section of the target firmware code is modified, the differential upgrade package only contains the modified part instead of the entire firmware. The current version information is used to identify the current version status of the firmware, including version number, release date, etc., so as to perform version comparison and verification. The unified upgrade package is a data packet that integrates the differential upgrade packages and version information of multiple functional chips. It adopts a unified data format and transmission protocol to facilitate unified processing and management of terminal devices.
[0037] Specifically, when a new firmware version needs to be updated, the server first obtains the firmware information currently running on each functional chip, and then finds the corresponding target firmware from the firmware library. The server uses a differential algorithm to compare the target firmware with the current firmware block by block, calculates the difference data block and its location information, and generates a differential upgrade package. Then, the server packages the generated differential upgrade package and the current version information according to a predetermined data structure to form a unified upgrade package. This unified upgrade package not only contains the differential data required for the upgrade of each functional chip, but also carries version information for subsequent verification and other operations to ensure the accuracy and completeness of the upgrade process.
[0038] In some embodiments, a differential upgrade package can be generated and packaged into a unified upgrade package in a variety of ways: Optionally, the server first establishes an index of the functional chip firmware library, and quickly locates the current firmware and the target firmware according to the device type and chip identification. Then, the firmware is divided into blocks using a hash algorithm and the characteristic values are calculated. The difference parts are compared to generate a differential upgrade package, and finally the differential upgrade package and the version information are packaged into a unified upgrade package; Optionally, the server first reads the binary data of the current firmware and the target firmware, compares them byte by byte, records the position and content of different bytes to form differential data, and then combines the differential data with the version information into a unified upgrade package. It is understandable that other methods can also be used to implement this step, which is not limited here.
[0039] S102: The server transmits the unified upgrade package to a main control chip. The main control chip includes a dual-partition storage space. The dual-partition storage space includes a used partition and an unused partition. The used partition includes the currently running firmware.
[0040] Among them, the main control chip is the core control chip in the dot matrix pen, which is responsible for coordinating and managing the work of other functional chips, such as common high-performance microcontrollers. The dual-partition storage space is two independent storage areas divided in the main control chip, which are used to store firmware in different states. The used partition is the area where the currently running firmware is stored. When the system starts, the firmware will be loaded from this partition into the memory and executed. The unused partition is the space reserved for storing new firmware, which plays a role of temporary storage during the upgrade process.
[0041] Specifically, after the unified upgrade package is generated on the server side, it will be transmitted to the main control chip. The server side communicates with the main control chip through a preset data transmission protocol, such as a custom transmission protocol based on Bluetooth or other wireless transmission protocols. The server side divides the unified upgrade package into certain data packet sizes, and then sends them to the main control chip one by one. When the main control chip receives the data packet, it will first temporarily store it in the buffer and perform data verification to ensure the integrity and accuracy of the data. When all data packets are received and verified, the main control chip will write the complete unified upgrade package to the unused partition to prepare for subsequent firmware upgrade operations, ensuring that the normal operation of the current system will not be affected during the upgrade process, because the currently running firmware is still working normally in the used partition.
[0042] In some embodiments, the unified upgrade package can be transmitted to the main control chip in a variety of ways: Optionally, the server uses the broadcast mode of Bluetooth BLE to send the unified upgrade package to the main control chip, the main control chip is in receiving mode, caches and verifies the data after receiving it, and writes it to the unused partition after it is correct; Optionally, the server connects to the main control chip via wireless Wi-Fi, establishes a reliable TCP connection, sends the unified upgrade package in accordance with the agreed transmission format, and the main control chip receives and processes it in sequence. It is understandable that other methods can also be used to implement this step, which is not limited here.
[0043] S103: After receiving the unified upgrade package, the dot matrix pen terminal verifies the current version information in the unified upgrade package.
[0044] Among them, the dot pen terminal refers to the dot pen device actually used by the user. It integrates various functional chips and related hardware components. It is the main body for realizing writing and data interaction, such as the dot pen used by students in class. The unified upgrade package is a data packet generated and transmitted by the server, which contains multiple functional chip differential upgrade packages and current version information. It is a key data carrier for realizing firmware upgrades. The current version information is used to indicate the current version status of the firmware, including version number, checksum and other content. It is an important basis for judging whether the upgrade package is applicable to the current device and whether the data is complete. For example, in the version number format of "V1.2.3", the checksum can be a value calculated by a specific algorithm to ensure data integrity.
[0045] Specifically, when the dot matrix pen terminal receives the unified upgrade package from the server, it will immediately start the version information verification process. This step is executed after receiving the unified upgrade package and before performing the firmware update operation. Its purpose is to ensure that the upcoming upgrade process is safe and reliable. The verification process mainly includes two key aspects: one is to compare whether the firmware version number in the upgrade package is consistent with the version information previously requested by the dot matrix pen terminal, which ensures that the upgrade package is for the device and meets the expected version; the second is to calculate the check value of the upgrade package and compare it with the check value carried in the package. The characteristic value of the upgrade package data is calculated through a preset check algorithm (such as CRC check, SHA check, etc.). If the two are consistent, it means that the data has not been tampered with or damaged during the transmission process. Only when both aspects of the verification are passed will the subsequent firmware update operation continue, otherwise the update will be rejected and an error message will be fed back to the server.
[0046] In some embodiments, the current version information in the unified upgrade package can be verified in a variety of ways: Optionally, first extract the version number field in the upgrade package, and perform a string comparison with the previously requested version number stored locally. If they are exactly the same, proceed to the next step of verification value verification. Then read all the data of the upgrade package, calculate the verification value according to the preset CRC algorithm, and then compare it with the CRC verification value carried in the package. If they are consistent, the verification is successful; Optionally, use the encryption and decryption function provided by the security chip to first decrypt the upgrade package (if the upgrade package is encrypted and transmitted), then obtain the version number and verification value information therein, compare the version number with the local version number, and if it meets the upgrade rules (such as the new version number is greater than the old version number), then use the SHA algorithm to calculate the hash value of the upgrade package data, and compare it with the SHA verification value in the package. If they are consistent, the verification is successful. It can be understood that other methods can also be used to implement this step, which is not limited here.
[0047] S104: If the verification is successful, the dot matrix pen terminal generates a target firmware according to the differential upgrade package.
[0048] Among them, the dot pen terminal is the main device for firmware reconstruction operations. The differential upgrade package is a compressed package generated by the server that contains the difference data and location information between the target firmware and the current firmware. It is a key data source for generating the target firmware. For example, if the target firmware adds a new functional module, the differential upgrade package will contain the code of the module and the insertion location information in the firmware. The target firmware refers to the complete firmware program to be run on the dot pen terminal after the update. It will have new functions or fix existing problems.
[0049] Specifically, when the dot pen terminal verifies the current version information in the unified upgrade package, it will enter the stage of generating the target firmware according to the differential upgrade package. This step is performed in order to obtain the complete target firmware that can be used to update the functional chip after determining that the upgrade package is legal and applicable. In specific operations, the dot pen terminal first reads the currently running firmware from the used partition and loads it into the specified memory space to prepare for the subsequent differential data application. Then the differential data and location information in the differential upgrade package are parsed, and the differential data is applied to the current firmware block by block according to the preset differential reconstruction algorithm. For example, if the differential data indicates that a new code is inserted at a certain address, the terminal will insert the code at the corresponding position of the current firmware; if it indicates replacing some data, it will be replaced accurately. In the process of applying differential data, the terminal will continuously perform data integrity checks to ensure that each step of the operation is correct. After the reconstruction is completed, the terminal will also perform integrity verification on the generated target firmware, such as calculating the check value again and comparing it with the expected value to ensure the correctness of the reconstruction result and provide a reliable firmware file for subsequent writing and distribution operations.
[0050] In some embodiments, the target firmware can be generated according to the differential upgrade package in a variety of ways: Optionally, the terminal first creates a blank memory area of the same size as the current firmware for storing the target firmware. Then read the difference data in the order of the position information in the differential upgrade package. For the insert operation, insert the data at the corresponding position of the blank area; for the replace operation, directly overwrite the data at the corresponding position. After each block of difference data is processed, the check value calculation result of the target firmware is updated. After all the processing is completed, the final check value is compared with the expected check value. If they are consistent, the generation is successful; Optionally, using dynamic link library technology, the current firmware and the differential upgrade package are used as inputs to call a special firmware reconstruction function. The function will automatically parse and execute the application operation of the difference data according to the format of the differential upgrade package, and gradually build the target firmware in the memory. During the construction process, the memory usage and data consistency are monitored in real time. After the construction is completed, a comprehensive firmware check is performed, and the generated target firmware is returned after passing. It can be understood that other methods can also be used to implement this step, which is not limited here.
[0051] S105. The dot pen terminal writes the target firmware into the unused partition, and distributes the target firmware to each of the functional chips corresponding to the target firmware.
[0052] Among them, the dot pen terminal is the executor of the firmware writing and distribution operations, and is a device directly operated by the user. The target firmware is a complete and updated firmware program rebuilt through the previous steps, which contains new functions or repair content, such as firmware optimized for a certain dot pen function. The unused partition is a storage area specially reserved in the main control chip for storing new firmware. It serves as transitional storage during the upgrade process to ensure the independence of system operation and upgrade. The functional chip is an integrated circuit that performs specific functions in the dot pen, such as the Bluetooth chip responsible for communication, the MCU chip for image acquisition, etc. Each functional chip requires the correct firmware to realize its function.
[0053] Specifically, after the target firmware is generated, the dot pen terminal will execute the operation of writing it into the unused partition and distributing it to the functional chip. This step is performed after the target firmware is successfully rebuilt and has passed the integrity check. It is a key link in the firmware update process to ensure that the new firmware can be correctly deployed to each functional chip. First, the dot pen terminal writes the rebuilt target firmware into the unused partition of the main control chip. The writing process adopts the page-by-page writing method, that is, each time a fixed-size data page is written, data verification will be performed during writing to ensure that the data is accurately written to the storage area. After the writing is completed, the terminal distributes the corresponding target firmware to each functional chip through the corresponding communication protocol according to the communication interface type of the functional chip (such as serial port, I2C, etc.). The distribution process adopts a packet transmission mechanism to divide the target firmware into multiple data packets for transmission. Each data packet is confirmed after the transmission is completed. If the confirmation is not received, the data packet is retransmitted to ensure that the firmware is completely and correctly transmitted to the functional chip.
[0054] In some embodiments, the target firmware can be written to the unused partition and distributed to the functional chip in a variety of ways: Optionally, for writing to the unused partition, the terminal first obtains the starting address and available space size of the unused partition, and then writes the target firmware data in sequence according to a fixed page size (such as 512 bytes). Each time a page is written, the checksum of the page data is calculated and compared with the predefined checksum. If they are consistent, the next page is written until all are written. For distribution to the functional chip, if the functional chip uses serial communication, the terminal first configures the serial port parameters (baud rate, data bit, stop bit, etc.), and then divides the target firmware into 128-byte packets, sends the data packets in sequence, waits for the functional chip to return a confirmation signal, and resends if it is not received after a timeout until all data packets are sent; Optionally, when writing to the unused partition, the built-in flash memory write driver of the main control chip is used to directly call the driver function to write the target firmware to the unused partition in blocks (such as 1024 bytes per block), and the driver automatically performs error detection and correction during the writing process. For distribution to the functional chip, if the functional chip supports I2C communication, the terminal, as the master device, first sends a start signal and address information to the functional chip, and then divides the target firmware into 64-byte packets of data, and sends them one by one through the I2C protocol. After each packet is sent, wait for the response signal from the slave device (functional chip). If the response is wrong, resend the packet until all data distribution is completed. It can be understood that other methods can also be used to implement this step, which is not limited here.
[0055] The following is a more detailed description of the process of the method provided by this implementation. Figure 2 , is another flow chart of the unified differential OTA method of the dot matrix pen in the embodiment of the present application.
[0056] S201, the dot matrix pen terminal sends a firmware upgrade request to the server, the firmware upgrade request includes the device identification information of the dot matrix pen terminal, the identification information of the function chip and the firmware version information currently running on each function chip.
[0057] The dot pen terminal is an intelligent writing device with multiple built-in functional chips, including the main control chip, communication chip, etc., which are used to realize functions such as writing track recognition and data transmission. The server is a firmware management server, which is responsible for firmware version control and upgrade package distribution. The device identification information contains information such as the device serial number that can uniquely identify the device; the functional chip identification information contains information such as the chip model and internal number that can distinguish different chips; the firmware version information contains information such as the version number and release date that are used to identify the firmware version. These three types of information together constitute the core content of the firmware upgrade request.
[0058] Among them, the OTA application (firmware upgrade request) can be initiated by the pen end or by the server. At the beginning of the firmware upgrade process, the dot pen terminal first establishes an encrypted connection with the server through the wireless communication module. After the connection is established, the terminal will send the upgrade request data packet containing device identification information, identification information of each functional chip, and information about the currently running firmware version to the server through a preset secure transmission protocol. The data packet is encapsulated in a standardized data format to ensure that the server can accurately parse the information in the request.
[0059] S202: The server confirms the device type of the dot matrix pen terminal according to the device identification information, and obtains target firmware corresponding to the device type from a firmware library according to the identification information of the function chip.
[0060] Device type is a classification of the hardware specifications of the dot matrix pen. Different types of devices have differences in hardware configuration, functional characteristics, etc. The firmware library is a hierarchically managed firmware storage system that organizes and stores various versions of firmware according to multiple dimensions such as device type and chip type. The target firmware refers to the latest version or specified version of firmware that has been fully tested and verified for a specific device type and chip type.
[0061] After receiving the upgrade request, the server first queries the device management database through the device identification information to determine the specific model and hardware specifications of the dot pen terminal. After confirming the device type, the server retrieves the target firmware of each functional chip corresponding to the device type in the firmware library according to the identification information of the functional chip. The firmware library uses a multi-level directory structure to store firmware files, and establishes an index relationship through device type and chip type to achieve rapid positioning and extraction of target firmware.
[0062] S203: The server compares the firmware version information currently running on all chips with the version information of the target firmware, and determines the chip with inconsistent firmware version information as the functional chip.
[0063] The firmware version information adopts a standardized version number format, including the major version number, minor version number and revision number, which is used to identify the iteration process of the firmware. The comparison of version information is to judge the newness of the firmware by the numerical value of the version number. The function chip refers to the integrated circuit chip in the dot matrix pen that performs a specific function. Each function chip requires corresponding firmware to support its normal operation.
[0064] When the server performs version comparison, it compares the firmware version information currently running on each functional chip with the corresponding target firmware version information. The version comparison uses a high-to-low comparison method, comparing the major version number, minor version number, and revision number in sequence. When it is found that the current firmware version of a chip is lower than the target firmware version, the server marks the chip as a functional chip that needs to be upgraded. This version comparison mechanism ensures that the upgrade operation is only performed on chips that really need to be upgraded, improving upgrade efficiency.
[0065] S204: The server generates a differential upgrade package for the firmware of each functional chip, and packages the differential upgrade package with the current version information to form a unified upgrade package.
[0066] The differential upgrade package is an upgrade data package that only contains the changed parts by comparing the differences between the target firmware and the current firmware, which is used to reduce the amount of data transmitted. Version information is data that includes firmware version number, checksum, etc., which is used to verify the integrity of the firmware. The unified upgrade package is a data package that integrates the differential upgrade packages and version information of multiple functional chips, using a unified data format and transmission protocol, which is convenient for unified processing and management of terminal devices.
[0067] The server uses a differential algorithm to perform differential calculations on each functional chip that needs to be upgraded. The differential calculation process first divides the target firmware and the current firmware into blocks of fixed size, calculates the characteristic value of each data block through a hash algorithm, and finds the different data blocks. Then, these difference data blocks are packaged with their location information to generate a differential upgrade package. This process is repeated for all functional chips that need to be upgraded to generate multiple differential upgrade packages. Finally, all differential upgrade packages are integrated with the corresponding firmware version information, checksums, and other data, and packaged into a unified upgrade package according to the predefined data structure.
[0068] S205. The server transmits the unified upgrade package to a main control chip. The main control chip includes a dual-partition storage space. The dual-partition storage space includes a used partition and an unused partition. The used partition includes the currently running firmware.
[0069] The main control chip is the core control chip in the dot matrix pen, responsible for managing the operation of other functional chips. The dual partition storage space is two independent storage areas in the main control chip for storing firmware, called the used partition and the unused partition. The used partition stores the currently running firmware, and the unused partition is used to store new firmware. This dual partition mechanism ensures that the system always has an available firmware during the firmware upgrade process, improving the reliability of the upgrade process.
[0070] The server uses the preset data transmission protocol to transmit the unified upgrade package to the main control chip of the dot matrix pen through the wireless communication interface. The transmission process adopts a packet transmission mechanism to divide the unified upgrade package into multiple fixed-size data packets, which are sent and verified packet by packet. When the main control chip receives the data packet, it first temporarily stores the data packet in the buffer. After completing the reception and verification of all data packets, it writes the complete unified upgrade package to the unused partition to prepare for the subsequent firmware upgrade.
[0071] S206: After receiving the unified upgrade package, the dot matrix pen terminal verifies the current version information in the unified upgrade package.
[0072] Version information verification is an important step to ensure the correctness of the upgrade package, which includes version number verification and data integrity verification. Version number verification ensures that the firmware version in the upgrade package is consistent with the version requested by the terminal, and data integrity verification ensures that the upgrade package has not been tampered with or damaged during transmission through the checksum value.
[0073] After receiving the unified upgrade package, the dot pen terminal first parses the version information part in the upgrade package. The verification process includes comparing whether the firmware version number in the upgrade package matches the version information in the original upgrade request, calculating the checksum of the upgrade package and comparing it with the checksum carried in the package. The verification process uses a preset verification algorithm to calculate the characteristic value of the upgrade package data and compare it with the checksum carried in the upgrade package to ensure the integrity and correctness of the upgrade package. This multiple verification mechanism ensures the security and reliability of the firmware upgrade process.
[0074] S207: If the verification is successful, the dot matrix pen terminal generates a target firmware according to the differential upgrade package.
[0075] The differential upgrade package is a compressed package containing firmware difference data, which records the difference content and location information between the current firmware and the target firmware. The target firmware is a complete firmware file rebuilt by applying the differential data on the basis of the current firmware. The firmware reconstruction process is the process of inserting or replacing the data at the corresponding position in the current firmware according to the location information in the differential upgrade package, and finally generating a complete target firmware.
[0076] After the verification is passed, the dot pen terminal reads the currently running firmware from the used partition and loads it into the specified memory space. Subsequently, the terminal parses the difference data and location information in the differential upgrade package, and applies the difference data to the current firmware block by block according to the preset differential reconstruction algorithm. During the reconstruction process, the terminal determines the insertion or replacement position of each block of difference data based on the location information, and completes the reconstruction of the target firmware in the memory by reorganizing and splicing the data blocks. After the reconstruction is completed, the terminal performs an integrity check on the reconstructed target firmware to ensure the correctness of the reconstruction result.
[0077] S208. The dot pen terminal writes the target firmware into the unused partition, and distributes the target firmware to each of the functional chips corresponding to the target firmware.
[0078] The unused partition is a firmware storage area reserved in the main control chip for storing newly generated target firmware. Firmware distribution is the process of transferring the target firmware to each functional chip through the communication interface of the main control chip. Functional chips are integrated circuits that perform specific functions, including communication chips, sensor chips, etc. Each functional chip is equipped with independent firmware storage space.
[0079] The dot pen terminal first writes the rebuilt target firmware into the unused partition of the main control chip. The writing process adopts page-by-page writing to ensure the reliability of data writing. After writing is completed, the terminal distributes the corresponding target firmware to each functional chip through the corresponding communication protocol according to the communication interface type of the functional chip (such as serial port, I2C, etc.). The distribution process adopts a packet transmission mechanism to divide the target firmware into multiple data packets for transmission. After each data packet is transmitted, it is confirmed to ensure that the firmware is completely transmitted to the functional chip.
[0080] S209: The dot matrix pen terminal verifies the target firmware in the functional chip.
[0081] Firmware verification is the process of verifying whether the target firmware written into the functional chip is complete and correct through a specific verification algorithm. The verification algorithm includes CRC verification, SHA verification and other methods, and the integrity of the firmware is determined by calculating the characteristic value of the firmware data. The verification process ensures that no data is damaged or lost during the firmware transmission and writing process.
[0082] The dot pen terminal verifies each functional chip that has completed the firmware update. The verification process first reads the written target firmware data from the functional chip, and uses the same verification algorithm as in the firmware package to calculate the characteristic value of the read data. The calculated characteristic value is then compared with the verification value stored in the firmware package. The verification process is performed on the complete data of the firmware to ensure that each part of the firmware is correctly written into the functional chip. This verification mechanism provides reliability guarantee for subsequent firmware switching and operation.
[0083] S210: If the verification is passed, the dot pen terminal marks the unused partition as a used partition, marks the original used partition as an unused partition, and updates the partition table information in the main control chip.
[0084] Partition tag refers to the flag used to identify the partition status in the partition management system of the main control chip. The partition table information is a data structure that records the status, starting address, size and other information of each partition, and is used to determine which partition's firmware to load when the system starts. Partition switching is the process of switching the system's firmware loading location from one partition to another by modifying the partition tag and partition table information.
[0085] After confirming that the firmware verification of all functional chips has passed, the dot pen terminal performs the partition switching operation. First, the terminal modifies the partition mark, marks the unused partition storing the new firmware as used, and marks the original used partition as unused. Subsequently, the terminal updates the partition table information in the main control chip, modifies the partition status identifier, firmware version information, partition usage flag and other data in the partition table. The update of the partition table adopts a transaction mechanism to ensure the atomicity of the update process and prevent the partition table information from being inconsistent due to abnormal conditions such as power failure.
[0086] S211, the dot matrix pen terminal sends an update success message to the server.
[0087] The update success message is a data packet that the dot pen terminal reports the firmware upgrade completion status to the server. The message contains device identification information, new firmware version information of each functional chip, upgrade result status code and other information. It is used by the server to update the device firmware version record and serves as a confirmation mark for the completion of the upgrade process.
[0088] After completing the partition switch, the dot pen terminal organizes a status report data packet containing complete upgrade result information. The data packet records the device identification information, the new firmware version number of all functional chips, the verification result, the partition switch status and other information. The terminal sends the data packet to the server through the preset communication protocol. After receiving the update success message, the server updates the firmware version record in the device management database to complete the record archiving of the entire upgrade process.
[0089] S212: When receiving a system restart instruction, the dot matrix pen terminal uses the target firmware in the used partition as the current running firmware.
[0090] The system restart command is a control command triggered by the server or user to restart the dot pen system. The currently running firmware refers to the firmware program actually loaded and executed by the system. Firmware switching refers to the process of loading and running the target firmware from the new used partition according to the partition table information during the system restart process.
[0091] After receiving the restart command, the dot pen terminal first performs the data saving work before the system is shut down to ensure that all important data has been properly saved. During the system restart process, the boot program reads the partition table information in the main control chip and determines the current used partition based on the partition mark. Subsequently, the boot program loads the target firmware from the used partition to the system memory to complete the loading and initialization of the firmware. After the system is initialized, the new target firmware starts to run normally, completing the entire firmware upgrade process. The entire restart and firmware switching process uses a safe boot mechanism to ensure that the system can stably switch to the new firmware running state.
[0092] S213: If the verification fails, the dot matrix pen terminal keeps the current running firmware in the used partition running, and records the firmware upgrade status and communication interface information of the functional chip that fails the verification.
[0093] The used partition is the storage area for storing the currently running firmware, ensuring that the system can continue to work normally when the upgrade fails. The firmware upgrade status is the status information that records the execution results of each stage in the firmware upgrade process, including the reason for the verification failure, the failure time and other information. The communication interface information contains the communication protocol type, communication parameters, interface address and other data of the functional chip, which is used to accurately locate the communication link where the upgrade failed. These information together constitute a complete record of the upgrade failure.
[0094] After the dot pen terminal detects that the firmware verification of the functional chip fails, it immediately terminates the upgrade operation of the chip and keeps the original firmware running. At the same time, the terminal records detailed failure information in the log system, including the firmware version number at the time of failure, verification value comparison results, failure timestamp and other upgrade status information, as well as the communication protocol type, baud rate, data format and other communication interface parameters used by the functional chip. These records are stored in a structured data format to facilitate subsequent failure analysis and retry operations.
[0095] S214: The dot matrix pen terminal sends an update failure message including the firmware upgrade status and the communication interface information to the server.
[0096] The update failure message is a data packet from the terminal to the server reporting the upgrade failure, including device identification, failed chip information, failure reason, etc. The firmware upgrade status includes detailed information such as upgrade progress, verification results, and failure reason. The communication interface information records the complete parameter set required to communicate with the functional chip, which is used by the server to accurately locate the failure cause and generate a correction plan.
[0097] The dot pen terminal organizes the recorded failure information into a failure report data packet in a standard format. The data packet contains device identification information, failed functional chip identification, progress information during the firmware upgrade process, specific reasons for verification failure, and complete communication interface parameters of the functional chip. The terminal sends the failure report to the server through a secure communication channel to ensure that the failure information can be fully and accurately transmitted to the server.
[0098] S215: When receiving the update failure message, the server regenerates a partial upgrade package for the functional chip that has not been updated according to the firmware upgrade status and the communication interface information.
[0099] Some upgrade packages are upgrade packages generated for functional chips that failed to upgrade, and only contain the firmware update content required by the chip. The server is a server system responsible for firmware management and distribution, and has the ability to analyze the cause of failure based on failure information and generate a correction upgrade package. The firmware upgrade status and communication interface information are important bases for the server to determine the cause of failure and generate a correction plan.
[0100] After receiving the update failure message, the server first parses the firmware upgrade status information in the failure report to determine the specific stage and cause of the upgrade failure. Then, based on the communication interface information, it analyzes whether there are problems such as improper communication parameter configuration. Based on the confirmed failure cause, the server re-extracts the target firmware corresponding to the failed chip from the firmware library, adjusts the differential calculation strategy according to the failure situation, and regenerates a partial upgrade package specifically for the functional chip. The newly generated partial upgrade package contains a targeted verification mechanism and communication parameter configuration to improve the success rate of the retry upgrade.
[0101] S216: When receiving the partial upgrade package, the dot matrix pen terminal verifies the current version information in the partial upgrade package.
[0102] The partial upgrade package is an upgrade data package regenerated by the server for the functional chip that failed to upgrade, and contains special version information and differential data. The current version information contains verification data such as the firmware version number and checksum, which is used to ensure that the partial upgrade package matches the currently running firmware version. Version verification is a check process to ensure that the partial upgrade package is applicable to the current system status to prevent upgrade failures due to version mismatches.
[0103] After receiving the partial upgrade package, the dot pen terminal first parses the version information field in the upgrade package. The terminal reads the firmware version information currently running on the failed chip and compares it with the version information in the partial upgrade package. The verification process includes comparing the consistency of the version number, checking the integrity check value of the upgrade package, and verifying the security signature information contained in the upgrade package. This strict version verification mechanism ensures that the partial upgrade package is indeed generated for the current running version, avoiding upgrade failures caused by version mismatch.
[0104] S217: If the verification is successful, the dot matrix pen terminal generates partial firmware according to the partial upgrade package.
[0105] Partial firmware is the target firmware rebuilt on the basis of the current firmware through the differential data in the partial upgrade package. The differential data contains the difference between the current firmware and the target firmware, as well as the corresponding location information. Firmware reconstruction is the process of applying the differential data to the current firmware to generate a complete target firmware. This process is specifically performed on the functional chips that failed to upgrade and does not affect other chips that have been successfully upgraded.
[0106] After the version verification is passed, the dot pen terminal starts to execute the reconstruction process of part of the firmware. The terminal first reads the firmware data currently running on the failed chip from the storage and loads it into the specified memory space. Then it parses the differential data in the partial upgrade package and applies the difference content to the current firmware block by block according to the location information. The reconstruction process uses a separate memory space to avoid affecting the normal operation of the system. After the reconstruction is completed, the terminal performs integrity verification on the generated part of the firmware to ensure the correctness of the reconstruction result.
[0107] S218. The dot matrix pen terminal writes the part of the firmware into the unused partition, and distributes the part of the firmware to the functional chip that has not been updated.
[0108] The unused partition is a storage area reserved in the main control chip for temporary storage of newly generated firmware. Partial firmware distribution is the process of transferring the rebuilt target firmware to the function chip that failed to upgrade. The function chip is an integrated circuit that performs a specific function and has an independent firmware storage space and upgrade mechanism. This partition management and distribution mechanism ensures the security and reliability of the upgrade process.
[0109] The dot pen terminal first writes the rebuilt part of the firmware into the unused partition of the main control chip. The writing process adopts page writing to ensure the reliability of data writing. After writing is completed, the terminal reads the previously recorded communication interface information and establishes a communication connection with the failed chip. The terminal sends part of the firmware to the failed functional chip through the corresponding communication protocol. The distribution process adopts a packet transmission mechanism, and each data packet is confirmed to ensure that the firmware can be written completely and correctly into the functional chip.
[0110] S219: When it is detected that the target firmware has an operating abnormality, the dot matrix pen terminal loads the currently running firmware stored in the used partition.
[0111] Operational anomalies refer to functional failures, performance degradation, or system instability that occur during the operation of the target firmware. The used partition is the storage area for storing the original normal operating firmware, which serves as a fallback guarantee when the system encounters an abnormality. The currently running firmware refers to the firmware version that runs stably before the upgrade and has proven reliability. Firmware loading is the process of reading the firmware data stored in the partition into the system memory in preparation for execution.
[0112] The dot pen terminal continuously detects the system operation status through the monitoring program, including indicators such as function response time, communication stability, and resource usage. When the abnormal indicator is detected to exceed the preset threshold, the terminal starts the rollback mechanism. The terminal first stops the execution of the current abnormal firmware, and then reads the original firmware data from the used partition. The reading process uses a data verification mechanism to ensure that the loaded firmware data is intact. The terminal loads the read firmware into the system memory to complete the preparation for firmware rollback.
[0113] S220: The dot pen terminal distributes the currently running firmware to the functional chip, and sends a rollback success message to the server.
[0114] Firmware distribution is the process of transferring rolled-back firmware data to each functional chip. The rollback success message is a data packet in which the terminal reports the firmware rollback completion status to the server, which contains information such as device identification, rollback result, and current firmware version. Functional chips are integrated circuits that perform specific functions and need to be restored to the original stable version through firmware updates.
[0115] The dot pen terminal establishes the corresponding communication connection according to the communication interface type of the functional chip. The terminal transmits the loaded original firmware to each functional chip through the preset communication protocol. The transmission process adopts a packetization mechanism, and each data packet is confirmed after transmission to ensure that the firmware is written completely. When all functional chips complete the firmware rollback, the terminal organizes a status report containing complete rollback information and sends it to the server through a secure channel. The report records the execution results of the rollback process in detail, so that the server can update the firmware version status of the device in a timely manner.
[0116] S221. Upon receiving a confirmation message from the server, the dot pen terminal clears the target firmware in the unused partition.
[0117] The confirmation message is the receipt information sent by the server to the terminal after receiving the rollback success message, indicating that the server has updated the device status record. The unused partition is the storage area for temporary storage of new firmware. After the rollback operation is completed, it needs to be cleared for subsequent upgrades. The clear operation is the process of erasing the data in the storage area and restoring it to the initial state.
[0118] After the dot pen terminal receives the confirmation message from the server, it starts the cleanup process of the unused partition. The terminal first verifies the validity of the confirmation message and confirms that the server has completed the status update. Then the terminal performs a partition erase operation to completely clear the abnormal target firmware data stored in the unused partition. The erasure process uses a safe data cleanup mechanism to ensure that the data is completely deleted. After the cleanup is completed, the unused partition is restored to a usable state and is ready for the next firmware upgrade. This complete cleanup mechanism ensures the effective use of system storage space while preventing residual abnormal firmware data from affecting subsequent upgrade operations.
[0119] The following describes the unified differential OTA system in the embodiment of the present invention from the perspective of hardware processing. Figure 3 , is a schematic diagram of a physical device structure of a unified differential OTA system in an embodiment of the present application.
[0120] It should be noted that Figure 3 The structure of the unified differential OTA system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0121] like Figure 3 As shown, the unified differential OTA system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0122] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0123] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are performed.
[0124] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.
[0126] Specifically, the unified differential OTA system of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the unified differential OTA method of the dot matrix pen provided in the above embodiment is implemented.
[0127] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the unified differential OTA system described in the above embodiment; or may exist independently without being assembled into the unified differential OTA system. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the unified differential OTA system, the unified differential OTA system implements the unified differential OTA method of the dot matrix pen provided in the above embodiment.
[0128] As described above, 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. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0129] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0130] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A unified differential OTA method for a dot matrix pen, characterized in that: Applied to a unified differential OTA system, the unified differential OTA system includes a server and a dot pen terminal, and the method includes: The server generates a differential upgrade package for the firmware of each functional chip, and packages the differential upgrade package with the current version information to form a unified upgrade package; The server transmits the unified upgrade package to a main control chip, the main control chip includes a dual-partition storage space, the dual-partition storage space includes a used partition and an unused partition, and the used partition includes the currently running firmware; After receiving the unified upgrade package, the dot matrix pen terminal verifies the current version information in the unified upgrade package; If the verification is successful, the dot matrix pen terminal generates a target firmware according to the differential upgrade package; The dot pen terminal writes the target firmware into the unused partition, and distributes the target firmware to each of the function chips corresponding to the target firmware.
2. The method according to claim 1, characterized in that After the step of the dot pen terminal writing the target firmware into the unused partition and distributing the target firmware to each of the function chips corresponding to the target firmware, the method further includes: The dot pen terminal verifies the target firmware in the function chip; If the verification is passed, the dot matrix pen terminal marks the unused partition as a used partition, marks the original used partition as an unused partition, and updates the partition table information in the main control chip; The dot matrix pen terminal sends an update success message to the server; When receiving a system restart instruction, the dot matrix pen terminal uses the target firmware in the used partition as the current running firmware.
3. The method according to claim 2, characterized in that After the step of the dot matrix pen terminal verifying the target firmware in the function chip, the method further includes: If the verification fails, the dot matrix pen terminal keeps the current running firmware in the used partition and records the firmware upgrade status and communication interface information of the function chip that fails the verification; The dot matrix pen terminal sends an update failure message including the firmware upgrade status and the communication interface information to the server.
4. The method according to claim 3, characterized in that After the step of, if the verification fails, the dot matrix pen terminal keeps the current running firmware in the used partition running, and sends an update failure message to the server, the method further includes: When receiving the update failure message, the server regenerates a partial upgrade package for the function chip that has not been updated according to the firmware upgrade status and the communication interface information; When receiving the partial upgrade package, the dot matrix pen terminal verifies the current version information in the partial upgrade package; If the verification is successful, the dot matrix pen terminal generates partial firmware according to the partial upgrade package; The dot matrix pen terminal writes the part of the firmware into the unused partition, and distributes the part of the firmware to the function chip that has not been updated.
5. The method according to claim 2, characterized in that: After the step of using the target firmware in the used partition as the current running firmware when the dot matrix pen terminal receives the system restart instruction, the method further includes: When it is detected that the target firmware has an operational anomaly, the dot matrix pen terminal loads the currently running firmware stored in the used partition; The dot pen terminal distributes the currently running firmware to the functional chip, and sends a rollback success message to the server.
6. The method according to claim 5, characterized in that After the step of distributing the currently running firmware to the functional chip and sending a rollback success message to the server, the method further includes: When receiving the confirmation message from the server, the dot pen terminal clears the target firmware in the unused partition.
7. The method according to claim 1, characterized in that Before the step of generating a differential upgrade package for the firmware of each functional chip at the server end and packaging the differential upgrade package with the current version information to form a unified upgrade package, the method further includes: The dot matrix pen terminal sends a firmware upgrade request to the server, wherein the firmware upgrade request includes device identification information of the dot matrix pen terminal, identification information of the function chip, and firmware version information currently running on each function chip; The server confirms the device type of the dot matrix pen terminal according to the device identification information, and obtains the target firmware corresponding to the device type from the firmware library according to the identification information of the function chip; The server compares the firmware version information currently running on all chips with the version information of the target firmware, and determines the chip with inconsistent firmware version information as the functional chip.
8. A unified differential OTA system, characterized in that: The unified differential OTA system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the unified differential OTA system to execute the method described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on a unified differential OTA system, the unified differential OTA system is enabled to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product runs on a unified differential OTA system, the unified differential OTA system is enabled to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Remote firmware upgrading method, remote firmware upgrading device, remote firmware upgrading system and air conditioner
CN106325818A
Method and device for firmware upgrade over the air and vehicle
CN106802813A
Firmware upgrading method of wearable device and wearable device
CN106843942A
Distributed equipment firmware upgrading method and device and storage medium
CN113703806A
Agent differential upgrading method and system
CN114265614A
Cited By
Dot matrix pen collective creation data block storage system based on region division
CN121411700A
Firmware upgrading method and device, electronic equipment and storage medium
CN121597252A