A Dynamic Invocation System and Method for Embedded Software Modularization Based on Compile-Time Linking
By using a dynamic invocation system for embedded software modules based on compile-time linking, the problems of module addition and deletion intrusion into the main process, uncontrollable timing, lack of grouping and isolation, and RAM overhead in embedded software module development are solved. This system enables parallel development of modules and rigidity of execution order, thereby improving development efficiency and hardware security.
Patent Information
- Application Number
- CN202611396555.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-11-17
AI Technical Summary
Existing embedded software module development solutions suffer from problems such as module addition/deletion intruding into the main process, uncontrollable execution timing, lack of business package grouping and isolation mechanisms, inconsistent module input parameters, lack of compile-time static verification, and RAM resource consumption due to runtime linked list solutions.
An embedded software modular dynamic calling system based on compile-time linking is adopted. Through the compilation partition storage layer, framework macro encapsulation layer and business module application layer, static storage rules and automatic sorting rules are defined. Function pointers are allocated to the specified Flash storage segment according to the segment name, and a unified calling interface is generated through macro mechanism to realize the parallel development and static storage of modules.
It achieves parallel independence in module development, eliminates conflicts in collaborative development, ensures the rigidity of execution order and hardware security, reduces RAM overhead and memory risks, and shortens the debugging cycle.
Smart Images

Figure CN123114594A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of embedded MCU real-time control software architecture technology, specifically to an embedded software modular dynamic calling system and method based on compile-time linking. Background Technology
[0002] In embedded development, modular development breaks down complex embedded systems into multiple independent functional modules. This development approach directly impacts product development efficiency, code maintainability, and firmware reliability.
[0003] In existing technologies, common solutions for developing embedded software modules fall into the following two categories: The first type is the manual hard-coded registration scheme, where developers call the initialization functions of each module sequentially in the main function and system initialization function. When adding a new functional module, the function call statement must be manually added to the initialization process; when deleting a module, the corresponding call code is deleted. If parameters need to be passed between modules, each module defines an independent input parameter structure, resulting in inconsistent function parameter formats. If functional groups need to be distinguished, manual comments are used for differentiation, with no code-level isolation mechanism. If the initialization order needs to be controlled, it can only be achieved by adjusting the order in which the code is written. The second type is the runtime linked list dynamic registration scheme, which defines a global linked list head node, and each module provides a registration function. Module registration is performed at the initial power-on of the program, dynamically inserting the module function pointer into the linked list; at runtime, the linked list is traversed to execute the module logic. This scheme supports simple priority sorting, and module parameters are also passed using custom structures.
[0004] However, the existing general solutions for embedded software module development have the following defects: (1) adding or deleting modules intrudes into the main process, resulting in many conflicts in collaborative development; (2) the execution sequence of modules is uncontrollable, and there is no standardized hierarchical scheduling mechanism; (3) there is no business package grouping and isolation mechanism, making it difficult to maintain large projects; (4) the module input parameters are not uniform, resulting in a large amount of code redundancy; (5) there is a lack of static verification during compilation, and defects can only be discovered after power-on; (6) the runtime linked list solution has RAM overhead and memory risks. Summary of the Invention
[0005] This invention provides a modular dynamic invocation system and method for embedded software based on compile-time linking, in order to solve one of the problems of the prior art.
[0006] In a first aspect, the present invention provides an embedded software modular dynamic invocation system based on compile-time linking, the system comprising: a compile partition storage layer, a framework macro encapsulation layer, and a business module application layer, wherein... The business module application layer is used to allow module developers to define business packages and specify the business package name and execution priority of the business module when including header files during the development phase. The compilation partition storage layer is used to define static storage rules and automatic sorting rules during the compilation phase. Static storage rules are used to allocate function pointers of each business module to the specified Flash storage segment according to the segment name during the compilation phase. Automatic sorting rules are used by the linker to sort each function pointer according to the lexicographical order of the segment name during the linking phase, so as to form a continuous and ordered block of function pointer addresses in Flash. The segment name includes the business package name and execution priority. The framework macro encapsulation layer is used during the development phase to generate function pointers corresponding to functions of each business module through a macro mechanism, allocate the function pointers to the specified Flash storage segment, and complete the registration according to static storage rules and automatic sorting rules to generate the corresponding calling interface; The framework macro encapsulation layer is also used during runtime to traverse the function pointer address block by calling the interface, and sequentially call and execute the functions of the business modules corresponding to each function pointer according to the execution priority.
[0007] This invention provides a business module application layer that allows module developers to define business packages, specify the business package name to which the business module belongs, and the execution priority, enabling parallel and independent module development. Through the compilation partition storage layer, static storage rules and automatic sorting rules are defined, and the function pointer table is embedded in Flash, which does not consume RAM resources and eliminates dynamic memory risks. Through the framework macro encapsulation layer, scattered business function code is encapsulated into a unified calling interface, achieving centralized execution during the runtime phase. This decouples the calling logic from the module implementation, eliminates collaborative development conflicts, and ensures the rigidity of the execution order and hardware security.
[0008] In one optional implementation, the framework macro encapsulation layer includes a unified parameter carrier, a business package creation macro, a module registration and verification macro, and a batch call macro, wherein, The unified parameter carrier is used to standardize the input parameter format of all module functions; The business package creation macro is used to create a business package with a specified name, and automatically generates the start sentinel function, end sentinel function, and traversal execution function. The module registration and verification macro is used to encapsulate module functions into standard interface functions and store the interface function pointers in the Flash segment according to the business package name and execution priority. The module registration and verification macro is used to display references to specific placeholder symbols generated by the business package creation macro. If the function's package name is not created by the business package creation macro, it will report that the symbol is undefined and terminate the compilation stage. The batch call macro is used to receive parameters, automatically initialize a unified parameter carrier structure, and call the corresponding traversal execution function of the business package.
[0009] This invention unifies the input parameter format of all module functions by using a unified parameter carrier, eliminating the problems of interface fragmentation and code redundancy caused by each module defining its own parameter structure. It establishes an independent physical storage boundary for each business package by creating a business package macro, isolating different business functions. It advances the discovery of configuration errors to the compilation stage by using module registration and verification macros, shortening the debugging cycle. It simplifies the calling logic by using batch calling macros to traverse and execute functions and triggering centralized execution.
[0010] Secondly, the present invention provides a method for dynamic invocation of embedded software modules based on compile-time linking, applied to the embedded software modular dynamic invocation system based on compile-time linking of the first aspect, the method comprising: During the development phase, it responds to header file inclusion operations, business package definition operations, business module to which the business package name belongs, and execution priority specification operations. During the compilation phase, static storage rules and automatic sorting rules are defined. Static storage rules are used to allocate function pointers of each business module to the specified Flash storage segment according to the segment name during the compilation phase. Automatic sorting rules are used by the linker to sort the function pointers according to the lexicographical order of the segment names during the linking phase, so as to form a continuous and ordered block of function pointer addresses in Flash. The segment name includes the business package name and execution priority. During the development phase, function pointers corresponding to the functions of each business module are generated through a macro mechanism, and the function pointers are allocated to the specified Flash storage segment. Registration is completed according to static storage rules and automatic sorting rules to generate the corresponding calling interface. During the runtime phase, the function pointer address block is traversed by calling the interface, and the functions of the business modules corresponding to each function pointer are called and executed in sequence according to the execution priority.
[0011] This invention enables parallel and independent development of modules during the development phase by responding to header file inclusion operations, business package definition operations, business module business package name and execution priority specification operations, achieving zero modification to the main process code and fundamentally solving the problem of code merging conflicts in parallel development. By defining static storage rules and automatic sorting rules during the compilation phase, the function pointer table is solidified in Flash, without consuming RAM resources and eliminating dynamic memory risks. By encapsulating scattered business function code into a unified calling interface during the development phase and achieving centralized execution during the runtime phase, the invention decouples the calling logic from the module implementation, eliminates collaborative development conflicts, and ensures the rigidity of the execution order and hardware security.
[0012] In one optional implementation, in response to header file inclusion operations, business package definition operations, business package names to which business modules belong, and execution priority specification operations, the following are included: When a header file inclusion operation is detected, the header file is included in the project; Define business packages using the business package creation module; Macros are used to write function names, and the operation is specified based on the business package name and execution priority to determine the business package name and execution priority of the business module.
[0013] This invention integrates header files into the project, enabling zero-dependency integration into embedded development without relying on third-party libraries. By using business packages to create modules and define business packages, it achieves physical partitioning and isolation of different business functions in Flash. Function functions are written using macros, and the business package name and execution priority of each business module are determined, making the entire process independent and parallel, achieving zero modification to the main process code, and improving integration efficiency.
[0014] In one optional implementation, static storage rules and automatic sorting rules are defined, including: The function pointer, encapsulated as a standard interface function, is stored in the corresponding Flash segment with the specified business package name and execution priority; Priority information is encoded into segment names, and function pointers are sorted according to the lexicographical order of segment names to form a continuous and ordered block of function pointer addresses in Flash. Based on the specific placeholder symbol used by the module registration and verification macro references, if the business package name of a function is not created through the business package creation macro, an undefined symbol is reported, and the compilation phase is terminated.
[0015] This invention stores function addresses in the corresponding Flash segments, enabling module data to be physically partitioned and stored during the compilation phase without occupying RAM resources. By encoding priority information into segment names and sorting function pointers according to a dictionary of segment names, the execution order is determined and traceable after compilation, preventing accidents such as PWM oscillation and MOSFET shoot-through caused by software timing errors. By verifying the business package name of the function, it solves the configuration errors that can only be detected during power-on operation in traditional solutions, thereby shortening the integration and testing cycle in the later stages of product development.
[0016] In one alternative implementation, the method further includes: If the function's business package name is created using the business package creation macro, then the linking is successful and firmware is generated.
[0017] This invention determines that the connection is successful and generates firmware when the function service package name verification is successful, thereby solidifying the module execution order.
[0018] In one optional implementation, by calling an interface, the function pointer address block is traversed, and the functions of the business modules corresponding to each function pointer are called and executed sequentially according to execution priority, including: Call macros as needed; The traversal functions are called sequentially according to execution priority, starting from the Flash start sentinel and executing all modules in the business package in order of execution priority until the end sentinel.
[0019] This invention supports differentiated function combinations for different hardware models by calling macros on demand, and executes all modules in the business package sequentially by calling traversal functions according to execution priority, thereby greatly simplifying the execution logic.
[0020] Thirdly, the present invention provides an embedded software modular dynamic invocation device based on compile-time linking, the device comprising: The response module is used during the development phase to respond to header file inclusion operations, business package definition operations, business module business package name, and execution priority specification operations, with execution priority including high priority and low priority. Define the module, which is used to define static storage rules and automatic sorting rules during the compilation phase. Static storage rules are used to allocate function pointers of each business module to the specified Flash storage segment according to the segment name during the compilation phase. Automatic sorting rules are used by the linker to sort each function pointer according to the lexicographical order of the segment name during the linking phase, so as to form a continuous and ordered block of function pointer addresses in Flash. The segment name includes the business package name and execution priority. The allocation module is used during the development phase to generate function pointers corresponding to functions of each business module through a macro mechanism, allocate the function pointers to the specified Flash storage segment, and complete the registration according to static storage rules and automatic sorting rules to generate the corresponding calling interface; The execution module is used during the runtime phase to traverse the function pointer address block by calling the interface, and sequentially call and execute the functions of the business modules corresponding to each function pointer according to the execution priority.
[0021] Fourthly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the embedded software modular dynamic invocation method based on compile-time linking as described in the second aspect above or any corresponding embodiment.
[0022] Fifthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the embedded software modular dynamic invocation method based on compile-time linking as described in the second aspect above or any corresponding embodiment.
[0023] In a sixth aspect, the present invention provides a computer program product, including computer instructions for causing a computer to execute the embedded software modular dynamic invocation method based on compile-time linking as described in the second aspect above or any corresponding embodiment. Attached Figure Description
[0024] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of an embedded software modular dynamic calling system based on compile-time linking according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating the modular dynamic invocation method for embedded software based on compile-time linking according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the cross-functional swimlane process according to an embodiment of the present invention; Figure 4 This is a structural block diagram of an embedded software modular dynamic calling device based on compile-time linking according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention in an appropriate manner in accordance with relevant laws and regulations, and their permission should be obtained.
[0028] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0029] The shortcomings and underlying causes of existing general solutions for embedded software module development are as follows: (1) Module addition and deletion intrude into the main process, causing many conflicts in collaborative development: The module calling logic is concentrated in the main initialization function. Adding or deleting modules requires modifying the main function code. When multiple people develop in parallel, code merging conflicts are very likely to occur. The module initialization function is often omitted or added repeatedly, resulting in the device power-on function being missing or hardware malfunctions. (2) The execution timing of modules is uncontrollable and there is no standardized hierarchical scheduling mechanism: the execution order is controlled only by the order of code writing, and there is no unified priority configuration interface; industrial power supplies have strict initialization dependencies (hardware driver → sampling → control algorithm → upper-level communication → protection logic), and manual adjustment of the order is very easy to cause timing disorder, resulting in abnormal PWM output, closed-loop oscillation, and MOS shoot-through failure. The dual-layer multi-dimensional priority control capability is lacking, and it is impossible to distinguish the module startup level in detail; (3) No business package grouping and isolation mechanism, making large-scale projects difficult to maintain: all modules are laid out in the same scheduling queue, and the driver, algorithm, communication and protection logic are mixed, making it impossible to package and manage them according to business functions; when cutting functions in the low-end version of the product, it is necessary to comment out the module code file by file, which is prone to omissions and residual invalid code. (4) Inconsistent module input parameters and large amount of code redundancy: Each business module defines its own parameter structure, and there is no unified carrier for passing parameters such as integers, floating points, and pointers; cross-module parameter passing requires repeated writing of structure definition and data copying code, resulting in high redundancy in project code; (5) Lack of compile-time static verification, defects can only be discovered after power-on: There is no syntax binding verification in module registration, resulting in hidden problems such as misspelled package names, duplicate registration, and invalid registration; the compiler cannot identify errors, and the problem can only be exposed after the program is burned and powered on, resulting in a long debugging cycle; (6) The runtime linked list scheme has RAM overhead and memory risks: dynamic linked lists rely on RAM to store function pointers, and the memory resources of multi-channel high-power MCUs are tight; dynamic insertion of nodes has the risk of memory fragmentation and linked list breakage, and minimalist MCUs without dynamic memory management cannot be used.
[0030] This invention provides an embedded software modular dynamic invocation system and method based on compile-time linking, aiming to solve the following problems: (1) Code intrusion issues: Eliminate the physical code modification of the main initialization process by adding or deleting modules, and completely avoid code merging conflicts when multiple people are developing together; (2) Uncontrollable timing problem: Establish a standardized two-level priority hierarchical scheduling mechanism to ensure strict power-on execution timing in an explicit and configurable manner, and prevent power hardware damage caused by timing disorder; (3) Lack of grouping and isolation: Provide business package grouping and isolation capabilities at the code generation level to support large-scale project modular management and rapid, complete trimming of product functions; (4) Inconsistent interface: Define a unified module parameter passing interface for the entire system to completely eliminate redundant parameter structure definitions and data copying code; (5) Verification lag problem: Implement compile-time static forced verification of module registration legality, advance the time of discovering registration errors from "runtime" to "compile time", and significantly shorten the debugging iteration cycle; (6) RAM overhead and memory risk issues: The compile-time static storage technology is adopted to solidify all management data in Flash (read-only memory), achieving zero RAM occupation and completely avoiding the fragmentation and disconnection risks caused by dynamic memory allocation.
[0031] This invention provides an embedded software modular dynamic calling system and method based on compile-time linking. Its core idea is to transform the traditional "runtime dynamic registration" into "compile-time static partitioning storage and automatic sorting".
[0032] The technical implementation path is as follows: Utilizing the `__attribute__((section("section name"))` feature of the GCC (GNU Compiler Collection) compiler, the function pointers of each module are forcibly stored in their respective independently named custom Flash segments according to their respective business packages and preset two-level priorities. The segment name is designed with a specific format containing the business package name and two-level priority numbers. Since the linker strictly sorts all symbols within the same segment according to the lexicographical order of their complete segment names during the final linking process, by simply encoding the priority information into the segment name string, the inherent behavior of the linker can be cleverly leveraged to automatically complete the physical sorting of all module function pointers during the compilation phase, forming a naturally continuous, strictly priority-ordered static array of function pointers.
[0033] At runtime, the system requires no initialization or registration; a simple pointer traversal loop is all that's needed to execute all functions in the array sequentially. The entire call chain is constructed and ordered statically at compile time, incurring no RAM overhead or code intrusion at runtime.
[0034] This invention provides an embedded software modular dynamic invocation system based on compile-time linking, such as... Figure 1 As shown, the system includes a compilation partition storage layer, a framework macro encapsulation layer, and a business module application layer.
[0035] Specifically, the compilation partition storage layer, as the technological foundation of this system, defines the static storage rules and automatic sorting rules for specifying function storage addresses in Flash. The static storage rules are used during the compilation phase to allocate function pointers of each business module to designated Flash storage segments according to segment names. The automatic sorting rules are used during the linking phase by the linker to sort the function pointers according to the lexicographical order of segment names, forming a contiguous and ordered block of function pointer addresses in Flash. Specific functions are as follows: (1) Custom segment binding macro:
[0036] The macro forces a constant (i.e., a module function pointer) to be placed in a Flash storage segment named x, instead of the default .rodata or .text segment, which is key to implementing physical partitioning; (2) Prevent optimization by retaining the macro IT_IS_USED:
[0037] Function pointer constants generated during module registration are not explicitly called in application-level code. To prevent the compiler from optimizing and deleting them as "useless code," this macro is used to force the preservation of this symbol. (3) Partition naming and sorting rules: Segment names are designed to have a specific format that includes the business package name and two levels of execution priority numbers. The segment name definition format is as follows:
[0038] For example, the segment name is: .module_pack.NIT.0105; Automatic sorting principle: When the linker processes segments with the same name scattered in various .o files, it merges them and sorts them in lexicographical ascending order according to the complete string of the segment name.
[0039] For example: text .module_pack.INIT.0000 → Starting Sentinel Function .module_pack.INIT.0105 → PWM initialization (hl=01,ll=05) .module_pack.INIT.0110 → Loop driver initialization (hl=01, ll=10) .module_pack.INIT.0200 → AFE initialization (hl=02, ll=00) .module_pack.INIT.9999 → End sentinel function The smaller the priority number, the earlier it appears in the lexicographical order, thus achieving physical sorting by priority from smallest to largest.
[0040] Specifically, during the development phase, the framework macro encapsulation layer uses a series of ingeniously designed macros to distribute different code for the same business function into different code spaces, generating function pointers corresponding to the functions of each business module, allocating the function pointers to the specified Flash storage segment, and completing the registration according to the static storage rules and automatic sorting rules in the Flash of the compilation partition storage layer. The encapsulated upper-level calling interface is called during the runtime phase to traverse the function pointer address block and call and execute the functions of the business modules corresponding to each function pointer in sequence according to the execution priority, so as to centrally execute the same business function code that is scattered in different code spaces.
[0041] Specifically, the framework macro encapsulation layer includes the following: (1) Unified parameter carrier C_MODULE_PARAM:
[0042] The unified parameter carrier serves as the sole module parameter carrier in the system, unifying the input parameter format of all module functions to const C_MODULE_PARAM. param completely eliminates the problem of interface fragmentation.
[0043] (2) Macro for creating business packages: c_module_pack_create(__name): As a macro for defining and instantiating business packages within the entire framework, users can use it to define a new business package named __name.
[0044] This macro will be generated automatically: The initial sentinel function is an empty function with priority (00,00) whose function pointer is located at the very beginning of the package memory space. Termination Sentinel Function: An empty function with priority (99, 99) whose function pointer is located at the end of the package memory space; Traversal execution function: This function is implemented as a for loop. The loop pointer starts from "starting sentinel address + 1" and increments when it is "less than the ending sentinel address".
[0045] This approach eliminates the need for additional storage of the number of modules within a package; traversal can be completed solely through address boundaries, resulting in an extremely concise and efficient design.
[0046] (3) Module registration and verification macro c_module_fun(__pname,__fun,...): As the sole entry point for module developers to write functional code and add it to a specific business package, this is the core innovative interface of the system, integrating the following two major functions: Registration function: The function body {...} subsequently written by the developer is encapsulated into a standard interface function, and the interface function pointer is stored in the corresponding Flash segment according to the specified business package name __pname and execution priority; Compile-time verification: This macro explicitly references a specific placeholder symbol generated by `c_module_pack_create` (the business package creation macro). If the package name `__pname` entered by the developer in this macro has not been created by `c_module_pack_create`, the linker will immediately report an "undefined reference" error and terminate the compilation phase. This mechanism intercepts 100% of registration errors during the compilation phase, achieving zero-cost static verification.
[0047] (4) Batch call macro c_module_pack_call(__name,...): As a call trigger interface for business packages, it is used in upper-level logic such as the main function. It receives a variable number of parameters, automatically initializes the C_MODULE_PARAM structure, and then calls the corresponding traversal execution function of the package to achieve "one-click triggering and full package execution".
[0048] Specifically, for the application layer of business modules, within the framework of this invention, such as an industrial energy storage power supply project, the architect can create multiple business packages such as PWR_DRIVER (power drive), ALG_CTRL (core algorithm), COMM_PVI (communication protocol), and FLT_PROTECT (fault protection) using c_module_pack_create. All module developers only need to declare the business package and priority of their module using the c_module_fun macro in their own independent .c file to develop independently and in parallel. They can use c_module_fun to write the function entities for each functional package, including the initial configuration package (PWM configuration, loop drive initialization, AFE initialization, other functional chip initialization, etc.), the signal acquisition package (raw ADC value acquisition, AFE chip data acquisition, cell voltage and temperature assignment, voltage and current calculation), and the fault protection package (MOS circuit control, overcurrent detection, overtemperature detection, overvoltage detection). The integration and sequencing of the entire project are completed automatically at compile time, and the main flow code is extremely concise and remains unchanged throughout.
[0049] By unifying the parameter carrier and all module function interfaces, the problem of interface fragmentation and code redundancy caused by each module defining its own parameter structure is eliminated. By creating macros for business packages, independent physical storage boundaries are established for each business package to isolate different business functions. By using module registration and verification macros, the timing of configuration error detection is brought forward to compilation, shortening the debugging cycle. By using batch call macros to call and traverse execution functions, centralized execution is triggered, simplifying the calling logic.
[0050] The embedded software modular dynamic invocation system based on compile-time linking provided in this embodiment allows module developers to define business packages, specify the name of the business package and the execution priority through the business module application layer, enabling parallel and independent module development. Through the compile partition storage layer, static storage and automatic sorting rules for functions are defined, and the function pointer table is fixed in Flash, which does not consume RAM resources and has no dynamic memory risks. Through the framework macro encapsulation layer, the scattered business function code is encapsulated into a unified calling interface, which enables centralized execution during the runtime phase, decoupling the calling logic and module implementation, eliminating collaborative development conflicts, and ensuring the rigidity of the execution order and hardware security.
[0051] According to an embodiment of the present invention, an embodiment of a modular dynamic invocation method for embedded software based on compile-time linking is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0052] This embodiment provides a method for dynamic invocation of embedded software modules based on compile-time linking, which is applied to the aforementioned dynamic invocation system for embedded software modules based on compile-time linking. Figure 2 This is a flowchart of a modular dynamic invocation method for embedded software based on compile-time linking according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: During the development phase, respond to header file inclusion operations, business package definition operations, business package name to which the business module belongs, and execution priority specification operations.
[0053] In this embodiment of the invention, during the development phase, in response to the architect's operation of including the header file in the project, in response to the architect's operation of defining the required business package, and in response to the module developer's operation of specifying the business package name and execution priority of the business module, the execution priority includes high priority and low priority.
[0054] Step S202: During the compilation phase, define static storage rules and automatic sorting rules.
[0055] In this embodiment of the invention, during the compilation phase, priority information is encoded into segment names, and function pointers are sorted according to the lexicographical order of the segment names, forming a continuous and ordered block of static function pointer addresses in Flash. Utilizing lexicographical sorting, all symbols within the same segment are sorted according to the lexicographical order of the complete segment name, forming an automatic sorting rule. The segment name is designed with a specific format containing the business package name and two levels of execution priority numbers.
[0056] Step S203: During the development phase, function pointers corresponding to the functions of each business module are generated through a macro mechanism, and the function pointers are allocated to the specified Flash storage segment. Registration is completed according to static storage rules and automatic sorting rules to generate the corresponding calling interface.
[0057] In this embodiment of the invention, during the development phase, a series of ingeniously designed macros are used to distribute different codes of the same business function to different code spaces, generate function pointers corresponding to the functions of each business module, allocate the function pointers to the specified Flash storage, and encapsulate them into a very user-friendly upper-layer calling interface according to the static storage rules and automatic sorting rules in the compilation partition storage layer Flash.
[0058] Step S204: During the runtime phase, the function pointer address block is traversed by calling the interface, and the functions of the business modules corresponding to each function pointer are called and executed in sequence according to the execution priority.
[0059] In this embodiment of the invention, during the runtime phase, a variable number of parameters are received, and a unified parameter carrier structure, namely the C_MODULE_PARAM structure, is automatically initialized. By calling the corresponding runtime interface, the function pointer address block is traversed, and the functions of the business modules corresponding to each function pointer are called and executed in sequence according to the execution priority, so as to centrally execute the same business function code that is scattered in different code spaces.
[0060] The embedded software modular dynamic invocation method based on compile-time linking provided in this embodiment enables parallel and independent development of modules during the development phase by responding to header file inclusion operations, business package definition operations, business module business package name and execution priority specification operations. This achieves zero modification to the main process code and fundamentally solves the problem of code merging conflicts in parallel development. By defining static storage rules and automatic sorting rules during the compilation phase, the function pointer table is solidified in Flash, which does not consume RAM resources and has no dynamic memory risk. By encapsulating scattered business function code into a unified calling interface during the development phase and achieving centralized execution during the runtime phase, the calling logic and module implementation are decoupled, collaborative development conflicts are eliminated, and the rigidity of execution order and hardware security are guaranteed.
[0061] This embodiment provides a method for dynamic invocation of embedded software modules based on compile-time linking. The process includes the following steps: Step S301: During the development phase, respond to header file inclusion operations, business package definition operations, business package name to which the business module belongs, and execution priority specification operations.
[0062] Specifically, the steps S301 above that respond to the header file inclusion operation, the business package definition operation, the business package name to which the business module belongs, and the execution priority specification operation include: Step S3011: When a header file inclusion operation is detected, include the header file in the project; Step S3012: Define a business package using the business package creation module; Step S3013: Use macros to write function programs to determine the business package name and execution priority of the business module based on the business package name and execution priority.
[0063] In embodiments of the present invention, such as Figure 3 As shown, the framework integration is performed first, with the role of the architect. When a header file import operation is detected, the c_module.h header file is imported into the project, with no other library dependencies.
[0064] Then, the business package is created. The role is architect. When the business package definition operation is detected, c_module_pack_create is used to define all the necessary business packages (such as sys_init, sys_task) for the system.
[0065] Finally, parallel module development is implemented, with the role of the module developer. When the business package name and execution priority are specified, each developer writes a function using the `c_module_fun` macro in their respective `.c` file, and independently specifies the business package name and execution priority of their business module. It should be noted that this process is completely independent and parallel, requiring no notification to others or modification of any common files.
[0066] By including header files in the project, zero-dependency integration into embedded development is achieved without relying on third-party libraries. By using business packages to create modules and define business packages, physical partitioning and isolation of different business functions in Flash are achieved. Function functions are written using macros, and their respective business package names and execution priorities are determined, making the entire process independent and parallel, achieving zero modification to the main process code, and improving integration efficiency.
[0067] Step S302: During the compilation phase, define static storage rules and automatic sorting rules.
[0068] Specifically, the static storage rules and automatic sorting rules defined in step S302 above include: Step S3021: Store the function pointer, which is encapsulated as a standard interface function, into the corresponding Flash segment with the specified business package name and execution priority; Step S3022: Encode the priority information into the segment name, sort the function pointers according to the lexicographical order of the segment name, and form a continuous and ordered static function pointer address block in Flash. Step S3023: Based on the specific placeholder symbol for the macro reference in module registration and verification, if the business package name of the function is not created through the business package creation macro, report an undefined symbol and terminate the compilation phase.
[0069] In embodiments of the present invention, such as Figure 3 As shown, compilation and partitioning are performed first. The compiler is the execution role, compiling each source file, identifying the section attribute, and storing the function pointers encapsulated as standard interface functions into the corresponding Flash custom segment according to the specified business package name and execution priority based on the section attribute.
[0070] Then, linking, sorting, and validation are performed, with the linker acting as the execution role. This process consists of two steps: merging and sorting, and static validation. (1) Merge and sort: merge scattered segments, merge segments with the same name, encode priority information into segment names, and strictly sort each function pointer according to the lexicographical order of segment names to form a continuous and ordered static function pointer array. (2) Static verification: parse all symbol references, and based on the specific placeholder symbol of the module registration and verification macro reference, if the business package name _pname of the function is not created by the business package creation macro c_module_pack_create, an error will be immediately reported as "undefined reference", and the compilation stage will be terminated without generating firmware.
[0071] By storing function addresses in the corresponding Flash segments, module data is physically partitioned and stored during the compilation phase, eliminating the need for RAM resources. By encoding priority information into segment names and sorting them lexicographically, the execution order is determined and traceable after compilation, preventing accidents such as PWM oscillation and MOSFET shoot-through caused by software timing errors. By verifying function package names, configuration errors that can only be detected during power-on operation in traditional solutions are resolved, thereby shortening the integration and testing cycle in the later stages of product development.
[0072] In some alternative implementations, the method further includes: Step S3024: If the service package name of the function is created through the service package creation macro, then the linking is successful and the firmware is generated.
[0073] In embodiments of the present invention, such as Figure 3 As shown, if the business package name of the function is created through the business package creation macro, then the business package name already exists. If the business package name verification passes, the linking is successful, and a firmware file that can be burned is generated.
[0074] When the function service package name verification is successful, the connection is considered successful, and firmware is generated to solidify the module execution order.
[0075] Step S303: During the development phase, function pointers corresponding to the functions of each business module are generated through a macro mechanism, and the function pointers are allocated to the specified Flash storage segment. Registration is completed according to static storage rules and automatic sorting rules to generate the corresponding calling interface.
[0076] Please see details Figure 2 Step S203 of the illustrated embodiment will not be described again here.
[0077] Step S304: During the runtime phase, the function pointer address block is traversed by calling the interface, and the functions of the business modules corresponding to each function pointer are called and executed in sequence according to the execution priority.
[0078] Specifically, in step S304 above, the process of calling the interface, traversing the function pointer address block, and sequentially calling and executing the functions of the business modules corresponding to each function pointer according to their execution priority includes: Step S3031: Call macros as needed; Step S3032: Call the traversal function in sequence according to execution priority. Starting from the Flash start sentinel, execute all modules in the business package in sequence according to execution priority until the end sentinel.
[0079] In embodiments of the present invention, such as Figure 3 As shown, the trigger call is performed first, with the CPU as the execution role. After the MCU is powered on, the main function is executed. The main function calls the c_module_pack_call macro as needed, such as c_module_pack_call("init"), and initializes C_MODULE_PARAM.
[0080] Then, the execution proceeds through a traversal process, with the CPU acting as the execution role. The macro calls the traversal function of the corresponding business package. Starting from the initial sentinel in Flash, the CPU executes all modules within the business package in sequence according to execution priority until the end of the sentinel, and then returns to main.
[0081] By calling macros on demand, differentiated function combinations for different hardware models can be supported. By calling traversal functions according to execution priority, all modules in the business package are executed sequentially, achieving extremely simplified execution logic.
[0082] In summary, to address the problems that this embodiment aims to solve, the embedded software modular dynamic invocation system and method based on compile-time linking provided in this embodiment specifically addresses the issues from the following six aspects: (1) In view of the shortcomings of the existing technology code being highly intrusive, the module self-registration mechanism in this embodiment allows the main process to operate the "business package" only through the c_module_pack_call macro, thereby achieving physical decoupling. Adding or deleting modules does not require modifying the main process code, thus completely eliminating the root cause of merging conflicts. (2) In view of the defects of uncontrollable timing in the existing technology, this embodiment uses the linker segment name dictionary order sorting, combined with the two-level priority parameters (00-99), to realize automatic sorting at compile time, realize timing rigidity, and the execution order is completely determined after compilation, thus eliminating human sorting errors from the root. (3) In view of the lack of group isolation in the existing technology, the c_module_pack_create macro in this embodiment creates an independent business package physically partitioned in Flash to achieve physical isolation, realize the forced group management of modules, and support the "one-click" secure trimming of product functions; (4) In view of the defects of inconsistent interfaces in existing technologies, this embodiment forces the use of C_MODULE_PARAM as a unified parameter carrier, ensuring that all module interfaces are consistent, achieving a high degree of standardization, eliminating redundant parameter structure definitions, and is expected to reduce the amount of related code by more than 30%. (5) In view of the shortcomings of the existing technology in the late verification, the c_module_fun macro in this embodiment has built-in symbol binding logic, which performs forced verification during the compilation and linking period, realizes the left shift of errors, and advances the time of discovery of configuration errors from runtime to compilation time, which greatly shortens the debugging cycle; (6) In view of the shortcomings of existing technologies that occupy RAM and are risky, the function pointer table in this embodiment is statically constructed during compilation and stored in Flash (ROM), achieving zero RAM overhead, no dynamic memory allocation, completely avoiding fragmentation and chain break risks, and adapting to various MCUs.
[0083] Compared with existing technologies, the embedded software modular dynamic invocation method based on compile-time linking provided in this embodiment has the following advantages: (1) Complete decoupling and elimination of collaboration conflicts: Module addition and deletion become atomic operations of the module itself, and the main process code is modified without modification. This fundamentally solves the code merging conflict problem in the parallel development of large-scale teams and greatly improves integration efficiency. (2) Rigid timing to ensure hardware safety: The standardized two-layer priority mechanism provides explicit and configurable strict power-on logic protection, which eliminates catastrophic accidents such as PWM oscillation and MOSFET shoot-through caused by software timing errors in industrial equipment, and significantly improves the long-term operational reliability of the product. (3) Physical isolation enables agile customization: Different business functions are physically partitioned and isolated in Flash, forming natural product function "building blocks". Different product firmware models can be quickly configured by adding or deleting business packages, resulting in a qualitative leap in code reusability and product iteration speed; (4) Standardization reduces R&D costs: The unified parameter interface and module registration method eliminate the unspoken rules within the team, reduce the cognitive load of new members and the maintenance costs of old members, and significantly enhance code readability and maintainability; (5) Static verification, quality effectively moved forward: The pioneering package name verification mechanism during compilation can intercept 100% of configuration errors that could only be found during power-on and runtime in the development environment during the compilation stage, realizing "quality built-in" and greatly shortening the integration and testing cycle in the later stages of product development; (6) Zero memory overhead, extreme platform adaptability: All control and management data (function pointer table) resides in Flash, without consuming any precious and scarce RAM resources, and there is no risk of dynamic memory usage. It should be noted that this "zero cost" feature makes this solution applicable to extreme cost-sensitive platforms, ranging from resource-rich high-end Cortex-M7 MCUs to M0 / M0+ with only a few KB of RAM.
[0084] This embodiment also provides an embedded software modular dynamic invocation device based on compile-time linking. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0085] This embodiment provides an embedded software modular dynamic invocation device based on compile-time linking, such as... Figure 4 As shown, it includes: Response module 401 is used during the development phase to respond to header file inclusion operations, business package definition operations, business package name to which the business module belongs, and execution priority specification operations. Module 402 is defined to define static storage rules and automatic sorting rules during the compilation phase. Static storage rules are used to allocate function pointers of each business module to the specified Flash storage segment according to the segment name during the compilation phase. Automatic sorting rules are used by the linker to sort the function pointers according to the lexicographical order of the segment names during the linking phase, so as to form a continuous and ordered block of function pointer addresses in Flash. The segment name includes the business package name and execution priority. The allocation module 403 is used during the development phase to generate function pointers corresponding to the functions of each business module through a macro mechanism, allocate the function pointers to the specified Flash storage segment, and complete the registration according to static storage rules and automatic sorting rules to generate the corresponding calling interface; Execution module 404 is used during the runtime phase to traverse the function pointer address block by calling the interface, and sequentially call and execute the functions of the business modules corresponding to each function pointer according to the execution priority.
[0086] In some alternative implementations, the response module 401 includes: The `import` unit is used to include header files in the project when a header file inclusion operation is detected. Define a unit, used to define a business package using the business package creation module; The determination unit is used to write function macros to determine the business package name and execution priority of the business module based on the business package name and execution priority.
[0087] In some alternative implementations, the definition module 402 includes: The storage unit is used to store function pointers encapsulated as standard interface functions into the corresponding Flash custom segment with the specified business package name and execution priority; The merging unit is used to encode priority information into the segment name, sort the function pointers according to the lexicographical order of the segment name, and form a continuous and ordered static function pointer address block in Flash. The reporting unit is used to report an undefined symbol and terminate the compilation phase when the business package name of a function is not created through the business package creation macro, based on the specific placeholder symbol of the module registration and verification macro reference.
[0088] In some alternative embodiments, the device further includes: The firmware generation module is used to link successfully and generate firmware if the business package name of a function is created using a business package creation macro.
[0089] In some alternative implementations, the allocation module 403 includes: The calling unit is used to invoke macros on demand. The traversal unit is used to call the traversal function sequentially according to execution priority. Starting from the Flash start sentinel, all modules in the business package are executed sequentially according to execution priority until the end sentinel.
[0090] The embedded software modular dynamic invocation device based on compile-time linking provided in this embodiment of the invention can execute the embedded software modular dynamic invocation method based on compile-time linking provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0091] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0092] The following is a detailed reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0093] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0094] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the embedded software modular dynamic invocation method based on compile-time linking according to embodiments of the present invention.
[0095] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0096] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the embedded software modular dynamic invocation method based on compile-time linking shown in the above embodiments is implemented.
[0097] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0098] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope defined by the appended invention.
Claims
1. An embedded software modular dynamic invocation system based on compile-time linking, characterized in that, The system includes: a compilation partition storage layer, a framework macro encapsulation layer, and a business module application layer, wherein... The application layer of the business module is used to allow module developers to define business packages and specify the name of the business package to which the business module belongs and its execution priority when the header file is included during the development phase. The compilation partition storage layer is used to define static storage rules and automatic sorting rules during the compilation phase. The static storage rules are used to allocate function pointers of each business module to a specified Flash storage segment according to the segment name during the compilation phase. The automatic sorting rules are used by the linker to sort the function pointers according to the lexicographical order of the segment names during the linking phase, so as to form a continuous and ordered block of function pointer addresses in Flash. The segment name includes the business package name and execution priority. The framework macro encapsulation layer is used to generate function pointers corresponding to functions of each business module through a macro mechanism during the development phase, allocate the function pointers to a specified Flash storage segment, and complete the registration according to the static storage rules and the automatic sorting rules to generate the corresponding calling interface; The framework macro encapsulation layer is also used during the runtime phase to traverse the function pointer address block through the calling interface, and sequentially call and execute the functions of the business modules corresponding to each function pointer according to the execution priority.
2. The system according to claim 1, characterized in that, The framework macro encapsulation layer includes a unified parameter carrier, a business package creation macro, a module registration and verification macro, and a batch call macro, among which, The unified parameter carrier is used to unify the input parameter format of all module functions; The business package creation macro is used to create a business package with a specified name and automatically generate a start sentinel function, an end sentinel function, and a traversal execution function. The module registration and verification macro is used to encapsulate module functions into standard interface functions and store the interface function pointers in the Flash segment according to the business package name and execution priority. The module registration and verification macro is used to display references to specific placeholder symbols generated by the business package creation macro. When the package name of a function is not created by the business package name creation macro, an undefined symbol is reported and the compilation stage is terminated. The batch call macro is used to receive parameters, automatically initialize a unified parameter carrier structure, and call the corresponding traversal execution function of the business package.
3. A modular dynamic invocation method for embedded software based on compile-time linking, characterized in that, The method, applied to the embedded software modular dynamic invocation system based on compile-time linking as described in any one of claims 1-2, comprises: During the development phase, it responds to header file inclusion operations, business package definition operations, business module to which the business package name belongs, and execution priority specification operations. During the compilation phase, static storage rules and automatic sorting rules are defined. The static storage rules are used to allocate function pointers of each business module to a specified Flash storage segment according to the segment name during the compilation phase. The automatic sorting rules are used by the linker to sort the function pointers according to the lexicographical order of the segment name during the linking phase, so as to form a continuous and ordered block of function pointer addresses in Flash. The segment name includes the business package name and execution priority. During the development phase, function pointers corresponding to the functions of each business module are generated through a macro mechanism, and the function pointers are allocated to a designated Flash storage segment. Registration is completed according to the static storage rules and the automatic sorting rules to generate the corresponding calling interface. During the runtime phase, the function pointer address block is traversed through the calling interface, and the functions of the business modules corresponding to each function pointer are called and executed sequentially according to the execution priority.
4. The method according to claim 3, characterized in that, The responses to header file inclusion operations, business package definition operations, business module to which the business package name belongs, and execution priority specification operations include: When a header file inclusion operation is detected, the header file is included in the project; Define business packages using the business package creation module; Macros are used to write function names, and the operation is specified based on the business package name and execution priority to determine the business package name and execution priority of the business module.
5. The method according to claim 3, characterized in that, The defined static storage rules and automatic sorting rules include: The function pointer, encapsulated as a standard interface function, is stored in the corresponding Flash segment with the specified business package name and execution priority; Priority information is encoded into segment names, and the function pointers are sorted according to the lexicographical order of the segment names to form a continuous and ordered block of function pointer addresses in Flash. Based on the specific placeholder symbol used by the module registration and verification macro references, if the business package name of a function is not created through the business package creation macro, an undefined symbol is reported, and the compilation phase is terminated.
6. The method according to claim 5, characterized in that, The method further includes: If the function's business package name is created using the business package creation macro, then the linking is successful and firmware is generated.
7. The method according to claim 3, characterized in that, The step of traversing the function pointer address block through the calling interface and sequentially calling and executing the functions of the business modules corresponding to each function pointer according to the execution priority includes: Call macros as needed; The traversal function is called sequentially according to the execution priority. Starting from the initial sentinel of Flash, all modules in the business package are executed sequentially according to the execution priority until the end sentinel.
8. An embedded software modular dynamic invocation device based on compile-time linking, characterized in that, The device includes: The response module is used during the development phase to respond to header file inclusion operations, business package definition operations, business package names to which business modules belong, and execution priority specification operations. A definition module is used to define static storage rules and automatic sorting rules during the compilation phase. The static storage rules are used to allocate function pointers of each business module to a specified Flash storage segment according to the segment name during the compilation phase. The automatic sorting rules are used by the linker to sort the function pointers according to the lexicographical order of the segment names during the linking phase, so as to form a continuous and ordered block of function pointer addresses in Flash. The segment name includes the business package name and execution priority. The allocation module is used during the development phase to generate function pointers corresponding to the functions of each business module through a macro mechanism, allocate the function pointers to the specified Flash storage segment, and complete the registration according to the static storage rules and the automatic sorting rules to generate the corresponding calling interface. The execution module is used during the runtime phase to traverse the function pointer address block through the calling interface and sequentially call and execute the functions of the business modules corresponding to each function pointer according to the execution priority.
9. An electronic device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the computer instructions to perform the embedded software modular dynamic invocation method based on compile-time linking as described in any one of claims 3 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the embedded software modular dynamic invocation method based on compile-time linking as described in any one of claims 3 to 7.
11. A computer program product, characterized in that, Includes computer instructions for causing a computer to execute the embedded software modular dynamic invocation method based on compile-time linking as described in any one of claims 3 to 7.
