APP module firmware compiling and updating method, computer equipment and storage medium
By monitoring the changes in the source code library and using manifest files and JSON files to compare the compilation information, only the modules that need to be changed are compiled, which solves the problems of slow compilation speed and large OTA differential package size in the existing technology, and achieves efficient and fast software updates Experience.
Patent Information
- Application Number
- CN202411391196.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-30
AI Technical Summary
The existing technology performs full compilation when the source code library changes, resulting in slow compilation speed, increasing the burden of R&D efficiency, and the OTA differential package size is large, which reduces the upgrade speed and affects the user experience.
By monitoring the changes in the source code library, using manifest files and JSON files to compare the compilation information, only modules that need to be changed are compiled, unnecessary duplicate compilation work, and precisely control the volume of OTA differential packages.
It effectively shortens the compilation time, reduces the volume of OTA differential packages, and improves the efficiency and user experience of software updates.
Smart Images

Figure CN119292644A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software development and compilation technology, and in particular to an APP module firmware compilation and update method, a computer device and a storage medium. Background Art
[0002] In the software development process, compilation is the process of converting source code written in a high-level programming language into code that can be directly executed by a computer.
[0003] Currently, every time the source code library changes, even if only a small part of the entire source code library has changed, the existing technology will recompile the code of all APP modules (called full compilation) and generate new firmware, but in fact the code of some modules has not changed since the last compilation. This method will result in slow compilation because it contains a lot of unnecessary duplication of work, which increases compilation time and reduces R&D efficiency.
[0004] Moreover, since the CRC (Cyclic Redundancy Check) value of the APP module firmware is different each time it is recompiled, the difference between versions will still be considered large even if its code has not changed substantially. This results in a larger size of the generated OTA (Over-The-Air) differential package. Larger OTA differential packages require more time to transmit and install, which reduces the upgrade speed and affects the user experience.
[0005] Therefore, it is necessary to improve the existing technology.
[0006] The above information is presented as background information only to assist with understanding the present disclosure and no determination or admission is made as to whether any of the above may be used as prior art with respect to the present disclosure. Summary of the invention
[0007] The present invention provides an APP module firmware compiling and updating method, a computer device and a storage medium, so as to solve the problems of slow compiling speed and slow upgrading speed caused by repeated compiling in the prior art.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] In a first aspect, the present invention provides a method for compiling and updating APP module firmware, the method comprising:
[0010] S101, monitor whether the source code library has changed; if not, continue to execute S101; if yes, execute S102;
[0011] S102, reading a manifest file from the source code library, and parsing the manifest file to extract relevant information of each module, the relevant information including version number and dependency, and then executing S103;
[0012] S103, check whether the JSON file can be obtained; if so, execute step S104; if not, execute step S105;
[0013] S104, storing the compilation tool information, the packaging method information of each module and the related information of each module into the JSON file, and then executing S106;
[0014] S105, creating the JSON file, storing the compilation tool information, the packaging method information of each module and the related information of each module in the JSON file, determining that all modules need to be recompiled, and recompiling, and then executing S107;
[0015] S106, reading the compilation tool information, the packaging method information of each module, and the related information of each module stored last time in the JSON file, and comparing them with the compilation tool information, the packaging method information of each module, and the related information of each module stored this time, so as to determine the modules that need to be recompiled, and recompile them, and then execute S107;
[0016] S107, respectively packaging the firmware generated after recompilation to form a compressed package, and then executing S108;
[0017] S108, uploading the JSON file to the code review system, and uploading the compressed package to the FTP server, and then executing S109;
[0018] S109. When it is necessary to make an OTA differential package, all firmware that needs to be recompiled and has been generated after recompilation are downloaded from the FTP server, and packaged to form the OTA differential package for distribution and deployment; or, part of the firmware that needs to be recompiled and has been generated after recompilation is downloaded from the FTP server, and the remaining modules that need to be recompiled but have not been recompiled are recompiled, and then packaged to form the OTA differential package for distribution and deployment.
[0019] Further, in the APP module firmware compile and update method, S101 is:
[0020] Monitor whether new source code is submitted to the source code library to determine whether the source code library has changed.
[0021] Furthermore, in the APP module firmware compiling and updating method, before S104, the method further includes:
[0022] A configuration file is obtained from the source code library, and the configuration file is parsed to extract compilation tool information and packaging method information of each module.
[0023] Further, in the APP module firmware compile and update method, S106 includes:
[0024] S106.1. Read the compilation tool information, packaging method information of each module and related information of each module stored last time in the JSON file, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time, and then execute S106.2, S106.3, S106.4 and S106.5 respectively;
[0025] S106.2. If the compilation tool information is not consistent, it is determined that all modules need to be recompiled, and the recompilation is performed;
[0026] S106.3. If the version numbers of one or more modules are inconsistent, it is determined that the one or more modules need to be recompiled, and the recompilation is performed;
[0027] S106.4. If the dependency comparison is inconsistent, determine that the modules involved in the dependency need to be recompiled, and recompile;
[0028] S106.5. If the packaging methods of one or several modules are inconsistent, it is determined that the one or several modules need to be recompiled, and the recompilation is performed.
[0029] Furthermore, in the APP module firmware compile and update method, the relevant information also includes a submission identifier;
[0030] The S107 is:
[0031] The firmware generated after compilation is packaged separately and named in combination with the submission identifier to form a compressed package.
[0032] Further, in the APP module firmware compile and update method, 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] Further, in the APP module firmware compile and update method, S109 includes:
[0036] S109.1. When it is necessary to generate an OTA differential package, read the manifest file from the source code library, and parse the manifest file to extract relevant information of each module, wherein the relevant information includes a version number and a dependency relationship;
[0037] S109.2, check whether the JSON file can be obtained; if so, execute step S109.3; if not, execute step S109.4;
[0038] S109.3, storing the compilation tool information, the packaging method information of each module and the related information of each module into the JSON file, and then executing 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, the packaging method information of each module, and the related information of each module stored last time in the JSON file, and compare them with the compilation tool information, the packaging method information of each module, and the related information of each module stored this time to determine the module that needs to be recompiled, and then execute S109.6;
[0041] S109.6, check whether all firmware that needs to be recompiled and has been recompiled has been uploaded to the FTP server; if so, execute S109.7; if not, execute S109.8;
[0042] S109.7. Download all firmware that needs to be recompiled and has been recompiled from the FTP server, and package them to form the OTA differential package for distribution and deployment;
[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 recompiled, and then package them to form the OTA differential package for distribution and deployment.
[0044] Furthermore, in the APP module firmware compiling and updating 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, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the APP module firmware compilation and update method provided in the first aspect is implemented.
[0046] In a third aspect, the present invention provides a storage medium comprising computer executable instructions, wherein the computer executable instructions 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] The present invention provides an APP module firmware compilation and update method, computer device and storage medium. When a source code library change is detected, the manifest file and the JSON file are combined to compare the information stored last time with the current time, so as to ensure that only the code of the module that needs to be recompiled is compiled each time, thereby effectively reducing unnecessary repeated compilation work, shortening the compilation time, and accurately controlling the size of the OTA differential package, so as to achieve a more efficient, fast and user-friendly software update experience.
[0049] The present invention has other features and advantages, which will be apparent from or will be described in detail in the accompanying drawings and the following detailed description incorporated herein, which together serve to explain the specific principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 It is a flowchart of a method for compiling and updating APP module firmware provided in the first embodiment of the present invention;
[0052] Figure 2 is a detailed flow chart of S106 provided in the first embodiment of the present invention;
[0053] Figure 3 is a detailed flow chart of S108 provided in the first embodiment of the present invention;
[0054] Figure 4 is a detailed flow chart of S109 provided in the first embodiment of the present invention;
[0055] Figure 5 It is a structural diagram of a computer device provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0056] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0057] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0058] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0059] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0060] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0061] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0062] In this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0063] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0064] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0065] Embodiment 1
[0066] The embodiment of the present invention achieves high automation and efficiency in APP module firmware compilation and update by accurately monitoring source code library changes, intelligently comparing compilation information, implementing differentiated compilation strategies, and combining efficient firmware packaging and distribution mechanisms, thereby providing users with more convenient and faster software update services.
[0067] Please refer to the attached Figure 1 , is a flow chart of a method for compiling and updating APP module firmware provided in the first embodiment of the present invention. The method is applicable to the scenario where the code of the APP module is recompiled after the source code library changes and a new firmware is generated. The method specifically includes the following steps:
[0068] S101, monitor whether the source code library has changed; if not, continue to execute S101; if so, execute S102.
[0069] It should be noted that after entering the continuous monitoring state, the system will continuously monitor whether there is any update or change in the source code library. If the monitoring result shows that the source code library remains the same, S101 will continue to be executed to keep monitoring uninterrupted; once a change in the source code library is detected, S102 will be immediately transferred.
[0070] It should be emphasized that the efficient execution of this step is inseparable from the support and assistance of advanced tools. Specifically, you can use the industry's widely recognized continuous integration tools (such as Jenkins & Gerrit) or other highly customized monitoring mechanisms to build a real-time, accurate and efficient source code library change monitoring system. These tools and mechanisms not only have powerful automated processing capabilities, but also can ensure instant perception and response to changes in the source code library by configuring flexible strategies.
[0071] In one implementation of this embodiment, the monitoring mechanism of step S101 is further strengthened and refined. Specifically, S101 can be refined into a more specific execution process, that is, when the system monitors whether there are changes in the source code library, it specifically focuses on a key and direct judgment basis, that is, monitoring whether new source code or modified source code is submitted to the source code library. If so, it is determined that the source code library has changed, and if not, it is determined that the source code library has not changed.
[0072] The core of this detailed operation is that by directly tracking the submission of source code, the system can capture the latest changes in the source code library in real time and accurately. Whenever the developer completes the writing, modification or optimization of the code and pushes it to the source code library in the form of submission, the system can immediately perceive this change, thereby triggering the subsequent compilation and update process.
[0073] In this way, the S101 step not only improves the accuracy and timeliness of source code library change monitoring, but also ensures that the entire compilation and update process can keep up with the pace of source code development and respond to every important change in the source code library in a timely manner. This is of vital importance to ensuring the continuous iteration, rapid delivery and efficient operation and maintenance of software projects.
[0074] S102, reading a manifest file from the source code library, and parsing the manifest file to extract relevant information of each module, the relevant information including version number and dependency, and then executing S103.
[0075] It should be noted that in this step, the system automatically reads and parses the manifest file from the changed source code library. This process aims to accurately extract the relevant information of each module, including but not limited to the version number of each module and the dependency relationship of each module, laying the foundation for subsequent steps.
[0076] Specifically, the information directly extracted from the manifest file includes the warehouse address, the version number of each module and the latest submission identifier of each module, and the dependency relationship of each module can be queried from the warehouse through the warehouse address.
[0077] S103, check whether the JSON file can be obtained; if so, execute step S104; if not, execute step S105.
[0078] It should be noted that JSON files are an important carrier for recording compilation-related information (such as compilation tool information, module packaging methods, module versions and dependencies, etc.), and 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 the same platform for easy 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 key data for each stage of project construction, testing, and release.
[0080] Version control and security: Code review systems usually support version control, which means that historical versions of JSON files can be recorded and tracked. This version control mechanism not only helps prevent data loss, but also allows you to go back to the previous compilation state when needed, making it easier to debug and solve problems. At the same time, data storage in a protected code review system also enhances data security.
[0081] Automated integration: In the continuous integration / continuous deployment (CI / CD) process, the code review system is often closely integrated with automation tools such as compilation, testing, and deployment. Storing JSON files in the code review system can easily interact with other automation tools to achieve automatic extraction and comparison of compilation information and automatic triggering of compilation tasks.
[0082] In this step, it is crucial to check whether the JSON file exists in the code review system. If the file exists, it means that the system has information related to the previous compilation stored, which can be used to compare with the current state of the source code library. Through comparison, the system can intelligently identify which modules have changed since the last compilation, so that only these changed modules are recompiled. This practice significantly improves compilation efficiency and reduces unnecessary compilation work.
[0083] On the contrary, if the JSON file does not exist in the code review system, it means that there is no previously stored compilation information for comparison. In this case, in order to ensure the integrity and consistency of the firmware, the system will choose to recompile all modules. Although this approach will increase the compilation time, it is a necessary means to ensure the accuracy of the compilation results.
[0084] S104, storing the compilation tool information, the packaging method information of each module and the related information of each module into the JSON file, and then executing 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 the relevant information of each module in the file, so as to enter S106 later, allowing the system to read and compare the information stored last time and this time to determine which modules' codes need 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 a configuration file from the source code library and parsing the configuration file to extract compilation tool information and packaging method information of each module.
[0087] Specifically, the steps are described as follows:
[0088] First, the system needs to obtain the configuration file from the specified location. This configuration file is a file specifically used to store project building and compilation related settings, which usually contains various parameters, paths, tool versions and other information required in the compilation process.
[0089] After obtaining the configuration file, the system needs to parse it to extract the crucial information in the compilation process. This information mainly includes two parts:
[0090] Compilation tool information: including the name, version, and possible configuration parameters of the compiler, linker, packaging tool, etc. This information is crucial to ensure the consistency of the compilation environment and the reliability of the compilation results.
[0091] Packaging information for each module: Since different modules may require different packaging methods, the configuration file needs to clearly specify the packaging method and related parameters for each module. This information will guide the subsequent packaging process to ensure that the generated firmware meets the actual requirements of each module.
[0092] After extracting the compilation tool information and module packaging 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 refinement step, since the compilation tool information and packaging method information are dynamically obtained based on the configuration file, when this information changes (for example, the compiler version is upgraded or the packaging strategy is changed), the system can automatically sense and make corresponding adjustments, thus avoiding problems caused by information lag. This automation mechanism further improves the accuracy and efficiency of the compilation process.
[0094] S105, creating the JSON file, storing the compilation tool information, the packaging method information of each module and the related information of each module in the JSON file, determining that all modules need to be recompiled, and recompiling, and then executing S107.
[0095] It should be noted that if the JSON file does not exist, the system will create a new file and fully record the compilation tool information, module packaging method and module related information. In this situation, the system determines that all modules need to be recompiled to ensure the integrity and consistency of the firmware. After the full compilation is completed, enter S107.
[0096] S106. Read the compilation tool information, the packaging method information of each module, and the related information of each module stored last time in the JSON file, and compare them with the compilation tool information, the packaging method information of each module, and the 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, in the case where a JSON file already exists, by comparing the information difference between the two storages, the system can intelligently identify the module list that only needs to be recompiled, thereby avoiding unnecessary full compilation and significantly improving compilation efficiency. After completing the differential compilation, the process also enters S107.
[0098] In an implementation of this embodiment, the 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 last time in the JSON file, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time, and then execute S106.2, S106.3, S106.4 and S106.5 respectively;
[0100] S106.2. If the compilation tool information is not consistent, it is determined that all modules need to be recompiled, and the recompilation is performed;
[0101] S106.3. If the version numbers of one or more modules are inconsistent, it is determined that the one or more modules need to be recompiled, and the recompilation is performed;
[0102] S106.4. If the dependency comparison is inconsistent, determine that the modules involved in the dependency need to be recompiled, and recompile;
[0103] S106.5. If the packaging methods of one or several modules are inconsistent, it is determined that the one or several modules need to be recompiled, and the recompilation is performed.
[0104] It should be noted that if the comparison results show that the compilation tool information is inconsistent (such as changes in the compiler version, linker options, etc.), it is determined that all modules need to be recompiled. This is because changes in the compilation tool may affect the output of the compilation results and even cause binary compatibility issues. Therefore, in order to ensure the consistency and stability of the firmware, all modules need to be recompiled.
[0105] If the version numbers of one or several modules are inconsistent, only these specific modules need to be recompiled. Changes in module version numbers usually mean that new functions have been implemented or known bugs have been fixed within the module, so recompilation is required to ensure that the new version of the module can be correctly integrated into the firmware.
[0106] If the module dependency comparison is inconsistent (for example, a new dependency is added, a dependency is removed, or the dependency version is changed), the modules involved in these dependencies need to be recompiled. Changes in dependencies may affect the compilation process and results of the module, so all affected modules must be recompiled to ensure that they can link and interact correctly.
[0107] If the packaging method of one or several modules is inconsistent (such as changing from a static library to a dynamic library), it is determined that these specific modules need to be recompiled. The change in packaging method may affect the loading, operation and performance of the module, so these modules must be recompiled to generate firmware that meets the new packaging requirements.
[0108] Through the refinement of the above sub-steps, step S106 can more accurately identify which modules need to be recompiled, thereby avoiding unnecessary compilation work. This refined management method not only improves compilation efficiency, but also enhances the stability and reliability of the firmware. At the same time, it also embodies the idea of modular design and incremental construction in software engineering, which helps to reduce the complexity and maintenance cost of the project.
[0109] S107, respectively packing the firmware generated after recompilation to form a compressed package, and then executing S108.
[0110] It should be noted that in the firmware compilation and update process, packaging the recompiled firmware is an important step. The main purpose of this step is to package the compiled firmware into a compressed package (such as ZIP, TAR, etc.) to facilitate subsequent storage, transmission and deployment. The compressed package not only reduces the space occupied by the firmware file, but also facilitates file management and transmission efficiency.
[0111] In the detailed implementation of this embodiment, in order to better manage and track each compiled firmware, after the compiled firmware is packaged separately, a method of combining the commit ID as part of the compressed package name is introduced. This method ensures that the generated firmware is unique, avoids duplication and confusion, and helps to quickly identify the corresponding firmware during subsequent storage, transmission and deployment, facilitating downloading, version management and tracking, etc.
[0112] It is understandable that in the naming process of the generated compressed package, in addition to combining the submission identifier, the software package information (package) and the like may also be combined.
[0113] The naming format of the compressed package can be:
[0114] <package>_<commit_id> _<tools_id> .zip, if there is an associated submission naming format, it can be <package>_<commit_id> _<tools_id> _<associated submission id>.zip.
[0115] S108, uploading the JSON file to the code review system, and uploading the compressed package to the FTP server, and then executing S109.
[0116] It should be noted that in this step, the system automatically uploads the JSON file containing the compilation information to the code review system for comparison and traceability; at the same time, the compressed package containing the latest firmware is uploaded to the FTP server so that the system can download it on demand.
[0117] In a further refinement of this embodiment, step S108 is divided into two specific sub-steps, which respectively process the upload operations of the JSON file and the compressed package. This division helps to ensure that each key 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 should be noted that the purpose of this sub-step is to upload a JSON file containing compilation tool information, module packaging information, and module-related information to a code review system. A code review system is a tool for reviewing and managing code changes, which allows team members to review and discuss the code before it is merged into the main branch. Uploading the JSON file to the system has the following benefits:
[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 problem tracking and version rollback.
[0122] Security: Reviewing JSON files through a code review system can ensure the correctness and security of configuration information and prevent potential errors or malicious changes.
[0123] S108.2. Upload the compressed package to the FTP server according to the set FTP path.
[0124] It should be noted that this sub-step is responsible for uploading the firmware compressed package to the set FTP path on the FTP (File Transfer Protocol) server. The FTP server is a service for storing and sharing files, which allows users to upload files to the server or download files from the server through the FTP protocol. The benefits of uploading the compressed package to the FTP server include:
[0125] Centralized Storage: The FTP server provides a centralized storage location for easy access and sharing of firmware files among team members.
[0126] Easy to transfer: The FTP protocol supports reliable transmission of large files, ensuring the integrity and correctness of files even under unstable network conditions.
[0127] Easy deployment: Once the firmware package is uploaded to the FTP server, it can be easily downloaded and deployed to the target device or environment.
[0128] It is understandable that by uploading the compressed package to the FTP server according to the set FTP path, for example / <app_name> / <branch> / <app_zip_name> , which can bring significant improvements to file storage in the following aspects.
[0129] Orderliness: Setting clear FTP paths can help maintain a clear and orderly file structure. Different projects, versions, or modules can be assigned different folders or paths, making it easy to classify and manage files on the server. This orderliness not only helps current development work, but also facilitates future version control, backup, and recovery operations.
[0130] Accessibility: FTP server provides a centralized and stable file storage location, where team members can easily access and download required files through standard FTP protocol or client software that supports FTP. This accessibility makes file sharing more efficient and flexible, and promotes collaboration and communication among team members.
[0131] Easy to download: Since the FTP server supports reliable transmission of large files, even if the firmware compression package is large, it can be quickly downloaded to the local computer or target device. This is especially important for scenarios that require frequent firmware updates or large-scale deployments.
[0132] Easy for developers to find: Through reasonable path planning and naming conventions, developers can find the required firmware compressed package more easily. 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 make an OTA differential package, all firmware that needs to be recompiled and has been generated after recompilation are downloaded from the FTP server, and packaged to form the OTA differential package for distribution and deployment; or, part of the firmware that needs to be recompiled and has been generated after recompilation is downloaded from the FTP server, and the remaining modules that need to be recompiled but have not been recompiled are recompiled, and then packaged to form the OTA differential package for distribution and deployment.
[0134] It should be noted that steps S101-S108 belong to the process of pre-compilation, and step S109 belongs to the process of firmware management.
[0135] There are two situations when an OTA (Over-the-Air) differential package needs to be produced. In the first situation, all modules that need to be recompiled have been compiled in the precompilation 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 case, during the pre-compilation process, not all modules that need to be recompiled are compiled, but only some modules that need to be recompiled are compiled, and only the firmware of the recompiled modules is uploaded to the FTP server. At this time, the system will 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 recompiled on site, and finally package them together into a complete OTA differential package. If the pre-compilation process completes the compilation of all modules that need to be recompiled, the generated new firmware will be uploaded to the FTP server and will not participate in the production 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 an implementation of this embodiment, the S109 may be further refined to include the following sub-steps:
[0139] S109.1. When it is necessary to generate an OTA differential package, read the manifest file from the source code library, and parse the manifest file to extract relevant information of each module, wherein the relevant information includes a version number and a dependency relationship;
[0140] S109.2, check whether the JSON file can be obtained; if so, execute step S109.3; if not, execute step S109.4;
[0141] S109.3, storing the compilation tool information, the packaging method information of each module and the related information of each module into the JSON file, and then executing 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, the packaging method information of each module, and the related information of each module stored last time in the JSON file, and compare them with the compilation tool information, the packaging method information of each module, and the related information of each module stored this time to determine the module that needs to be recompiled, and then execute S109.6;
[0144] S109.6, check whether all firmware that needs to be recompiled and has been recompiled has been uploaded to the FTP server; if so, execute S109.7; if not, execute S109.8;
[0145] S109.7. Download all firmware that needs to be recompiled and has been recompiled from the FTP server, and package them to form the OTA differential package for distribution and deployment;
[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 recompiled, and then package them to form the OTA differential package for distribution and deployment.
[0147] It should be noted that the detailed sub-step of S109 also involves the application of manifest files and JSON files, but its purpose is to know which modules need to be recompiled when not all modules that need to be recompiled are compiled during the precompilation process, so as to facilitate their on-site recompilation.
[0148] In an implementation manner of this embodiment, 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 naming of the compressed package and the set FTP path is an important step in S109. It ensures that the system can accurately obtain the required firmware files and provides reliable input for subsequent OTA differential package production.
[0150] Although the terms such as source code library, manifest file, and compilation are used more frequently in this application, the possibility of using other terms is not excluded. These terms are used only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional restrictions is contrary to the spirit of the present invention.
[0151] An APP module firmware compilation and update method, computer device and storage medium provided by the embodiment of the present invention, when detecting changes in the source code library, combines the manifest file and the JSON file to compare the information stored last time with the current time, so as to ensure that only the code of the module that needs to be recompiled is compiled each time, thereby effectively reducing unnecessary repeated compilation work, shortening the compilation time, and accurately controlling the size of the OTA differential package, so as to achieve a more efficient, fast and user-friendly software update experience.
[0152] Embodiment 2
[0153] Figure 5 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 use in implementing embodiments of the present invention is shown. Figure 5 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0154] like Figure 5 As shown, the computer device 12 is 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, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0155] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0156] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0157] The 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. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called 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, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various 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 the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0159] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via a bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, 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 the programs stored in the system memory 28, such as implementing the APP module firmware compiling and updating method provided in the embodiment of the present invention.
[0161] Embodiment 3
[0162] Embodiment 3 of the present invention provides a computer-readable storage medium on which computer-executable instructions are stored. When the instructions are executed by a processor, the APP module firmware compilation and update method provided in all the embodiments of the present application is implemented.
[0163] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0164] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0165] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0166] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0167] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of this application, this does not limit the scope of patent protection of this application. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concept of this application using the contents recorded in the specification and drawings of this application, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of this application.< / branch> < / package> < / package>
Claims
1. A method for compiling and updating APP module firmware, characterized in that: The method comprises: S101, monitor whether the source code library has changed; if not, continue to execute S101; if yes, execute S102; S102, reading a manifest file from the source code library, and parsing the manifest file to extract relevant information of each module, the relevant information including version number and dependency, and then executing S103; S103, check whether the JSON file can be obtained; if so, execute step S104; if not, execute step S105; S104, storing the compilation tool information, the packaging method information of each module and the related information of each module into the JSON file, and then executing S106; S105, creating the JSON file, storing the compilation tool information, the packaging method information of each module and the related information of each module in the JSON file, determining that all modules need to be recompiled, and recompiling, and then executing S107; S106, reading the compilation tool information, the packaging method information of each module, and the related information of each module stored last time in the JSON file, and comparing them with the compilation tool information, the packaging method information of each module, and the related information of each module stored this time, so as to determine the modules that need to be recompiled, and recompile them, and then execute S107; S107, respectively packaging the firmware generated after recompilation to form a compressed package, and then executing S108; S108, uploading the JSON file to the code review system, and uploading the compressed package to the FTP server, and then executing S109; S109. When it is necessary to make an OTA differential package, all firmware that needs to be recompiled and has been generated after recompilation are downloaded from the FTP server, and packaged to form the OTA differential package for distribution and deployment; or, part of the firmware that needs to be recompiled and has been generated after recompilation is downloaded from the FTP server, and the remaining modules that need to be recompiled but have not been recompiled are recompiled, and then packaged to form the OTA differential package for distribution and deployment.
2. The APP module firmware compiling and updating method according to claim 1, characterized in that: The S101 is: Monitor whether new source code is submitted to the source code library to determine whether the source code library has changed.
3. The APP module firmware compiling and updating method according to claim 1, characterized in that: Before S104, the method further includes: A configuration file is obtained from the source code library, and the configuration file is parsed to extract compilation tool information and packaging method information of each module.
4. The APP module firmware compiling and updating method according to claim 1, characterized in that: The S106 includes: S106.
1. Read the compilation tool information, packaging method information of each module and related information of each module stored last time in the JSON file, and compare them with the compilation tool information, packaging method information of each module and related information of each module stored this time, and then execute S106.2, S106.3, S106.4 and S106.5 respectively; S106.
2. If the compilation tool information is not consistent, it is determined that all modules need to be recompiled, and the recompilation is performed; S106.
3. If the version numbers of one or more modules are inconsistent, it is determined that the one or more modules need to be recompiled, and the recompilation is performed; S106.
4. If the dependency comparison is inconsistent, determine that the modules involved in the dependency need to be recompiled, and recompile; S106.
5. If the packaging methods of one or several modules are inconsistent, it is determined that the one or several modules need to be recompiled, and the recompilation is performed.
5. The APP module firmware compiling and updating method according to claim 1, characterized in that: The relevant information also includes a submission identifier; The S107 is: The firmware generated after compilation is packaged separately and named in combination with the submission identifier to form a compressed package.
6. The APP module firmware compiling and updating method according to claim 5, characterized in that: The 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.
7. The APP module firmware compiling and updating method according to claim 1, characterized in that: The S109 includes: S109.
1. When it is necessary to generate an OTA differential package, read the manifest file from the source code library, and parse the manifest file to extract relevant information of each module, wherein the relevant information includes a version number and a dependency relationship; S109.2, check whether the JSON file can be obtained; if so, execute step S109.3; if not, execute step S109.4; S109.3, storing the compilation tool information, the packaging method information of each module and the related information of each module into the JSON file, and then executing S109.5; S109.
4. Determine that all modules need to be recompiled, and then execute S109.6; S109.
5. Read the compilation tool information, the packaging method information of each module, and the related information of each module stored last time in the JSON file, and compare them with the compilation tool information, the packaging method information of each module, and the related information of each module stored this time to determine the module that needs to be recompiled, and then execute S109.6; S109.6, check whether all firmware that needs to be recompiled and has been recompiled has been uploaded to the FTP server; if so, execute S109.7; if not, execute S109.8; S109.
7. Download all firmware that needs to be recompiled and has been recompiled from the FTP server, and package them to form the OTA differential package for distribution and deployment; 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 recompiled, and then package them to form the OTA differential package for distribution and deployment.
8. The APP module firmware compiling and updating method according to claim 6, 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.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the APP module firmware compilation and update method according to any one of claims 1 to 8 is implemented.
10. 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 according to any one of claims 1 to 8.
Citation Information
Patent Citations
Installation package packaging method and apparatus, electronic device and computer readable medium
CN107678755A
Compiling integration method and device
CN112835587A
Module upgrading method and device, storage medium and electronic device
CN114257509A
Source code processing method and system, storage medium and electronic equipment
CN114489676A
A computer-implemented method and system for automatically recommending a code modification
EP3432144A1