CN110990020A - Software compiling method and device, electronic equipment and storage medium - Google Patents

Software compiling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110990020A
CN110990020A CN201911161217.XA CN201911161217A CN110990020A CN 110990020 A CN110990020 A CN 110990020A CN 201911161217 A CN201911161217 A CN 201911161217A CN 110990020 A CN110990020 A CN 110990020A
Authority
CN
China
Prior art keywords
software
software package
compiling
source code
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911161217.XA
Other languages
Chinese (zh)
Inventor
张承乾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201911161217.XA priority Critical patent/CN110990020A/en
Publication of CN110990020A publication Critical patent/CN110990020A/en
Priority to PCT/CN2020/087162 priority patent/WO2021098148A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application discloses a software compiling method, a device, equipment and a medium, wherein the method comprises the following steps: acquiring a source code of target application software, and automatically analyzing the source code to obtain software package information depended on by the target application software; automatically detecting whether a corresponding target software package is installed in the current operating system or not based on the software package information; if the current operating system is provided with the target software package, reading the server hardware information, and automatically generating a compiling configuration file by utilizing the server hardware information; the source code is compiled based on the compilation configuration file. According to the method and the device, firstly, the source code of the target application software is automatically analyzed to obtain the information of the dependent software package, and then whether the target software package is installed in the current operating system is automatically detected, if so, the compiling configuration file can be automatically generated, so that the compiling source code is executed based on the compiling configuration file, the standardization and the automation of software compiling steps are realized, the labor and material cost can be reduced, and the working efficiency is improved.

Description

Software compiling method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of software compiling technologies, and in particular, to a software compiling method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the popularization of information security and localization, various policies for localization are issued one after another, and a core unit is required to preferentially use a security-controllable localization server and application software thereof, so that an operating system and application software specially for the localization software and hardware are generated. However, the variety of the localization products is various, including various types such as CPU, server, database, middleware, etc., and the localization software and hardware are still in the early development stage of immaturity, so how to compile the application software on the localization server and the operating system also becomes a problem to be solved urgently.
Therefore, how to provide an effective application compiling method is a great concern for those skilled in the art.
Disclosure of Invention
The application aims to provide a software compiling method and device, an electronic device and a computer readable storage medium, so that standardization and automation of software compiling steps are realized, labor and material cost can be reduced, and working efficiency is improved.
In order to achieve the above object, the present application provides a software compiling method, including:
acquiring a source code of target application software, and automatically analyzing the source code to obtain software package information depended by the target application software;
automatically detecting whether a corresponding target software package is installed in the current operating system or not based on the software package information;
if the target software package is installed in the current operating system, reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information;
compiling the source code based on the compilation configuration file.
Optionally, the obtaining a source code of the target application software and automatically analyzing the source code to obtain software package information that the target application software depends on includes:
acquiring a source code corresponding to the target application software, and determining the language type of the source code;
and if the language type is Java, analyzing the configuration file of the target application software by using a compiler, and determining the name and the version of the software package on which the target application software depends.
Optionally, after determining the name and version of the software package on which the target application software depends, the method further includes:
acquiring the module name of the software package depended by the target application software;
generating a first software package list based on the module name and the software package name and version;
correspondingly, the automatically detecting whether the current operating system has installed the corresponding target software package based on the software package information includes:
and automatically detecting whether the current operating system installs the target software package recorded in the first software package list.
Optionally, the obtaining a source code of the target application software and automatically analyzing the source code to obtain software package information that the target application software depends on includes:
acquiring a source code corresponding to the target application software, and determining the language type of the source code;
if the language type is C language, analyzing the compiling sequence rule file, and determining a source file to be compiled and a compiling sequence of the source file;
and analyzing the header file of the target application software according to the compiling sequence, and determining to obtain a third-party platform project library depended by the target application software.
Optionally, after the determining to obtain the third-party platform project library on which the target application software depends, the method further includes:
generating a second software package list based on the name of the source file, the name of the header file and the name of the third-party platform project library;
correspondingly, the automatically detecting whether the current operating system has installed the corresponding target software package based on the software package information includes:
and automatically detecting whether the current operating system installs the target software package recorded in the second software package list.
Optionally, after automatically detecting whether the current operating system has installed the corresponding target software package based on the software package information, the method further includes:
if the target software package is not installed in the current operating system, searching the target software package in an operating system mirror image or a front-end software package manager based on the software package information;
and if the target software package is found, loading the target software package from the operating system mirror image or the front-end software package manager, and entering a step of reading server hardware information after the target software package is loaded.
Optionally, after the target software package is searched in the operating system image or the front-end software package manager based on the software package information, the method further includes:
and if the target software package is not found, generating a third software package list containing information of the software package, so that a user can check and modify the source code, determine the modified code as the source code, and re-enter the step of automatically analyzing the source code.
Optionally, the reading the server hardware information, and automatically generating a compiling configuration file by using the server hardware information includes:
reading CPU information and memory information of the server;
and determining the compiling parallelism based on the CPU information and the memory information, and automatically generating the compiling configuration file according to the compiling parallelism.
Optionally, after the compiling the source code based on the compiling configuration file, the method further includes:
and creating a compiling log, and recording a compiling process aiming at the source code into the compiling log.
Optionally, after the compiling the source code based on the compiling configuration file, the method further includes:
detecting whether the compiling process is successfully completed;
and if not, writing corresponding compiling failure information into the compiling log.
Optionally, the method further includes:
generating a source code analysis log based on the process of analyzing the source code;
generating a dependent package audit log based on a detection process for whether the current operating system has installed the target software package.
To achieve the above object, the present application provides a software compiling apparatus including:
the code analysis module is used for acquiring a source code of the target application software and automatically analyzing the source code to obtain software package information depended by the target application software;
the software package detection module is used for automatically detecting whether the corresponding target software package is installed in the current operating system or not based on the software package information;
the configuration generation module is used for reading the server hardware information if the target software package is installed in the current operating system and automatically generating a compiling configuration file by utilizing the server hardware information;
and the code compiling module is used for compiling the source code based on the compiling configuration file.
To achieve the above object, the present application provides an electronic device including:
a memory for storing a computer program;
a processor for implementing the steps of any of the software compilation methods disclosed above when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of any one of the software compiling methods disclosed in the foregoing disclosure.
According to the scheme, the software compiling method provided by the application comprises the following steps: acquiring a source code of target application software, and automatically analyzing the source code to obtain software package information depended by the target application software; automatically detecting whether a corresponding target software package is installed in the current operating system or not based on the software package information; if the target software package is installed in the current operating system, reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information; compiling the source code based on the compilation configuration file. According to the method, when the application software needs to be compiled, the source code of the target application software is automatically analyzed to obtain the information of the software package, whether the target software package is installed in the current operating system is automatically detected, if yes, the compiling configuration file can be automatically generated, so that the process of compiling the source code is executed based on the compiling configuration file, the standardization and the automation of software compiling steps are realized, the labor and material cost can be reduced, and the working efficiency is improved.
The application also discloses a software compiling device, an electronic device and a computer readable storage medium, which can also realize the technical effects.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a software compiling method disclosed in the embodiments of the present application;
FIG. 2 is a flowchart of one embodiment of a software compiling method disclosed in the embodiments of the present application;
FIG. 3 is a flowchart of another embodiment of a software compiling method disclosed in the embodiments of the present application;
FIG. 4 is a flowchart of another software compiling method disclosed in the embodiments of the present application;
fig. 5 is a block diagram of a software compiling apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of an electronic device disclosed in an embodiment of the present application;
fig. 7 is a block diagram of another electronic device disclosed in the embodiments of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the related art, the types of localization products are various, including various types such as CPU, server, database, middleware, etc., and the localization software and hardware are still in an immature early development stage, so how to compile application software on the localization server and the operating system becomes a problem to be solved urgently by those skilled in the art.
Therefore, the embodiment of the application discloses a software compiling method, which realizes standardization and automation of software compiling steps, can reduce the cost of manpower and material resources and improves the working efficiency.
Referring to fig. 1, a software compiling method disclosed in the embodiment of the present application includes:
s101: acquiring a source code of target application software, and automatically analyzing the source code to obtain software package information depended by the target application software;
in the embodiment of the application, a source code of target application software is obtained first. The target application software is specifically application software to be compiled, a source code of the target application software may be a code manually written by a developer, or may be a source code of open source software, and a mode of acquiring the source code of the target application software may be to import the source code through a preset interface, or may be to download the source code from a network. After the source code is acquired, the source code is automatically analyzed, so that the software package information depended by the target application software is acquired.
S102: automatically detecting whether a corresponding target software package is installed in the current operating system or not based on the software package information;
in this step, the software package information, which is obtained by analyzing in the above step and depended on by the target application software, may be detected in the current operating system to query whether the target software package corresponding to the software package information has been installed in the current operating system.
As a possible implementation manner, the process of detecting whether the target software package corresponding to the software package information is installed in the current operating system may specifically include: firstly, all software packages installed in the current operating system are read and obtained, and then the software package information is matched with the installed software packages one by one to judge whether the target software package is installed or not.
S103: if the target software package is installed in the current operating system, reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information;
after detecting whether the current operating system is provided with the target software package, if the target software package is detected to be installed in the current operating system, the hardware information of the server can be read, and then the corresponding compiling configuration file is automatically generated according to the hardware information of the server.
Specifically, the process of reading the server hardware information and automatically generating the compiling configuration file by using the server hardware information may include: reading CPU information and memory information of a server; and determining the compiling parallelism based on the CPU information and the memory information, and automatically generating a compiling configuration file according to the compiling parallelism. That is, the performance state of the server may be obtained by reading the hardware information of the server, so as to determine the compiling parallelism that the server can support, and generate the corresponding compiling configuration file according to the compiling parallelism.
S104: compiling the source code based on the compilation configuration file.
It is understood that, after generating the compiling configuration file, the embodiment of the present application may compile the source code of the target application software based on the compiling configuration file.
In a preferred implementation manner, in the embodiment of the present application, a compilation log may be created in advance, and after the source code is compiled based on the compilation configuration file, a compilation process for the source code is recorded in the compilation log. In specific implementation, after the source code is compiled by using the compiling configuration file, whether the compiling process is successfully completed or not can be further detected, and if not, compiling failure information corresponding to the process can be written into a compiling log for recording.
It should be noted that, in the embodiment of the present application, in addition to creating a compilation log to record a compilation process of a source code, a source code parsing log may be generated based on a process of parsing the source code, and a dependent package check log may be generated based on a detection process of whether a target software package is installed in a current operating system, so that a user may implement tracing and query through the two logs.
According to the scheme, the software compiling method provided by the application comprises the following steps: acquiring a source code of target application software, and automatically analyzing the source code to obtain software package information depended by the target application software; automatically detecting whether a corresponding target software package is installed in the current operating system or not based on the software package information; if the target software package is installed in the current operating system, reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information; compiling the source code based on the compilation configuration file. According to the method, when the application software needs to be compiled, the source code of the target application software is automatically analyzed to obtain the information of the software package, whether the target software package is installed in the current operating system is automatically detected, if yes, the compiling configuration file can be automatically generated, so that the process of compiling the source code is executed based on the compiling configuration file, the standardization and the automation of software compiling steps are realized, the labor and material cost can be reduced, and the working efficiency is improved.
The embodiment of the present application discloses a specific implementation manner of a software compiling method, and compared with the previous embodiment, the embodiment further describes and optimizes the technical scheme. Referring to fig. 2, specifically:
s201: acquiring a source code of target application software, and determining the language type of the source code;
s202: if the language type is Java, analyzing the configuration file of the target application software by using a compiler, and determining the name and the version of the software package which the target application software depends on;
s203: acquiring the module name of the software package depended by the target application software;
s204: generating a first software package list based on the module name and the software package name and version;
s205: automatically detecting whether a current operating system installs a target software package recorded in the first software package list;
s206: if the target software package is installed in the current operating system, reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information;
s207: compiling the source code based on the compilation configuration file.
In the embodiment of the application, when the source code is analyzed to determine the software package information that the target application software depends on, the language type of the source code is determined first. If the current source code is written by using Java language, the configuration file of the target application software can be analyzed by using a compiler, so that the software package depended by the target application software is determined, and the name and version information of the software package are obtained. Further, the module to which the software package belongs and its name need to be determined. In specific implementation, the embodiment of the application may generate a first software package list based on the name of the module, the name of the software package, and the version information, and further detect the current operating system based on the first software package list, and determine whether the current operating system has installed the software package of the specified version under the specified module recorded in the first software package list. If the target software package is installed in the current operating system, a compiling configuration file can be automatically generated according to the hardware information of the server, and then the source code is compiled based on the compiling configuration file.
Specifically, in an actual implementation scenario, if a Maven compiler needs to be used for software compilation, a pom. Xml files belong to project level configuration files, which mainly describe the Maven coordinates of the target application software, the dependency relationship with the software package, the rules that the developer needs to follow, the defect management system, the organization and license certification, and other all target application software related factors. Xml files are analyzed, so that the software package name and version information which are depended on when the target application software is compiled can be determined, and a first software package list can be generated according to the information.
The embodiment of the present application discloses another specific implementation of the software compiling method, and compared with the previous embodiment, the embodiment further describes and optimizes the technical scheme. Referring to fig. 3, specifically:
s301: acquiring a source code corresponding to target application software, and determining the language type of the source code;
s302: if the language type is C language, analyzing the compiling sequence rule file, and determining a source file to be compiled and a compiling sequence of the source file;
s303: analyzing the header file of the target application software according to the compiling sequence, and determining to obtain a third-party platform project library which the target application software depends on;
s304: generating a second software package list based on the name of the source file, the name of the header file and the name of the third-party platform project library;
s305: automatically detecting whether the current operating system installs the target software package recorded in the second software package list or not;
s306: if the target software package is installed in the current operating system, reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information;
s307: compiling the source code based on the compilation configuration file.
In the embodiment of the application, when the source code is analyzed to determine the software package information that the target application software depends on, the language type of the source code is determined first. If the current source code is written by using C language, acquiring and analyzing a compiling sequence rule file, determining a source file to be compiled and a compiling sequence of the source file, and sequentially analyzing a header file of the target application software according to the compiling sequence, thereby determining a third-party platform project library which the target application software depends on. Further, a second software package list may be generated based on the name of the source file, the name of the header file, and the name of the third-party platform project library, so as to detect whether the current operating system has installed the target software package based on the information recorded in the second software package list. If the current operating system has the target software package installed, a compiling configuration file can be automatically generated, and the source code is compiled based on the compiling configuration file.
In a specific implementation scenario, if a Make compiler is required to compile software, a Makefile file needs to be analyzed first, and a compiling sequence of a source file needing to be compiled is determined; secondly, analyzing corresponding header files according to the source file compiling sequence, and determining a third-party platform project library, namely a software package on which the target application software depends; and generating a second software package list based on the name of the source file, the name of the header file and the name of the third-party platform project library.
The embodiment of the application discloses another software compiling method, and compared with the previous embodiment, the embodiment further explains and optimizes the technical scheme. Referring to fig. 4, specifically:
s401: acquiring a source code of target application software, and automatically analyzing the source code to obtain software package information depended by the target application software;
s402: automatically detecting whether a corresponding target software package is installed in the current operating system or not based on the software package information; if yes, go to step S406; if not, go to step S403;
s403: searching the target software package in an operating system mirror image or a front-end software package manager based on the software package information; if not, go to step S404; if yes, go to step S405;
s404: generating a third software package list containing the information that the software package does not exist, so that a user can check and modify the source code, determine the modified code as the source code, and re-enter the step S401;
s405: loading the target software package from the operating system image or the front-end software package manager, and entering step S406 after the loading is completed;
s406: reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information;
s407: compiling the source code based on the compilation configuration file.
In the embodiment of the present application, after the detection process for whether the target software package is installed is performed in the current operating system, if the target software package is not installed in the current operating system, the target software package is further searched in the operating system image or the front-end software package manager according to the software package information. If the target software package is found in the operating system mirror image or the front-end software package manager, loading the target software package, and after the loading is finished, executing the process of reading the server hardware information and automatically generating a compiling configuration file; if the target software package is not found in the operating system image or the front-end software package manager, a third software package list can be generated according to the search result, wherein the third software package list is used for recording the nonexistent software packages, namely the software packages which are not installed and cannot be found. After the third software package list is generated, the third software package list can be returned to the user, so that the user is prompted that the source code of the software may have an error per se or an error occurs in the software analysis process, so that an error dependent package exists, the user can judge whether the analysis process has an error or not according to the source code analysis log, or the source code can be checked, after the possible error of the source code is solved, the modified code can be determined as the source code again, and the source code is returned again to be analyzed, so that the workflow of the software package information which is depended by the target application software is obtained.
In the following, a software compiling apparatus provided by the embodiment of the present application is introduced, and a software compiling apparatus described below and a software compiling method described above may be referred to each other.
Referring to fig. 5, a software compiling apparatus provided in an embodiment of the present application includes:
the code analysis module 501 is configured to obtain a source code of a target application software, and automatically analyze the source code to obtain software package information that the target application software depends on;
a software package detection module 502, configured to automatically detect whether a corresponding target software package is installed in a current operating system based on the software package information;
a configuration generating module 503, configured to read server hardware information if the target software package is installed in the current operating system, and automatically generate a compiling configuration file by using the server hardware information;
a code compiling module 504, configured to compile the source code based on the compiling configuration file.
For the specific implementation process of the modules 501 to 504, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.
According to the software compiling device provided by the embodiment of the application, when the application software needs to be compiled, the source code of the target application software is automatically analyzed to obtain the information of the software package which depends on the source code, whether the target software package is installed in the current operating system is further automatically detected, if yes, the compiling configuration file can be automatically generated, so that the process of compiling the source code is executed based on the compiling configuration file, the standardization and automation of software compiling steps are realized, the cost of manpower and material resources can be reduced, and the working efficiency is improved.
The present application further provides an electronic device, and as shown in fig. 6, an electronic device provided in an embodiment of the present application includes:
a memory 100 for storing a computer program;
the processor 200, when executing the computer program, may implement the steps provided by the above embodiments.
Specifically, the memory 100 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions, and the internal memory provides an environment for the operating system and the computer-readable instructions in the non-volatile storage medium to run. The processor 200 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments, and provides computing and controlling capability for the electronic device, and when executing the computer program stored in the memory 100, the steps of the software compiling method disclosed in any of the foregoing embodiments may be implemented.
On the basis of the above embodiment, as a preferred implementation, referring to fig. 7, the electronic device further includes:
and an input interface 300 connected to the processor 200, for acquiring computer programs, parameters and instructions imported from the outside, and storing the computer programs, parameters and instructions into the memory 100 under the control of the processor 200. The input interface 300 may be connected to an input device for receiving parameters or instructions manually input by a user. The input device may be a touch layer covered on a display screen, or a button, a track ball or a touch pad arranged on a terminal shell, or a keyboard, a touch pad or a mouse, etc.
And a display unit 400 connected to the processor 200 for displaying data processed by the processor 200 and for displaying a visualized user interface. The display unit 400 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like.
And a network port 500 connected to the processor 200 for performing communication connection with each external terminal device. The communication technology adopted by the communication connection can be a wired communication technology or a wireless communication technology, such as a mobile high definition link (MHL) technology, a Universal Serial Bus (USB), a High Definition Multimedia Interface (HDMI), a wireless fidelity (WiFi), a bluetooth communication technology, a low power consumption bluetooth communication technology, an ieee802.11 s-based communication technology, and the like.
While fig. 7 shows only an electronic device having the assembly 100 and 500, those skilled in the art will appreciate that the configuration shown in fig. 7 is not intended to be limiting of electronic devices and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
The present application also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. The storage medium has a computer program stored thereon, which when executed by a processor implements the steps of the software compiling method disclosed in any of the foregoing embodiments.
When the application software needs to be compiled, the source code of the target application software is automatically analyzed to obtain the information of the software package which depends on the source code, whether the target software package is installed in the current operating system is automatically detected, if yes, the compiling configuration file can be automatically generated, so that the process of compiling the source code is executed based on the compiling configuration file, the standardization and the automation of software compiling steps are realized, the cost of manpower and material resources can be reduced, and the working efficiency is improved.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (14)

1. A method of software compilation, comprising:
acquiring a source code of target application software, and automatically analyzing the source code to obtain software package information depended by the target application software;
automatically detecting whether a corresponding target software package is installed in the current operating system or not based on the software package information;
if the target software package is installed in the current operating system, reading server hardware information, and automatically generating a compiling configuration file by using the server hardware information;
compiling the source code based on the compilation configuration file.
2. The software compiling method according to claim 1, wherein the obtaining a source code of the target application software and automatically parsing the source code to obtain software package information that the target application software depends on comprises:
acquiring a source code corresponding to the target application software, and determining the language type of the source code;
and if the language type is Java, analyzing the configuration file of the target application software by using a compiler, and determining the name and the version of the software package on which the target application software depends.
3. The method for software compilation according to claim 2, wherein the determining the name and version of the software package on which the target application software depends further comprises:
acquiring the module name of the software package depended by the target application software;
generating a first software package list based on the module name and the software package name and version;
correspondingly, the automatically detecting whether the current operating system has installed the corresponding target software package based on the software package information includes:
and automatically detecting whether the current operating system installs the target software package recorded in the first software package list.
4. The software compiling method according to claim 1, wherein the obtaining a source code of the target application software and automatically parsing the source code to obtain software package information that the target application software depends on comprises:
acquiring a source code corresponding to the target application software, and determining the language type of the source code;
if the language type is C language, analyzing the compiling sequence rule file, and determining a source file to be compiled and a compiling sequence of the source file;
and analyzing the header file of the target application software according to the compiling sequence, and determining to obtain a third-party platform project library depended by the target application software.
5. The software compilation method of claim 4, wherein after determining the third-party platform project library on which the target application software depends, further comprising:
generating a second software package list based on the name of the source file, the name of the header file and the name of the third-party platform project library;
correspondingly, the automatically detecting whether the current operating system has installed the corresponding target software package based on the software package information includes:
and automatically detecting whether the current operating system installs the target software package recorded in the second software package list.
6. The software compiling method of claim 1, wherein after automatically detecting whether the current operating system has installed the corresponding target software package based on the software package information, further comprising:
if the target software package is not installed in the current operating system, searching the target software package in an operating system mirror image or a front-end software package manager based on the software package information;
and if the target software package is found, loading the target software package from the operating system mirror image or the front-end software package manager, and entering a step of reading server hardware information after the target software package is loaded.
7. The software compiling method of claim 6 wherein after searching for the target software package in an operating system image or a front-end software package manager based on the software package information, further comprising:
and if the target software package is not found, generating a third software package list containing information of the software package, so that a user can check and modify the source code, determine the modified code as the source code, and re-enter the step of automatically analyzing the source code.
8. The software compiling method of claim 1 wherein reading the server hardware information and automatically generating the compiling configuration file using the server hardware information comprises:
reading CPU information and memory information of the server;
and determining the compiling parallelism based on the CPU information and the memory information, and automatically generating the compiling configuration file according to the compiling parallelism.
9. The software compiling method according to any one of claims 1 to 8, wherein after the compiling the source code based on the compiling configuration file, further comprising:
and creating a compiling log, and recording a compiling process aiming at the source code into the compiling log.
10. The software compiling method of claim 9, wherein after compiling the source code based on the compiling configuration file, further comprising:
detecting whether the compiling process is successfully completed;
and if not, writing corresponding compiling failure information into the compiling log.
11. The software compiling method of claim 9 further comprising:
generating a source code analysis log based on the process of analyzing the source code;
generating a dependent package audit log based on a detection process for whether the current operating system has installed the target software package.
12. A software compiling apparatus characterized by comprising:
the code analysis module is used for acquiring a source code of the target application software and automatically analyzing the source code to obtain software package information depended by the target application software;
the software package detection module is used for automatically detecting whether the corresponding target software package is installed in the current operating system or not based on the software package information;
the configuration generation module is used for reading the server hardware information if the target software package is installed in the current operating system and automatically generating a compiling configuration file by utilizing the server hardware information;
and the code compiling module is used for compiling the source code based on the compiling configuration file.
13. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the software compilation method according to any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the software compilation method according to any one of claims 1 to 11.
CN201911161217.XA 2019-11-24 2019-11-24 Software compiling method and device, electronic equipment and storage medium Pending CN110990020A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911161217.XA CN110990020A (en) 2019-11-24 2019-11-24 Software compiling method and device, electronic equipment and storage medium
PCT/CN2020/087162 WO2021098148A1 (en) 2019-11-24 2020-04-27 Software compiling method and apparatus, and electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911161217.XA CN110990020A (en) 2019-11-24 2019-11-24 Software compiling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110990020A true CN110990020A (en) 2020-04-10

Family

ID=70086214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911161217.XA Pending CN110990020A (en) 2019-11-24 2019-11-24 Software compiling method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110990020A (en)
WO (1) WO2021098148A1 (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522560A (en) * 2020-04-21 2020-08-11 北京三快在线科技有限公司 Software installation method and device, storage medium and electronic equipment
CN111638906A (en) * 2020-05-15 2020-09-08 郑州阿帕斯数云信息科技有限公司 SDK (software development kit) access method, device and system
CN111782239A (en) * 2020-06-03 2020-10-16 中移(杭州)信息技术有限公司 Software packaging and source code version information acquisition method, device and storage medium
CN111859827A (en) * 2020-06-29 2020-10-30 山东云海国创云计算装备产业创新中心有限公司 Chip IP integration method and device, electronic equipment and storage medium
CN111949268A (en) * 2020-06-23 2020-11-17 贝壳技术有限公司 Project compiling method and device, electronic equipment and storage medium
CN112130862A (en) * 2020-09-28 2020-12-25 平安国际智慧城市科技股份有限公司 Package file generation method, device, equipment and computer readable storage medium
CN112214220A (en) * 2020-09-02 2021-01-12 深圳市优必选科技股份有限公司 Method, device and equipment for integrated system
CN112286534A (en) * 2020-11-25 2021-01-29 湖南麒麟信安科技股份有限公司 Automatic compiling method for software package
CN112379915A (en) * 2020-11-06 2021-02-19 中国人寿保险股份有限公司 Source code processing method and device
CN112631599A (en) * 2020-12-09 2021-04-09 潍柴动力股份有限公司 Compiling method, device and storage medium
CN112748927A (en) * 2020-12-30 2021-05-04 上海微盟企业发展有限公司 Project interface analysis method and related device
WO2021098148A1 (en) * 2019-11-24 2021-05-27 苏州浪潮智能科技有限公司 Software compiling method and apparatus, and electronic device and storage medium
CN113176880A (en) * 2021-04-12 2021-07-27 深圳市明源云科技有限公司 Project compiling method, project compiling device and computer readable storage medium
CN113254033A (en) * 2021-05-28 2021-08-13 浪潮电子信息产业股份有限公司 Master disk file generation method and device, electronic equipment and storage medium
CN113391826A (en) * 2021-08-16 2021-09-14 统信软件技术有限公司 Solution method for software package dependence in customized mirror image
CN114268624A (en) * 2022-03-02 2022-04-01 上海豪承信息技术有限公司 Version file transmission method and device and server
WO2022148185A1 (en) * 2021-01-07 2022-07-14 苏州浪潮智能科技有限公司 Data packet updating method and apparatus, electronic device, and readable storage medium
US20220244953A1 (en) * 2020-05-22 2022-08-04 The George Washington University Binary code similarity detection system
CN116931954A (en) * 2023-09-18 2023-10-24 浙江简捷物联科技有限公司 Built-in software package compiling construction method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5956513A (en) * 1997-08-07 1999-09-21 Mci Communications Corporation System and method for automated software build control
CN102035892A (en) * 2010-12-23 2011-04-27 中科方德软件有限公司 System and method for automatically releasing operating system version and automatically updating software package
CN108614701A (en) * 2016-12-26 2018-10-02 中移(苏州)软件技术有限公司 A kind of (SuSE) Linux OS method for customizing and device
CN109918091A (en) * 2019-02-27 2019-06-21 苏州浪潮智能科技有限公司 A kind of method for rapidly mounting of linux system installation kit
CN110333872A (en) * 2019-07-09 2019-10-15 广州虎牙科技有限公司 A kind of processing method of application, device, equipment and medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8464228B2 (en) * 2007-08-23 2013-06-11 Accenture Global Services Limited Binary library
CN102419711A (en) * 2011-11-16 2012-04-18 深圳市佳创视讯技术股份有限公司 Package management system and method for embedded system of digital television receiving terminal
CN109976793B (en) * 2019-03-15 2022-05-10 北京字节跳动网络技术有限公司 Application program running method, device, equipment and medium
CN110990020A (en) * 2019-11-24 2020-04-10 苏州浪潮智能科技有限公司 Software compiling method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5956513A (en) * 1997-08-07 1999-09-21 Mci Communications Corporation System and method for automated software build control
CN102035892A (en) * 2010-12-23 2011-04-27 中科方德软件有限公司 System and method for automatically releasing operating system version and automatically updating software package
CN108614701A (en) * 2016-12-26 2018-10-02 中移(苏州)软件技术有限公司 A kind of (SuSE) Linux OS method for customizing and device
CN109918091A (en) * 2019-02-27 2019-06-21 苏州浪潮智能科技有限公司 A kind of method for rapidly mounting of linux system installation kit
CN110333872A (en) * 2019-07-09 2019-10-15 广州虎牙科技有限公司 A kind of processing method of application, device, equipment and medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
文全刚: "《十三五 嵌入式Linux操作系统原理与应用 第3版》", 31 May 2017, 北京航空航天大学出版社 *
陈万里 等: "《Android嵌入式系统开发实战 玩转Linux内核驱动开发》", 30 November 2008, 西安电子科技大学出版社 *

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021098148A1 (en) * 2019-11-24 2021-05-27 苏州浪潮智能科技有限公司 Software compiling method and apparatus, and electronic device and storage medium
CN111522560A (en) * 2020-04-21 2020-08-11 北京三快在线科技有限公司 Software installation method and device, storage medium and electronic equipment
CN111638906A (en) * 2020-05-15 2020-09-08 郑州阿帕斯数云信息科技有限公司 SDK (software development kit) access method, device and system
US11934458B2 (en) * 2020-05-22 2024-03-19 The George Washington University Binary code similarity detection system
US20220244953A1 (en) * 2020-05-22 2022-08-04 The George Washington University Binary code similarity detection system
CN111782239A (en) * 2020-06-03 2020-10-16 中移(杭州)信息技术有限公司 Software packaging and source code version information acquisition method, device and storage medium
CN111782239B (en) * 2020-06-03 2023-07-11 中移(杭州)信息技术有限公司 Method, device and storage medium for software packaging and source code version information acquisition
CN111949268A (en) * 2020-06-23 2020-11-17 贝壳技术有限公司 Project compiling method and device, electronic equipment and storage medium
CN111859827A (en) * 2020-06-29 2020-10-30 山东云海国创云计算装备产业创新中心有限公司 Chip IP integration method and device, electronic equipment and storage medium
CN111859827B (en) * 2020-06-29 2022-06-17 山东云海国创云计算装备产业创新中心有限公司 Chip IP integration method and device, electronic equipment and storage medium
CN112214220A (en) * 2020-09-02 2021-01-12 深圳市优必选科技股份有限公司 Method, device and equipment for integrated system
CN112214220B (en) * 2020-09-02 2023-10-10 深圳市优必选科技股份有限公司 Method, apparatus and device for integrated system
CN112130862B (en) * 2020-09-28 2024-04-05 平安国际智慧城市科技股份有限公司 Method, apparatus, device and computer readable storage medium for generating package file
CN112130862A (en) * 2020-09-28 2020-12-25 平安国际智慧城市科技股份有限公司 Package file generation method, device, equipment and computer readable storage medium
CN112379915A (en) * 2020-11-06 2021-02-19 中国人寿保险股份有限公司 Source code processing method and device
CN112286534A (en) * 2020-11-25 2021-01-29 湖南麒麟信安科技股份有限公司 Automatic compiling method for software package
CN112631599B (en) * 2020-12-09 2024-03-19 潍柴动力股份有限公司 Compiling method, compiling device and storage medium
CN112631599A (en) * 2020-12-09 2021-04-09 潍柴动力股份有限公司 Compiling method, device and storage medium
CN112748927A (en) * 2020-12-30 2021-05-04 上海微盟企业发展有限公司 Project interface analysis method and related device
WO2022148185A1 (en) * 2021-01-07 2022-07-14 苏州浪潮智能科技有限公司 Data packet updating method and apparatus, electronic device, and readable storage medium
CN113176880A (en) * 2021-04-12 2021-07-27 深圳市明源云科技有限公司 Project compiling method, project compiling device and computer readable storage medium
CN113254033A (en) * 2021-05-28 2021-08-13 浪潮电子信息产业股份有限公司 Master disk file generation method and device, electronic equipment and storage medium
CN113254033B (en) * 2021-05-28 2023-11-03 浪潮电子信息产业股份有限公司 Method and device for generating master disc file, electronic equipment and storage medium
CN113391826A (en) * 2021-08-16 2021-09-14 统信软件技术有限公司 Solution method for software package dependence in customized mirror image
CN114268624B (en) * 2022-03-02 2022-06-03 上海豪承信息技术有限公司 Version file transmission method and device and server
CN114268624A (en) * 2022-03-02 2022-04-01 上海豪承信息技术有限公司 Version file transmission method and device and server
CN116931954A (en) * 2023-09-18 2023-10-24 浙江简捷物联科技有限公司 Built-in software package compiling construction method, device, equipment and medium
CN116931954B (en) * 2023-09-18 2023-12-19 浙江简捷物联科技有限公司 Built-in software package compiling construction method, device, equipment and medium

Also Published As

Publication number Publication date
WO2021098148A1 (en) 2021-05-27

Similar Documents

Publication Publication Date Title
CN110990020A (en) Software compiling method and device, electronic equipment and storage medium
Sen et al. Jalangi: A selective record-replay and dynamic analysis framework for JavaScript
Gottschalk et al. Removing energy code smells with reengineering services
CN112100072B (en) Static detection method, device, equipment and medium for application program code
US20110078211A1 (en) Systems and methods for analyzing and transforming an application from a source installation to a target installation
KR20150024842A (en) Adaptive portable libraries
US8370799B2 (en) Provision of code base modification using automatic learning of code changes
US11593342B2 (en) Systems and methods for database orientation transformation
US20230114540A1 (en) Checking source code validity at time of code update
US9921827B1 (en) Developing versions of applications based on application fingerprinting
CN107783766B (en) Method and device for cleaning files of application program
CN112068852B (en) Method, system, equipment and medium for installing open-source software based on domestic server
CN109408354B (en) Data processing method and device for application component
EP2706459B1 (en) Apparatus and method for validating a compiler for a reconfigurable processor
CN109032631A (en) Application program service packs acquisition methods, device, computer equipment and storage medium
CN103186463B (en) Determine the method and system of the test specification of software
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
US20150020056A1 (en) Methods and systems for file processing
CN116893960A (en) Code quality detection method, apparatus, computer device and storage medium
CN111240987A (en) Migration program detection method and device, electronic equipment and computer readable storage medium
CN111475148A (en) Third-party dependent library isolation method and device, electronic equipment and storage medium
Wu et al. CydiOS: A Model-Based Testing Framework for iOS Apps
CN110297639B (en) Method and apparatus for detecting code
CN114625381A (en) Privacy policy text acquisition method, system and terminal
CN110321130B (en) Non-repeatable compiling and positioning method based on system call log

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200410