Application compiling method and program product

Through static code analysis and hardware adaptation configuration file optimization compilation methods, the problem of inconsistent execution of power grid applications on different hardware devices is solved, the stable deployment and efficient operation of target applications is achieved, and the grid operation and maintenance efficiency and user experience are improved.

CN120491968APending Publication Date: 2025-08-15CHINA SOUTHERN POWER GRID COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510555389.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-15

Smart Images

  • Figure CN120491968A_ABST
    Figure CN120491968A_ABST
Patent Text Reader

Abstract

The invention discloses an application compiling method and a program product. The method comprises the following steps: analyzing source program data of a target application through a static code analysis tool to obtain a plurality of program static resources in the source program data; respectively determining a resource occupation byte of each program static resource, and compressing the program static resources under the condition that the resource occupation byte is greater than or equal to a preset resource threshold value; determining a hardware adaptation configuration file of target equipment of the target application to be deployed, and determining a compiling optimization mode corresponding to the target application according to the hardware adaptation configuration file; and determining a target binary file corresponding to the source program data based on the compressed program static resources and the compiling optimization mode. According to the scheme, the source program data of the target application is compiled and optimized, so that different types of target equipment are adapted, and the performance and stability of the target application running in the target equipment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application technology, and in particular to an application compilation method and program product. Background Art

[0002] With the rapid development of smart grids, power systems are becoming increasingly complex and intelligent. Various small, card-like apps are playing an increasingly important role in grid monitoring, management, and maintenance. Grid applications typically process and display large amounts of real-time grid data, such as power load curves and device status information. This results in poor performance and a poor user experience. Furthermore, slow response or crashes can impact the efficiency and safety of grid operations and maintenance.

[0003] In real-world scenarios, applications often run on a variety of different hardware devices, such as servers in high-performance control centers or mobile devices used by field personnel. Related technologies often encounter different performance issues on different hardware devices, or even prevent deployment on any specific hardware device. Developing separate applications for different hardware devices is time-consuming, costly, and labor-intensive. Summary of the Invention

[0004] The present invention provides an application compilation method and program product to solve technical problems such as different execution effects on different hardware devices, even the inability to deploy to hardware devices and the need to produce multiple applications, resulting in low efficiency and high costs.

[0005] According to one aspect of the present invention, a method for compiling an application is provided, the method comprising:

[0006] Analyze the source program data of the target application using a static code analysis tool to obtain multiple program static resources in the source program data;

[0007] Determine the resource occupancy bytes of each program static resource respectively, and compress the program static resource when the resource occupancy bytes is greater than or equal to a preset resource threshold;

[0008] Determine the hardware adaptation configuration file of the target device for the target application to be deployed, and determine the compilation optimization method corresponding to the target application based on the hardware adaptation configuration file;

[0009] The target binary file corresponding to the source program data is determined based on the compressed program static resources and the compilation optimization method.

[0010] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the application compiling method according to any embodiment of the present invention.

[0011] The technical solution of the embodiment of the present invention is to parse the source program data of the target application through a static code analysis tool to obtain multiple program static resources in the source program data, realize the use of the static code analysis tool to scan and parse the source program data of the target application to obtain the program static resources, and provide data support for subsequent compilation optimization; determine the resource occupied bytes of each program static resource respectively, and compress the program static resources when the resource occupied bytes are greater than or equal to a preset resource threshold, thereby realizing compression of the program static resources, reducing the static resource occupied space, improving the loading speed of the program static resources, and reducing the impact of the program static resources on the runtime of the target application; determine the hardware adaptation profile of the target device of the target application to be deployed, and determine the compilation optimization method corresponding to the target application according to the hardware adaptation profile, thereby realizing that the target application can adapt to different types of target devices and ensure that the target application can run stably on different types of target devices; determine the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, realize compilation optimization of the source program data, so that the target application can run smoothly on the target device, thereby improving the deployment and usage experience of the target application.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A flowchart of an application compilation method provided in Example 1 of the present invention;

[0015] Figure 2 A flowchart of an application compilation method provided in the second embodiment of the present invention;

[0016] Figure 3 A structural diagram of an application compilation device provided in Embodiment 3 of the present invention;

[0017] Figure 4 A schematic structural diagram of an electronic device for implementing an application compilation method provided in a fourth embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0019] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0020] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0021] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0022] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0023] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0024] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0025] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0026] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0027] Example 1

[0028] Figure 1 This is a flowchart of an application compilation method provided in Example 1 of the present invention. This embodiment is applicable to situations where application compilation is optimized. The method can be performed by an application compilation device, which can be implemented in the form of hardware and / or software. Optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.

[0029] like Figure 1 As shown, the method may specifically include:

[0030] S101 , parsing source program data of a target application using a static code analysis tool to obtain a plurality of program static resources in the source program data.

[0031] In an embodiment of the present invention, a static code analysis tool may refer to an application that parses source program data to obtain data such as static resource data, program elements, and corresponding relationships between program elements. A static code analysis tool can analyze source code without running the application code.

[0032] The target application can be a lightweight and modular application that loads quickly and is ready to use. For example, the target application can be a small card-style quick application in the power grid field, used for specific power grid monitoring, management, or maintenance tasks, such as a power load monitoring card, a device fault diagnosis card, or a power grid topology analysis card.

[0033] Source program data may refer to the source code files of the target application and the related dependent library files referenced by the source code. Among them, the related dependent libraries may include but are not limited to at least one of the library files such as the quick application runtime library, the routing management library, the state management library, the network request library, the tool function library, the data storage library, the animation effect library, the chart library, and the multimedia processing library. Among them, the quick application runtime library is used to provide basic application program interfaces and functional support; the interactive interface component library is used to provide components deployed on the interactive interface; the routing management library is used to manage page jumps within the target application; the state management library is used to manage the state of the target application; the network request library is used to send or receive network requests; the tool function library is used to provide tool functions; the data storage library is used for local data storage; the animation effect library is used to achieve complex animation effects; the chart library is used for data visualization; and the multimedia processing library is used for audio and video processing. Program static resources may refer to one-time resources used by the target application program when it is loaded into memory, which will no longer be modified after the program is compiled.

[0034] Specifically, the source program data of the target application may be input into a static code analysis tool, and the source program data of the target application may be scanned and analyzed by the static code analysis tool to extract a plurality of program static resources contained in the source program data.

[0035] As an optional implementation manner of an embodiment of the present invention, after parsing the source program data of the target application through a static code analysis tool, it also includes: obtaining program relationship data of the source program data, determining a first program element to be executed in parallel and a second program element to be executed serially based on the program relationship data; constructing a parallel execution queue based on the first program element, and constructing a serial execution queue based on the second program element and the program relationship data corresponding to the second program element.

[0036] In an embodiment of the present invention, program relationship data may refer to the relationship data between various functions, between various program modules, and between various functions and various program modules in the source program data, which can represent the calling relationship between various functions, the dependency relationship between various program modules, and the various functions in various program modules and their inputs and outputs.

[0037] The first program element may refer to a function or program module in the source program data that can run independently and can run without relying on other functions or program modules. A parallel execution queue may refer to a queue that is constructed for the first program element that can run independently and is executed synchronously in parallel, and the parallel execution queues do not affect each other during the execution process. The second program element may refer to a program module or call relationship function with a dependency relationship in the source program data. A serial execution queue may refer to a queue that is constructed for the second program element with a dependency relationship or a call relationship and is executed sequentially in a serial manner, and the dependent program modules or called functions in the serial execution queue are executed first. Exemplarily, if program module A depends on program module B, then program module A and program module B are in the same serial execution queue, and program module B is compiled before program module A.

[0038] Specifically, when the source program data of the target application is scanned and parsed using a static code analysis tool, the various functions and their inputs and outputs of each program module in the source program data can also be extracted, and the dependencies between the various program modules and the calling relationships between the various functions can be analyzed. Furthermore, based on the dependencies between the program modules and the calling relationships between the functions, the source program data can be divided into a first program element that can run independently and a second program element that has a dependency relationship or a calling relationship. Ultimately, a parallel execution queue for synchronous execution can be constructed for the first program element, and a serial execution queue for sequential execution can be constructed for the second program element based on the program relationship data corresponding to the second program element.

[0039] As an optional implementation manner of an embodiment of the present invention, the first program element includes a target program module and a target function; accordingly, determining the first program element to be executed in parallel based on the program relationship data includes: obtaining the dependency relationship between multiple program modules and the calling relationship between multiple functions with the source program data; constructing a dependency graph corresponding to the source program data with the program modules as nodes and the dependency relationship as edges, and determining the target program module without dependency relationship from multiple program modules based on the dependency graph; constructing a call graph corresponding to the source program data with the functions as nodes and the dependency relationship as edges, and determining the target function without dependency relationship from multiple functions based on the call graph.

[0040] Specifically, a dependency graph can be generated based on the dependency relationships between multiple program modules in the source program data, and a call graph can be generated based on the call relationships between multiple functions in the source program data, and the number of times a function is called can be recorded. Furthermore, a program module in the dependency graph that can be run without relying on other program modules can be used as a target program module, and a function in the call graph that can be run without calling other functions can be used as a target function. Finally, the target program module and the target function can be combined to form the first program element in the source program data.

[0041] S102: Determine the resource occupied bytes of each program static resource respectively, and compress the program static resource when the resource occupied bytes is greater than or equal to a preset resource threshold.

[0042] In an embodiment of the present invention, the resource occupied bytes may refer to the size of the storage space or memory occupied by the program static resources, expressed in bytes. The preset resource threshold may refer to a preset threshold in bytes of the storage space or memory occupied by the program static resources without affecting the use of the program static resources.

[0043] Specifically, the size in bytes of the storage space occupied by each program static resource obtained by the static code analysis tool can be calculated as the resource occupied bytes of each program static resource. By comparing the resource occupied bytes of each program static resource with the corresponding preset resource threshold, the program static resources whose resource occupied bytes are greater than or equal to the preset resource threshold are determined. Furthermore, a corresponding compression method can be selected to compress the program static resources whose resource occupied bytes are greater than or equal to the preset resource threshold until the resource occupied bytes of the program static resource are less than the preset resource threshold.

[0044] Exemplarily, the resource type of the program static resources may include at least one of the resource types such as image resources, audio resources, video resources, and file resources. Furthermore, the resource type and corresponding resource format of the program static resources can be identified by a static code analysis tool, and the corresponding compression format can be selected to compress the program static resources. For example, for image type program static resources, the resource format is PNG or BMP, which can be compressed into JPEG or WebP format to reduce the resource size and maintain the preset image quality; for audio type program static resources, the resource format is WAV, which can be compressed into MP3 or AAC format to reduce storage and loading time; for video type program static resources, they can be compressed into H.264 or H.265 format.

[0045] Optionally, a compression tool to be used is determined from preset compression tools based on the resource type or resource format of the program static resource, and the program static resource is compressed using the compression tool. Specifically, a preset image compression tool may be used for image-type program static resources; a preset audio and video compression tool may be used for audio or video-type program static resources, and further compression may be achieved by adjusting the bit rate after compression; a preset file compression tool may be used for text-type program static resources, and so on.

[0046] As an optional implementation of an embodiment of the present invention, compressing program static resources includes: compressing the program static resources using a preset compression ratio to obtain preliminary compressed resources; adjusting the preset compression ratio when the resource occupation bytes of the preliminary compressed resources are greater than or equal to a preset resource threshold; compressing the program static resources using the adjusted preset compression ratio so that the resource occupation bytes of the compressed program static resources are less than the preset resource threshold.

[0047] Specifically, when the bytes occupied by the static resources of the program are greater than or equal to the preset resource threshold, that is, S≥S threshold , where S represents the bytes occupied by the static resources of the program, S threshold The preset resource threshold of the program static resource can be used to select the corresponding compression format according to the type of the program static resource and determine the preset compression ratio corresponding to the compression format. Then, the program static resource can be compressed according to the preset compression ratio to obtain the compressed preliminary compressed resource and calculate the resource occupied bytes of the preliminary compressed resource, i.e., S compressed =S×C ratio , where S compressed Indicates the resource occupied by the initial compressed resource in bytes, C ratio Indicates the preset compression ratio. Compare the resource occupancy bytes of the initially compressed resources with the preset resource threshold. If the resource occupancy bytes of the initially compressed resources are less than the preset resource threshold, compress the program static resources using the preset compression ratio. If the resource occupancy bytes of the initially compressed resources are greater than or equal to the preset resource threshold, adjust the preset compression ratio, for example, by reducing the preset compression ratio, until the resource occupancy bytes of the compressed program static resources are less than the preset resource threshold. Compress the program static resources using the adjusted preset compression ratio.

[0048] S103: Determine a hardware adaptation configuration file of a target device for the target application to be deployed, and determine a compilation optimization method corresponding to the target application according to the hardware adaptation configuration file.

[0049] In embodiments of the present invention, a target device may be a hardware platform device on which a target application is to be deployed, such as a large-screen display system in a power grid control center or a mobile device used by field personnel. Deploying the target application on the target device can help relevant personnel quickly obtain the required information, improving work efficiency and decision-making accuracy.

[0050] A hardware adaptation profile may refer to a file used to describe or configure the device performance characteristics of a target device, so that the target application can be recognized and loaded into the target device. Device performance characteristics may include, for example, central processing unit (CPU) architecture, memory size, or graphics processing unit (GPU) characteristics. A compilation optimization method may refer to the optimization method used by the target device when compiling a target application, to improve program efficiency and performance, such as selecting compilation optimization parameters or using compilation optimization tools.

[0051] Specifically, the target device's performance characteristics can be obtained and a hardware adaptation profile for the target device can be created based on the device's performance characteristics. Furthermore, the target device's compilation optimization method for the target application can be determined based on the device's performance characteristics recorded in the hardware adaptation profile. For example, the compilation optimization method for the target application can be determined based on the CPU architecture, memory size, and GPU characteristics recorded in the hardware adaptation profile.

[0052] For example, the compilation optimization method can be determined based on the CPU architecture recorded in the hardware adaptation configuration file. For example, when the CPU is configured on a mobile device, "-mcpu" or "-mtune" is used to optimize the specific CPU; when the CPU is configured on a device that supports vectorization, "-ftree-vectorize" is used to use Single Instruction Multiple Data (SIMD) for parallel computing to enable vectorization to improve computing performance, thereby utilizing the CPU's vector instruction set to accelerate computing; select the corresponding compilation parameters according to the CPU architecture so that the compiled optimized code can adapt to the CPU characteristics.

[0053] For example, the compilation optimization method can be determined based on the memory size recorded in the hardware adaptation configuration file. For example, when the device memory is less than the preset memory value, "-Os" is used to optimize code size, or "-flto" is used to eliminate redundant code during the linking phase; when the device memory is greater than or equal to the preset memory value, "-O2" or "-O3" is used for performance optimization.

[0054] For example, the compilation optimization method can be determined based on the GPU characteristics recorded in the hardware adaptation configuration file. For example, a device that supports GPU computing can select supported GPU compilation parameters; a device that supports GPU acceleration can use "-lOpenCL" or "-lcuda" to enable GPU acceleration.

[0055] S104: Determine a target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method.

[0056] In an embodiment of the present invention, the target binary file may refer to a file that stores compressed program static resources and source program data in binary form, and is used to store resources such as complex data structures and program codes.

[0057] Specifically, the compressed program static resources and source program data can be compiled and optimized to generate the corresponding target binary file. For example, the target binary file can be generated by selecting compilation parameters for CPU, memory, and GPU and corresponding compilation tools.

[0058] For example, CPU architecture optimization, memory performance optimization, vectorization optimization, and link-time optimization are enabled through "gcc -mcpu=cortex-a72-O3-ftree-vectorize-flto-ooptimized_binary source.c; -mcpu=cortex-a72" to reduce code redundancy and generate a target binary file.

[0059] As an optional implementation manner of an embodiment of the present invention, a target binary file corresponding to the source program data is determined based on the compressed program static resources and compilation optimization method, including: determining the target compilation task to be executed according to the parallel execution queue and the serial execution queue, and compiling the target compilation task based on the compressed program static resources and compilation optimization method to obtain the target binary file corresponding to the source program data.

[0060] In an embodiment of the present invention, a target compilation task may refer to a compilation task that converts source program data into a binary file. The target compilation task may include: a task that compiles a parallel execution queue of a first program element in the source program data, and a task that compiles a serial execution queue of a second program element in the source program data.

[0061] Specifically, a compilation task converted into a binary file can be created for the parallel execution queue and the serial execution queue as a target compilation task. Furthermore, the target compilation task can be compiled based on the compilation optimization method and the compressed program static resources, and the compiled binary file can be used as the target binary file corresponding to the source program data.

[0062] For example, for a first program element in an independently compilable parallel execution queue, the computational requirements of the first program element can be determined based on the program complexity and file size of the first program element. Furthermore, the resources or threads allocated to the first program element can be determined based on the computational requirements of the first program element, and a target compilation task corresponding to the parallel execution queue can be generated to improve compilation efficiency and reduce compilation time. For example, a first program element whose computational requirements are less than a preset threshold can be assigned to an idle thread.

[0063] The technical solution of the embodiment of the present invention is to parse the source program data of the target application through a static code analysis tool to obtain multiple program static resources in the source program data, realize the use of the static code analysis tool to scan and parse the source program data of the target application to obtain the program static resources, and provide data support for subsequent compilation optimization; determine the resource occupied bytes of each program static resource respectively, and compress the program static resources when the resource occupied bytes are greater than or equal to a preset resource threshold, thereby realizing compression of the program static resources, reducing the static resource occupied space, improving the loading speed of the program static resources, and reducing the impact of the program static resources on the runtime of the target application; determine the hardware adaptation profile of the target device of the target application to be deployed, and determine the compilation optimization method corresponding to the target application according to the hardware adaptation profile, thereby realizing that the target application can adapt to different types of target devices and ensure that the target application can run stably on different types of target devices; determine the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, realize compilation optimization of the source program data, so that the target application can run smoothly on the target device, thereby improving the deployment and usage experience of the target application.

[0064] Example 2

[0065] Figure 2 This is a flowchart of an application compilation method provided in Example 2 of the present invention. The technical solution of this embodiment further refines the process of determining the hardware adaptation configuration file for the target device to be deployed with the target application in the aforementioned embodiment. For specific implementation methods, please refer to the description of this embodiment. Technical features that are identical or similar to those in the aforementioned embodiment are not repeated here.

[0066] like Figure 2 As shown, the method may specifically include:

[0067] S201: Analyze source program data of a target application using a static code analysis tool to obtain a plurality of program static resources in the source program data.

[0068] S202: Determine the resource occupied bytes of each program static resource respectively, and compress the program static resource when the resource occupied bytes is greater than or equal to a preset resource threshold.

[0069] S203: Determine performance limitation information of a target component of a target device of a target application to be deployed, and generate a hardware adaptation configuration file according to the performance limitation information, wherein the target component includes at least one of a central processing unit, a memory, and a graphics processing unit.

[0070] Specifically, the performance bottleneck of the CPU, memory, or GPU can be used as the performance bottleneck of the target component. Based on the performance bottleneck of the target component, performance limitation information of the target component can be determined. The performance limitation information indicates whether the target component has reached a performance bottleneck. Furthermore, based on the performance limitation information of the target component, an optimized configuration of the target component can be determined, and a hardware adaptation profile can be generated based on the optimized configuration of the target component.

[0071] For example, for the performance bottleneck of the central processing unit, computing-intensive tasks can be assigned to multi-core parallel processing, or tasks can be assigned according to the main frequency to avoid overloading of a single core, or tasks can be split and calculated in parallel to achieve load balancing, or the dependency between tasks can be reduced and the degree of parallelization can be increased to improve task parallelism; for the performance bottleneck of memory, data access patterns can be optimized to reduce unnecessary memory access, or cache optimization can be used to optimize the memory access order, or technologies such as data segmentation, memory pooling, and delayed loading can be adopted; for the performance bottleneck of the graphics processor, if the graphics processor resources are sufficient and the application is suitable for parallel computing, the graphics processor accelerated computing resources are enabled, or the graphics processor task allocation, memory management, and parallel computing scheduling are optimized. If the graphics processor resources are insufficient, the central processing unit or heterogeneous computing resources are used instead.

[0072] Exemplarily, when the target component includes a central processing unit, the hardware adaptation profile includes the optimized configuration of the central processing unit, i.e., whether multi-threading is enabled, task allocation strategy, and core usage allocation; when the target component includes memory, the hardware adaptation profile includes the optimized configuration of the memory, i.e., memory pool configuration, cache management strategy, and data access optimization; when the target component includes a graphics processor, the hardware adaptation profile includes the optimized configuration of the graphics processor, i.e., graphics processor memory allocation, number of parallel tasks, and data transmission optimization.

[0073] As an optional implementation manner of an embodiment of the present invention, the target component includes a central processing unit; the performance limitation information includes a task processing limitation; accordingly, determining the performance limitation information of the target component of the target device of the target application to be deployed includes: determining the task processing limitation of the central processing unit based on the number of cores, the main frequency and the amount of tasks to be processed of the central processing unit of the target device of the target application to be deployed.

[0074] Specifically, information about the CPU may include the number of CPU cores, CPU frequency, and CPU architecture. Task processing limitations may refer to the performance bottleneck of the CPU when processing tasks relative to the workload. Furthermore, when the target component includes a CPU, the performance limitation information includes the CPU's task processing limitations, which are determined based on the number of CPU cores, frequency, and workload.

[0075] For example, the task processing requirements of the CPU can be calculated in the following way:

[0076]

[0077] Among them, T cpu Indicates the task processing requirements of the central processor; N tasks Indicates the amount of tasks to be processed; C cpu Indicates the number of cores of the central processing unit; F cpu Indicates the CPU's main frequency. Furthermore, when the CPU's task processing requirements exceed its computing power, it indicates a CPU performance bottleneck.

[0078] As an optional implementation manner of an embodiment of the present invention, the target component includes memory; the performance limitation information includes memory access limitation; accordingly, determining the performance limitation information of the target component of the target device of the target application to be deployed includes: determining the memory access limitation of the memory based on the bandwidth of the memory of the target device of the target application to be deployed and the amount of data to be processed by the target application.

[0079] Specifically, the memory information may include: total memory capacity, memory bandwidth, and memory latency. Memory access limitations may refer to the performance bottleneck of memory bandwidth for data access. Furthermore, when the target component includes memory, the performance limitation information includes memory access limitations, which are determined based on the memory bandwidth and the amount of data to be processed by the target application.

[0080] For example, the memory access requirements can be calculated as follows:

[0081]

[0082] Among them, T mem Indicates the memory access requirements of the memory; N data Indicates the amount of data to be processed; B mem Indicates the memory bandwidth. Furthermore, when the memory access demand is greater than the memory bandwidth limit, it indicates that a memory bandwidth performance bottleneck has occurred.

[0083] As an optional implementation manner of an embodiment of the present invention, the target component includes a graphics processor; the performance limitation information includes a processing time limit; accordingly, determining the performance limitation information of the target component of the target device to be deployed with the target application includes: determining the processing time limit of the compilation task corresponding to the graphics processor based on the number of computing units, the main frequency, and the number of tasks to be processed in parallel of the target device to be deployed with the target application.

[0084] Specifically, information about a graphics processor may include: GPU model, number of GPU compute units, GPU memory, and GPU main frequency. The processing time limit may refer to the performance bottleneck of the GPU when processing parallel tasks. Furthermore, when the target component includes a graphics processor, the performance limit information includes the processing time limit of the graphics processor, which is determined based on the number of compute units and main frequency of the graphics processor, as well as the number of tasks to be processed in parallel.

[0085] For example, the task processing time of the graphics processor can be calculated in the following way:

[0086]

[0087] Among them, T GPU Indicates the task processing time of the graphics processor; N tasks ′ represents the number of tasks to be processed in parallel; C GPU Indicates the number of computing units of the graphics processor; F GPU Indicates the main frequency of the graphics processor. Furthermore, when the task processing time of the graphics processor exceeds the preset processing time threshold, it indicates that the graphics processor has a performance bottleneck.

[0088] S204: Determine a compilation optimization method corresponding to the target application according to the hardware adaptation configuration file.

[0089] S205: Determine a target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method.

[0090] As an optional implementation manner of an embodiment of the present invention, after determining the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, it also includes: determining the resource type, resource usage frequency and hardware adaptation factor of the target device of the target application to be deployed corresponding to the program static resources, and determining the resource weight of the program static resources according to the resource type; performing weighted summation on the resource occupied bytes, resource weight, resource usage frequency and hardware adaptation factor of the program static resources to obtain the loading priority of the program static resources, so as to load the program static resources to the target device based on the loading priority.

[0091] In an embodiment of the present invention, resource usage frequency may refer to the number of times a program static resource is used within a preset time range. The hardware adaptation factor may refer to a quantitative representation of the ability of a hardware device to load program static resources when the program static resources are loaded into the hardware device. A higher hardware adaptation factor indicates better performance in loading program static resources. Resource weight may refer to a weight value pre-set for program static resources, which is used to preliminarily determine the loading order of program static resources. For example, resource weights may be set for program static resources using a priority allocation algorithm.

[0092] Specifically, the loading order of program static resources into the target device can be determined by the loading priority of the program static resources, and the program static resources can be loaded into the target device in sequence according to the loading order. For example, program static resources that must be loaded at startup are defined as the first priority and loaded in serial mode to avoid delays caused by parallel loading, so as to ensure that they are processed first during the loading process; program static resources used during operation are defined as the second priority and can adopt a lazy loading strategy to load them when they are used; program static resources that are delayed in loading are defined as the third priority and can be loaded asynchronously in the background without blocking the main thread.

[0093] For example, the loading priority of a program's static resources can be calculated in the following way:

[0094]

[0095] Among them, P i Indicates the loading priority of the static resource of the i-th program; S i Indicates the bytes occupied by the static resources of the i-th program; T i Indicates the resource weight of the static resource of the i-th program, ranging from 0 to 1; U i Indicates the resource usage frequency of the static resources of the i-th program; H i represents the hardware adaptation factor of the static resource of the i-th program; α, β, γ, δ represent resource weights, and satisfy α+β+γ+δ=1.

[0096] For example, the loading priority of the program's static resources can be combined with the hardware adaptation priority to dynamically adjust the resource loading strategy to ensure that the target application runs smoothly on different target devices. For example, for the CPU and memory resources of the target device, by analyzing the CPU processing power and memory size, ensure that the loading of the program's static resources does not exceed the target device's carrying capacity. If the target device's hardware resources are limited, a parallel loading method can be used. For the GPU resources of the target device, if the target device has a GPU, the program's static resources of image or video types can be pushed to the GPU for accelerated loading.

[0097] For example, the hardware adaptation priority of the target device can be adjusted in the following ways:

[0098] W′ i =W i ×g(H i , A i ),

[0099] Among them, W′ i Indicates the hardware adaptation priority of the target device after adjustment; H i Indicates the hardware adaptation factor of the program's static resources; A i Indicates the performance limitations of the target device, such as memory, CPU, or GPU performance; W i Indicates the hardware adaptation priority of the target device before adjustment.

[0100] For example, the static resources of the program can be loaded in a serial or parallel manner. The total time of the serial loading can be calculated as follows:

[0101] T total =max(∑ i∈P T i ),

[0102] Among them, T total Indicates the total serial loading time; T i represents the time to load the static resource of the i-th program; P represents the number of static resources of the program. The total time of parallel loading can be calculated as follows:

[0103]

[0104] Among them, T total represents the total parallel loading time; T i It represents the time of loading the static resources of the i-th program; P represents the number of static resources of the program, and n represents the number of parallel threads.

[0105] As an optional implementation manner of an embodiment of the present invention, after determining the target binary file corresponding to the source program data based on the compressed program static resources and compilation optimization method, it also includes: determining the target execution path of the target binary file based on the target binary file, the hardware adaptation configuration file and the hardware environment of the target device.

[0106] In an embodiment of the present invention, the hardware environment of the target device may refer to the hardware load of the target device, which may be represented by hardware utilization. The hardware environment of the target device may include the load of the CPU, memory, and GPU of the target device. For example, the CPU load may be calculated as follows:

[0107]

[0108] Among them, C cpu Indicates the CPU load; U cpu Indicates the CPU usage; N cpu Indicates the total number of CPU cores. Memory usage can be calculated as follows:

[0109]

[0110] Among them, M mem Indicates memory usage; U mem Indicates memory usage; T mem Indicates the total amount of memory. The GPU load can be calculated as follows:

[0111]

[0112] Among them, C GPU Indicates the GPU load; U GPU Indicates the GPU usage; N GPU Indicates the total computing power of the GPU. The target execution path can refer to the execution process of the target device loading the target binary file.

[0113] Specifically, the target device's hardware environment can be used to identify the performance bottlenecks of the hardware characteristics recorded in the hardware adaptation profile, thereby determining the target execution path for the target binary file. For example, for CPU-intensive tasks, a multi-threaded parallel execution path can be selected to fully utilize the multi-core CPU; for graphics rendering tasks, a GPU acceleration path can be selected to reduce the CPU burden; and for memory bottlenecks, execution paths that reduce memory usage can be prioritized, such as selecting low-memory algorithms or delaying the loading of resources.

[0114] For example, the target execution path of the target binary file can be calculated in the following way:

[0115] S exec =f(C cpu , M mem , C GPU ),

[0116] Among them, S exeG Represents the target execution path of the target binary file; f represents the selection function of the target execution path.

[0117] Exemplary execution methods for the target binary file may include: multi-core CPU scheduling, GPU scheduling, GPU acceleration scheduling, and performance optimization. Multi-core CPU scheduling is used to determine the number of parallel threads based on load conditions; GPU scheduling is used to undertake computing tasks such as image processing or image rendering. CPU scheduling can be calculated in the following ways:

[0118]

[0119] Among them, N threads (t) represents the number of threads at time t; C cpu (t) represents the CPU load at time t; threshold represents the preset CPU load threshold. When the threshold is exceeded, the number of threads is reduced. GPU acceleration scheduling can be calculated as follows:

[0120]

[0121] Among them, T GPU (t) represents the GPU acceleration task at time t; threshold′ represents the preset GPU load threshold. When the threshold is exceeded, the CPU is used to process the task. Performance optimization can be calculated as follows:

[0122] T total (t) = T exec (t)+T load (t),

[0123] Among them, T total (t) represents the total execution time; T exec (t) represents the running time of the execution path; T load (t) represents the loading time; by adjusting T exec (t) and T load The value of (t) can be used to optimize performance. For example, by reducing T load (t) can gain more execution time for computing tasks.

[0124] The technical solution of the embodiment of the present invention is to parse the source program data of the target application through a static code analysis tool to obtain multiple program static resources in the source program data, realize the use of the static code analysis tool to scan and parse the source program data of the target application to obtain program static resources, and provide data support for subsequent compilation optimization; respectively determine the resource occupied bytes of each program static resource, and compress the program static resources when the resource occupied bytes are greater than or equal to a preset resource threshold, thereby realizing the compression of program static resources, reducing the static resource occupied space, improving the loading speed of program static resources, and reducing the impact of program static resources on the runtime of the target application; determine the performance limitation information of the target component of the target device to be deployed with the target application According to the information, a hardware adaptation profile is generated according to the performance limitation information, wherein the target component includes at least one of a central processing unit, a memory and a graphics processor; according to the hardware adaptation profile, a compilation optimization method corresponding to the target application is determined, and a hardware adaptation profile of the target device is generated according to the performance limitation information of the target component, so that the target application can be more adapted to different types of target devices, and the stability of the target application running on different types of target devices is further improved; based on the compressed program static resources and the compilation optimization method, a target binary file corresponding to the source program data is determined, and compilation optimization of the source program data is realized, so that the target application can run smoothly on the target device, thereby improving the deployment and usage experience of the target application.

[0125] Example 3

[0126] Figure 3 This is a structural diagram of an application compilation device provided in the third embodiment of the present invention. This embodiment is applicable to the case of optimizing application compilation, and the application compilation device can be implemented in the form of hardware and / or software. Figure 3 As shown, the application compilation device may specifically include: a program static resource acquisition module 301, a first determination module 302, a second determination module 303, and a third determination module 304. The program static resource acquisition module 301 is used to parse the source program data of the target application using a static code analysis tool to obtain multiple program static resources in the source program data; the first determination module 302 is used to respectively determine the resource occupied bytes of each program static resource, and compress the program static resources when the resource occupied bytes are greater than or equal to a preset resource threshold; the second determination module 303 is used to determine the hardware adaptation profile of the target device to which the target application is to be deployed, and determine the compilation optimization method corresponding to the target application based on the hardware adaptation profile; and the third determination module 304 is used to determine the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method.

[0127] The technical solution of the embodiment of the present invention is as follows: according to the program static resource acquisition module 301, the source program data of the target application is parsed by a static code analysis tool to obtain multiple program static resources in the source program data, thereby realizing the use of the static code analysis tool to scan and parse the source program data of the target application to obtain the program static resources, and providing data support for subsequent compilation optimization; the first determination module 302 determines the resource occupied bytes of each program static resource respectively, and when the resource occupied bytes are greater than or equal to a preset resource threshold, compresses the program static resources, thereby realizing compression of the program static resources, reducing the static resource occupied space, improving the loading speed of the program static resources, and reducing the impact of the program static resources on the runtime of the target application; the second determination module 303 determines the hardware adaptation profile of the target device to be deployed on the target application, and determines the compilation optimization method corresponding to the target application based on the hardware adaptation profile, thereby realizing that the target application can adapt to different types of target devices and ensure that the target application can run stably on different types of target devices; the third determination module 304 determines the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, thereby realizing compilation optimization of the source program data, enabling the target application to run smoothly on the target device, thereby improving the deployment and usage experience of the target application.

[0128] Based on any of the above optional technical solutions, the second determination module 303 optionally includes a hardware adaptation profile generation unit. The hardware adaptation profile generation unit is configured to determine performance limitation information of a target component of a target device for deploying the target application, and generate a hardware adaptation profile based on the performance limitation information, wherein the target component includes at least one of a central processing unit, a memory, and a graphics processing unit.

[0129] Based on any of the above optional technical solutions, optionally, the target component includes a central processing unit; the performance limitation information includes a task processing limitation; accordingly, the hardware adaptation profile generation unit is used to determine the task processing limitation of the central processing unit based on the number of cores, main frequency and amount of tasks to be processed of the central processing unit of the target device to which the target application is to be deployed.

[0130] Based on any of the above optional technical solutions, optionally, the target component includes memory; the performance limitation information includes memory access limitation; accordingly, the hardware adaptation profile generation unit is used to determine the memory access limitation of the memory based on the memory bandwidth of the target device of the target application to be deployed and the amount of data to be processed by the target application.

[0131] Based on any of the above optional technical solutions, optionally, the target component includes a graphics processor; the performance limitation information includes a processing time limit; accordingly, the hardware adaptation profile generation unit is used to determine the processing time limit of the compilation task corresponding to the graphics processor based on the number of computing units, the main frequency, and the number of tasks to be processed in parallel of the target device of the target application to be deployed.

[0132] Based on any of the above optional technical solutions, the application compilation device optionally further includes: a program element determination unit and an execution queue construction unit. The program element determination unit is used to obtain the program relationship data of the source program data after parsing the source program data of the target application through a static code analysis tool, and determine the first program element to be executed in parallel and the second program element to be executed serially based on the program relationship data; the execution queue construction unit is used to construct a parallel execution queue based on the first program element, and to construct a serial execution queue based on the second program element and the program relationship data corresponding to the second program element; accordingly, the third determination module 304 is used to determine the target compilation task to be executed based on the parallel execution queue and the serial execution queue, and compile the target compilation task based on the compressed program static resources and the compilation optimization method to obtain a target binary file corresponding to the source program data.

[0133] Based on any of the above optional technical solutions, optionally, the first program element includes a target program module and a target function; accordingly, the program element determination unit includes: a call relationship acquisition subunit, a target program module determination subunit, and a target function determination subunit. Among them, the call relationship acquisition subunit is used to obtain the dependency relationship between multiple program modules and the call relationship between multiple functions with the source program data; the target program module determination subunit is used to construct a dependency graph corresponding to the source program data with program modules as nodes and dependency relationships as edges, and determine the target program module without dependency relationship from multiple program modules based on the dependency graph; the target function determination subunit is used to construct a call graph corresponding to the source program data with functions as nodes and dependency relationships as edges, and determine the target function without dependency relationship from multiple functions based on the call graph.

[0134] On the basis of any of the above optional technical solutions, the application compilation device may optionally further include: a resource weight determination module and a loading priority determination module. The resource weight determination module is used to determine the resource type, resource usage frequency and hardware adaptation factor of the target device of the target application to be deployed corresponding to the program static resources after determining the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, and determine the resource weight of the program static resources according to the resource type; the loading priority determination module is used to perform weighted summation of the resource occupied bytes, resource weight, resource usage frequency and hardware adaptation factor of the program static resources to obtain the loading priority of the program static resources, so as to load the program static resources to the target device based on the loading priority.

[0135] Based on any of the above optional technical solutions, the application compilation device may optionally further include a target execution path determination module. The target execution path determination module is configured to, after determining a target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, determine a target execution path for the target binary file based on the target binary file, a hardware adaptation configuration file, and a hardware environment of the target device.

[0136] The application compilation device provided in the embodiment of the present invention can execute the application compilation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0137] Example 4

[0138] Figure 4 A structural diagram of an electronic device for implementing an application compilation method provided in Example 4 of the present invention. The electronic 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 electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0139] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0140] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0141] The processor 11 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the application compilation method.

[0142] In some embodiments, the application compilation 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 electronic 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 application compilation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the application compilation method in any other appropriate manner (e.g., via firmware).

[0143] Various embodiments of the systems and techniques described 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), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] Computer programs for implementing 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 the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0145] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

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

[0147] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0148] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0149] An embodiment of the present invention also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, the technical solution of applying the compilation method in the above embodiment can be implemented.

[0150] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0151] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. An application compilation method, characterized in that: include: Parsing the source program data of the target application using a static code analysis tool to obtain a plurality of program static resources in the source program data; respectively determining the resource occupied bytes of each of the program static resources, and compressing the program static resources when the resource occupied bytes is greater than or equal to a preset resource threshold; Determining a hardware adaptation configuration file of a target device on which the target application is to be deployed, and determining a compilation optimization method corresponding to the target application based on the hardware adaptation configuration file; A target binary file corresponding to the source program data is determined based on the compressed program static resources and the compilation optimization method.

2. The application compilation method according to claim 1, characterized in that: Determining a hardware adaptation configuration file of a target device on which the target application is to be deployed includes: Determine performance limitation information of a target component of a target device on which the target application is to be deployed, and generate a hardware adaptation configuration file according to the performance limitation information, wherein the target component includes at least one of a central processing unit, a memory, and a graphics processing unit.

3. The application compilation method according to claim 2, characterized in that: The target component includes a central processing unit; the performance limitation information includes task processing limitations; and the performance limitation information of the target component of the target device to be deployed with the target application is determined, including: The task processing limit of the central processing unit is determined according to the number of cores, the main frequency and the amount of tasks to be processed of the central processing unit of the target device on which the target application is to be deployed.

4. The application compilation method according to claim 2, characterized in that: The target component includes a memory; the performance limitation information includes a memory access limitation; and the performance limitation information of the target component of the target device to which the target application is to be deployed is determined, including: The memory access restriction of the memory is determined according to the bandwidth of the memory of the target device on which the target application is to be deployed and the amount of data to be processed by the target application.

5. The application compilation method according to claim 2, characterized in that: The target component includes a graphics processor; the performance limitation information includes a processing time limit; and determining the performance limitation information of the target component of the target device to which the target application is to be deployed includes: The processing time limit of the compilation task corresponding to the graphics processor is determined according to the number of computing units and the main frequency of the target device to which the target application is to be deployed and the number of tasks to be processed in parallel.

6. The application compilation method according to claim 1, characterized in that: After parsing the source program data of the target application using the static code analysis tool, the method further includes: Obtaining program relationship data of the source program data, and determining a first program element to be executed in parallel and a second program element to be executed serially according to the program relationship data; Building a parallel execution queue based on the first program element, and building a serial execution queue based on the second program element and the program relationship data corresponding to the second program element; The determining of a target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method includes: A target compilation task to be executed is determined according to the parallel execution queue and the serial execution queue, and the target compilation task is compiled using the compressed program static resources and the compilation optimization method to obtain a target binary file corresponding to the source program data.

7. The application compilation method according to claim 6, characterized in that: The first program element includes the target program module and the target function; and determining the first program element to be executed in parallel according to the program relationship data includes: Obtaining dependency relationships between multiple program modules and calling relationships between multiple functions of the source program data; Constructing a dependency graph corresponding to the source program data using the program modules as nodes and the dependency relationships as edges, and determining a target program module that does not have the dependency relationship from a plurality of the program modules based on the dependency graph; A call graph corresponding to the source program data is constructed with the functions as nodes and the dependency relationships as edges, and a target function without the dependency relationship is determined from the plurality of functions based on the call graph.

8. The application compilation method according to claim 1, wherein: After determining the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, the method further includes: Determining the resource type, resource usage frequency, and hardware adaptation factor of the target device on which the target application is to be deployed corresponding to the program static resource, and determining the resource weight of the program static resource according to the resource type; The resource occupied bytes, the resource weight, the resource usage frequency and the hardware adaptation factor of the program static resource are weightedly summed to obtain the loading priority of the program static resource, so as to load the program static resource to the target device based on the loading priority.

9. The application compilation method according to claim 1, characterized in that: After determining the target binary file corresponding to the source program data based on the compressed program static resources and the compilation optimization method, the method further includes: A target execution path of the target binary file is determined based on the target binary file, the hardware adaptation configuration file, and the hardware environment of the target device.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the application compilation method according to any one of claims 1 to 9.