Search

CN-117707544-B - Platform for compiling program and method for compiling program

CN117707544BCN 117707544 BCN117707544 BCN 117707544BCN-117707544-B

Abstract

The present disclosure provides a platform for compiling a program and a method for compiling an application program, and relates to the field of computer technology. The platform of the compiling program comprises an environment module, a core module and a packaging container module, wherein the environment module is used for setting a platform software system version and a platform compiling environment version according to compiling instructions and first configuration information to complete platform environment construction, the core module is used for caching the platform program, acquiring the platform program from a first target server according to second configuration information under the condition that the platform program is not stored in a local cache, and further used for executing compiling operation on the platform program to obtain a first target program, and the packaging container module is used for performing program verification and output on the first target program. According to the scheme of the disclosure, the platform environment of the corresponding version can be built adaptively based on the compiling instruction, the program to be compiled can be cached, the cached program can be obtained from any server, verification of the compiling program can be achieved, and physical limitation of software and hardware isolation is broken.

Inventors

  • TAO RONG
  • HUANG KAI

Assignees

  • 大陆软件系统开发中心(重庆)有限公司

Dates

Publication Date
20260508
Application Date
20231213

Claims (8)

  1. 1. The device for compiling the program comprises an environment module, a core module, a packaging container module and a customizing module; the customization module is used for executing compiling operation on the customization program to obtain a second target program; the environment module includes: The first configuration management sub-module is used for finding out an adapted environment entry package configuration file from first configuration information according to second version information of a compiling instruction, wherein the first configuration information is a single-compiling environment configuration set associated with the environment module, and a plurality of groups of environment entry package configuration files are stored in the single-compiling environment configuration set; the environment detection sub-module is used for acquiring a platform software system file corresponding to a platform software system version and software required by a platform compiling environment version from a cache management unit of a download management sub-module of the core module by utilizing a self download port unit, acquiring the software adapted to the environment module, the core module and the packaging container module and the compiling instruction according to a server address in an environment entry package configuration file under the condition that the platform software system file corresponding to the platform software system version and the software required by the platform compiling environment version do not exist in a cache, acquiring corresponding patches by combining the self patch management unit, and updating the environment module, the core module and the packaging container module to the software version adapted to the compiling instruction based on the patches and the software so as to complete the construction of the platform environment; The core module includes: The download management sub-module comprises a cache management unit and a file management unit, wherein the cache management unit is used for caching a platform program, the customized program, the platform software system file corresponding to the platform software system version and software required by the platform compiling environment version; The second configuration management sub-module is used for acquiring the platform program from a first target server according to second configuration information when the platform program is not stored in a local cache or the cached platform program is inconsistent with a basic version of the platform program required to be written in the compiling instruction, wherein the first target server is a proprietary server of the platform or a proprietary server of a target client, and the second target server is a proprietary server of the platform or a proprietary server of the target client; The compiling management sub-module is used for compiling the platform program through a platform single compiling unit to obtain a first target program, and compiling the customized program through a customized single compiling module of the customized module to obtain a second target program; Wherein the core module is further configured to cache the custom program and obtain the custom program from the second target server according to third configuration information if the custom program is not stored in the local cache, and And the packaging container module is used for performing program verification and output on the first target program and the second target program.
  2. 2. The apparatus of claim 1, wherein the packaging container module is further configured to, if it is determined that the first target program needs to utilize a first dependent program, generate a first application program according to the first dependent program and the first target program, and perform program verification and output on the first application program; wherein the first dependent program comprises a platform program associated with the core module and/or a non-platform program.
  3. 3. The apparatus of claim 1, wherein the packaging container module is further configured to, if it is determined that the second target program needs to utilize a second dependent program, generate a second application program according to the second dependent program and the second target program, and perform program verification and output on the second application program; wherein the second dependent program comprises a platform program associated with the core module and/or a non-platform program.
  4. 4. A method of compiling a program, applied to a device of compiling a program, comprising: The customization module executes compiling operation on the customization program to obtain a second target program; The environment module finds an adapted environment entry package configuration file from the first configuration information according to the second version information of the compiling instruction, acquires a platform software system file corresponding to the platform software system version and software required by the platform compiling environment version from a cache management unit of a download management sub-module of the core module by utilizing a self download port unit, acquires a server address in an environment entry package configuration file according to the server address in the environment entry package configuration file under the condition that the platform software system file corresponding to the required platform software system version and the software required by the platform compiling environment version do not exist in the cache, acquires the software adapted by the environment module, the core module and the packaging container module and the compiling instruction, acquires corresponding patches by combining the self patch management unit, updates the environment module, the core module and the packaging container module to the software version adapted by the compiling instruction based on the patches and the software, and completes the platform environment construction, wherein the first configuration information is a single compiling environment configuration set associated with the environment module, and the single compiling environment configuration set stores a plurality of groups of environment entry package configuration files The core module determines that the platform program needs to be compiled according to the compiling instruction, obtains the platform program from a first target server according to second configuration information when the platform program is not stored in a local cache or the base version of the platform program which is not required to be compiled in the compiling instruction is inconsistent with the base version of the platform program which is required to be compiled in the local cache, obtains the customized program from a second target server according to third configuration information when the customized program is not stored in the local cache, compiles the platform program through a platform single compiling unit to obtain a first target program, compiles the customized program through a customized single compiling module of the customized module to obtain the second target program, wherein the first target server is a proprietary server of the platform or a proprietary server of a target client, and the second target server is a proprietary server of the platform or a proprietary server of the target client, and And the packaging container module performs program verification and output on the first target program and the second target program.
  5. 5. The method of claim 4, wherein program verifying and outputting the first target program comprises: Acquiring a first dependent program under the condition that the first target program is determined to need to utilize the first dependent program; generating a first application program according to the first dependent program and the first target program; program verification and output are carried out on the first application program; wherein the first dependent program comprises a platform program associated with the core module and/or a non-platform program.
  6. 6. The method of claim 4, wherein program verifying and outputting the second target program comprises: acquiring a second dependent program under the condition that the second target program is determined to need to utilize the second dependent program; Generating a second application program according to the second dependent program and the second target program; Program verification and output are carried out on the second application program; wherein the second dependent program comprises a platform program associated with the core module and/or a non-platform program.
  7. 7. An electronic device, comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 4 to 6.
  8. 8. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 4 to 6.

Description

Platform for compiling program and method for compiling program Technical Field The present disclosure relates to the field of computer technology, and in particular, to a platform for a compiler and a method for compiling a program. Background In order to integrate more application programs in each domain controller system of a vehicle, a software system is usually built by combining a Linux (operating system kernel) scheme with an Adaptive auto sar (Adaptive Automotive Open System Architecture, adaptive automobile open system architecture) scheme. The C/c++ (C plus plus, computer programming language) based development project builds applications through compilable packages and a platform for package management (package manager). Disclosure of Invention The present disclosure provides a platform for a compiler and a method for a compiler to solve or alleviate one or more of the technical problems of the prior art. In a first aspect, the present disclosure provides a platform for a compiler, including an environment module, a core module, and a packaging container module; the environment module is used for setting a platform software system version and a platform compiling environment version according to the compiling instruction and the first configuration information so as to complete the construction of the platform environment; the core module is used for caching the platform program, acquiring the platform program from the first target server according to the second configuration information under the condition that the platform program is not stored in the local cache, and executing compiling operation on the platform program to obtain the first target program, and And the packaging container module is used for performing program verification and output on the first target program. In a second aspect, the present disclosure provides a method for compiling a program, applied to a platform of the compiler, including: Setting a platform software system version and a platform compiling environment version according to the compiling instruction and the first configuration information so as to complete the construction of a platform environment; Under the condition that the platform program is determined to be compiled according to the compiling instruction and is not stored in the local cache, acquiring the platform program from the first target server according to the second configuration information; performing compiling operation on the platform program to obtain a first target program, and Program verification and output are carried out on the first target program. In a third aspect, an electronic device is provided, comprising: At least one processor. And A memory communicatively coupled to the at least one processor. Wherein, the The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the embodiments of the present disclosure. In a fourth aspect, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are for causing the computer to perform a method according to any of the embodiments of the present disclosure. According to the scheme of the disclosure, the platform environment of the corresponding version can be built adaptively based on the compiling instruction, the program to be compiled can be cached, the cached program can be obtained from any server, verification of the compiling program can be achieved, and physical limitation of software and hardware isolation is broken. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings In the drawings, the same reference numerals refer to the same or similar parts or elements throughout the several views unless otherwise specified. The figures are not necessarily drawn to scale. It is appreciated that these drawings depict only some embodiments provided according to the disclosure and are not to be considered limiting of its scope. Fig. 1 is a block diagram of a platform of a compiler according to an embodiment of the present disclosure. Fig. 2 is a block diagram of a platform of a compiler according to an embodiment of the present disclosure. Fig. 3 is an application schematic of a platform of a compiler according to an embodiment of the present disclosure. Fig. 4 is a flow diagram of a method of compiling a program according to an embodiment of the disclosure. Fig. 5 is a block diagram of an electronic device used to implement a method of compiling a program according to an embodiment of the disclosure. Detailed Description The present disclosure will be described in further detail below with reference to the accompanying draw