An APP module firmware compiling updating method, a computer device and a storage medium
By monitoring changes in the source code library and comparing compilation information, only the changed modules are recompiled and repackaged differently, solving the problems of slow compilation speed and large OTA differential package size in existing technologies, and achieving efficient and fast software updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DONGGUAN HUABEL ELECTRONICS TECH
- Filing Date
- 2024-09-30
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies suffer from slow compilation speeds and large OTA differential package sizes due to full compilation, which affect upgrade speed and user experience.
By monitoring changes in the source code repository and comparing compilation information with manifest files and JSON files, only the changed modules are recompiled, and differentiated firmware is packaged and distributed, reducing unnecessary duplication of work.
It improves compilation efficiency, reduces compilation time, precisely controls the size of OTA differential packages, and provides an efficient, fast, and user-friendly software update experience.
Smart Images

Figure CN119292644B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of software development and compilation technology, and in particular to a method for compiling and updating firmware for an APP module, a computer device, and a storage medium. Background Technology
[0002] In the software development process, compilation is the process of converting source code written in a high-level programming language into code that a computer can directly execute.
[0003] Currently, whenever the source code library changes, even if only a small part of the entire source code library changes, existing technology will recompile the code of all APP modules (called full compilation) and generate new firmware. However, the code of some modules has not changed since the last compilation. This approach leads to slow compilation speed because it involves a lot of unnecessary repetitive work, thereby increasing compilation time and reducing R&D efficiency.
[0004] Furthermore, because the CRC (Cyclic Redundancy Check) value of each recompiled APP module firmware is different, even if the code itself hasn't changed substantially, the differences between versions are still considered significant. This results in larger OTA (Over-The-Air) differential packets. Larger OTA differential packets require more time for transmission and installation, thus slowing down upgrades and impacting user experience.
[0005] Therefore, improvements to existing technologies are necessary.
[0006] The above information is provided as background information only to aid in understanding this disclosure and does not constitute an assertion or admission that any of the above content can be used as prior art relative to this disclosure. Summary of the Invention
[0007] This invention provides a method for compiling and updating firmware for an APP module, a computer device, and a storage medium to solve the problems of slow compilation and slow upgrade speed caused by repeated compilation in the prior art.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] In a first aspect, the present invention provides a method for compiling and updating firmware for an APP module, the method comprising:
[0010] S101. Monitor whether the source code library has changed; if not, continue with S101; if yes, proceed with S102.
[0011] S102. Read the manifest file from the source code library and parse the manifest file to extract relevant information for each module, including version number and dependency relationship, and then execute S103.
[0012] S103. Check if the JSON file can be obtained; if yes, proceed to step S104; if no, proceed to step S105.
[0013] S104. Store the compilation tool information, the packaging method information of each module, and the relevant information of each module into the JSON file, and then execute S106;
[0014] S105. Create the JSON file, store the compilation tool information, the packaging method information of each module and the relevant information of each module in the JSON file, determine that all modules need to be recompiled, and perform recompilation, and then execute S107.
[0015] S106. Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time to determine the modules that need to be recompiled, and recompile them, and then execute S107.
[0016] S107. Package the recompiled firmware separately to form a compressed package, and then execute S108.
[0017] S108. Upload the JSON file to the code review system and the compressed package to the FTP server, then execute S109;
[0018] S109. When it is necessary to create an OTA differential package, download all firmware that needs to be recompiled and has been recompiled from the FTP server, package them to form the OTA differential package for distribution and deployment; or, download some firmware that needs to be recompiled and has been recompiled from the FTP server, recompile the remaining modules that need to be recompiled but have not been fully recompiled, package them to form the OTA differential package for distribution and deployment.
[0019] Furthermore, in the APP module firmware compilation and update method, step S101 is:
[0020] Monitor whether new source code has been submitted to the source code repository to determine whether the source code repository has changed.
[0021] Furthermore, in the APP module firmware compilation and update method, before S104, the method further includes:
[0022] The configuration file is obtained from the source code repository and parsed to extract compilation tool information and packaging method information for each module.
[0023] Furthermore, in the APP module firmware compilation and update method, step S106 includes:
[0024] S106.1 Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time. Then execute S106.2, S106.3, S106.4 and S106.5 respectively.
[0025] S106.2 If the information of the compilation tools is inconsistent, then all modules need to be recompiled and recompiled.
[0026] S106.3 If the version numbers of one or more modules are inconsistent, then it is determined that the one or more modules need to be recompiled and recompiled.
[0027] S106.4 If the dependency comparison is inconsistent, it is determined that the modules involved in the dependency need to be recompiled and recompiled.
[0028] S106.5 If the packaging methods of one or more modules are inconsistent, then it is determined that one or more modules need to be recompiled and recompiled.
[0029] Furthermore, in the APP module firmware compilation and update method, the relevant information also includes a submission identifier;
[0030] S107 is:
[0031] The compiled firmware is packaged separately and named according to the submission identifier to form a compressed package.
[0032] Furthermore, in the APP module firmware compilation and update method, step S108 includes:
[0033] S108.1. Upload the JSON file to the code review system;
[0034] S108.2. Upload the compressed package to the FTP server according to the set FTP path.
[0035] Furthermore, in the APP module firmware compilation and update method, step S109 includes:
[0036] S109.1 When it is necessary to create an OTA differential package, read the manifest file from the source code library and parse the manifest file to extract the relevant information of each module, including the version number and dependency relationship;
[0037] S109.2 Check if the JSON file can be obtained; if yes, proceed to step S109.3; if no, proceed to step S109.4.
[0038] S109.3 Store the compilation tool information, the packaging method information of each module, and the relevant information of each module into the JSON file, and then execute S109.5;
[0039] S109.4. Determine that all modules need to be recompiled, and then execute S109.6;
[0040] S109.5 Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time to determine the modules that need to be recompiled, and then execute S109.6.
[0041] S109.6 Detect whether all firmware that needs to be recompiled and has been generated after recompilation has been uploaded to the FTP server; if yes, proceed to S109.7; if no, proceed to S109.8.
[0042] S109.7 Download all firmware that needs to be recompiled and has been recompiled from the FTP server, package them into the OTA differential package, and distribute and deploy them.
[0043] S109.8 Download the firmware that needs to be recompiled and has been recompiled from the FTP server, and recompile the remaining modules that need to be recompiled but have not been fully recompiled, and then package them to form the OTA differential package for distribution and deployment.
[0044] Furthermore, in the APP module firmware compilation and update method, in S109, the recompiled firmware is downloaded from the FTP server according to the name of the compressed package and the set FTP path.
[0045] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the APP module firmware compilation and update method provided in the first aspect above.
[0046] Thirdly, the present invention provides a storage medium containing computer-executable instructions, which are executed by a computer processor to implement the APP module firmware compilation and update method provided in the first aspect above.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] This invention provides an APP module firmware compilation and update method, computer device, and storage medium. By combining manifest files and JSON files when changes are detected in the source code library, the information stored in the previous and current versions is compared. This ensures that only the code of the modules that need to be recompiled is compiled each time, thereby effectively reducing unnecessary recompilation work, shortening compilation time, and precisely controlling the size of the OTA differential package, achieving a more efficient, faster, and user-friendly software update experience.
[0049] The present invention has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart illustrating an APP module firmware compilation and update method provided in Embodiment 1 of the present invention;
[0052] Figure 2 This is a detailed flowchart of S106 provided in Embodiment 1 of the present invention;
[0053] Figure 3 This is a detailed flowchart of S108 provided in Embodiment 1 of the present invention;
[0054] Figure 4 This is a detailed flowchart of S109 provided in Embodiment 1 of the present invention;
[0055] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 2 of the present invention. Detailed Implementation
[0056] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.
[0057] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.
[0058] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.
[0059] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.
[0060] In this application, terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy or order between these entities or operations.
[0061] Unless otherwise specified, the use of terms such as “comprising,” “including,” “having,” or other similar expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.
[0062] In this application, expressions such as "greater than", "less than", and "exceeding" are understood to exclude the stated number; expressions such as "above", "below", and "within" are understood to include the stated number. Furthermore, in the description of the embodiments of this application, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times", unless otherwise explicitly specified.
[0063] In the description of the embodiments of this application, the space-related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential," indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of this application or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0064] Unless otherwise expressly specified or limited, the terms "installation," "connection," "linking," "fixing," and "setting," as used in the description of the embodiments of this application, should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two components or the interaction between two components. For those skilled in the art to which this application pertains, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0065] Example 1
[0066] This invention achieves a high degree of automation and efficiency in APP module firmware compilation and updates by accurately monitoring changes in the source code library, intelligently comparing compilation information, implementing differentiated compilation strategies, and combining them with an efficient firmware packaging and distribution mechanism, thus bringing users a more convenient and faster software update service.
[0067] Please refer to the attached document. Figure 1 This is a flowchart illustrating an APP module firmware compilation and update method according to Embodiment 1 of the present invention. This method is applicable to scenarios where the APP module code needs to be recompiled after changes to the source code library to generate new firmware. The method specifically includes the following steps:
[0068] S101. Monitor whether the source code library has changed; if not, continue with S101; if yes, proceed with S102.
[0069] It should be noted that after entering continuous monitoring mode, the system will continuously monitor whether any updates or changes have occurred to the source code repository. If the monitoring results show that the source code repository remains unchanged, S101 will continue to be executed to keep the monitoring uninterrupted; once changes to the source code repository are detected, the system will immediately switch to S102.
[0070] It is particularly important to emphasize that the efficient execution of this step relies heavily on the support and assistance of advanced tools. Specifically, widely recognized continuous integration tools (such as Jenkins and Gerrit) or other highly customized monitoring mechanisms can be used to build a real-time, accurate, and efficient source code repository change monitoring system. These tools and mechanisms not only possess powerful automation capabilities but also ensure immediate awareness and response to source code repository changes through flexible policy configurations.
[0071] In one embodiment of this invention, the monitoring mechanism of step S101 is further strengthened and refined. Specifically, S101 can be refined into a more specific execution flow, that is, when the system monitors whether there are changes in the source code library, it focuses on a key and direct judgment criterion, namely, whether new or modified source code has been submitted to the source code library. If so, it is determined that the source code library has changed; if not, it is determined that the source code library has not changed.
[0072] The core of this refined operation lies in the fact that by directly tracking source code commit behavior, the system can capture the latest changes in the source code repository in real time and accurately. Whenever developers complete the writing, modification, or optimization of code and push it to the source code repository in the form of a commit, the system can immediately detect this change, thereby triggering the subsequent compilation and update process.
[0073] In this way, step S101 not only improves the accuracy and timeliness of source code repository change monitoring, but also ensures that the entire compilation and update process keeps pace with source code development and responds promptly to every significant change in the source code repository. This is crucial for ensuring continuous iteration, rapid delivery, and efficient operation and maintenance of software projects.
[0074] S102. Read the manifest file from the source code library and parse the manifest file to extract relevant information for each module, including version number and dependency relationship, and then execute S103.
[0075] It should be noted that in this step, the system automatically reads and parses the manifest file from the changed source code repository. This process aims to accurately extract relevant information for each module, including but not limited to the version number and dependencies of each module, laying the foundation for subsequent steps.
[0076] Specifically, the information directly extracted from the manifest file includes the repository address, the version number of each module, and the latest commit identifier of each module. The dependency relationship of each module can be queried from the repository through the repository address.
[0077] S103. Check if the JSON file can be obtained; if yes, proceed to step S104; if no, proceed to step S105.
[0078] It's worth noting that JSON files, as an important carrier of compilation-related information (such as compiler tool information, module packaging methods, module versions, and dependencies), are stored in code review systems (such as Gerrit). This design choice is based on several important considerations:
[0079] Centralized Management and Traceability: Storing JSON files in the code review system ensures that all compilation-related information is centralized on a single platform, facilitating management and traceability. The code review system is not only used for code review but also often serves as a central repository for project information, storing critical data from various stages of project building, testing, and release.
[0080] Version Control and Security: Code review systems typically support version control, meaning that historical versions of JSON files can be recorded and tracked. This version control mechanism not only helps prevent data loss but also allows for reverting to previous compilation states when needed, facilitating debugging and problem resolution. Furthermore, storing data in a protected code review system enhances data security.
[0081] Automated Integration: In the Continuous Integration / Continuous Deployment (CI / CD) process, code review systems are often tightly integrated with automated tools for compilation, testing, and deployment. Storing JSON files in the code review system facilitates interaction with other automation tools, enabling automatic extraction and comparison of compilation information and automated triggering of compilation tasks.
[0082] In this step, checking for the presence of a JSON file in the code review system is crucial. If the file exists, it indicates that the system contains previously stored compilation information, which can be compared to the current state of the source code repository. Through this comparison, the system can intelligently identify which modules have changed since the last compilation, and thus recompile only those changed modules. This significantly improves compilation efficiency and reduces unnecessary compilation work.
[0083] Conversely, if the JSON file is not present in the code review system, it indicates that there is no previously stored compilation information available for comparison. In this case, to ensure the integrity and consistency of the firmware, the system will recompile all modules. Although this increases compilation time, it is a necessary measure to guarantee the accuracy of the compilation results.
[0084] S104. Store the compilation tool information, the packaging method information of each module, and the relevant information of each module into the JSON file, and then execute S106.
[0085] It should be noted that, when the JSON file exists, the system stores the current compilation tool information, the packaging method information of each module, and relevant information of each module in the file. This allows the system to read and compare the information stored previously with the information stored now in S106 to determine which modules' code needs to be recompiled.
[0086] In a further optimized implementation of this embodiment, in order to improve the automation and accuracy of the compilation process, an additional refinement step is introduced before step S104, namely, obtaining the configuration file from the source code library and parsing the configuration file to extract compilation tool information and packaging method information for each module.
[0087] Specifically, the steps are described as follows:
[0088] First, the system needs to retrieve the configuration file from the specified location. This configuration file is specifically used to store project build and compilation settings, and typically contains information such as various parameters, paths, and tool versions required during the compilation process.
[0089] After obtaining the configuration file, the system needs to parse it to extract crucial information for the compilation process. This information mainly includes two parts:
[0090] Compiler tool information: This includes the names, versions, and possible configuration parameters of the compiler, linker, packaging tools, etc. This information is crucial for ensuring a consistent compilation environment and reliable compilation results.
[0091] Packaging information for each module: Since different modules may require different packaging methods, the configuration file needs to explicitly specify the packaging method and related parameters for each module. This information will guide the subsequent packaging process, ensuring that the generated firmware meets the actual requirements of each module.
[0092] After extracting the compilation tool information and module packaging method information, the system will prepare for the storage and use of this information in subsequent steps. In particular, in the upcoming S104 step, this information will be stored in a JSON file for comparison and subsequent compilation decisions.
[0093] By introducing this refined step, since the compilation tool information and packaging method information are dynamically obtained based on configuration files, the system can automatically detect and make corresponding adjustments when this information changes (such as upgrading the compiler version or changing the packaging strategy), thereby avoiding problems caused by information lag. This automation mechanism further improves the accuracy and efficiency of the compilation process.
[0094] S105. Create the JSON file, store the compilation tool information, the packaging method information of each module and the relevant information of each module in the JSON file, determine that all modules need to be recompiled, and perform recompilation, and then execute S107.
[0095] It should be noted that if the JSON file does not exist, the system will create it and comprehensively record the compilation tool information, module packaging method, and other relevant module information. In this scenario, the system determines that all modules need to be recompiled to ensure the integrity and consistency of the firmware. After completing the full compilation, the system proceeds to S107.
[0096] S106. Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time to determine the modules that need to be recompiled, and recompile them, and then execute S107.
[0097] It should be noted that, for cases where a JSON file already exists, by comparing the differences between the information stored before and after the initial compilation, the system can intelligently identify a list of modules that only need to be recompiled, thereby avoiding unnecessary full compilation and significantly improving compilation efficiency. After completing the differentiated compilation, the process proceeds to S107.
[0098] In one embodiment of this example, S106 can be further refined to include the following sub-steps. This refinement improves the efficiency and accuracy of the compilation process and reduces unnecessary compilation work, namely:
[0099] S106.1 Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time. Then execute S106.2, S106.3, S106.4 and S106.5 respectively.
[0100] S106.2 If the information of the compilation tools is inconsistent, then all modules need to be recompiled and recompiled.
[0101] S106.3 If the version numbers of one or more modules are inconsistent, then it is determined that the one or more modules need to be recompiled and recompiled.
[0102] S106.4 If the dependency comparison is inconsistent, it is determined that the modules involved in the dependency need to be recompiled and recompiled.
[0103] S106.5 If the packaging methods of one or more modules are inconsistent, then it is determined that one or more modules need to be recompiled and recompiled.
[0104] It should be noted that if the comparison results show inconsistencies in the compilation tool information (such as changes in compiler version, linker options, etc.), then all modules need to be recompiled. This is because changes in the compilation tools may affect the output of the compilation results and even lead to binary compatibility issues. Therefore, to ensure firmware consistency and stability, all modules need to be recompiled.
[0105] If the version numbers of one or more modules do not match, then only those specific modules need to be recompiled. Changes in module version numbers usually indicate that new features have been implemented or known bugs have been fixed within the module, thus requiring recompilation to ensure that the new version of the module can be correctly integrated into the firmware.
[0106] If the dependencies of modules are inconsistent (e.g., dependencies have been added, removed, or their versions have changed), then the modules involved in those dependencies need to be recompiled. Changes in dependencies can affect the compilation process and results of modules, so all affected modules must be recompiled to ensure they can link and interact correctly.
[0107] If the packaging method of one or more modules is inconsistent (e.g., changing from a static library to a dynamic library), then these specific modules need to be recompiled. Changes in packaging methods can affect module loading, operation, and performance; therefore, these modules must be recompiled to generate firmware that meets the new packaging requirements.
[0108] By refining the sub-steps described above, step S106 can more accurately identify which modules need to be recompiled, thus avoiding unnecessary compilation work. This refined management approach not only improves compilation efficiency but also enhances firmware stability and reliability. Furthermore, it embodies the modular design and incremental build principles of software engineering, helping to reduce project complexity and maintenance costs.
[0109] S107. Package the recompiled firmware separately into a compressed package, and then execute S108.
[0110] It's important to note that packaging the recompiled firmware is a crucial step in the firmware compilation and update process. The main purpose of this step is to package the compiled firmware into a compressed file (such as ZIP or TAR) to facilitate subsequent storage, transmission, and deployment. Compressed files not only reduce the space occupied by the firmware files but also improve file management and transmission efficiency.
[0111] In a detailed implementation of this embodiment, to better manage and track each compiled firmware, after packaging the compiled firmware separately, a practice is introduced that incorporates the commit ID as part of the compressed package name. This approach ensures the uniqueness of the generated firmware, avoids duplication and confusion, and helps to quickly identify the corresponding firmware during subsequent storage, transmission, and deployment processes, facilitating downloading, version management, and tracking.
[0112] Understandably, in the naming process of the generated compressed package, in addition to combining the submission identifier, package information can also be combined.
[0113] The naming format for the compressed file can be:
[0114] <package>_<commit_id> _<tools_id> If a .zip file is associated with a specific submission naming format, then it can be used for... <package>_<commit_id> _<tools_id> _<Associated Submission ID>.zip.
[0115] S108. Upload the JSON file to the code review system and the compressed package to the FTP server, then execute S109.
[0116] It should be noted that in this step, the system automatically uploads a JSON file containing compilation information to the code review system for comparison and traceability; at the same time, it uploads a compressed package containing the latest firmware to the FTP server so that the system can download it as needed.
[0117] In a further refinement of this embodiment, step S108 is broken down into two specific sub-steps, handling the upload operations of the JSON file and the compressed package respectively. This breakdown helps ensure that each critical step is properly handled and improves the transparency and traceability of the entire process, namely:
[0118] S108.1. Upload the JSON file to the code review system;
[0119] It's important to note that this sub-step aims to upload a JSON file containing compiler information, module packaging information, and module-related information to the code review system. The code review system is a tool for reviewing and managing code changes, allowing team members to review and discuss code before it's merged into the main branch. Uploading the JSON file to this system offers several advantages:
[0120] Transparency: Team members can clearly see the specific configurations and parameters used during the compilation and packaging process, making it easier to understand firmware changes and updates.
[0121] Traceability: As a record of the compilation and packaging process, the JSON file can provide important reference information for subsequent issue tracking and version rollback.
[0122] Security: Reviewing JSON files through a code review system ensures the correctness and security of configuration information, preventing potential errors or malicious changes.
[0123] S108.2. Upload the compressed package to the FTP server according to the set FTP path.
[0124] It's important to note that this sub-step is responsible for uploading the firmware archive to the designated FTP path on the FTP (File Transfer Protocol) server. An FTP server is a service used for storing and sharing files, allowing users to upload or download files via the FTP protocol. The benefits of uploading the archive to an FTP server include:
[0125] Centralized storage: The FTP server provides a centralized storage location, making it easy for team members to access and share firmware files.
[0126] Easy to transfer: The FTP protocol supports reliable transfer of large files, ensuring file integrity and correctness even under unstable network conditions.
[0127] Easy to deploy: Once the firmware package is uploaded to the FTP server, it can be easily downloaded and deployed to the target device or environment.
[0128] Understandably, this involves uploading the compressed file to the FTP server via a pre-defined FTP path, such as / <app_name> / <branch> / <app_zip_name> This can bring significant improvements to file storage in the following aspects.
[0129] Orderliness: Setting explicit FTP paths helps maintain a clear and orderly file structure. Different projects, versions, or modules can be assigned different folders or paths, making files easy to categorize and manage on the server. This orderliness not only facilitates current development work but also provides convenience for future version control, backup, and recovery operations.
[0130] Accessibility: An FTP server provides a centralized and stable file storage location, allowing team members to easily access and download the files they need using standard FTP protocols or FTP-enabled client software. This accessibility makes file sharing more efficient and flexible, promoting collaboration and communication among team members.
[0131] Easy download: Because FTP servers support reliable transfer of large files, even large firmware packages can be quickly downloaded to the local computer or target device. This is especially important for scenarios requiring frequent firmware updates or large-scale deployments.
[0132] Facilitates searching for developers: Through reasonable path planning and naming conventions, developers can more easily find the required firmware packages. They can quickly locate the target file based on key information such as project name, version number, or module name, thereby improving work efficiency and accuracy.
[0133] S109. When it is necessary to create an OTA differential package, download all firmware that needs to be recompiled and has been recompiled from the FTP server, package them to form the OTA differential package for distribution and deployment; or, download some firmware that needs to be recompiled and has been recompiled from the FTP server, recompile the remaining modules that need to be recompiled but have not been fully recompiled, package them to form the OTA differential package for distribution and deployment.
[0134] It should be noted that steps S101-S108 belong to the pre-compilation process, while step S109 belongs to the firmware management process.
[0135] When it is necessary to create an OTA (Over-the-Air) differential package, there are two scenarios. In the first scenario, all modules that need to be recompiled have been compiled during the pre-compilation process, and all the generated new firmware has been uploaded to the FTP server. At this time, the system can directly download all the firmware that needs to be recompiled and has been recompiled from the FTP server and package it into a complete OTA differential package.
[0136] In the second scenario, the pre-compilation process doesn't complete the compilation of all modules requiring recompilation; only a portion is compiled, and only the firmware of these recompiled modules is uploaded to the FTP server. In this case, the system will download the recompiled firmware from the FTP server and recompile the remaining modules that needed recompilation but weren't fully completed. Finally, all these components are packaged into a complete OTA differential package. If the pre-compilation process completes the compilation of all modules requiring recompilation, the resulting new firmware will be uploaded to the FTP server and will not be included in the creation of this OTA differential package.
[0137] This step ensures the accurate generation and efficient distribution of OTA differential packages, providing users with a seamless and fast software update experience.
[0138] In one embodiment of this example, step S109 can be further refined to include the following sub-steps:
[0139] S109.1 When it is necessary to create an OTA differential package, read the manifest file from the source code library and parse the manifest file to extract the relevant information of each module, including the version number and dependency relationship;
[0140] S109.2 Check if the JSON file can be obtained; if yes, proceed to step S109.3; if no, proceed to step S109.4.
[0141] S109.3 Store the compilation tool information, the packaging method information of each module, and the relevant information of each module into the JSON file, and then execute S109.5;
[0142] S109.4. Determine that all modules need to be recompiled, and then execute S109.6;
[0143] S109.5 Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time to determine the modules that need to be recompiled, and then execute S109.6.
[0144] S109.6 Detect whether all firmware that needs to be recompiled and has been generated after recompilation has been uploaded to the FTP server; if yes, proceed to S109.7; if no, proceed to S109.8.
[0145] S109.7 Download all firmware that needs to be recompiled and has been recompiled from the FTP server, package them into the OTA differential package, and distribute and deploy them.
[0146] S109.8 Download the firmware that needs to be recompiled and has been recompiled from the FTP server, and recompile the remaining modules that need to be recompiled but have not been fully recompiled, and then package them to form the OTA differential package for distribution and deployment.
[0147] It should be noted that the detailed sub-steps of S109 also involve the use of manifest files and JSON files, but their purpose is to identify which modules need to be recompiled when not all modules have been compiled during the pre-compilation process, thus facilitating their on-site recompilation.
[0148] In one embodiment of this example, in S109, the recompiled firmware is downloaded from the FTP server according to the name of the compressed package and the set FTP path.
[0149] It should be noted that downloading the recompiled firmware from the FTP server according to the compressed package name and the set FTP path is an important step in the S109. It ensures that the system can accurately obtain the required firmware file, providing reliable input for the subsequent creation of OTA differential packages.
[0150] Although this application frequently uses terms such as source code library, manifest file, and compiler, the possibility of using other terms is not excluded. These terms are used merely for the convenience of describing and explaining the essence of the invention; interpreting them as any additional limitation would contradict the spirit of the invention.
[0151] The present invention provides an APP module firmware compilation and update method, computer device and storage medium. By combining manifest file and JSON file when changes are detected in the source code library, the information stored in the previous and current versions is compared. This ensures that only the code of the module that needs to be recompiled is compiled each time, thereby effectively reducing unnecessary recompilation work, shortening compilation time, and precisely controlling the size of the OTA differential package, thus achieving a more efficient, faster and user-friendly software update experience.
[0152] Example 2
[0153] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 2 of the present invention. Figure 5 A block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present invention is shown. Figure 5 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0154] like Figure 5 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0155] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0156] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0157] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0158] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0159] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although... Figure 5 As not shown, it can be used in conjunction with computer device 12 with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0160] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the APP module firmware compilation and update method provided in the embodiments of the present invention.
[0161] Example 3
[0162] Embodiment 3 of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the APP module firmware compilation and update method provided in all embodiments of the present application.
[0163] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0164] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0165] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0166] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0167] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.< / branch> < / package> < / package>
Claims
1. A method for compiling and updating firmware for an APP module, characterized in that, The method includes: S101. Monitor whether the source code library has changed; if not, continue with S101; if yes, proceed with S102. S102. Read the manifest file from the source code library and parse the manifest file to extract relevant information for each module, including version number and dependency relationship, and then execute S103. S103. Check if a JSON file can be obtained; the JSON file is used to record compilation tool information, module packaging method, module version and dependency relationship, and is stored in the code review system; if yes, proceed to step S104; if no, proceed to step S105. S104. Store the compilation tool information, the packaging method information of each module, and the relevant information of each module into the JSON file, and then execute S106; S105. Create the JSON file, store the compilation tool information, the packaging method information of each module and the relevant information of each module in the JSON file, determine that all modules need to be recompiled, and perform recompilation, and then execute S107. S106. Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time to determine the modules that need to be recompiled, and recompile them, and then execute S107. S107. Package the recompiled firmware separately to form a compressed package, and then execute S108. S108. Upload the JSON file to the code review system and the compressed package to the FTP server, then execute S109; S109. When it is necessary to create an OTA differential package, download all firmware that needs to be recompiled and has been recompiled from the FTP server, package them to form the OTA differential package for distribution and deployment; or, download some firmware that needs to be recompiled and has been recompiled from the FTP server, recompile the remaining modules that need to be recompiled but have not been fully recompiled, package them to form the OTA differential package for distribution and deployment. S106 includes: S106.1 Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time. Then execute S106.2, S106.3, S106.4 and S106.5 respectively. S106.2 If the information of the compilation tools is inconsistent, then all modules need to be recompiled and recompiled. S106.3 If the version numbers of one or more modules are inconsistent, then it is determined that the one or more modules need to be recompiled and recompiled. S106.4 If the dependency comparison is inconsistent, it is determined that the modules involved in the dependency need to be recompiled and recompiled. S106.5 If the packaging methods of one or more modules are inconsistent, then it is determined that one or more modules need to be recompiled and recompiled.
2. The APP module firmware compilation and update method according to claim 1, characterized in that, S101 is: Monitor whether new source code has been submitted to the source code repository to determine whether the source code repository has changed.
3. The APP module firmware compilation and update method according to claim 1, characterized in that, Prior to S104, the method further includes: The configuration file is obtained from the source code repository and parsed to extract compilation tool information and packaging method information for each module.
4. The APP module firmware compilation and update method according to claim 1, characterized in that, The relevant information also includes a submission identifier; S107 is: The compiled firmware is packaged separately and named according to the submission identifier to form a compressed package.
5. The APP module firmware compilation and update method according to claim 4, characterized in that, S108 includes: S108.
1. Upload the JSON file to the code review system; S108.
2. Upload the compressed package to the FTP server according to the set FTP path.
6. The APP module firmware compilation and update method according to claim 1, characterized in that, S109 includes: S109.1 When it is necessary to create an OTA differential package, read the manifest file from the source code library and parse the manifest file to extract the relevant information of each module, including the version number and dependency relationship; S109.2 Check if the JSON file can be obtained; if yes, proceed to step S109.3; if no, proceed to step S109.
4. S109.3 Store the compilation tool information, the packaging method information of each module, and the relevant information of each module into the JSON file, and then execute S109.5; S109.
4. Determine that all modules need to be recompiled, and then execute S109.6; S109.5 Read the compilation tool information, packaging method information of each module and related information of each module stored in the JSON file last time, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time to determine the modules that need to be recompiled, and then execute S109.
6. S109.6 Detect whether all firmware that needs to be recompiled and has been generated after recompilation has been uploaded to the FTP server; if yes, proceed to S109.7; if no, proceed to S109.
8. S109.7 Download all firmware that needs to be recompiled and has been recompiled from the FTP server, package them into the OTA differential package, and distribute and deploy them. S109.8 Download the firmware that needs to be recompiled and has been recompiled from the FTP server, and recompile the remaining modules that need to be recompiled but have not been fully recompiled, and then package them to form the OTA differential package for distribution and deployment.
7. The APP module firmware compilation and update method according to claim 5, characterized in that, In S109, the recompiled firmware is downloaded from the FTP server according to the name of the compressed package and the set FTP path.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the APP module firmware compilation and update method as described in any one of claims 1-7.
9. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions are executed by a computer processor to implement the APP module firmware compilation and update method as described in any one of claims 1-7.