Method for controlling creation of loadable files, installation of executable modules and running of applications
By adding a configuration file with simple identification information to the embedded operating system, the problem of callback interface validity checking in non-object-oriented programming languages is solved, configuration parameters are simplified, and application performance is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING TONGFANG MICROELECTRONICS
- Filing Date
- 2025-07-15
- Publication Date
- 2026-07-28
AI Technical Summary
In the existing technology, embedded operating systems based on non-object-oriented programming languages cannot effectively check the rationality of callback interfaces when generating loadable application module files, resulting in lengthy and error-prone configuration parameters.
By adding simple identification information to the configuration file of the application module's intermediate file, the callback interface of each executable module is recorded when the application module's loadable file is generated, simplifying the configuration parameters and checking the rationality of the callback interface.
It improves application performance, simplifies the configuration process, reduces errors, and improves the efficiency of rationality checks.
Smart Images

Figure CN121501362B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, specifically to the field of embedded operating systems, and more particularly to a method for controlling the creation of loadable files, installation of executable modules, and application. Background Technology
[0002] In an embedded operating system, application source code is compiled into loadable application module files. These loadable files are then loaded into the on-chip operating system by an on-chip installer, generating the application module. Each application module contains one or more executable modules, and each executable module has a unique interface for installing the application. By calling and running this unique installation interface within the runtime environment of the embedded operating system, the executable module can be instantiated into one or more applications.
[0003] In embedded operating systems based on WebAssembly virtual machines, the runtime environment runs the installed application according to the application runtime framework. If the application source code is written in a non-object-oriented programming language, the various framework interfaces required for the normal operation of the application need to be implemented as callback interfaces. These callback interfaces are then registered with the runtime environment during application installation, allowing the runtime environment to control the application's operation by calling the registered callback interfaces.
[0004] In the process of developing this invention, the inventors discovered that existing callback interfaces implemented using non-object-oriented programming languages have the following drawbacks: when converting the name of the callback interface as a configuration parameter to obtain a loadable file for the application module, it is impossible to know which callback interfaces the application module specifically implements, thus making it impossible to check the rationality of the callback interfaces during the application conversion stage; in addition, since all callback interface names in the application source code need to be used as configuration parameters, when the number of executable modules contained in the application module is large, the configuration parameter information becomes lengthy, and the development configuration process becomes complex and error-prone. Summary of the Invention
[0005] This invention provides a method for creating loadable files, installing executable modules, and controlling the operation of applications. It simplifies the configuration parameters of callback interfaces, checks the rationality of callback interfaces during the application conversion stage, and effectively simplifies application code.
[0006] According to one aspect of the present invention, a loadable file creation method is provided, executed by a converter, the method comprising:
[0007] Obtain the intermediate application module files obtained after compiling the application source code, as well as the configuration files corresponding to the intermediate application module files;
[0008] The application module intermediate file includes at least one callback interface corresponding to each executable module in the application module; the configuration file includes simple identification information to identify the executable module to which each callback interface belongs.
[0009] Based on the intermediate files and configuration files of the application module, generate the loadable files for the application module;
[0010] The application module loadable file includes an executable module data segment, which records the interface representation of the callback interface implemented by each executable module.
[0011] According to another aspect of the present invention, an executable module installation method is also provided, executed by the runtime environment of an embedded operating system, the method comprising:
[0012] In response to the application installation command for the target executable module in the target application module executable file, obtain the target application module executable file obtained after loading the target application module loadable file;
[0013] The application module executable file includes multiple executable modules and an executable module data segment corresponding to each executable module. The executable module data segment records the interface representation of the callback interface implemented by each executable module.
[0014] If, based on the executable module data segment in the target application module executable file, it is determined that the callback interface implemented by the target executable module includes the installation interface, then the target callback interface function corresponding to the installation interface is obtained in the target application module executable file.
[0015] Execute the bytecode of the target callback interface function to install the target application corresponding to the target executable module into the embedded operating system.
[0016] According to another aspect of the present invention, an application operation control method is also provided, executed by the runtime environment of an embedded operating system, the method comprising:
[0017] If a call request to the target callback interface is identified based on the context information, then the current application that matches the call request is obtained;
[0018] Retrieve the target executable module from the target application module executable file corresponding to the current application;
[0019] If it is determined from the executable module data segment in the target application module executable file that the target executable module implements the target callback interface, then the target callback interface function corresponding to the target callback interface is obtained in the target application module executable file.
[0020] Execute the bytecode of the target callback interface function and perform subsequent processing based on the obtained execution result.
[0021] According to another aspect of the present invention, a loadable file creation apparatus is also provided, configured in a converter, the apparatus comprising:
[0022] The file acquisition module is used to acquire the intermediate application module files obtained after compiling the application source code, as well as the configuration files corresponding to the intermediate application module files.
[0023] The application module intermediate file includes at least one callback interface corresponding to each executable module in the application module; the configuration file includes simple identification information to identify the executable module to which each callback interface belongs.
[0024] The loadable file generation module is used to generate loadable files for application modules based on intermediate files and configuration files of the application modules;
[0025] The application module loadable file includes an executable module data segment, which records the interface representation of the callback interface implemented by each executable module.
[0026] According to another aspect of the present invention, an executable module installation apparatus is also provided, configured in the runtime environment of an embedded operating system, the apparatus comprising:
[0027] The executable file acquisition module is used to obtain the target application module executable file after loading the target application module loadable file in response to the application installation instruction of the target executable module in the target application module executable file;
[0028] The application module executable file includes multiple executable modules and an executable module data segment corresponding to each executable module. The executable module data segment records the interface representation of the callback interface implemented by each executable module.
[0029] The interface function acquisition module is used to obtain the target callback interface function corresponding to the installation interface in the target application module executable file if it is determined from the executable module data segment in the target application module executable file that the callback interface implemented by the target executable module includes the installation interface;
[0030] The executable module installation module is used to execute the bytecode of the target callback interface function to install the target application corresponding to the target executable module into the embedded operating system.
[0031] According to another aspect of the present invention, an application operation control device is also provided, configured in the runtime environment of an embedded operating system, the device comprising:
[0032] The current application acquisition module is used to acquire the current application that matches the call request if a call request to the target callback interface is identified based on the context information.
[0033] The executable module acquisition module is used to acquire the target executable module in the target application module executable file corresponding to the current application.
[0034] The callback interface function acquisition module is used to retrieve the target callback interface function corresponding to the target callback interface in the target application module executable file if it is determined from the executable module data segment in the target application module executable file that the target executable module implements the target callback interface.
[0035] The callback interface function execution module is used to execute the bytecode of the target callback interface function and perform subsequent processing based on the obtained execution results.
[0036] According to another aspect of the present invention, a confined device is also provided, the confined device comprising:
[0037] At least one processor; and
[0038] A memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform a loadable file creation method as described in any one of the embodiments of the present invention, or to perform an executable module installation as described in any one of the embodiments of the present invention, or to perform an application operation control method as described in any one of the embodiments of the present invention.
[0040] According to another aspect of the present invention, an electronic device is also provided, including the restricted device as described in any one of the embodiments of the present invention.
[0041] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement a loadable file creation method as described in any embodiment of the present invention, or to implement an executable module installation as described in any embodiment of the present invention, or to implement an application operation control method as described in any embodiment of the present invention.
[0042] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of a loadable file creation method as described in any embodiment of the present invention, or implements the steps of an executable module installation method as described in any embodiment of the present invention, or implements the steps of an application operation control method as described in any embodiment of the present invention.
[0043] The technical solution of this invention adds simplified identification information to the configuration file corresponding to the intermediate application module file to identify the executable module to which each callback interface belongs. When the converter generates a loadable application module file based on the intermediate application module file, it can add an executable module data segment to the loadable application module file to record the interface representations of the callback interfaces implemented by each executable module. This simplifies the configuration parameters written for the executable module in the configuration file. During application conversion, the converter identifies and checks the consistency and rationality of each callback interface, avoiding the need for the embedded operating system to perform interface identification and checking. Furthermore, it simplifies the application code. Moreover, when the embedded operating system calls the callback interfaces in the executable module to install the application, or calls specific callback interfaces of the installed application, the executable module data segment can identify in advance whether the application has implemented the required callback interfaces, thereby greatly improving the application's performance.
[0044] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a flowchart illustrating the implementation of application compilation, conversion, loading, and installation for an embedded operating system applicable to the embodiments of the present invention.
[0047] Figure 2 This is a flowchart of a loadable file creation method provided in an embodiment of the present invention;
[0048] Figure 3This is a flowchart of another loadable file creation method provided by an embodiment of the present invention;
[0049] Figure 4 This is a flowchart of an executable module installation method provided in an embodiment of the present invention;
[0050] Figure 5 This is a flowchart of an application operation control method provided in an embodiment of the present invention;
[0051] Figure 6 This is a structural diagram of a loadable file creation device provided in an embodiment of the present invention;
[0052] Figure 7 This is a structural diagram of an executable module installation device provided in an embodiment of the present invention;
[0053] Figure 8 This is a structural diagram of an application operation control device provided in an embodiment of the present invention;
[0054] Figure 9 This is a schematic diagram of the structure of a restricted device that implements the methods for creating loadable files, installing executable modules, and controlling the operation of applications according to embodiments of the present invention.
[0055] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0056] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0057] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0058] To facilitate understanding of the technical solutions of the various embodiments of the present invention, the implementation process of compiling, converting, loading, and installing applications applicable to the embedded operating system is first briefly described. Specifically, as follows... Figure 1 As shown, after writing the application source code in a specified programming language (e.g., C, C++, C#, or Java), compiling the application source code using a compiler yields an application module intermediate file. This intermediate file contains the application bytecode. Then, by using a converter to transform the application module intermediate file, configuration files, and linker files, a loadable application module file can be obtained.
[0059] The link file is a link file for the application source code to reference the interface library file. The configuration file contains various configuration information required to convert and generate the loadable application module file, including the unique identifier (also known as AID) of the application module and information on one or more executable modules. The executable module information includes the executable module AID and the installation interface class name or installation interface function name of the executable module.
[0060] Subsequently, using the on-chip installer in the device where the application needs to be installed, the loadable file of the application module can be loaded into the on-chip embedded operating system, generating an executable file for the application module (often simply referred to as the application module). This application module contains one or more executable modules, each containing a unique interface for installing the application. This device is generally a restricted device, which can be understood as a resource-constrained device, referring to devices with very limited hardware resources, such as memory resources. Furthermore, this restricted device can be a smart card, a Secure Element (SE), or an embedded device.
[0061] The application installation process involves the runtime environment within the embedded operating system calling and running the unique installation interface within the application module to create application data and the registry. By installing applications, each executable module can be instantiated into one or more applications.
[0062] Figure 2 This is a flowchart illustrating a method for creating a loadable file according to an embodiment of the present invention. This embodiment is applicable to situations where a converter generates a loadable application module file based on intermediate application module files compiled by a compiler. This method can be executed by a loadable file creation device, which can be implemented in hardware and / or software and is generally configured within the converter. Figure 2 As shown, the method may include:
[0063] S210. Obtain the intermediate application module file obtained after compiling the application source code, and the configuration file corresponding to the intermediate application module file.
[0064] The application module intermediate file includes at least one callback interface corresponding to each executable module in the application module; the configuration file includes simple identification information to identify the executable module to which each callback interface belongs.
[0065] As mentioned earlier, when the application source code is written in a non-object-oriented programming language, the various framework interfaces required for the application to function properly need to be implemented as callback interfaces. Therefore, after compiling the application source code into an intermediate application module file, this intermediate file includes at least one callback interface corresponding to each executable module within the application module. For example, this intermediate application module file includes callback interfaces A1 and A2 in executable module 1 of application module X, and callback interfaces B1, B2, and B3 in executable module 2 of application module X.
[0066] Specifically, when the same executable module corresponds to multiple callback interfaces, these multiple callback interfaces can be understood as callback interfaces of different interface categories. That is, different callback interfaces are used to implement different framework functions. For example, callback interfaces may include: installation interfaces, application command processing interfaces, and uninstallation interfaces, etc.
[0067] Existing technologies for implementing callback interfaces cannot effectively check the validity of callback interfaces during the conversion of application module loadable files by the converter. Furthermore, the information recorded in the configuration file for each callback interface's executable module is excessively lengthy. In other words, besides writing the executable module information for multiple executable modules in the configuration file, a separate set of callback interface names corresponding to each executable module is also required. Therefore, the inventors propose adding a simplified identification method to the configuration file to identify the executable module to which each callback interface belongs, thereby reducing the amount of information in the configuration file.
[0068] In an optional implementation of this embodiment, the simplified identification information may include the filename of the callback interface file to which each callback interface belongs in the application source code, the callback interface file records the callback function implemented in the executable module to which it belongs; and the callback interface is named using the filename of the callback interface file to which it belongs and the unique identifier of the callback interface.
[0069] In this embodiment, the following rules must be followed when writing the application source code: 1. The function name of the callback interface should follow the rule of "filename of the callback interface file_unique identifier of the callback interface"; 2. All callback interfaces of the same executable module should be implemented in the same callback interface file in the application source code; 3. When the application source code contains the code of multiple executable modules, the filename of the callback interface file that implements the code of each executable module should not be the same, that is, the filename of the callback interface file corresponding to each executable module should be different.
[0070] The unique identifier for the callback interface can be understood as the identification information used to uniquely determine the callback interface. It is understandable that different executable modules can implement the same callback interface (for example, both implementing the installation interface), but because the callback interface files they belong to are different, the function names of the aforementioned callback interface in the application module's intermediate file will also be different.
[0071] In a specific example, if the callback interface of the installation interface is uniquely identified as "install", then the intermediate file of the application module can contain two callback interfaces named "callback interface file 1_install" and "callback interface file 2_install".
[0072] Accordingly, in this embodiment, since the function names of each callback interface in the application module intermediate file contain the filename of the callback interface file to which the callback interface belongs, and the filename of the callback interface file to which the callback interface implemented by each executable module belongs in the application source code is added to the configuration file (i.e., simple identification information), the executable module to which each callback interface belongs can be easily located in the application module intermediate file based on the filenames corresponding to each executable module contained in the configuration file.
[0073] S220. Generate a loadable file for the application module based on the intermediate files and configuration files of the application module.
[0074] The application module loadable file includes an executable module data segment, which records the interface representation of the callback interface implemented by each executable module.
[0075] The executable module data segment can be understood as a special data structure that defines key information corresponding to each executable module in the application module. This key information may include the executable module AID for each executable module and the interface representation of the callback interface implemented in each executable module. The interface representation can be understood as a distinguishable data-driven description of a specific callback interface using specific data or data bits.
[0076] As mentioned earlier, based on the special naming convention of each callback interface in the application source code and the compiled application module intermediate file, as well as the simple identification information added to the configuration file to identify the executable module to which each callback interface belongs, the executable module to which each callback interface belongs can be quickly located in the application module intermediate file during the conversion process of the converter to implement the application module executable file. Then, through special data fields, the interface representation of the callback interface implemented by each executable module can be written in the converted application module loadable file.
[0077] In an optional implementation of this embodiment, generating the loadable application module file based on the application module intermediate file and configuration file may include:
[0078] S2201. Locate the current configuration information of the current executable module in the configuration file, and obtain the current filename corresponding to the current executable module from the current configuration information.
[0079] S2202. In the application module intermediate file, traverse the function names of each callback interface and obtain the callback interfaces that match the current file name.
[0080] S2203. Based on the unique identifier of each callback interface included in the function name of each hit callback interface, identify each callback interface implemented by the current executable module, and record the identification result in the executable module data segment.
[0081] As mentioned earlier, different callback interface files are built for different executable modules in the application source code. These callback interface files define all the callback interfaces implemented by the respective executable module. For example, if the callback interface file corresponding to executable module A contains an implementation function of the "installation interface" callback interface, it means that executable module A implements the "installation interface" callback function.
[0082] In this optional implementation, taking an executable module contained in the application module intermediate file as an example (that is, the current executable module), the process of writing the interface representation of each callback interface implemented by the current executable module into the executable module data segment is described.
[0083] Specifically, since the configuration file records the current executable module's AID and the filename of the callback interface file corresponding to that current executable module in the application source code (i.e., the current filename), the current filename can be obtained from the configuration file. Then, based on the application source code and the specific naming convention of each callback interface in the compiled application module intermediate file, all callback interfaces whose function names contain the current filename can be located in the application module intermediate file. These located callback interfaces are all implemented by the current executable module. Because the function name of the callback interface also contains a unique identifier, it is not necessary to parse the specific interface code in the callback interface; simply extracting the unique identifier is sufficient to determine each callback interface implemented by the current executable module. Therefore, the interface representations of each callback interface implemented by the current executable module can be written into the executable module's data segment.
[0084] Furthermore, the aforementioned prior art cannot know which specific callback interfaces each executable module in the application module implements, thus making it impossible to check the rationality of the callback interfaces during the application conversion stage. However, this application can identify each callback interface implemented by each executable module in the application module, and therefore can perform a simple rationality check based on preset callback interface construction rules. For example, if it is pre-defined that an executable module must implement an installation interface, then if the callback interfaces implemented by any executable module do not include the installation interface, an error will be directly reported during the converter conversion stage. This expands the converter's functionality, adds a new rationality verification method for the application source code, and improves the efficiency of rationality verification for the application source code.
[0085] The technical solution of this invention adds simplified identification information to the configuration file corresponding to the intermediate file of the application module to identify the executable module to which each callback interface belongs. Then, when the converter generates a loadable application module file based on the intermediate file, it can add an executable module data segment to the loadable application module file to record the interface representations of the callback interfaces implemented by each executable module. Through this setting, the configuration parameters written for the executable module in the configuration file can be simplified, while the converter identifies each callback interface implemented by the executable module and checks the consistency and rationality of each callback interface during the application conversion process. This avoids the need for the embedded operating system to implement interface identification and checking, and also simplifies the application code.
[0086] Figure 3This is a flowchart of another loadable file creation method provided by an embodiment of the present invention. This embodiment is based on the above embodiments and is optimized. Specifically, the method for checking the rationality of the callback interface during the application conversion stage and the method for generating the callback interface index information in the loadable file of the application module are optimized.
[0087] Correspondingly, such as Figure 3 As shown, the method may include:
[0088] S310. Obtain the intermediate application module file obtained after compiling the application source code, and the configuration file corresponding to the intermediate application module file.
[0089] The application module intermediate file includes at least one callback interface corresponding to each executable module in the application module; the configuration file includes simple identification information to identify the executable module to which each callback interface belongs.
[0090] S320. Locate the current configuration information of the currently executable module in the configuration file, and obtain the current filename corresponding to the currently executable module from the current configuration information.
[0091] S330. In the executable module data segment, create a current data structure that matches the current executable module, and create a bit information field of a preset length in the current data structure.
[0092] In this context, different bits in the bit information field are used to identify the different callback interfaces implemented by the executable module.
[0093] In this embodiment, considering that an application module generally contains one or more executable modules, a matching data structure can be created for each executable module in the executable module data segment to independently store the interface representation of each callback interface implemented in each executable module.
[0094] To reduce the amount of information contained in the interface representations of the callback interfaces implemented in each executable module, a bit information field (also referred to as BitInfo) of a preset length is used to store the above information. Specifically, the preset length can be understood as the total number of callback interfaces that each executable module can implement. For example, assuming a total of 10 callback interfaces can be implemented, the preset length is 10 bits. Furthermore, considering the subsequent expansion of new callback interfaces, the preset length can also be greater than the total number of callback interfaces.
[0095] Correspondingly, by establishing a one-to-one mapping relationship between each bit in the bit information field and each callback interface, each bit in the bit information field can identify the implementation status of the executable module for the specified callback interface.
[0096] For example, suppose the bit information field corresponding to executable module A is a 6-bit binary string, where each bit in the binary string corresponds to a specific callback interface. When a bit in this bit information field is set to a value of 0, it means that executable module A has not implemented the callback interface matching that bit. Conversely, when the bit is set to a value of 1, it means that executable module A has implemented the callback interface matching that bit.
[0097] S340. In the application module intermediate file, traverse the function names of each callback interface and obtain the callback interfaces that match the current file name.
[0098] S350. Identify the callback interfaces implemented by the current executable module based on the unique identifier of each callback interface included in the function name of each callback interface that is hit.
[0099] S360. Whenever it is identified that the current executable module implements the target callback interface, locate the target bit corresponding to the target callback interface in the bit information field of the current data structure corresponding to the current executable module.
[0100] In this embodiment, when creating a bit information field of a preset length, each bit in the bit information field can be initialized to a binary value used to identify that the interface is not implemented. Furthermore, whenever it is identified that the current executable module implements the target callback interface, the target bit corresponding to the target callback interface can be located in the bit information field of the current data structure based on the pre-established mapping relationship between bit positions and callback interfaces.
[0101] In a specific example, for a bit information field of the form "000000", the least significant bit represents the callback interface "Installation Interface", and a 0 in the bit indicates that the callback interface has not been implemented. Therefore, when the application module's intermediate file identifies a callback function name composed of the current filename corresponding to the current executable module and the unique identifier of the callback interface corresponding to "Installation Interface", it is determined that the current executable module implements the "Installation Interface" callback interface. At this point, the least significant bit in the bit information field of the current data structure needs to be updated from 0 to 1. In a specific example, if the current executable module only implements the "Installation Interface" callback interface, the bit information field in the current data structure will ultimately be updated to "000001".
[0102] S370. Set the target bit to a binary value used to identify the interface implementation.
[0103] S380. Based on the callback interface table maintained locally by the converter and the executable module data segment, generate callback interface index information corresponding to each executable module, and add the callback interface index information to the application module loadable file.
[0104] The callback interface table defines the order of each callback interface and is typically managed as an expandable list in the converter. Based on the order of the callback interfaces defined in the callback interface table, callback interface index information corresponding to each executable module can be added to the application module's loadable file.
[0105] The callback interface index information can be understood as the index location of the callback interface required by the executable module during installation, or the index location of the callback interface required to be called during the execution of the installed application. Based on this callback interface index information, the index location of the required callback function can be quickly located in actual demand scenarios, improving the efficiency of executable module installation and application execution.
[0106] In this embodiment, a specific executable module (i.e., the target executable module) is used as an example to describe the specific process of generating matching callback interface index information for the target executable module.
[0107] Accordingly, in an optional implementation of this embodiment, generating callback interface index information corresponding to each executable module based on the callback interface table maintained locally by the converter and the executable module data segment may include:
[0108] S3801. During the process of generating the callback interface index information corresponding to the target executable module, the current callback interface is obtained sequentially according to the order of each callback interface defined in the callback interface table.
[0109] For example, if the callback interface table stores the installation interface, command processing interface, selection interface, deselection interface, etc., in sequentially arranged entries, then the callback interface table is defined in the order of "installation interface -> command processing interface -> selection interface -> deselection interface...". Furthermore, the callback index corresponding to each callback interface needs to be retrieved sequentially in the same order of "installation interface -> command processing interface -> selection interface -> deselection interface...".
[0110] S3802. Based on the executable module data segment, check whether the target executable module implements the current callback interface: if yes, execute S3803; otherwise, execute S3804.
[0111] S3803. Obtain the current callback index determined by the position of the current callback interface in the callback interface table and the preset index starting point, and add the current callback index to the callback interface index information, then execute S3805.
[0112] S3804. Retain the current callback index and execute S3805.
[0113] In this embodiment, a fixed-structure callback interface index information is used to store the callback indexes of each callback interface implemented by the target executable module. The relative storage position of the callback index of each callback interface in the callback interface index information is fixed. If a callback interface is implemented in the target executable module, the corresponding callback index will be stored at the storage location matching the callback interface. If a callback interface is not implemented in the target executable module, the storage location matching the callback interface will be left empty, without storing any information, in order to preserve the current callback index.
[0114] With the above settings, callback interface index information corresponding to each executable module can be created efficiently and conveniently. Then, based on the fixed storage location of the callback index of different callback interfaces in the callback interface index information, the callback index of the callback interface to be called can be quickly located, so as to complete the quick access to the callback interface to be accessed.
[0115] S3805. Check whether the processing of all callback interfaces in the callback interface table is complete: if yes, confirm that the process of generating the callback interface index information corresponding to the target executable module is complete; otherwise, return to execute S3801.
[0116] The technical solution of this invention creates a data structure matching the current executable module in the executable module data segment, and creates a bit information field of preset length in the data structure. When it is identified that the executable module implements the target callback interface, the target bit corresponding to the target callback interface is located in the bit information field of the data structure corresponding to the executable module. The target bit is set to identify the implementation method of the binary value of the interface implementation. The callback interface implemented by each executable module can be identified in the application module loadable file through simple binary bit information, so as to efficiently record the interface representation of the callback interface implemented by each executable module with the least amount of information.
[0117] Based on the above embodiments, at least one combined interface group is pre-marked in each callback interface;
[0118] Accordingly, after identifying the callback interfaces implemented by the executable module based on the unique identifier of each callback interface included in the function name of each matched callback interface, and recording the identification results in the executable module's data segment, it may also include:
[0119] If, based on the callback interfaces implemented by the current executable module, it is determined that the current executable module includes at least one callback interface corresponding to the target combined interface group, but does not include all callback interfaces corresponding to the target combined interface group, then a conversion error will occur.
[0120] A composite interface group can contain two or more callback interfaces that are related. For example, a multi-channel selection interface and a multi-channel deselection interface can be a composite interface group, and a composite interface group corresponds to a special composite callback interface. For example, the composite callback interface corresponding to the multi-channel selection interface and the multi-channel deselection interface is a multi-channel interface. During the writing of the application source code, all callback interfaces contained in a composite interface group must either be fully implemented or none of them must be implemented. Therefore, if the converter, during the conversion of the application module's intermediate files, identifies from the executable module's data segment that the executable module only implements some of the callback interfaces in a composite interface group, a conversion error will occur accordingly.
[0121] Furthermore, the bit information fields included in the data segment of the executable module may simultaneously include binary bits corresponding to each callback interface in the combined interface group and the composite callback interface of the combined interface group. Alternatively, they may only include binary bits corresponding to each callback interface in the combined interface group, or they may only include binary bits corresponding to the composite callback interface of the combined interface group, etc. This embodiment does not impose any limitations on this.
[0122] It should be noted that if the bit information field only contains binary bits corresponding to the composite callback interface of the composite interface group, then other fields or cache information are needed to identify the implementation of each callback interface in the composite interface group in order to check the rationality and consistency of the composite interface group.
[0123] Based on the above embodiments, each callback interface also has an existence attribute, which includes a mandatory interface or an optional interface;
[0124] Accordingly, after identifying the callback interfaces implemented by the current executable module based on the unique identifier of each callback interface included in the function name of each matched callback interface, and recording the identification results in the executable module's data segment, the process also includes:
[0125] If, based on the callback interfaces implemented by the current executable module, it is determined that the current executable module does not include callback interfaces with the attribute of being a required interface, then a conversion error will occur.
[0126] In this embodiment, an existence attribute can be further set for each callback interface. Specifically, if the existence attribute of a callback interface A is set to "required," it means that callback interface A must be implemented in the application source code for each executable module. That is, callback interfaces with the "required" existence attribute are essential and indispensable callback interfaces in the application. Conversely, if the existence attribute of a callback interface B is set to "optional," it means that when implementing callback interfaces for each executable module in the application source code, implementation of callback interface B is optional.
[0127] Correspondingly, if the converter identifies, during the conversion of the intermediate files of the application module, that the executable module does not implement the callback interface with the attribute of a required interface based on the executable module data segment, a conversion error will be reported accordingly.
[0128] Based on the above embodiments, the callback interface may include: an installation interface, a command processing interface, a selection interface, and a deselection interface, all of which have the attribute of being mandatory; and,
[0129] There are multiple-channel selection interface, multiple-channel deselection interface, uninstallation interface, authorization request interface, and personalization interface, all of which are optional.
[0130] Among them, the multi-channel selection interface and the multi-channel deselection interface belong to a combined interface group.
[0131] Figure 4 This is a flowchart of an executable module installation method provided by an embodiment of the present invention. This embodiment is applicable to the situation of performing application installation operations on a set executable module that has been loaded onto an on-chip operating system. The method can be executed by a loadable file creation device, which can be implemented in hardware and / or software, and can generally be configured in a restricted device (e.g., various security elements or smart cards) with an embedded operating system installed.
[0132] The method in this embodiment can be executed by a runtime environment within an embedded operating system. A runtime environment is a secure runtime environment that executes virtual machines on restricted resources such as smart cards or secure elements; it can be considered a lightweight container. Applications (referred to as "applications") run within this runtime environment, thus achieving complete isolation from the native functions of the embedded operating system.
[0133] Correspondingly, such as Figure 4 As shown, the method may include:
[0134] S410. In response to the application installation instruction for the target executable module in the target application module executable file, obtain the target application module executable file obtained after loading the target application module loadable file.
[0135] The application module executable file includes multiple executable modules and an executable module data segment corresponding to each executable module. The executable module data segment records the interface representation of the callback interface implemented by each executable module.
[0136] In this embodiment, after the converter obtains the application module loadable file, the installer can load the application module loadable file onto the on-chip operating system. Then, the loading unit in the installer links the external interfaces in the application module loadable file with the internal interfaces of the embedded operating system, ultimately creating the application module executable file within the embedded operating system. Notably, the callback interfaces of each executable module within an application module are not called by other application modules and are not involved in the linking process.
[0137] Specifically, the application module AID of the target application module and the executable module AID of the target executable module can be included in the application installation instruction. Then, the executable file of the target application module can be located first based on the application module AID.
[0138] S420. If, based on the executable module data segment in the target application module executable file, it is determined that the callback interface implemented by the target executable module includes an installation interface, then the target callback interface function corresponding to the installation interface is obtained in the target application module executable file.
[0139] In an optional implementation of this embodiment, based on the executable module data segment in the target application module executable file, it is determined that the callback interface implemented by the target executable module includes an installation interface, which may include:
[0140] In the executable module data segment of the target application module executable file, obtain the target data structure that matches the target executable module, and obtain the target bit information field in the target data structure; in the target bit information field, obtain the target bit corresponding to the installation interface; when the value of the target bit is a binary value used to identify the interface implementation, it is determined that the callback interface implemented by the target executable module includes the installation interface.
[0141] Furthermore, the application module executable file may also include callback interface index information corresponding to each executable module;
[0142] Accordingly, obtaining the target callback interface function corresponding to the target callback interface in the target application module executable file can include:
[0143] In the executable file of the target application module, calculate the location of the target callback interface index information corresponding to the target executable module; based on the position of the installation interface in the callback interface table, obtain the callback interface index of the target callback interface in the target callback interface index information; according to the target callback interface index, obtain the target callback interface function corresponding to the target callback interface in the executable file of the target application module.
[0144] Specifically, we can first calculate the starting address of the storage location of the target callback interface index information corresponding to the target executable module. Combining this starting address with the fixed storage location of the target callback interface's callback interface index within that target callback interface index information (the relative address of the target callback interface's callback interface index within the target callback interface index information), we can obtain the target callback interface index. Finally, based on the target callback interface index, we can obtain the target callback interface function corresponding to the target callback interface in the target application module's executable file.
[0145] Based on the above embodiments, after obtaining the executable file of the target application module obtained by loading the loadable file of the target application module, it may further include:
[0146] If, based on the executable module data segment in the target application module executable file, it is determined that the callback interface implemented by the target executable module does not include the installation interface, then the program installation will fail.
[0147] S430: Execute the bytecode of the target callback interface function to install the target application corresponding to the target executable module into the embedded operating system.
[0148] In an optional implementation of this embodiment, executing the bytecode of the target callback interface function to install the target application corresponding to the target executable module in the embedded operating system may include:
[0149] Initialize the virtual machine and push all the parameters required by the target callback interface onto the virtual machine stack;
[0150] Start the virtual machine and execute the bytecode of the target callback interface function to install the target application;
[0151] After confirming that the target application is installed, check whether the target application has been successfully registered to the embedded operating system application management module;
[0152] If yes, the target application is confirmed to have been installed successfully; otherwise, the target application is confirmed to have failed to install.
[0153] Based on the above embodiments, after determining that the target application is successfully installed, the method may further include: establishing a correspondence between the target application and the target executable module.
[0154] The technical solution of this invention, by adding an executable module data segment that records the callback interfaces implemented by each executable module to the application module loadable file, can carry the aforementioned executable module data segment in the final application module executable file loaded into the on-chip embedded operating system. When the embedded operating system calls the callback interface that implements application installation in the executable module to install the application, it can identify in advance whether the callback interface is implemented in the executable module through the executable module data segment, thereby greatly improving the application installation efficiency.
[0155] Figure 5 This is a flowchart of an application operation control method provided by an embodiment of the present invention. This embodiment can be applied to the situation of operating and controlling an installed application in an on-chip operating system. The method can be executed by an application operation control device, which can be implemented in hardware and / or software, and can generally be configured in a restricted device (e.g., various security elements or smart cards) with an embedded operating system installed.
[0156] Correspondingly, such as Figure 5 As shown, the method may specifically include:
[0157] S510. If a call request to the target callback interface is identified based on the context information, then obtain the current application that matches the call request.
[0158] This context information can be understood as the command context, which may include: selection command, installation command, or deletion command, etc.
[0159] S520. Obtain the target executable module from the target application module executable file corresponding to the current application.
[0160] In this context, the embedded operating system preloads one or more application module executable files. The application module executable file includes multiple executable modules and an executable module data segment corresponding to each executable module. The executable module data segment records the interface representation of the callback interface implemented by each executable module.
[0161] In this embodiment, the target executable module corresponding to the current application can be obtained based on the mapping relationship between the application and the executable module established in advance during application installation.
[0162] S530. If it is determined from the executable module data segment in the target application module executable file that the target executable module implements the target callback interface, then obtain the target callback interface function corresponding to the target callback interface in the target application module executable file.
[0163] In an optional implementation of this embodiment, determining that the target executable module implements the target callback interface based on the executable module data segment in the target application module executable file may include:
[0164] In the executable module data segment of the target application module executable file, obtain the target data structure that matches the target executable module, and obtain the target bit information field in the target data structure;
[0165] In the target bit information field, obtain the target bit corresponding to the target callback interface;
[0166] When the target bit value is a binary value used to identify the interface implementation, it is determined that the target executable module implements the target callback interface.
[0167] Based on the above embodiments, the application module executable file may also include callback interface index information corresponding to each executable module;
[0168] Accordingly, in the executable file of the target application module, the target callback interface function corresponding to the target callback interface can specifically include:
[0169] In the executable file of the target application module, calculate the location of the target callback interface index information corresponding to the target executable module; based on the position of the target callback interface in the callback interface table, obtain the callback interface index of the target callback interface from the target callback interface index information; according to the target callback interface index, obtain the target callback interface function corresponding to the target callback interface in the executable file of the target application module.
[0170] Based on the above embodiments, after obtaining the target executable module in the target application module executable file corresponding to the current application, it may further include:
[0171] If, based on the executable module data segment in the target application module executable file, it is determined that the target executable module does not implement the target callback interface, the program will report an error.
[0172] S540: Execute the bytecode of the target callback interface function and perform subsequent processing based on the obtained execution result.
[0173] In an optional implementation of this embodiment, executing the bytecode of the target callback interface function and performing subsequent processing based on the obtained execution result may include:
[0174] Initialize the virtual machine and push all the parameters required by the target callback interface onto the virtual machine stack; start the virtual machine, execute the bytecode of the target callback interface function, and obtain the running result; perform subsequent processing based on the obtained running result.
[0175] Specifically, the follow-up processing may include exception handling, transaction processing, or space reclamation. The specific follow-up processing to be performed is related to the specific callback interface called and the result obtained after the interface call.
[0176] The technical solution of this invention, by adding an executable module data segment that records the callback interfaces implemented by each executable module to the application module loadable file, can carry the aforementioned executable module data segment in the final application module executable file loaded into the on-chip embedded operating system. When the embedded operating system calls the callback interface of the application installed based on the executable module, it can identify in advance whether the callback interface is implemented in the executable module through the executable module data segment, thereby greatly improving the running performance of the application.
[0177] Specific application scenarios
[0178] To further clarify the solutions of the various embodiments of the present invention, a complete solution will now be described in a specific application scenario.
[0179] First, the key requirements for solving the problems in the various embodiments of this invention should include concise configuration parameters in the configuration file and simple application and operating system functions. Therefore, for non-object-oriented programming languages, the following method is adopted to realize the conversion and execution of application module loadable files:
[0180] 1. The configuration file parameters use filenames, that is, the content of each executable module information includes the executable module AID and the filename where the executable module interface is located.
[0181] 2. Define a unified callback interface table, assign a unique identifier to all callback interfaces, and name the callback interfaces using the filename + unique identifier. The unique identifier of the callback interface includes, but is not limited to, the following:
[0182] a) Unique identifier for the installation interface: install
[0183] b) Unique identifier for the application command processing interface: process
[0184] c) Select the unique identifier for the interface: select
[0185] d) The unique identifier for deselecting the interface: deselect
[0186] e) Unique identifier for the uninstallation interface: uninstall
[0187] 3. The conversion tool (i.e., the converter) identifies all callback interfaces in the executable module based on the parameter content and callback interface command rules in the configuration file, records the interface index, and generates an executable module data segment. The structure of this data segment is as follows:
[0188]
[0189] BitInfo consists of multiple bytes, and the content of the first byte is shown in Table 1.
[0190] Table 1
[0191]
[0192]
[0193] After the application module loadable file is loaded into the embedded operating system by the installer, an application module executable file is generated, containing the executable module data segment content. When the embedded operating system's runtime environment runs the application, it looks up the required interface index based on the executable module data information corresponding to the application and starts the virtual machine to execute the interface bytecode.
[0194] Furthermore, the complete implementation process involved in the embodiments of the present invention includes:
[0195] 1. Define a unique identifier for the executable module callback interface.
[0196] Basic principle: Define callback interfaces for executable modules in the application source code according to actual needs, using the interface name as the unique identifier for each callback interface. For example, if the application selects a callback interface, then `select` is agreed to be the unique identifier for that interface. The parameters and return type of each callback interface can be defined in detail to facilitate validity checks when generating executable module information through a converter.
[0197] Required Interfaces: When writing application source code, the necessary callback interfaces should be implemented according to application requirements. However, the application should have a set of essential callback interfaces, which may include the following:
[0198] 1) Installation interface
[0199] a) The unique identifier for the installation interface is install.
[0200] b) The parameters of the installation interface should include a byte array and the length of the data content in the array, without returning any data.
[0201] 2) Select Interface
[0202] a) The unique identifier for the selected interface is select.
[0203] b) If the selection interface has no parameters, it should return a boolean value indicating whether the selection was successful or failed.
[0204] 3) Cancel the selection of the interface
[0205] a) The unique identifier for deselecting the interface is deselect.
[0206] b) The deselection interface has no parameters and no return value.
[0207] 4) Command processing interface
[0208] a) The unique identifier for the command processing interface is process.
[0209] b) The command processing interface has no parameters and no return value.
[0210] Optional interfaces:
[0211] If the application supports multi-channel selection, the executable module should implement the following interface:
[0212] 1) Multi-channel selection interface
[0213] a) The unique identifier for the multi-channel selection interface is multiSelect.
[0214] b) The multi-channel selection interface should include a boolean parameter indicating whether an application with the same application module installed has been selected on other logical channels, and return a boolean value indicating whether the selection was successful.
[0215] 2) Multi-channel deselection interface
[0216] a) The unique identifier for the multi-channel deselect interface is multiDeselect.
[0217] b) The multi-channel deselection interface should include a boolean parameter indicating whether there is an application installed with the same application module that is still selected on other logical channels, and without a return value.
[0218] Both the multi-channel selection interface and the multi-channel deselection interface must exist simultaneously.
[0219] Furthermore, if the application needs to clear potential data references upon deletion, the following interface should be implemented in the executable module:
[0220] 1) Unloading the interface
[0221] a) The uninstallation interface is uniquely identified as uninstall.
[0222] b) The uninstallation interface has no parameters and no return value.
[0223] If an application needs to share its non-callback interfaces with other applications, the executable module should implement an authorization request interface:
[0224] 1) Authorization Request Interface
[0225] a) The unique identifier for the authorization request interface is requestPriviledge.
[0226] b) The authorization application interface should include two parameters: one is the unique identifier (AID) of the server application, and the other is the application type.
[0227] If the application needs to personalize confidential data using a secure channel within a security domain, then the personalization interface should be implemented in the executable module:
[0228] 1) Personalized Interface
[0229] a) The unique identifier for the personalized interface is processData.
[0230] b) The personalized interface should include two parameters: the byte array to which the personalized array is passed, and the length of the personalized data in the array.
[0231] 2. Write the application source code
[0232] When writing application source code, the following rules should be followed when naming files that implement executable module code and callback functions within the executable module:
[0233] a) The function name of the callback interface should follow the rule of "filename_unique identifier of callback interface".
[0234] b) All callback interfaces of the executable module should be implemented in a single file.
[0235] c) When an application contains multiple executable module codes, the filenames of each executable module code callback interface should not be the same.
[0236] d) The callback interfaces implemented in each executable module code may be different, but the multi-channel selection callback interface and the multi-channel deselection callback interface should be consistent. All executable module code should either implement these two interfaces or not implement them at all.
[0237] 3. Generate loadable application module files
[0238] After the application source code files are compiled into intermediate application module files, a conversion tool is needed to generate loadable application module files (e.g., files with the *.wasm extension). This process requires inputting configuration files and linker files.
[0239] 1) Configuration file
[0240] a) Configure the AID of the application module.
[0241] b) Configure the application module name.
[0242] c) Configure one or more executable module information, each executable module information containing the following two items:
[0243] i. The AID of the executable module.
[0244] ii. The filename of the executable module code callback interface.
[0245] 2) Linked files
[0246] The linker file is a file that records the interface index of the library interface, and is used to provide linking information for application modules to call library interface functions in loadable files.
[0247] 3) Conversion method
[0248] i. Define the callback interface table
[0249] The callback interface table defines the order of callback interfaces, which are managed as an expandable list in the conversion tool. Specifically, as shown in Table 2, the callback interfaces are not limited to unique identifiers and attributes, depending on actual needs.
[0250] These callback interfaces are not called in the application source code of the executable module. Instead, the runtime environment of the embedded operating system will adaptively call these callback interfaces according to the context of the command.
[0251] Table 2
[0252] Serial Number unique identifier of callback interface Existence Attributes 1 install Required Interface 2 process Required Interface 3 select Required Interface 4 deselect Required Interface 5 multiSelect Optional Interface 6 multiDeselect Optional Interface 7 uninstall Optional Interface 8 processData Optional Interface 9 requestPriviledge Optional Interface …… …… ……
[0253] b) Create the executable module data segment
[0254] The data structure of the executable module's data segment is shown in Table 3.
[0255] Table 3
[0256]
[0257] The conversion tool searches for the callback interface function according to its naming rules, identifies whether the interface exists in the callback interface table according to the following rules, and generates BitInfo information (i.e., the bit information field):
[0258] If the required interface does not exist, the conversion will fail; if it does exist, the corresponding bit will be set to 1.
[0259] If a multi-channel interface exists, set the corresponding bit to 1; otherwise, set the corresponding bit to 0. If the multi-channel selection interface and the multi-channel deselection interface do not exist simultaneously, an error should be reported.
[0260] If the unload interface exists, set the corresponding bit to 1; otherwise, set the corresponding bit to 0.
[0261] If a personalized interface exists, set the corresponding bit to 1; otherwise, set the corresponding bit to 0.
[0262] If the authorization request interface exists, set the corresponding bit to 1; otherwise, set the corresponding bit to 0.
[0263] If multiple executable module information is configured in the configuration file, multiple AID+BitInfo information needs to be generated.
[0264] When the conversion tool generates loadable application module files, it prioritizes generating callback interface indices according to the callback interface table order. Callback interface indices that do not exist in the table are retained, and the relative address or space of the corresponding interface function bytecode is 0. If multiple executable module information exists, all callback interfaces should be stored consecutively according to the contents of the callback interface table.
[0265] 4. Application loading, installation, and running
[0266] 1) Application loading
[0267] When the installer loads the application module loadable file into the on-chip operating system, the loading unit links the external interfaces in the application module loadable file with the internal interfaces of the operating system. The callback interfaces in each executable module are not called by other application modules and do not participate in the linking. Finally, the application module executable file is created within the operating system.
[0268] 2) Application Installation
[0269] Application installation involves creating an application instance based on a specified executable module AID. The steps are as follows:
[0270] a) The operating system runtime environment searches for the corresponding Bitinfo information in the executable data segment based on the executable module AID in the command.
[0271] b) Check if the Bitinfo information supports the required interface; if not, report an error.
[0272] c) Calculate the callback interface index address for this executable module.
[0273] d) Based on the callback interface index information address, find the relative address of the install interface in the callback interface.
[0274] e) Initialize the virtual machine, push the parameters required by the install callback interface onto the virtual machine stack, and start the virtual machine to execute the install callback interface bytecode.
[0275] f) After completing the install callback interface bytecode, the runtime environment should check whether the application to be installed has been registered with the operating system application management module. If so, the installation is successful; otherwise, the installation fails.
[0276] g) Record the correspondence between the executable modules of this application.
[0277] 3) Application running
[0278] The essence of application execution is that the operating system runtime environment calls the corresponding interface callback function according to the current command context. Regardless of the type of callback interface, it should include the following execution steps:
[0279] a) Identify callback interfaces based on command context (select command, install command, delete command, etc.).
[0280] b) Locate the executable file of the application module corresponding to the current application.
[0281] c) Based on the correspondence between the application and the executable module, obtain the Bitinfo information of the matching executable module.
[0282] d) Check if the callback interface information to be called exists based on the Bitinfo information. If it does not exist, report an error and the call fails. If it exists, calculate the relative address of the interface based on the callback interface index information.
[0283] e) Initialize the virtual machine, push the parameters required by the callback interface onto the virtual machine stack, and start the virtual machine to run the callback interface bytecode.
[0284] f) After the virtual machine finishes running, check the running results and process subsequent tasks based on the results, including but not limited to exception handling, transaction processing, and space reclamation.
[0285] The technical solution of this invention simplifies the configuration parameters of executable modules in the configuration file of the conversion tool by designing a callback interface table for executable modules in the application and assigning unique identifiers, along with specific naming rules. This enables the application module conversion tool to identify the callback interfaces of executable modules and check the consistency and rationality of the callback interfaces. On the one hand, this avoids the embedded operating system from implementing interface identification and checking. On the other hand, it simplifies the application code, allowing the operating system to identify whether the application implements the corresponding callback interface before distributing commands to the application, thereby improving the running performance of the application.
[0286] Figure 6 This is a structural diagram of a loadable file creation device provided in an embodiment of the present invention. The loadable file creation device is configured in a converter, such as... Figure 6 As shown, the device includes:
[0287] The file acquisition module 610 is used to acquire the intermediate application module file obtained after compiling the application source code, and the configuration file corresponding to the intermediate application module file.
[0288] The application module intermediate file includes at least one callback interface corresponding to each executable module in the application module; the configuration file includes simple identification information to identify the executable module to which each callback interface belongs.
[0289] Loadable file generation module 620 is used to generate loadable files for application modules based on intermediate files and configuration files of application modules;
[0290] The application module loadable file includes an executable module data segment, which records the interface representation of the callback interface implemented by each executable module.
[0291] The technical solution of this invention adds simplified identification information to the configuration file corresponding to the intermediate application module file to identify the executable module to which each callback interface belongs. When the converter generates a loadable application module file based on the intermediate application module file, it can add an executable module data segment to the loadable application module file to record the interface representations of the callback interfaces implemented by each executable module. This simplifies the configuration parameters written for the executable module in the configuration file. During application conversion, the converter identifies and checks the consistency and rationality of each callback interface, avoiding the need for the embedded operating system to perform interface identification and checking. Furthermore, it simplifies the application code. Moreover, when the embedded operating system calls the callback interfaces in the executable module to install the application, or calls specific callback interfaces of the installed application, the executable module data segment can identify in advance whether the application has implemented the required callback interfaces, thereby greatly improving the application's performance.
[0292] Based on the above embodiments, the simplified identification information is the filename of the callback interface file to which each callback interface belonging to the same executable module belongs in the application source code; the callback interface file records the callback functions implemented in the executable module to which it belongs; and,
[0293] Callback interfaces are named using the filename of the corresponding callback interface file and a unique identifier for the callback interface.
[0294] Based on the above embodiments, the loadable file generation module 620 can be specifically used for:
[0295] Locate the current configuration information of the currently executable module in the configuration file, and obtain the current filename corresponding to the currently executable module from the current configuration information;
[0296] In the application module intermediate file, iterate through the function names of each callback interface and obtain the callback interfaces that match the current file name;
[0297] Based on the unique identifier of each callback interface included in the function name of each callback interface, identify each callback interface implemented by the current executable module and record the identification results in the executable module's data segment.
[0298] Based on the above embodiments, it may further include: a bit information field creation module, used for:
[0299] After locating the current configuration information of the current executable module in the configuration file, a current data structure matching the current executable module is created in the executable module data segment, and a bit information field of preset length is created in the current data structure. Different bits in the bit information field are used to identify different callback interfaces implemented by the executable module.
[0300] Accordingly, the loadable file generation module 620 can be further used for:
[0301] Whenever it is identified that the current executable module implements the target callback interface, the target bit corresponding to the target callback interface is located in the bit information field of the current data structure corresponding to the current executable module;
[0302] Set the target bit to a binary value used to identify the interface implementation.
[0303] Based on the above embodiments, at least one combined interface group is pre-marked in each callback interface;
[0304] Correspondingly, it may also include: a first conversion check module, used to identify each callback interface implemented by the current executable module based on the unique identifier of each callback interface included in the function name of each current callback interface, and record the identification result in the data segment of the executable module. If, based on the callback interfaces implemented by the current executable module, it is determined that the current executable module includes at least one callback interface corresponding to the target combined interface group, but does not fully include all callback interfaces corresponding to the target combined interface group, then a conversion error is reported.
[0305] Based on the above embodiments, each callback interface also has an existence attribute, which includes a mandatory interface or an optional interface;
[0306] Correspondingly, it may also include: a second conversion check module, which is used to identify each callback interface implemented by the current executable module based on the unique identifier of each callback interface included in the function name of each callback interface, and record the identification result in the data segment of the executable module. If it is determined based on the callback interfaces implemented by the current executable module that the current executable module does not include a callback interface with the attribute of being a required interface, then a conversion error is reported.
[0307] Based on the above embodiments, the file generation module 620 can also be used for:
[0308] Based on the callback interface table maintained locally by the converter and the executable module data segment, generate callback interface index information corresponding to each executable module, and add the callback interface index information to the application module loadable file.
[0309] Based on the above embodiments, the loadable file generation module 620 can be further used for:
[0310] During the process of generating the callback interface index information corresponding to the target executable module, the current callback interface is obtained sequentially according to the order of each callback interface defined in the callback interface table;
[0311] Based on the executable module data segment, detect whether the target executable module implements the current callback interface;
[0312] If yes, then obtain the current callback index determined by the position of the current callback interface in the callback interface table and the preset index starting point, and add the current callback index to the callback interface index information; otherwise, retain the current callback index.
[0313] Returning to the previous state, the system retrieves the operations of each callback interface in the order defined in the callback interface table, until all callback interfaces in the callback interface table have been processed.
[0314] Based on the above embodiments, the callback interface includes: an installation interface, a command processing interface, a selection interface, and a deselection interface, all of which are mandatory; and,
[0315] There are multiple-channel selection interface, multiple-channel deselection interface, uninstallation interface, authorization request interface, and personalization interface, all of which are optional.
[0316] Among them, the multi-channel selection interface and the multi-channel deselection interface belong to a combined interface group.
[0317] The loadable file creation apparatus provided in the embodiments of the present invention can execute the loadable file creation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0318] Figure 7 This is a structural diagram of an executable module installation device provided in an embodiment of the present invention. The executable module loadable file creation device is configured in the runtime environment of an embedded operating system, such as... Figure 7 As shown, the device includes:
[0319] The executable file acquisition module 710 is used to acquire the target application module executable file obtained after loading the target application module loadable file in response to the application installation instruction of the target executable module in the target application module executable file;
[0320] The application module executable file includes multiple executable modules and an executable module data segment corresponding to each executable module. The executable module data segment records the interface representation of the callback interface implemented by each executable module.
[0321] The interface function acquisition module 720 is used to acquire the target callback interface function corresponding to the installation interface in the target application module executable file if it is determined from the executable module data segment in the target application module executable file that the callback interface implemented by the target executable module includes the installation interface.
[0322] The executable module installation module 730 is used to execute the bytecode of the target callback interface function to install the target application corresponding to the target executable module in the embedded operating system.
[0323] The technical solution of this invention, by adding an executable module data segment that records the callback interfaces implemented by each executable module to the application module loadable file, can carry the aforementioned executable module data segment in the final application module executable file loaded into the on-chip embedded operating system. When the embedded operating system calls the callback interface that implements application installation in the executable module to install the application, it can identify in advance whether the callback interface is implemented in the executable module through the executable module data segment, thereby greatly improving the application installation efficiency.
[0324] Based on the above embodiments, it may further include an installation inspection module, used for:
[0325] After obtaining the executable file of the target application module by loading the loadable file of the target application module, if it is determined from the executable module data segment in the executable module file that the callback interface implemented by the target executable module does not include the installation interface, the program installation will report an error.
[0326] Based on the above embodiments, the interface function acquisition module 720 can be specifically used for:
[0327] In the executable module data segment of the target application module executable file, obtain the target data structure that matches the target executable module, and obtain the target bit information field in the target data structure;
[0328] In the target bit information field, obtain the target bit corresponding to the installation interface;
[0329] When the target bit value is a binary value used to identify the interface implementation, it is determined that the callback interface implemented by the target executable module includes the installation interface.
[0330] Based on the above embodiments, the application module executable file may also include callback interface index information corresponding to each executable module;
[0331] Correspondingly, the interface function acquisition module 720 can be further used for:
[0332] In the executable file of the target application module, calculate the location of the target callback interface index information corresponding to the target executable module;
[0333] Based on the position of the installation interface in the callback interface table, obtain the callback interface index of the target callback interface from the target callback interface index information;
[0334] Based on the target callback interface index, retrieve the target callback interface function corresponding to the target callback interface from the executable file of the target application module.
[0335] Based on the above embodiments, the executable module installation module 730 can be specifically used for:
[0336] Initialize the virtual machine and push all the parameters required by the target callback interface onto the virtual machine stack;
[0337] Start the virtual machine and execute the bytecode of the target callback interface function to install the target application;
[0338] After confirming that the target application is installed, check whether the target application has been successfully registered to the embedded operating system application management module;
[0339] If yes, the target application is confirmed to have been installed successfully; otherwise, the target application is confirmed to have failed to install.
[0340] Based on the above embodiments, a correspondence establishment module may also be included, used for:
[0341] After confirming that the target application is successfully installed, establish the correspondence between the target application and the target executable module.
[0342] The executable module installation device provided in this embodiment of the invention can execute the executable module installation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0343] Figure 8 This is a structural diagram of an application operation control device provided in an embodiment of the present invention. The application operation control device is configured in the runtime environment of an embedded operating system, such as... Figure 8 As shown, the device includes:
[0344] The current application acquisition module 810 is used to acquire the current application that matches the call request if a call request to the target callback interface is identified based on the context information.
[0345] The executable module acquisition module 820 is used to acquire the target executable module in the target application module executable file corresponding to the current application.
[0346] The callback interface function acquisition module 830 is used to acquire the target callback interface function corresponding to the target callback interface in the target application module executable file if it is determined from the executable module data segment in the target application module executable file that the target executable module implements the target callback interface.
[0347] The callback interface function execution module 840 is used to execute the bytecode of the target callback interface function and perform subsequent processing based on the obtained execution result.
[0348] The technical solution of this invention, by adding an executable module data segment that records the callback interfaces implemented by each executable module to the application module loadable file, can carry the aforementioned executable module data segment in the final application module executable file loaded into the on-chip embedded operating system. When the embedded operating system calls the callback interface of the application installed based on the executable module, it can identify in advance whether the callback interface is implemented in the executable module through the executable module data segment, thereby greatly improving the running performance of the application.
[0349] Based on the above embodiments, it may further include an application runtime check module, used for:
[0350] After obtaining the target executable module from the target application module executable file corresponding to the current application, if it is determined from the executable module data segment in the target application module executable file that the target executable module does not implement the target callback interface function, the program will report an error.
[0351] Based on the above embodiments, the callback interface function acquisition module 830 can be specifically used for:
[0352] In the executable module data segment of the target application module executable file, obtain the target data structure that matches the target executable module, and obtain the target bit information field in the target data structure;
[0353] In the target bit information field, obtain the target bit corresponding to the target callback interface;
[0354] When the target bit value is a binary value used to identify the interface implementation, it is determined that the target executable module implements the target callback interface.
[0355] Based on the above embodiments, the application module executable file may also include callback interface index information corresponding to each executable module;
[0356] Correspondingly, the callback interface function retrieval module 830 can be further used for:
[0357] In the executable file of the target application module, calculate the location of the target callback interface index information corresponding to the target executable module;
[0358] Based on the position of the target callback interface in the callback interface table, obtain the callback interface index of the target callback interface from the target callback interface index information;
[0359] Based on the target callback interface index, retrieve the target callback interface function corresponding to the target callback interface from the executable file of the target application module.
[0360] Based on the above embodiments, the callback interface function execution module 840 can be specifically used for:
[0361] Initialize the virtual machine and push all the parameters required by the target callback interface onto the virtual machine stack;
[0362] Start the virtual machine, execute the bytecode of the target callback interface function, and obtain the running result;
[0363] Perform subsequent processing based on the obtained results.
[0364] The application operation control device provided in the embodiments of the present invention can execute the application operation control method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0365] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0366] Figure 9 A schematic diagram of a limited device 10 that can be used to implement embodiments of the present invention is shown. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.
[0367] like Figure 9As shown, the restricted device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 16. The RAM 13 may also store various programs and data required for the operation of the restricted device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0368] The I / O interface 15 in the restricted device 10 may include eSPI (Enhanced Serial Peripheral Interface) and SPI (Serial Peripheral Interface), etc.
[0369] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, for example, performing the methods for creating loadable files, installing executable modules, and running applications as described in the embodiments of the present invention.
[0370] In some embodiments, the methods for creating loadable files, installing executable modules, and controlling the operation of applications as described in the various embodiments of the present invention can be implemented as computer programs tangibly contained in a computer-readable storage medium, such as storage unit 16. In some embodiments, part or all of the computer program can be loaded and / or installed on the restricted device 10 via ROM 12. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the methods for creating loadable files, installing executable modules, and controlling the operation of applications as described above in the various embodiments of the present invention can be performed. Alternatively, in other embodiments, processor 11 can be configured by any other suitable means (e.g., by means of firmware) to perform the methods for creating loadable files, installing executable modules, and controlling the operation of applications as described in the various embodiments of the present invention.
[0371] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0372] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0373] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0374] Figure 10 This is a structural diagram of an electronic device provided according to an embodiment of the present invention. Figure 10 The electronic device includes the restricted device 1010 as described in any embodiment of the present invention.
[0375] The restricted device can be understood as a resource-restricted device, which can typically be a smart card, USB key, ESAM (Embedded Secure Access Module), or SE (Secure Element), etc. The smart card in question is generally a multi-application smart card.
[0376] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0377] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for creating a loadable file, characterized in that, Performed by the converter, the method includes: Obtain the intermediate application module files obtained after compiling the application source code, as well as the configuration files corresponding to the intermediate application module files; The application module intermediate file includes at least one callback interface corresponding to each executable module in the application module; the configuration file includes simple identification information for identifying the executable module to which each callback interface belongs. The simple identification information is the filename of the callback interface file to which each callback interface belonging to the same executable module belongs in the application source code. Based on the intermediate files and configuration files of the application module, generate the loadable files for the application module; The application module loadable file includes an executable module data segment, which records the interface representation of the callback interface implemented by each executable module. The interface representation is in the form of a bit information field, and each bit in the bit information field corresponds to the implementation of each callback interface.
2. The method according to claim 1, characterized in that, The simplified identification information consists of the filenames of the callback interface files belonging to the same executable module in the application source code, and the callback interface files record the callback functions implemented in the respective executable modules; and, Callback interfaces are named using the filename of the corresponding callback interface file and a unique identifier for the callback interface.
3. The method according to claim 2, characterized in that, Based on the application module's intermediate files and configuration files, generate loadable files for the application module, including: Locate the current configuration information of the currently executable module in the configuration file, and obtain the current filename corresponding to the currently executable module from the current configuration information; In the application module intermediate file, iterate through the function names of each callback interface and obtain the callback interfaces that match the current file name; Based on the unique identifier of each callback interface included in the function name of each callback interface, identify each callback interface implemented by the current executable module and record the identification results in the executable module's data segment.
4. The method according to claim 3, characterized in that, After locating the current configuration information of the executable module in the configuration file, it also includes: In the executable module data segment, a current data structure matching the current executable module is created, and a bit information field of a preset length is created in the current data structure. Different bits in the bit information field are used to identify different callback interfaces implemented by the executable module. Accordingly, the recognition results are recorded in the executable module's data segment, including: Whenever it is identified that the current executable module implements the target callback interface, the target bit corresponding to the target callback interface is located in the bit information field of the current data structure corresponding to the current executable module; Set the target bit to a binary value used to identify the interface implementation.
5. The method according to claim 4, characterized in that, In each callback interface, at least one combined interface group is pre-marked; After identifying the unique identifiers of each callback interface implemented by the current executable module based on the function names of the matched callback interfaces, and recording the identification results in the executable module's data segment, the process also includes: If, based on the callback interfaces implemented by the current executable module, it is determined that the current executable module includes at least one callback interface corresponding to the target combined interface group, but does not include all callback interfaces corresponding to the target combined interface group, then a conversion error will occur.
6. The method according to claim 3, characterized in that, Each callback interface also has an existence attribute, which includes either a required interface or an optional interface; After identifying the unique identifiers of each callback interface implemented by the current executable module based on the function names of the matched callback interfaces, and recording the identification results in the executable module's data segment, the process also includes: If, based on the callback interfaces implemented by the current executable module, it is determined that the current executable module does not include callback interfaces with the attribute of being a required interface, then a conversion error will occur.
7. The method according to claim 4, characterized in that, Based on the application module's intermediate files and configuration files, a loadable file for the application module is generated, which also includes: Based on the callback interface table maintained locally by the converter and the executable module data segment, generate callback interface index information corresponding to each executable module, and add the callback interface index information to the application module loadable file.
8. The method according to claim 7, characterized in that, Based on the callback interface table maintained locally by the converter and the executable module data segment, generate callback interface index information corresponding to each executable module, including: During the process of generating the callback interface index information corresponding to the target executable module, the current callback interface is obtained sequentially according to the order of each callback interface defined in the callback interface table; Based on the executable module data segment, detect whether the target executable module implements the current callback interface; If yes, then obtain the current callback index determined by the position of the current callback interface in the callback interface table and the preset index starting point, and add the current callback index to the callback interface index information; otherwise, retain the current callback index. Returning to the previous state, the system retrieves the operations of each callback interface in the order defined in the callback interface table, until all callback interfaces in the callback interface table have been processed.
9. The method according to any one of claims 1-8, characterized in that, The callback interfaces include: an installation interface, a command processing interface, a selection interface, and a deselection interface, all of which have the attribute of being mandatory; and, There are multiple-channel selection interface, multiple-channel deselection interface, uninstallation interface, authorization request interface, and personalization interface, all of which are optional. Among them, the multi-channel selection interface and the multi-channel deselection interface belong to a combined interface group.
10. An executable module installation method, characterized in that, Executed by the runtime environment of an embedded operating system, the method includes: In response to the application installation command for the target executable module in the target application module executable file, obtain the target application module executable file obtained after loading the target application module loadable file; The application module executable file includes multiple executable modules and an executable module data segment corresponding to each executable module. The executable module data segment records the interface representation of the callback interface implemented by each executable module. The interface representation is in the form of a bit information field, and each bit in the bit information field corresponds to the implementation of each callback interface. If, based on the executable module data segment in the target application module executable file, it is determined that the callback interface implemented by the target executable module includes the installation interface, then the target callback interface function corresponding to the installation interface is obtained in the target application module executable file. Execute the bytecode of the target callback interface function to install the target application corresponding to the target executable module into the embedded operating system.
11. The method according to claim 10, characterized in that, After obtaining the executable file of the target application module obtained by loading the loadable file of the target application module, it also includes: If, based on the executable module data segment in the target application module executable file, it is determined that the callback interface implemented by the target executable module does not include the installation interface, then the program installation will fail.
12. The method according to claim 10, characterized in that, Based on the executable module data segment in the target application module's executable file, it is determined that the callback interfaces implemented by the target executable module include an installation interface, including: In the executable module data segment of the target application module executable file, obtain the target data structure that matches the target executable module, and obtain the target bit information field in the target data structure; In the target bit information field, obtain the target bit corresponding to the installation interface; When the target bit value is a binary value used to identify the interface implementation, it is determined that the callback interface implemented by the target executable module includes the installation interface.
13. The method according to claim 10, characterized in that, The application module executable file also includes callback interface index information corresponding to each executable module; Obtain the target callback interface function corresponding to the target callback interface from the target application module executable file, including: In the executable file of the target application module, calculate the location of the target callback interface index information corresponding to the target executable module; Based on the position of the installation interface in the callback interface table, obtain the callback interface index of the target callback interface from the target callback interface index information; Based on the target callback interface index, retrieve the target callback interface function corresponding to the target callback interface from the executable file of the target application module.
14. The method according to claim 10, characterized in that, Execute the bytecode of the target callback interface function to install the target application corresponding to the target executable module into the embedded operating system, including: Initialize the virtual machine and push all the parameters required by the target callback interface onto the virtual machine stack; Start the virtual machine and execute the bytecode of the target callback interface function to install the target application; After confirming that the target application is installed, check whether the target application has been successfully registered to the embedded operating system application management module; If yes, the target application is confirmed to have been installed successfully; otherwise, the target application is confirmed to have failed to install.
15. The method according to claim 14, characterized in that, After confirming that the target application has been successfully installed, the following steps are also included: Establish the correspondence between the target application and the target executable module.
16. An application operation control method, characterized in that, Executed by the runtime environment of an embedded operating system, the method includes: If a call request to the target callback interface is identified based on the context information, then the current application that matches the call request is obtained; Retrieve the target executable module from the target application module executable file corresponding to the current application; If it is determined from the executable module data segment in the target application module executable file that the target executable module implements the target callback interface, then the target callback interface function corresponding to the target callback interface is obtained in the target application module executable file. Execute the bytecode of the target callback interface function and perform subsequent processing based on the obtained execution result.
17. The method according to claim 16, characterized in that, After obtaining the target executable module from the target application module executable file corresponding to the current application, the following is also included: If, based on the executable module data segment in the target application module executable file, it is determined that the target executable module does not implement the target callback interface, the program will report an error.
18. The method according to claim 16, characterized in that, Based on the executable module data segment in the target application module executable file, it is determined that the target executable module implements the target callback interface, including: In the executable module data segment of the target application module executable file, obtain the target data structure that matches the target executable module, and obtain the target bit information field in the target data structure; In the target bit information field, obtain the target bit corresponding to the target callback interface; When the target bit value is a binary value used to identify the interface implementation, it is determined that the target executable module implements the target callback interface.
19. The method according to claim 16, characterized in that, The application module executable file also includes callback interface index information corresponding to each executable module; In the executable file of the target application module, obtain the target callback interface function corresponding to the target callback interface, including: In the executable file of the target application module, calculate the location of the target callback interface index information corresponding to the target executable module; Based on the position of the target callback interface in the callback interface table, obtain the callback interface index of the target callback interface from the target callback interface index information; Based on the target callback interface index, retrieve the target callback interface function corresponding to the target callback interface from the executable file of the target application module.
20. The method according to claim 16, characterized in that, Execute the bytecode of the target callback interface function and perform subsequent processing based on the obtained execution result, including: Initialize the virtual machine and push all the parameters required by the target callback interface onto the virtual machine stack; Start the virtual machine, execute the bytecode of the target callback interface function, and obtain the running result; Perform subsequent processing based on the obtained results.
21. A loadable file creation device, characterized in that, Configured in the converter, the device includes: The file acquisition module is used to acquire the intermediate application module files obtained after compiling the application source code, as well as the configuration files corresponding to the intermediate application module files. The application module intermediate file includes at least one callback interface corresponding to each executable module in the application module; the configuration file includes simple identification information for identifying the executable module to which each callback interface belongs. The simple identification information is the filename of the callback interface file to which each callback interface belonging to the same executable module belongs in the application source code. The loadable file generation module is used to generate loadable files for application modules based on intermediate files and configuration files of the application modules; The application module loadable file includes an executable module data segment, which records the interface representation of the callback interface implemented by each executable module. The interface representation is in the form of a bit information field, and each bit in the bit information field corresponds to the implementation of each callback interface.
22. An executable module installation device, characterized in that, The device, configured in the runtime environment of an embedded operating system, includes: The executable file acquisition module is used to obtain the target application module executable file after loading the target application module loadable file in response to the application installation instruction of the target executable module in the target application module executable file; The application module executable file includes multiple executable modules and an executable module data segment corresponding to each executable module. The executable module data segment records the interface representation of the callback interface implemented by each executable module. The interface representation is in the form of a bit information field, and each bit in the bit information field corresponds to the implementation of each callback interface. The interface function acquisition module is used to obtain the target callback interface function corresponding to the installation interface in the target application module executable file if it is determined from the executable module data segment in the target application module executable file that the callback interface implemented by the target executable module includes the installation interface; The executable module installation module is used to execute the bytecode of the target callback interface function to install the target application corresponding to the target executable module into the embedded operating system.
23. An application operation control device, characterized in that, The device, configured in the runtime environment of an embedded operating system, includes: The current application acquisition module is used to acquire the current application that matches the call request if a call request to the target callback interface is identified based on the context information. The executable module acquisition module is used to acquire the target executable module in the target application module executable file corresponding to the current application. The callback interface function acquisition module is used to retrieve the target callback interface function corresponding to the target callback interface in the target application module executable file if it is determined from the executable module data segment in the target application module executable file that the target executable module implements the target callback interface. The callback interface function execution module is used to execute the bytecode of the target callback interface function and perform subsequent processing based on the obtained execution results.
24. A restricted device, characterized in that, The restricted device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the loadable file creation method of any one of claims 1-9, or to perform the executable module installation of any one of claims 10-15, or to perform the application operation control method of any one of claims 16-20.
25. An electronic device, characterized in that, Includes the restricted device as described in claim 24.
26. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the loadable file creation method of any one of claims 1-9, or implement the executable module installation of any one of claims 10-15, or implement the application operation control method of any one of claims 16-20.
27. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the loadable file creation method according to any one of claims 1-9, or implements the executable module installation according to any one of claims 10-15, or implements the application operation control method according to any one of claims 16-20.