Conversion generation method and device of binary loadable file and resource-restricted device

By generating conversion auxiliary files for import and export segment information, the problem of long conversion time and slow installation speed of binary intermediate files in resource-constrained devices is solved, and the simultaneous conversion and linking of multiple files is realized, thereby improving the installation speed.

CN119088758BActive Publication Date: 2026-07-03BEIJING TONGFANG MICROELECTRONICS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING TONGFANG MICROELECTRONICS
Filing Date
2024-08-29
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, when installing applications on resource-constrained devices, the conversion process of binary intermediate files is time-consuming and the installation speed is slow, making it impossible to process the conversion and linking of multiple files simultaneously.

Method used

By acquiring conversion auxiliary files, import segment information and export segment information, as well as binary link files, are generated based on the segment data of the binary intermediate files to be converted, enabling simultaneous conversion and linking of multiple binary intermediate files.

Benefits of technology

It improves conversion efficiency, reduces the need for secondary linking during subsequent installation, and increases installation speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088758B_ABST
    Figure CN119088758B_ABST
Patent Text Reader

Abstract

The application discloses a conversion generation method and device of a binary loadable file and a resource-restricted device, and the method comprises the following steps: in the case of converting any to-be-converted binary intermediate file, obtaining a conversion auxiliary file based on segment data of the to-be-converted binary intermediate file; and converting the to-be-converted binary intermediate file according to the conversion auxiliary file to obtain import segment information and export segment information in a converted binary loadable file and a binary link file corresponding to the binary loadable file. The conversion auxiliary file is used to realize the conversion of the binary intermediate file, obtain the import segment information and the export segment information of the binary loadable file and the corresponding binary link file, and the scheme of the application can still be simultaneously realized for multiple binary intermediate files, the conversion efficiency is improved, the link between the multiple binary intermediate files is completed, the subsequent secondary link process is reduced, and the installation speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of file processing technology, and in particular to a method, apparatus, and resource-constrained device for converting and generating binary loadable files. Background Technology

[0002] Currently, for resource-constrained devices, installing applications typically involves converting binary intermediate files.

[0003] The current conversion method can only convert one binary intermediate file at a time, and the converted file still requires a lot of secondary linking during installation to ensure that the installed application can run normally. This results in a long conversion process and a slow installation speed. Summary of the Invention

[0004] This invention provides a method, apparatus, and resource-constrained device for converting and generating binary loadable files, in order to solve the problems of long conversion time and slow installation speed.

[0005] According to one aspect of the present invention, a method for converting and generating binary loadable files is provided, the method comprising:

[0006] When converting any binary intermediate file to be converted, a conversion auxiliary file is obtained based on the segment data of the binary intermediate file to be converted;

[0007] The intermediate binary file to be converted is converted according to the conversion auxiliary file to obtain the import segment information and export segment information in the converted binary loadable file, as well as the binary link file corresponding to the binary loadable file.

[0008] According to another aspect of the present invention, a binary loadable file conversion and generation apparatus is provided, the apparatus comprising:

[0009] The acquisition module is used to acquire a conversion auxiliary file based on the segment data of any binary intermediate file to be converted when converting any binary intermediate file to be converted.

[0010] The conversion module is used to convert the intermediate binary file to be converted according to the conversion auxiliary file, so as to obtain the import segment information and export segment information in the converted binary loadable file, as well as the binary link file corresponding to the binary loadable file.

[0011] According to another aspect of the present invention, a resource-constrained device is provided, wherein a multi-application smart card (AOS) operating system is installed on the resource-constrained device, the multi-application smart card (AOS) operating system having a runtime environment, a virtual machine, and an application programming interface, the resource-constrained device comprising:

[0012] At least one processor; and

[0013] A memory communicatively connected to the at least one processor; wherein,

[0014] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the binary loadable file conversion and generation method according to any embodiment of the present invention.

[0015] According to another aspect of the present invention, a computer program product is provided, characterized in that the computer program product includes a computer program, which, when executed by a processor, implements the binary loadable file conversion and generation method provided in any embodiment of the present invention.

[0016] The technical solution of this invention involves obtaining a conversion auxiliary file based on the segment data of any binary intermediate file to be converted when converting it; converting the binary intermediate file according to the conversion auxiliary file to obtain the import segment information and export segment information of the converted binary loadable file, as well as the corresponding binary link file. By utilizing the conversion auxiliary file, the conversion of binary intermediate files is achieved, obtaining the import segment information and export segment information of the binary loadable file, and the corresponding binary link file. For multiple binary intermediate files, the solution of this invention can still be implemented simultaneously, improving conversion efficiency. The modification of the import segment of the binary intermediate file completes the linking between multiple binary intermediate files, reducing the secondary linking process required during subsequent installation and improving installation speed.

[0017] 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

[0018] 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.

[0019] Figure 1 This is a flowchart illustrating a method for converting and generating binary loadable files according to Embodiment 1 of the present invention.

[0020] Figure 2 This is a flowchart of a method for converting and generating a binary loadable file according to Embodiment 2 of the present invention;

[0021] Figure 3 This is a flowchart of a method for converting and generating a binary loadable file according to Embodiment 3 of the present invention;

[0022] Figure 4 This is a schematic diagram of the structure of a binary loadable file conversion and generation device provided in Embodiment 4 of the present invention;

[0023] Figure 5 This is a schematic diagram of a resource-constrained device provided in Embodiment 5 of the present invention. Detailed Implementation

[0024] 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.

[0025] 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 a 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.

[0026] Example 1

[0027] Figure 1 This is a flowchart illustrating a method for converting and generating binary loadable files according to Embodiment 1 of the present invention. This embodiment is applicable to the conversion and generation of binary loadable files. The method can be executed by a binary loadable file conversion and generation device, which can be implemented in hardware and / or software and can be configured in a resource-constrained device. Figure 1 As shown, the method includes:

[0028] Step 101: When converting any binary intermediate file to be converted, obtain the conversion auxiliary file based on the segment data of the binary intermediate file to be converted.

[0029] In this step, the binary intermediate file is generated by the WebAssembly compiler compiling the application source code. The application source code is a combination of multiple applications implemented in a high-level language. One application combination can use system-provided API functions, or it can use API functions from other application combinations.

[0030] In this embodiment, a conversion auxiliary file can be obtained based on the segment data in the binary intermediate file to be converted. It should be noted that this step can obtain multiple binary intermediate files to be converted and perform parallel conversion. In addition, the segment data in the binary intermediate files to be converted mainly includes import segments, export segments, and function segments. In this embodiment, the conversion is mainly performed on the import segments and export segments.

[0031] In this step, the conversion auxiliary file is mainly obtained by relying on the import segment of the binary intermediate file to be converted. Specifically, the required binary intermediate file identifier can be obtained from the import segment of the binary intermediate file to be converted; then the conversion auxiliary file is obtained based on the binary intermediate file identifier.

[0032] The import section stores several pieces of import function information. Each piece of import information records the name of the binary intermediate file of the imported function, the function name, and the function signature information index. Therefore, the name of the binary intermediate file involved in this import section can be determined as the required binary intermediate file identifier.

[0033] Then, query the link status of the target binary intermediate file corresponding to the binary intermediate file identifier, and obtain the conversion configuration information corresponding to the binary intermediate file identifier.

[0034] It should be noted that the link status is used to identify whether the target binary intermediate file has been converted. Different status values ​​can usually be set to identify different link statuses. For example, a status value of "1" indicates that the corresponding target binary intermediate file is in a linked state, that is, it has been converted; a status value of "0" indicates that the corresponding target binary intermediate file is in an unlinked state, that is, it has not been converted.

[0035] If the link status indicates that the target binary intermediate file is linked, obtain the corresponding target binary link file and identify the target binary link file as the conversion auxiliary file.

[0036] If the link status indicates that the target binary intermediate file is not linked, the target binary intermediate file and the conversion configuration information are identified as conversion auxiliary files.

[0037] Therefore, the content contained in the conversion auxiliary file will be different depending on the link status.

[0038] Additionally, it should be noted that the conversion configuration information includes the configuration information required to convert the binary intermediate file to be converted into a binary loadable file; wherein, the configuration information includes: the identifier of the binary intermediate file to be converted, the module information and exported function information for converting into a binary loadable file, the module information includes: module version, module AID length and module AID, and the exported function information includes: the name of the exported function of the binary intermediate file to be converted.

[0039] Step 102: Convert the intermediate binary file to be converted based on the conversion auxiliary file to obtain the import segment information and export segment information in the converted loadable binary file, as well as the binary link file corresponding to the loadable binary file.

[0040] This step mainly involves converting the import segment in the binary intermediate file, and the converted import segment information is the import segment information in the binary loadable file; the export segment in the binary intermediate file is also converted, and the converted export segment information is the export segment information in the binary loadable file.

[0041] The generated binary link file corresponds to the binary loadable file and the binary intermediate file to be converted. The binary link file specifies the functions in the binary loadable file that can be called by other binary intermediate files.

[0042] In this embodiment, when converting any binary intermediate file to be converted, a conversion auxiliary file is obtained based on the segment data of the binary intermediate file to be converted; the binary intermediate file to be converted is converted according to the conversion auxiliary file to obtain the import segment information and export segment information of the converted binary loadable file, as well as the corresponding binary link file. Using the conversion auxiliary file, the conversion of the binary intermediate file is realized, and the import segment information and export segment information of the binary loadable file, as well as the corresponding binary link file, are obtained. For multiple binary intermediate files, the solution of the present invention can still be implemented simultaneously, which improves the conversion efficiency. The modification of the import segment of the binary intermediate file completes the linking between multiple binary intermediate files, reduces the secondary linking process required during subsequent installation, and improves the installation speed.

[0043] Example 2

[0044] Figure 2 This is a flowchart of a method for converting and generating a binary loadable file according to Embodiment 2 of the present invention. This embodiment describes the conversion and generation process when the target binary intermediate file is already linked. Figure 2 As shown, the method includes:

[0045] Step 201: Obtain the target binary link file corresponding to the target binary intermediate file, and identify the target binary link file as the conversion auxiliary file.

[0046] Based on the determination of the linking status of the target binary intermediate file in the aforementioned embodiments, this embodiment shows that it is already linked. Therefore, the target binary linking file corresponding to the target binary intermediate file can be obtained, and the target binary linking file can be identified as the conversion auxiliary file.

[0047] In other words, in this embodiment, the file used for subsequent conversion is the target binary link file corresponding to the target binary intermediate file.

[0048] It should be noted that in this step, after obtaining the target binary link file corresponding to the target binary intermediate file, the target binary link file can also be verified.

[0049] Specifically, a hash check can be used to compare and verify each target segment in the target binary link file to obtain the first verification result; the magic number and version in the target binary link file can be checked to obtain the check result; the name of the target binary link file and the name of the internally stored binary intermediate file can be compared for consistency to obtain the comparison result; the length and format of the AID and the information of each function in the target binary link file can be verified to obtain the second verification result; if the first verification result, check result, comparison result and second verification result are all passed, the target binary link file is determined to have passed the verification.

[0050] Each target segment may include, but is not limited to, the following fields: magic, version, module_name_size, module_name, module_aid_size, module_aid, export_function_count, and functions, and these fields will be used as the binary linker template file.

[0051] Step 202: Generate a binary link file export function information table based on the target binary link file in the conversion auxiliary file.

[0052] In this step, the target binary link file contains multiple exported functions and related information. Therefore, the exported functions and their related information can be extracted to generate an exported function information table for the binary link file.

[0053] The binary linker export function information table can contain multiple binary linker export function information entries. Each binary linker export function information entry includes the following items:

[0054] The binary intermediate file identifier corresponds to the name of the target binary intermediate file, the version of the target binary intermediate file, the AID of the target binary intermediate file, and the exported function names, indices, number of input parameters, and number of return values ​​contained in the exported segment of the binary link file.

[0055] It should be noted that AID stands for Application Identifier. For the specific definition of the above entries, please refer to relevant technologies, which will not be elaborated here.

[0056] Step 203: Generate an import function information table for the binary intermediate file to be converted based on the import segment of the binary intermediate file to be converted.

[0057] As can be seen from the foregoing embodiments, the import segment of the binary intermediate file to be converted stores several import function information entries. Each import information entry records the name of the binary intermediate file to be converted, the function name, and the function signature information index. This step can generate an import function information table for the binary intermediate file to be converted based on the information in the import segment.

[0058] The table containing the import function information for the binary intermediate file to be converted includes multiple entries for import functions of the binary intermediate file to be converted. Each entry includes the following items:

[0059] The name of the binary intermediate file to which the imported function belongs in the import segment of the binary intermediate file to be converted, the name of the imported function in the import segment of the binary intermediate file to be converted, the number of input parameters of the imported function in the type segment of the binary intermediate file to be converted, and the number of return values ​​of the imported function in the type segment of the binary intermediate file to be converted.

[0060] Step 204: Generate the export function information table of the binary intermediate file to be converted based on the export segment of the binary intermediate file to be converted.

[0061] In this step, the exported segment of the intermediate binary file to be converted contains the function name and function index of the exported function. Based on this index, the signature information and bytecode of the exported function can be found.

[0062] Based on the information from this exported segment, an export function information table for the binary intermediate file to be converted can be generated. This export function information table includes multiple export function information entries for the binary intermediate file to be converted, and each export function information entry includes the following table entries:

[0063] The names of the exported functions in the exported segment of the binary intermediate file to be converted, and the indexes of the exported functions in the binary intermediate file to be converted.

[0064] Step 205: Based on the exported function information table of the binary link file and the imported function information table of the binary intermediate file to be converted, convert the imported segment of the binary intermediate file to be converted to obtain the imported segment information of the converted binary loadable file.

[0065] In this step, when converting the imported segment, the main basis is the export function information table of the binary link file and the import function information table of the binary intermediate file to be converted.

[0066] Since the binary intermediate file import function information table contains multiple binary intermediate file import function entries, this step can iterate through the binary intermediate file import function information entries one by one based on the order in the table. When any binary intermediate file import function entry is encountered, the following processing is performed on that binary intermediate file import function entry:

[0067] For any binary intermediate file import function information in the binary intermediate file import function information table to be converted, traverse all the binary link file export function information tables obtained; for each binary link file export function information in the binary link file export function information table, determine whether the name of the target binary intermediate file in the binary link file export function information is the same as the name of the binary intermediate file in the binary intermediate file import function information.

[0068] If they are different, iterate through the next binary linker's exported function information; if they are the same, end the iteration and replace the AID of the target binary intermediate file corresponding to the binary intermediate file identifier in the binary linker's exported function information with the import module information corresponding to the import section in the binary intermediate file to be converted.

[0069] It should be noted that when traversing the exported function information table of all the obtained binary link files, the traversal of the exported function information table of the binary link files can be ended as soon as the name of the target binary intermediate file that is the same as the name of the imported function information of the binary intermediate file is found.

[0070] Then, the names of the binary link files that have the same target binary intermediate file are used as the data basis for conversion, and the import function information of this binary intermediate file is converted.

[0071] The specific conversion involves replacing the AID of the target binary intermediate file corresponding to the binary intermediate file's identifier in the exported function information of the binary linker with the import module information corresponding to the import section in the binary intermediate file to be converted. This ensures that the import module information only stores the aforementioned AID.

[0072] After the replacement is complete, proceed with the processing of the next binary intermediate file import function information.

[0073] After traversing through all the binary intermediate file import function information in the import function information table of the binary intermediate file to be converted, the duplicates of each import information in the converted import segment are removed to obtain the import segment information of the converted binary loadable file.

[0074] It should be noted that after the conversion is complete, there may be duplicate AIDs in the imported information. In this case, deduplication should be performed to keep only one of the duplicate AIDs.

[0075] Step 206: Convert the export segment of the binary intermediate file according to the export function information table of the binary intermediate file to be converted and the export function information in the conversion configuration information corresponding to the binary intermediate file to be converted, and obtain the export segment information of the converted binary loadable file.

[0076] The conversion of the exported segment is mainly based on the exported function information table of the binary intermediate file to be converted and the exported function information in the corresponding conversion configuration information of the binary intermediate file to be converted.

[0077] Specifically, the binary intermediate file export function information in the binary intermediate file export function information table to be converted is traversed one by one. For each binary intermediate file export function information encountered, the following processing is performed:

[0078] For any binary intermediate file export function information in the binary intermediate file export function information table to be converted, the export function information in the conversion configuration information corresponding to the binary intermediate file to be converted is traversed; for each binary intermediate file to be converted, the function name in the conversion configuration information corresponding to the binary intermediate file to be converted is compared with the function name in the binary intermediate file export function information.

[0079] If the same function is found during iteration, delete the function name from the exported information in the exported segment of the binary intermediate file; if the same function is not found during iteration, delete the exported function information in the binary intermediate file.

[0080] After the above processing, after traversing the export function information of all binary intermediate files, the export segment only contains information other than the function name in the export function information that appears in the conversion configuration information. This remaining information can be used as the export segment information of the converted binary loadable file.

[0081] Step 207: Convert the intermediate binary file to be converted according to the conversion auxiliary file to obtain the binary link file corresponding to the binary loadable file.

[0082] This step mainly involves deriving functions configured to be externally callable. Specifically, an export function information table for the binary intermediate file to be converted can be generated based on the binary intermediate file to be converted. Then, based on the export function information table for the binary intermediate file to be converted and the conversion configuration information corresponding to the binary intermediate file identifier, a binary link file corresponding to the converted loadable binary file can be generated.

[0083] The information table for exporting functions from the intermediate binary file to be converted can be found in the steps described above, and will not be repeated here.

[0084] When generating a binary link file, you can first determine the intersection of the exported function table of the binary intermediate file to be converted and the exported functions in the conversion configuration information corresponding to the binary intermediate file identifier; then determine the exported function information of the converted binary loadable file based on the exported functions in the intersection; finally, add the exported function information to the binary link file to obtain the binary link file corresponding to the converted binary loadable file.

[0085] It should be noted that the binary linker specifies which functions can be called externally, and this information is pre-configured in the conversion configuration information. The intersection of the exported functions in the conversion configuration information and the exported function table of the intermediate binary file to be converted is the set of functions that can be added to the binary linker for external use.

[0086] Example 3

[0087] Figure 3 This is a flowchart of a method for converting and generating a binary loadable file according to Embodiment 3 of the present invention. This embodiment describes the conversion and generation process when the target binary intermediate file is in an unlinked state. Figure 3 As shown, the method includes:

[0088] Step 301: Determine the target binary intermediate file and conversion configuration information as conversion auxiliary files.

[0089] In this embodiment, for unlinked target binary intermediate files, the target binary intermediate files and conversion configuration information can be used for conversion.

[0090] Step 302: Generate an import function information table for the binary intermediate file to be converted based on the import segment of the binary intermediate file to be converted.

[0091] As can be seen from the foregoing embodiments, the import segment of the binary intermediate file to be converted stores several import function information entries. Each import information entry records the name of the binary intermediate file to be converted, the function name, and the function signature information index. This step can generate an import function information table for the binary intermediate file to be converted based on the information in the import segment.

[0092] The table containing the import function information for the binary intermediate file to be converted includes multiple entries for import functions of the binary intermediate file to be converted. Each entry includes the following items:

[0093] The name of the binary intermediate file to which the imported function belongs in the import segment of the binary intermediate file to be converted, the name of the imported function in the import segment of the binary intermediate file to be converted, the number of input parameters of the imported function in the type segment of the binary intermediate file to be converted, and the number of return values ​​of the imported function in the type segment of the binary intermediate file to be converted.

[0094] Step 303: Generate the target binary intermediate file export function information table based on the export segment, type segment, and configuration information file of the target binary intermediate file in the conversion auxiliary file.

[0095] In this step, the target binary intermediate file export function information table includes multiple target binary intermediate file export function information entries. Each target binary intermediate file export function information entry includes the following table entries:

[0096] The target binary intermediate file name, target binary intermediate file version, target binary intermediate file AID, target binary intermediate file exported function name, target binary intermediate file exported function index, target binary intermediate file exported function input parameters, and target binary intermediate file exported function return value.

[0097] It should be noted that since the information stored in the export and type sections of the target binary intermediate file is limited, it can be merged with the corresponding exported function information in the configuration information file.

[0098] The configuration information file is the configuration information file corresponding to the target binary intermediate file.

[0099] Step 304: Generate the export function information table of the binary intermediate file to be converted based on the export segment of the binary intermediate file to be converted.

[0100] In this step, the exported segment of the intermediate binary file to be converted contains the function name and function index of the exported function. Based on this index, the signature information and bytecode of the exported function can be found.

[0101] Based on the information from this exported segment, an export function information table for the binary intermediate file to be converted can be generated. This export function information table includes multiple export function information entries for the binary intermediate file to be converted, and each export function information entry includes the following table entries:

[0102] The names of the exported functions in the exported segment of the binary intermediate file to be converted, and the indexes of the exported functions in the binary intermediate file to be converted.

[0103] Step 305: Based on the export function table of the target binary intermediate file and the import function table of the binary intermediate file to be converted, convert the import segment of the binary intermediate file to be converted to obtain the import segment information of the converted binary loadable file.

[0104] In this step, since the binary intermediate file import function information table contains multiple binary intermediate file import function entries, this step can iterate through the binary intermediate file import function information one by one based on the order in the table. When any binary intermediate file import function entry is encountered, the following processing is performed on that binary intermediate file import function entry:

[0105] For any binary intermediate file import function information in the import function table of the binary intermediate file to be converted, traverse the export function information table of all target binary intermediate files.

[0106] For each target binary intermediate file, the export function table information is traversed, and the name of the target binary intermediate file in the export function table information is compared with the name of the binary intermediate file in the binary intermediate file import function information.

[0107] If they are different, iterate through the next target binary intermediate file export function table information; if they are the same, end the iteration and replace the AID of the target binary intermediate file corresponding to the binary intermediate file identifier in the target binary intermediate file export function table information with the import module information corresponding to the import section in the binary intermediate file to be converted.

[0108] After traversing through all the binary intermediate file import function information in the import function table of the binary intermediate file to be converted, the duplicate import information in each import segment of the converted import segment is removed to obtain the import segment information of the converted binary loadable file.

[0109] Step 306: Based on the export function information table of the binary intermediate file to be converted and the export function information in the corresponding conversion configuration information of the binary intermediate file to be converted, convert the export segment of the binary intermediate file to be converted to obtain the export segment information of the converted binary loadable file.

[0110] The conversion of the exported segment is mainly based on the exported function information table of the binary intermediate file to be converted and the exported function information in the corresponding conversion configuration information of the binary intermediate file to be converted.

[0111] Specifically, the binary intermediate file export function information in the binary intermediate file export function information table to be converted is traversed one by one. For each binary intermediate file export function information encountered, the following processing is performed:

[0112] For any binary intermediate file export function information in the binary intermediate file export function information table to be converted, the export function information in the conversion configuration information corresponding to the binary intermediate file to be converted is traversed; for each binary intermediate file to be converted, the function name in the conversion configuration information corresponding to the binary intermediate file to be converted is compared with the function name in the binary intermediate file export function information.

[0113] If the same function is found during iteration, delete the function name from the exported information in the exported segment of the binary intermediate file; if the same function is not found during iteration, delete the exported function information in the binary intermediate file.

[0114] After the above processing, after traversing the export function information of all binary intermediate files, the export segment only contains information other than the function name in the export function information that appears in the conversion configuration information. This remaining information can be used as the export segment information of the converted binary loadable file.

[0115] Step 307: Convert the intermediate binary file to be converted based on the conversion auxiliary file to obtain the binary link file corresponding to the binary loadable file.

[0116] This step mainly involves deriving functions configured to be externally callable. Specifically, an export function information table for the binary intermediate file to be converted can be generated based on the binary intermediate file to be converted. Then, based on the export function information table for the binary intermediate file to be converted and the conversion configuration information corresponding to the binary intermediate file identifier, a binary link file corresponding to the converted loadable binary file can be generated.

[0117] When generating a binary link file, first determine the intersection of the exported function table of the binary intermediate file to be converted and the exported functions in the conversion configuration information corresponding to the binary intermediate file identifier; then determine the exported function information of the converted binary loadable file based on the exported functions in the intersection; finally, add the exported function information to the binary link file template file and calculate the checksum to obtain the binary link file corresponding to the converted binary loadable file.

[0118] It should be noted that the binary linker specifies which functions can be called externally, and this information is pre-configured in the conversion configuration information. The intersection of the exported functions in the conversion configuration information and the exported function table of the intermediate binary file to be converted is the set of functions that can be added to the binary linker for external use.

[0119] Example 4

[0120] Figure 4 This is a schematic diagram of a binary loadable file conversion and generation device provided in Embodiment 4 of the present invention. Figure 4 As shown, the device includes:

[0121] The acquisition module 401 is used to acquire a conversion auxiliary file based on the segment data of any binary intermediate file to be converted when converting any binary intermediate file to be converted.

[0122] The conversion module 402 is used to convert the intermediate binary file to be converted based on the conversion auxiliary file, and obtain the import segment information and export segment information in the converted binary loadable file, as well as the binary link file corresponding to the binary loadable file.

[0123] Example 5

[0124] Figure 5 This is a schematic diagram of a resource-constrained device according to Embodiment 5 of the present invention. The resource-constrained device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The resource-constrained device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0125] like Figure 5As shown, the resource-constrained 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 programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the resource-constrained 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.

[0126] Multiple components in resource-constrained device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows resource-constrained device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0127] 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, such as the conversion and generation method of binary loadable files.

[0128] In some embodiments, the binary loadable file conversion generation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on resource-constrained device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the binary loadable file conversion generation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the binary loadable file conversion generation method by any other suitable means (e.g., by means of firmware).

[0129] 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.

[0130] 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.

[0131] 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.

[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on a resource-constrained device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the resource-constrained device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or haptic feedback); and input from the user can be received in any form (including sound input, voice input, or haptic input).

[0133] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0134] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0135] Example 6

[0136] Embodiment 6 of the present invention provides a computer program product, which includes a computer program that, when executed by a processor, implements the binary loadable file conversion and generation method provided in any embodiment of the present application.

[0137] 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.

[0138] 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 converting and generating binary loadable files, characterized in that, The method includes: Multiple intermediate binary files to be converted are obtained and converted in parallel. When converting any intermediate binary file, a conversion auxiliary file is obtained based on the segment data of the intermediate binary file to be converted. The intermediate binary file to be converted is converted according to the conversion auxiliary file to obtain the import segment information and export segment information in the converted loadable binary file, as well as the binary link file corresponding to the loadable binary file; The step of obtaining the conversion auxiliary file based on the segment data of the binary intermediate file to be converted includes: obtaining the required binary intermediate file identifier from the import segment of the binary intermediate file to be converted; and obtaining the conversion auxiliary file based on the binary intermediate file identifier.

2. The method according to claim 1, characterized in that, The step of obtaining the conversion auxiliary file based on the binary intermediate file identifier includes: Query the link status of the target binary intermediate file corresponding to the binary intermediate file identifier, and obtain the conversion configuration information corresponding to the binary intermediate file identifier; If the link status indicates that the target binary intermediate file is linked, obtain the target binary link file corresponding to the target binary intermediate file, and determine the target binary link file as the conversion auxiliary file.

3. The method according to claim 2, characterized in that, The conversion of the intermediate binary file to be converted based on the conversion auxiliary file to obtain the import segment information and export segment information in the converted loadable binary file includes: Based on the target binary link file in the conversion auxiliary file, generate a binary link file export function information table; Generate an import function information table for the binary intermediate file to be converted based on the import segment of the binary intermediate file to be converted. Generate an export function information table for the binary intermediate file to be converted based on the exported segment of the binary intermediate file to be converted. Based on the binary link file export function information table and the binary intermediate file import function information table to be converted, the import segment of the binary intermediate file to be converted is converted to obtain the import segment information of the converted binary loadable file. The exported segment of the binary intermediate file is converted based on the exported function information table of the binary intermediate file to be converted and the exported function information in the conversion configuration information corresponding to the binary intermediate file to be converted, so as to obtain the exported segment information of the converted binary loadable file.

4. The method according to claim 2, characterized in that, The intermediate binary file to be converted is converted according to the conversion auxiliary file to obtain the binary link file corresponding to the binary loadable file, including: Generate an export function information table for the binary intermediate file to be converted based on the binary intermediate file to be converted. Based on the function export information table of the binary intermediate file to be converted and the conversion configuration information corresponding to the binary intermediate file identifier, a binary link file corresponding to the converted binary loadable file is generated.

5. The method according to claim 2, characterized in that, The step of obtaining the conversion auxiliary file based on the intermediate file identifier includes: If the link status indicates that the target binary intermediate file is not linked, the target binary intermediate file and the conversion configuration information are identified as the conversion auxiliary file.

6. The method according to claim 5, characterized in that, The conversion of the intermediate binary file to be converted based on the conversion auxiliary file to obtain the import segment information and export segment information in the converted loadable binary file includes: Generate an import function information table for the binary intermediate file to be converted based on the import segment of the binary intermediate file to be converted. Generate a target binary intermediate file export function information table based on the export segment, type segment, and configuration information file of the target binary intermediate file in the conversion auxiliary file; Generate an export function information table for the binary intermediate file to be converted based on the exported segment of the binary intermediate file to be converted. Based on the target binary intermediate file export function table and the binary intermediate file import function table to be converted, the import segment of the binary intermediate file to be converted is converted to obtain the import segment information of the converted binary loadable file. Based on the export function information in the export function information table of the binary intermediate file to be converted and the corresponding conversion configuration information of the binary intermediate file to be converted, the export segment of the binary intermediate file to be converted is converted to obtain the export segment information of the converted binary loadable file.

7. A device for converting and generating binary loadable files, characterized in that, The device includes: The acquisition module is used to acquire multiple binary intermediate files to be converted and perform parallel conversion. When converting any binary intermediate file to be converted, it acquires a conversion auxiliary file based on the segment data of the binary intermediate file to be converted. The acquisition of the conversion auxiliary file based on the segment data of the binary intermediate file to be converted includes: acquiring the required binary intermediate file identifier from the import segment of the binary intermediate file to be converted; and acquiring the conversion auxiliary file based on the binary intermediate file identifier. The conversion module is used to convert the intermediate binary file to be converted according to the conversion auxiliary file, so as to obtain the import segment information and export segment information in the converted binary loadable file, as well as the binary link file corresponding to the binary loadable file.

8. A resource-constrained device, characterized in that, The resource-constrained device is equipped with an embedded operating system, which executes a runtime environment. The resource-constrained 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 binary loadable file conversion generation method as described in any one of claims 1-6.

9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method for converting and generating a binary loadable file according to any one of claims 1-6.