Foundation program execution system and method
By storing the firmware on the server and decrypting it on the MCU using an encryption/decryption module, the problem of existing firmware encryption methods being easily cracked is solved, thereby improving the security and confidentiality of the firmware.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU ZHONO ELECTRONICS TECH CO LTD
- Filing Date
- 2022-09-05
- Publication Date
- 2026-05-15
AI Technical Summary
Existing firmware encryption methods offer poor security and are easily cracked by attackers, posing a risk of firmware theft.
The firmware is stored on the server and communicates with the server via the MCU. The encryption and decryption module is used to decrypt and encrypt the basic program to ensure the security of the firmware on the server side.
By storing the firmware on the server and decrypting it on the MCU side, the firmware is effectively prevented from being cracked, thus improving its security and confidentiality.
Smart Images

Figure CN115481369B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chip technology, and more specifically, to a basic program execution system and method. Background Technology
[0002] Firmware refers to the program that supports the basic functions of electronic devices. To prevent the core technology of a product from being leaked due to unauthorized reading of the firmware, it is encrypted for protection. Currently, firmware is generally stored in chips such as MCUs and protected using encryption algorithms or hardware circuitry. However, these methods offer limited security; for example, attackers can reverse engineer the algorithms and circuitry to obtain the firmware, thus the risk of firmware breaches remains. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a basic program execution system and method.
[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:
[0005] In a first aspect, the present invention provides a basic program execution system, the system comprising an MCU and a server connected in communication, the MCU comprising a CPU, an encryption / decryption module and a communication module connected in communication, the server pre-stores firmware, the firmware comprising multiple encrypted basic programs;
[0006] The CPU is used to send the first instruction for executing the target basic program to the communication module;
[0007] The communication module is used to send the first instruction to the server;
[0008] The server is used to retrieve the target basic program from the firmware according to the first instruction and send it to the communication module;
[0009] The communication module is used to send the target basic program to the encryption / decryption module;
[0010] The encryption / decryption module is used to decrypt the target basic program and send the decrypted target basic program to the CPU.
[0011] The CPU is used to execute the decrypted target base program.
[0012] In an optional implementation, the server includes storage space corresponding to the MCU; the MCU further includes registers that are communicatively connected to the CPU;
[0013] The register is used to store operating parameters that represent the current operating state of the MCU;
[0014] The CPU is used to periodically read the operating parameters in the register and send a second instruction storing the operating parameters to the encryption / decryption module;
[0015] The encryption / decryption module is used to encrypt the operating parameters according to the second instruction, and send the encrypted operating parameters to the communication module;
[0016] The communication module is used to send the encrypted operating parameters to the server;
[0017] The server is used to store the encrypted operating parameters in the storage space corresponding to the MCU.
[0018] In an optional implementation, the firmware includes a runtime recovery procedure;
[0019] The CPU is used to send a third instruction for executing the running state recovery program to the communication module;
[0020] The communication module is used to send the third instruction to the server;
[0021] The server is used to retrieve the latest operating parameters from the storage space corresponding to the MCU according to the third instruction and send them to the communication module;
[0022] The communication module is used to send the latest operating parameters to the encryption / decryption module;
[0023] The encryption / decryption module is used to decrypt the latest operating parameters and send the decrypted latest operating parameters to the CPU;
[0024] The CPU is used to send the decrypted latest operating parameters to the register;
[0025] The register is used to store the latest operating parameters after decryption, so that the MCU can resume its operating state.
[0026] In an optional implementation, the server includes storage space corresponding to the MCU; the MCU further includes RAM memory that is communicatively connected to the CPU;
[0027] The RAM memory is used to store the collected user data;
[0028] The CPU is used to periodically read user data from the RAM memory and send a fourth instruction to back up the user data to the encryption / decryption module;
[0029] The encryption / decryption module is used to encrypt the user data according to the fourth instruction and send the encrypted user data to the communication module;
[0030] The communication module is used to send the encrypted user data to the server;
[0031] The server is used to store the encrypted user data in the storage space corresponding to the MCU.
[0032] In an optional implementation, the firmware includes a data recovery program;
[0033] The CPU is used to send the fifth instruction for executing the data recovery program to the communication module;
[0034] The communication module is used to send the fifth instruction to the server;
[0035] The server is used to retrieve all user data from the storage space corresponding to the MCU and send it to the communication module according to the fifth instruction;
[0036] The communication module is used to send all user data to the encryption / decryption module;
[0037] The encryption / decryption module is used to decrypt all user data and send all decrypted user data to the CPU;
[0038] The CPU is used to send all decrypted user data to the RAM memory;
[0039] The RAM memory is used to store all decrypted user data.
[0040] In an optional implementation, the MCU has a chip identifier and a product model, and the server pre-stores multiple firmwares. The server pre-stores a firmware identifier and a matching table for each firmware, and the matching table includes the product model corresponding to each firmware identifier.
[0041] The CPU is used to generate matching instructions based on the chip identifier and product model of the MCU and send them to the communication module;
[0042] The communication module is used to send the matching instruction to the server;
[0043] The server is used to determine the target firmware identifier corresponding to the product model of the MCU in the matching table according to the matching instruction, and after establishing the correspondence between the target firmware identifier and the chip identifier of the MCU, send the matching success information to the communication module.
[0044] The communication module is used to send the matching success information to the CPU.
[0045] Secondly, the present invention provides a basic program execution method applied to a basic program execution system, the system comprising a MCU and a server connected by communication, the MCU comprising a CPU, an encryption / decryption module, and a communication module connected by communication, the server pre-stores firmware, the firmware comprising multiple encrypted basic programs, and the method comprising:
[0046] The CPU sends the first instruction for executing the target basic program to the communication module;
[0047] The communication module sends the first instruction to the server;
[0048] The server retrieves the target basic program from the firmware according to the first instruction and sends it to the communication module;
[0049] The communication module sends the target basic program to the encryption / decryption module;
[0050] The encryption / decryption module decrypts the target basic program and sends the decrypted target basic program to the CPU;
[0051] The CPU executes the decrypted target base program.
[0052] In an optional implementation, the server includes storage space corresponding to the MCU; the MCU further includes registers communicatively connected to the CPU, the registers being used to store operating parameters representing the current operating state of the MCU; the method further includes:
[0053] The CPU periodically reads the operating parameters from the register and sends a second instruction storing the operating parameters to the encryption / decryption module;
[0054] The encryption / decryption module encrypts the operating parameters according to the second instruction and sends the encrypted operating parameters to the communication module;
[0055] The communication module sends the encrypted operating parameters to the server;
[0056] The server stores the encrypted operating parameters in the storage space corresponding to the MCU.
[0057] In an optional implementation, the server includes storage space corresponding to the MCU; the MCU further includes a RAM memory communicatively connected to the CPU, the RAM memory being used to store collected user data; the method further includes:
[0058] The CPU periodically reads user data from the RAM and sends a fourth instruction to the encryption / decryption module to back up the user data.
[0059] The encryption / decryption module encrypts the user data according to the fourth instruction and sends the encrypted user data to the communication module;
[0060] The communication module sends the encrypted user data to the server;
[0061] The server stores the encrypted user data in the storage space corresponding to the MCU.
[0062] In an optional implementation, the MCU has a chip identifier and a product model, and the server pre-stores multiple firmwares. The server pre-stores a firmware identifier and a matching table for each firmware, and the matching table includes the product model corresponding to each firmware identifier; the method further includes:
[0063] The CPU generates a matching instruction based on the chip identifier and product model of the MCU and sends it to the communication module;
[0064] The communication module sends the matching instruction to the server;
[0065] According to the matching instruction, the server determines the target firmware identifier corresponding to the product model of the MCU in the matching table, and after establishing the correspondence between the target firmware identifier and the chip identifier of the MCU, sends the matching success information to the communication module.
[0066] The communication module sends the matching success information to the CPU.
[0067] The basic program execution system and method provided in this invention include an MCU and a server connected by communication. The MCU includes a CPU, an encryption / decryption module, and a communication module connected by communication. The server pre-stores firmware, which includes multiple encrypted basic programs. The CPU sends a first instruction to execute the target basic program to the communication module. The communication module sends the first instruction to the server. The server retrieves the target basic program from the firmware according to the first instruction and sends it to the communication module. The communication module sends the target basic program to the encryption / decryption module. The encryption / decryption module decrypts the target basic program and sends the decrypted target basic program to the CPU. The CPU executes the decrypted target basic program. By storing the firmware containing the basic programs on the server, the firmware is prevented from being cracked at the source, effectively protecting the firmware and improving its security and confidentiality.
[0068] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0069] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 This invention illustrates a schematic diagram of a basic program execution system provided in an embodiment of the present invention.
[0071] Figure 2 This diagram illustrates yet another structural schematic of the basic program execution system provided in an embodiment of the present invention;
[0072] Figure 3 This diagram illustrates yet another structural schematic of the basic program execution system provided in an embodiment of the present invention;
[0073] Figure 4 This invention illustrates a flowchart of a basic program execution method provided in an embodiment of the present invention.
[0074] Figure 5 This illustration shows another flowchart of the basic program execution method provided in an embodiment of the present invention;
[0075] Figure 6 This illustration shows another flowchart of the basic program execution method provided in an embodiment of the present invention;
[0076] Figure 7 This diagram illustrates yet another flowchart of the basic program execution method provided in an embodiment of the present invention.
[0077] Icons: 100-MCU; 200-Server; 110-Bus; 120-CPU; 130-Encryption / Decryption Module; 140-Communication Module; 150-Register; 160-RAM Memory. Detailed Implementation
[0078] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0079] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0080] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0081] Please refer to Figure 1 This is a schematic diagram of a basic program execution system provided in an embodiment of the present invention. The basic program execution system includes an MCU 100 and a server 200, which can communicate and connect via WiFi, 4G, 5G, Bluetooth, and a Bluetooth gateway.
[0082] The MCU100 includes a bus 110, a CPU 120, an encryption / decryption module 130, and a communication module 140.
[0083] Bus 110 can be a circuit that connects the components in MCU 100 to each other and transmits communication between the components of MCU 100.
[0084] CPU120, or Central Processing Unit (CPU), is an integrated circuit chip with signal processing capabilities. CPU120 can receive commands from other components in MCU100 (such as encryption / decryption module 130 and communication module 140) via bus 110, interpret the received commands, and perform calculations or data processing based on the interpreted commands.
[0085] The encryption / decryption module 130 can decrypt the basic program in the firmware and encrypt and decrypt the interactive data between the MCU100 and the server 200.
[0086] The communication module 140 can support signaling or data communication between the MCU 100 and the server 200.
[0087] Server 200 can be a standalone server or a server cluster consisting of multiple servers. Server 200 has firmware pre-stored, which includes multiple encrypted basic programs used to support the basic functions of electronic devices.
[0088] For ease of understanding, the following description uses the basic program used to support the basic functions of a fitness tracker as an example to illustrate the basic program execution system described above. It should be understood that the basic program in this embodiment can also be used to support the basic functions of other electronic devices; this embodiment does not limit its use.
[0089] Fitness trackers typically have basic functions such as displaying an interface and collecting exercise data. These basic functions require corresponding basic programs to support them, and these programs are the core technology of the fitness tracker. To prevent the leakage of core technology, all basic programs can be encrypted and stored in the firmware of server 200. Then, the basic functions of the fitness tracker are realized through communication between the MCU100 chip in the fitness tracker and server 200.
[0090] CPU 120 is used to send the first instruction for executing the target basic program to communication module 140; communication module 140 is used to send the first instruction to server 200;
[0091] Server 200 is used to obtain the target basic program from the firmware according to the first instruction and send it to communication module 140;
[0092] The communication module 140 is used to send the target basic program to the encryption / decryption module 130; the encryption / decryption module 130 is used to decrypt the target basic program and send the decrypted target basic program to the CPU 120; the CPU 120 is used to execute the decrypted target basic program.
[0093] For example, when a fitness tracker performs a basic function, it needs to execute the corresponding basic program, i.e., the target basic program. The CPU 120 generates a first instruction to execute the target basic program and sends the first instruction to the communication module 140; the communication module 140 sends the received first instruction to the server 200.
[0094] Then, according to the first instruction received, the server 200 retrieves the target basic program from the firmware and sends it to the communication module 140; the communication module 140 sends the received target basic program to the encryption / decryption module 130; the encryption / decryption module 130 decrypts the received target basic program, obtains the decrypted target basic program, and sends it to the CPU 120; finally, the CPU 120 receives the decrypted target basic program and executes it to realize the basic function.
[0095] As can be seen, the basic program execution system provided in this embodiment of the invention includes an MCU 100 and a server 200 connected by communication. The MCU 100 includes a CPU 120, an encryption / decryption module 130, and a communication module 140 connected by communication. The server 200 pre-stores firmware, which includes multiple encrypted basic programs. The CPU 120 sends a first instruction to execute the target basic program to the communication module 140. The communication module 140 sends the first instruction to the server 200. The server 200 retrieves the target basic program from the firmware according to the first instruction and sends it to the communication module 140. The communication module 140 sends the target basic program to the encryption / decryption module 130. The encryption / decryption module 130 decrypts the target basic program and sends the decrypted target basic program to the CPU 120. The CPU 120 executes the decrypted target basic program. By storing the firmware containing the basic programs in the server 200, the firmware is prevented from being cracked at the source, effectively protecting the firmware and improving its security and confidentiality.
[0096] Optionally, the server 200 includes a storage space corresponding to the MCU 100 for storing information about the MCU 100. For example, the MCU 100 in a fitness tracker can communicate with the server 200 to save its operating state to this storage space.
[0097] Please see Figure 2 This is another schematic diagram of the basic program execution system provided in this embodiment of the invention. The MCU 100 also includes a register 150 that is communicatively connected to the CPU 120. The register 150 can store commands or data received from the CPU 120 or other components in the MCU 100, or commands or data generated by other components in the CPU 120 or MCU 100.
[0098] Register 150 is used to store operating parameters that indicate the current operating status of MCU 100; CPU 120 is used to periodically read the operating parameters in register 150 and send the second instruction storing the operating parameters to encryption / decryption module 130;
[0099] The encryption / decryption module 130 is used to encrypt the running parameters according to the second instruction and send the encrypted running parameters to the communication module 140; the communication module 140 is used to send the encrypted running parameters to the server 200.
[0100] Server 200 is used to store the encrypted operating parameters to the storage space corresponding to MCU 100.
[0101] For example, during the operation of the fitness tracker, the current operating parameters of the MCU100 are acquired and stored in the register 150. The CPU120 periodically reads the operating parameters in the register 150 according to a set cycle, generates a second instruction to store the operating parameters, and then sends it to the encryption / decryption module 130. The encryption / decryption module 130 encrypts the operating parameters according to the received second instruction, obtains the encrypted operating parameters, and sends them to the communication module 140. Then, the communication module 140 receives the encrypted operating parameters and sends them to the server 200. The server 200 receives the encrypted operating parameters and stores them in the storage space corresponding to the MCU100.
[0102] It is understandable that fitness trackers may experience abnormal situations such as lag, requiring a restart. In order to restore the fitness tracker to its previous operating state after restarting, the firmware includes a running state recovery program that can be executed to restore the operating state.
[0103] CPU 120 is used to send a third instruction for executing the running state recovery program to communication module 140; communication module 140 is used to send the third instruction to server 200;
[0104] Server 200 is used to retrieve the latest operating parameters from the storage space corresponding to MCU 100 according to the third instruction and send them to communication module 140;
[0105] The communication module 140 is used to send the latest operating parameters to the encryption / decryption module 130; the encryption / decryption module 130 is used to decrypt the latest operating parameters and send the decrypted latest operating parameters to the CPU 120.
[0106] CPU120 is used to send the latest decrypted operating parameters to register 150; register 150 is used to store the latest decrypted operating parameters so that MCU100 can resume its operating state.
[0107] For example, CPU 120 generates a third instruction to execute the running state recovery program and sends the third instruction to communication module 140; then communication module 140 sends the received third instruction to server 200; server 200, based on the received third instruction, obtains the latest running parameters from the storage space corresponding to MCU 100, that is, the running parameters closest to the current time, and sends the latest running parameters to communication module 140.
[0108] Then, the communication module 140 sends the latest received operating parameters to the encryption / decryption module 130; the encryption / decryption module 130 decrypts the latest received operating parameters, obtains the decrypted latest operating parameters, and sends them to the CPU 120; the CPU 120 sends the decrypted latest operating parameters to the register 150; finally, the register 150 stores the decrypted latest operating parameters so that the MCU 100 can resume its operating state.
[0109] Optionally, the MCU100 in the fitness tracker can also communicate with the server 200 to back up the collected user data, i.e., store it in the storage space corresponding to the MCU100 in the server 200.
[0110] Please see Figure 3 This is another schematic diagram of the basic program execution system provided in this embodiment of the invention. The MCU100 also includes a RAM memory 160 communicatively connected to the CPU120. The RAM memory 160, or Random Access Memory (RAM), can store commands or data received from the CPU120 or other components in the MCU100, or commands or data generated by the CPU120 or other components in the MCU100.
[0111] RAM memory 160 is used to store the collected user data; CPU 120 is used to periodically read the user data in RAM memory 160 and send the fourth instruction to back up the user data to encryption / decryption module 130.
[0112] The encryption / decryption module 130 is used to encrypt user data according to the fourth instruction and send the encrypted user data to the communication module 140;
[0113] The communication module 140 is used to send encrypted user data to the server 200; the server 200 is used to store the encrypted user data in the storage space corresponding to the MCU 100.
[0114] For example, the wristband collects user data during the user's movement and stores it in RAM 160. CPU 120 periodically reads the user data from RAM 160 according to a set cycle, generates a fourth instruction to back up the user data, and sends it to encryption / decryption module 130. Encryption / decryption module 130 encrypts the user data according to the received fourth instruction, obtaining encrypted user data, and sends it to communication module 140. Communication module 140 then receives the encrypted user data and sends it to server 200. Server 200 receives the encrypted user data and stores it in the storage space corresponding to MCU 100.
[0115] It is understandable that fitness trackers may experience abnormal situations such as power outages, leading to data loss. Therefore, the firmware includes a data recovery program that can be executed to recover the data.
[0116] CPU 120 is used to send the fifth instruction for executing the data recovery program to communication module 140; communication module 140 is used to send the fifth instruction to server 200;
[0117] Server 200 is used to retrieve all user data from the storage space corresponding to MCU 100 and send it to communication module 140 according to the fifth instruction;
[0118] The communication module 140 is used to send all user data to the encryption / decryption module 130; the encryption / decryption module 130 is used to decrypt all user data and send all decrypted user data to the CPU 120.
[0119] CPU 120 is used to send all decrypted user data to RAM memory 160; RAM memory 160 is used to store all decrypted user data.
[0120] For example, CPU 120 generates a fifth instruction to execute the data recovery program and sends the fifth instruction to communication module 140; then communication module 140 sends the received fifth instruction to server 200; server 200 retrieves all user data from the storage space corresponding to MCU 100 according to the received fifth instruction and sends all user data to communication module 140.
[0121] Then, the communication module 140 sends all the received user data to the encryption / decryption module 130; the encryption / decryption module 130 decrypts all the received user data, obtains all the decrypted user data, and sends it to the CPU 120; the CPU 120 sends all the decrypted user data to the RAM memory 160; finally, the RAM memory 160 stores all the decrypted user data so that the MCU 100 can restore all the user data.
[0122] Optionally, for fitness trackers of the same model that have the same firmware, in order to save storage resources of server 200, fitness trackers of the same model can share a single firmware, which requires determining the firmware that matches the MCU100 in the fitness tracker.
[0123] The MCU100 has a chip identifier and product model. It's understandable that for the same model of fitness tracker, the product model of the MCU100 is the same in each fitness tracker, but the chip identifier of the MCU100 is different in each fitness tracker.
[0124] Server 200 contains multiple firmwares, each with a firmware identifier. Server 200 also has a pre-stored matching table, which includes the product model corresponding to each firmware identifier.
[0125] CPU 120 is used to generate a matching instruction based on the chip identifier and product model of MCU 100 and send it to communication module 140; communication module 140 is used to send the matching instruction to server 200;
[0126] Server 200 is used to determine the target firmware identifier corresponding to the product model of MCU100 in the matching table according to the matching instruction, and after establishing the correspondence between the target firmware identifier and the chip identifier of MCU100, send the matching success information to communication module 140.
[0127] The communication module 140 is used to send the matching success information to the CPU 120.
[0128] For example, CPU 120 generates a matching instruction based on the chip identifier and product model of MCU 100 and sends it to communication module 140; communication module 140 sends the received matching instruction to server 200; server 200, based on the received matching instruction, determines the target firmware identifier corresponding to the product model of MCU 100 in the matching table, then establishes the correspondence between the target firmware identifier and the chip identifier of MCU 100, and then sends the matching success information to communication module 140. Optionally, the matching success information may include the target firmware identifier; then communication module 140 sends the received matching success information to CPU 120, CPU 120 can receive the matching success information and store the target firmware identifier therein to complete the matching of MCU 100 and firmware.
[0129] Based on the basic program execution system described in the above embodiments, this invention also provides a basic program execution method. Please refer to... Figure 4 This is a flowchart illustrating a basic program execution method provided in an embodiment of the present invention, which includes the following steps:
[0130] In step S301, the CPU sends the first instruction for executing the target basic program to the communication module;
[0131] In step S303, the communication module sends the first instruction to the server;
[0132] Step S305: The server retrieves the target basic program from the firmware and sends it to the communication module according to the first instruction;
[0133] Step S307: The communication module sends the target basic program to the encryption / decryption module;
[0134] Step S309: The encryption / decryption module decrypts the target basic program and sends the decrypted target basic program to the CPU.
[0135] Step S311: The CPU executes the decrypted target base program.
[0136] It is understood that, in the above embodiments, the basic functions of the fitness tracker have been described through communication between the MCU chip in the fitness tracker and the server. The basic principles and technical effects of steps S301 to S311 are the same as in the above embodiments, and for the sake of brevity, please refer to the corresponding content of the above embodiments.
[0137] As can be seen from the above steps, the CPU sends the first instruction to execute the target basic program to the communication module; the communication module sends the first instruction to the server; the server, based on the first instruction, retrieves the target basic program from the firmware and sends it to the communication module; the communication module sends the target basic program to the encryption / decryption module; the encryption / decryption module decrypts the target basic program and sends the decrypted target basic program to the CPU; the CPU executes the decrypted target basic program. By storing the firmware containing the basic program on the server, firmware cracking is prevented at the source, effectively protecting the firmware and improving its security and confidentiality.
[0138] Optionally, the server includes storage space corresponding to the MCU, and the MCU also includes registers communicatively connected to the CPU, which are used to store operating parameters representing the current operating state of the MCU. This embodiment of the invention also provides a possible implementation. Please refer to... Figure 5 This includes the following steps:
[0139] In step S313A, the CPU periodically reads the operating parameters from the register and sends the second instruction storing the operating parameters to the encryption / decryption module;
[0140] In step S315A, the encryption / decryption module encrypts the operating parameters according to the second instruction and sends the encrypted operating parameters to the communication module.
[0141] In step S317A, the communication module sends the encrypted operating parameters to the server;
[0142] In step S319A, the server stores the encrypted operating parameters in the storage space corresponding to the MCU.
[0143] It is understood that, as described in the above embodiments, the MCU in the fitness tracker communicates with the server to save the MCU's operating state to the server. The basic principles and technical effects of steps S313A to S319A are the same as in the above embodiments, and for brevity, please refer to the corresponding content of the above embodiments.
[0144] Optionally, based on storing the MCU's operating parameters in the server, the firmware includes a running state recovery program, and may further include the following steps after step S319A:
[0145] In step S321A, the CPU sends the third instruction of the running state recovery program to the communication module;
[0146] In step S323A, the communication module sends the third instruction to the server;
[0147] In step S325A, the server retrieves the latest operating parameters from the storage space corresponding to the MCU according to the third instruction and sends them to the communication module.
[0148] Step S327A: The communication module sends the latest operating parameters to the encryption / decryption module;
[0149] In step S329A, the encryption / decryption module will decrypt the latest operating parameters and send the decrypted latest operating parameters to the CPU;
[0150] In step S331A, the CPU sends the decrypted latest operating parameters to the register;
[0151] Step S333A: The register stores the latest decrypted operating parameters to restore the MCU to its operating state.
[0152] It is understood that, in the above embodiments, the process of executing a running state recovery procedure to restore the MCU to its running state has already been described. The basic principles and technical effects of steps S321A to S333A are the same as in the above embodiments, and for the sake of brevity, please refer to the corresponding content of the above embodiments.
[0153] Optionally, the server includes storage space corresponding to the MCU, and the MCU further includes a RAM memory communicatively connected to the CPU, which is used to store the collected user data. This embodiment of the invention also provides another possible implementation. Please refer to... Figure 6 This includes the following steps:
[0154] In step S313B, the CPU periodically reads user data from the RAM and sends the fourth instruction for backing up the user data to the encryption / decryption module.
[0155] In step S315B, the encryption / decryption module encrypts the user data according to the fourth instruction and sends the encrypted user data to the communication module.
[0156] In step S317B, the communication module sends the encrypted user data to the server;
[0157] In step S319B, the server stores the encrypted user data in the storage space corresponding to the MCU.
[0158] It is understood that, as described in the above embodiments, the MCU in the fitness tracker communicates with the server to store the collected user data. The basic principles and technical effects of steps S313B to S319B are the same as in the above embodiments, and for brevity, please refer to the corresponding content of the above embodiments.
[0159] Optionally, based on storing the collected user data in a server, the firmware includes a data recovery program, and may further include the following steps after step S319B:
[0160] In step S321B, the CPU sends the fifth instruction of the data recovery program to the communication module;
[0161] In step S323B, the communication module sends the fifth instruction to the server;
[0162] In step S325B, the server retrieves all user data from the storage space corresponding to the MCU according to the fifth instruction and sends it to the communication module.
[0163] In step S327B, the communication module sends all user data to the encryption / decryption module;
[0164] In step S329B, the encryption / decryption module will decrypt all user data and send all decrypted user data to the CPU.
[0165] In step S3231B, the CPU sends all the decrypted user data to the RAM memory.
[0166] In step S333B, the RAM memory stores all the decrypted user data.
[0167] It is understood that, in the above embodiments, the process of executing a data recovery procedure to restore user data to the MCU has already been described. The basic principles and technical effects of steps S321B to S333B are the same as in the above embodiments, and for the sake of brevity, please refer to the corresponding content of the above embodiments.
[0168] Optionally, the MCU has a chip identifier and a product model. The server pre-stores multiple firmware files, each with its own firmware identifier and a matching table. The matching table includes the product model corresponding to each firmware identifier. This embodiment also provides a possible implementation method; please refer to [link to relevant documentation]. Figure 7 This includes the following steps:
[0169] In step S335, the CPU generates a matching instruction based on the MCU's chip identifier and product model and sends it to the communication module;
[0170] In step S337, the communication module sends the matching command to the server;
[0171] In step S339, the server determines the target firmware identifier corresponding to the MCU's product model in the matching table according to the matching instruction, and after establishing the correspondence between the target firmware identifier and the MCU's chip identifier, sends the matching success information to the communication module.
[0172] In step S341, the communication module sends the matching success information to the CPU.
[0173] It is understood that the firmware matching the MCU in the fitness tracker has already been described in the above embodiments. The basic principles and technical effects of steps S335 to S341 are the same as in the above embodiments, and for the sake of brevity, please refer to the corresponding content of the above embodiments.
[0174] In summary, the basic program execution system and method provided by this invention include a basic program execution system comprising a communication-connected MCU and a server. The MCU includes a communication-connected CPU, an encryption / decryption module, and a communication module. The server pre-stores firmware, which includes multiple encrypted basic programs. The CPU sends a first instruction to execute the target basic program to the communication module. The communication module sends the first instruction to the server. The server retrieves the target basic program from the firmware according to the first instruction and sends it to the communication module. The communication module sends the target basic program to the encryption / decryption module. The encryption / decryption module decrypts the target basic program and sends the decrypted target basic program to the CPU. The CPU executes the decrypted target basic program. By storing the firmware containing the basic programs on the server, the firmware is prevented from being cracked at the source, effectively protecting the firmware and improving its security and confidentiality.
[0175] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A basic program execution system, characterized in that, The system includes an MCU and a server connected by communication. The MCU includes a CPU, an encryption / decryption module, and a communication module connected by communication. The server has firmware pre-stored, and the firmware includes multiple encrypted basic programs. The CPU is used to send the first instruction for executing the target basic program to the communication module; The communication module is used to send the first instruction to the server; The server is used to retrieve the target basic program from the firmware according to the first instruction and send it to the communication module; The communication module is used to send the target basic program to the encryption / decryption module; The encryption / decryption module is used to decrypt the target basic program and send the decrypted target basic program to the CPU. The CPU is used to execute the decrypted target basic program; The server includes storage space corresponding to the MCU; the MCU also includes registers that are communicatively connected to the CPU. The register is used to store operating parameters that represent the current operating state of the MCU; The CPU is used to periodically read the operating parameters in the register and send a second instruction storing the operating parameters to the encryption / decryption module; The encryption / decryption module is used to encrypt the operating parameters according to the second instruction, and send the encrypted operating parameters to the communication module; The communication module is used to send the encrypted operating parameters to the server; The server is used to store the encrypted operating parameters in the storage space corresponding to the MCU.
2. The system according to claim 1, characterized in that, The firmware includes a runtime recovery program; The CPU is used to send a third instruction for executing the running state recovery program to the communication module; The communication module is used to send the third instruction to the server; The server is used to retrieve the latest operating parameters from the storage space corresponding to the MCU according to the third instruction and send them to the communication module; The communication module is used to send the latest operating parameters to the encryption / decryption module; The encryption / decryption module is used to decrypt the latest operating parameters and send the decrypted latest operating parameters to the CPU; The CPU is used to send the decrypted latest operating parameters to the register; The register is used to store the latest operating parameters after decryption, so that the MCU can resume its operating state.
3. The system according to claim 1, characterized in that, The server includes storage space corresponding to the MCU; the MCU also includes RAM memory that is communicatively connected to the CPU. The RAM memory is used to store the collected user data; The CPU is used to periodically read user data from the RAM memory and send a fourth instruction to back up the user data to the encryption / decryption module; The encryption / decryption module is used to encrypt the user data according to the fourth instruction and send the encrypted user data to the communication module; The communication module is used to send the encrypted user data to the server; The server is used to store the encrypted user data in the storage space corresponding to the MCU.
4. The system according to claim 3, characterized in that, The firmware includes a data recovery program; The CPU is used to send the fifth instruction for executing the data recovery program to the communication module; The communication module is used to send the fifth instruction to the server; The server is used to retrieve all user data from the storage space corresponding to the MCU and send it to the communication module according to the fifth instruction; The communication module is used to send all user data to the encryption / decryption module; The encryption / decryption module is used to decrypt all user data and send all decrypted user data to the CPU; The CPU is used to send all decrypted user data to the RAM memory; The RAM memory is used to store all decrypted user data.
5. The system according to claim 1, characterized in that, The MCU has a chip identifier and a product model. The server has multiple pre-stored firmwares. The server has a firmware identifier and a matching table for each firmware. The matching table includes the product model corresponding to each firmware identifier. The CPU is used to generate matching instructions based on the chip identifier and product model of the MCU and send them to the communication module; The communication module is used to send the matching instruction to the server; The server is used to determine the target firmware identifier corresponding to the product model of the MCU in the matching table according to the matching instruction, and after establishing the correspondence between the target firmware identifier and the chip identifier of the MCU, send the matching success information to the communication module. The communication module is used to send the matching success information to the CPU.
6. A basic program execution method, characterized in that, The method is applied to a basic program execution system, the system including a MCU and a server connected by communication; the MCU includes a CPU, an encryption / decryption module, and a communication module connected by communication; the server has pre-stored firmware, the firmware including multiple encrypted basic programs; the method includes: The CPU sends the first instruction for executing the target basic program to the communication module; The communication module sends the first instruction to the server; The server retrieves the target basic program from the firmware according to the first instruction and sends it to the communication module; The communication module sends the target basic program to the encryption / decryption module; The encryption / decryption module decrypts the target basic program and sends the decrypted target basic program to the CPU; The CPU executes the decrypted target basic program; The server includes storage space corresponding to the MCU; the MCU also includes registers communicatively connected to the CPU, the registers being used to store operating parameters representing the current operating state of the MCU; the method further includes: The CPU periodically reads the operating parameters from the register and sends a second instruction storing the operating parameters to the encryption / decryption module; The encryption / decryption module encrypts the operating parameters according to the second instruction and sends the encrypted operating parameters to the communication module; The communication module sends the encrypted operating parameters to the server; The server stores the encrypted operating parameters in the storage space corresponding to the MCU.
7. The method according to claim 6, characterized in that, The server includes storage space corresponding to the MCU; the MCU also includes a RAM memory communicatively connected to the CPU, the RAM memory being used to store collected user data; the method further includes: The CPU periodically reads user data from the RAM and sends a fourth instruction to the encryption / decryption module to back up the user data. The encryption / decryption module encrypts the user data according to the fourth instruction and sends the encrypted user data to the communication module; The communication module sends the encrypted user data to the server; The server stores the encrypted user data in the storage space corresponding to the MCU.
8. The method according to claim 6, characterized in that, The MCU has a chip identifier and a product model. The server pre-stores multiple firmware files, each with a firmware identifier and a matching table. The matching table includes the product model corresponding to each firmware identifier. The method further includes: The CPU generates a matching instruction based on the chip identifier and product model of the MCU and sends it to the communication module; The communication module sends the matching instruction to the server; According to the matching instruction, the server determines the target firmware identifier corresponding to the product model of the MCU in the matching table, and after establishing the correspondence between the target firmware identifier and the chip identifier of the MCU, sends the matching success information to the communication module. The communication module sends the matching success information to the CPU.