CN111880803B - Software construction method and device applied to multiple platforms - Google Patents

Software construction method and device applied to multiple platforms Download PDF

Info

Publication number
CN111880803B
CN111880803B CN202010645530.7A CN202010645530A CN111880803B CN 111880803 B CN111880803 B CN 111880803B CN 202010645530 A CN202010645530 A CN 202010645530A CN 111880803 B CN111880803 B CN 111880803B
Authority
CN
China
Prior art keywords
difference
code
hardware platform
target
files
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.)
Active
Application number
CN202010645530.7A
Other languages
Chinese (zh)
Other versions
CN111880803A (en
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 CN202010645530.7A priority Critical patent/CN111880803B/en
Publication of CN111880803A publication Critical patent/CN111880803A/en
Application granted granted Critical
Publication of CN111880803B publication Critical patent/CN111880803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code

Abstract

The invention discloses a software construction method and a device applied to multiple platforms, which comprises the following steps: performing code compiling of a main line on a target software code to obtain a main line compiling file packet; acquiring a group of difference code files aiming at a target hardware platform from a target software code, and independently compiling the group of difference code files to obtain a group of difference compilation files corresponding to the target hardware platform; writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of a target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files in the packing directory; and packaging the packaging catalog to obtain a software package applied to the target hardware platform. Therefore, the software development efficiency is improved, and the volume of the software package is reduced.

Description

Software construction method and device applied to multiple platforms
Technical Field
The invention relates to the field of software development, in particular to a software construction method and device applied to multiple platforms.
Background
In the process of developing the stored software, because the correlation between the software and the hardware platform is strong, different hardware platforms have codes of different business processes or different logic implementations, and the codes need to be distinguished by the platforms. For example, different hard disk types may be supported on multiple storage hardware platforms, and different hard disk drive codes need to be supported on software.
If all driver code is finally built into a software package, the following problems exist: 1. we may have supported certain hard disk types on a certain hardware platform that we do not wish to support. 2. If the platform difference is particularly large, the software package built by the software is also particularly large, and the software package is also larger along with the increase of hardware platforms. 3. If we would maintain a single code branch for each hardware platform, there would be many common codes (identical codes) between hardware platforms, and modifications to common codes would require synchronization to the code branches. This also causes a large amount of repetitive work, reducing the work efficiency.
Disclosure of Invention
The embodiment of the invention provides a software construction method and device applied to multiple platforms, which improve software development efficiency and reduce software package volume.
In a first aspect, an embodiment of the present invention provides a software construction method applied to multiple platforms, including:
performing code compiling of a main line on a target software code to obtain a main line compiling file packet;
acquiring a group of difference code files aiming at a target hardware platform from the target software code, and independently compiling the group of difference code files to obtain a group of difference compilation files corresponding to the target hardware platform;
writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files in the packing directory;
and packaging the packaging catalog to obtain a software package applied to the target hardware platform.
Optionally, the obtaining a set of difference code files for a target hardware platform from the target software code includes:
acquiring difference configuration information of the target hardware platform from a difference configuration file corresponding to the target software code, wherein the difference configuration file is used for distinguishing difference codes belonging to different hardware platforms in the target software code;
and acquiring a group of difference code files aiming at the target hardware platform from the target software codes according to the difference configuration information of the target hardware platform.
Optionally, the target software code includes a plurality of original code files, and the obtaining a set of difference code files for the target hardware platform from the target software code according to the difference configuration information of the target hardware platform includes:
directly identifying a first type of difference code file belonging to the target hardware platform from a plurality of original code files of the target software code;
for other original code files except the first type of difference code file in the plurality of original code files, identifying difference codes belonging to the target hardware platform from the other original code files by analyzing difference configuration information of the target hardware platform;
generating a second type difference code file aiming at the target hardware platform according to the difference code belonging to the target hardware platform;
forming a set of difference code files for the target hardware platform based on the first type of difference code file and the second type of difference code file.
Optionally, after performing code compilation on the main line on the target software code to obtain the main line compiled file package, the method further includes:
acquiring a software construction mode selection result, wherein the software construction mode selection result indicates whether platform construction software needs to be distinguished for the target software code;
if the selection result is yes, acquiring more than one target hardware platform needing platform-differentiated construction software, and executing the following steps aiming at each target hardware platform: performing code compiling of a main line on a target software code to obtain a main line compiling file packet; acquiring a group of difference code files aiming at a target hardware platform from the target software code, and independently compiling the group of difference code files to obtain a group of difference compilation files corresponding to the target hardware platform; writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files in the packing directory; packaging the packaging catalog to obtain a software package applied to the target hardware platform;
and if the selection result of the software construction mode is negative, integrally packaging all codes of the main line compiling file package to obtain a corresponding integral software package.
Optionally, before the target software code is compiled, the difference configuration file is used to distinguish the difference codes belonging to different hardware platforms in the target software code in advance.
In a second aspect, an embodiment of the present invention provides a software building apparatus applied to multiple platforms, including:
the main line compiling unit is used for compiling the code of the main line of the target software code to obtain a main line compiling file packet;
the difference compiling unit is used for acquiring a group of difference code files aiming at a target hardware platform from the target software codes and independently compiling the group of difference code files to obtain a group of difference compiling files corresponding to the target hardware platform;
the file writing unit is used for writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files under the packing directory;
and the independent packaging unit is used for packaging the packaging catalog to obtain a software package applied to the target hardware platform.
Optionally, the difference compiling unit includes:
a configuration information obtaining subunit, configured to obtain difference configuration information of the target hardware platform from a difference configuration file corresponding to the target software code, where the difference configuration file is used to distinguish difference codes belonging to different hardware platforms in the target software code;
and the code acquisition subunit is used for acquiring a group of difference code files aiming at the target hardware platform from the target software code according to the difference configuration information of the target hardware platform.
Optionally, the target software code includes a plurality of original code files, and the code obtaining subunit is specifically configured to:
directly identifying a first type of difference code file belonging to the target hardware platform from a plurality of original code files of the target software code;
for other original code files except the first type of difference code file in the plurality of original code files, identifying difference codes belonging to the target hardware platform from the other original code files by analyzing difference configuration information of the target hardware platform;
generating a second type difference code file aiming at the target hardware platform according to the difference code belonging to the target hardware platform;
forming a set of difference code files for the target hardware platform based on the first type of difference code files and the second type of difference code files.
Optionally, the apparatus further comprises:
the first selection unit is used for acquiring a software construction mode selection result, and the software construction mode selection result indicates whether platform-differentiated software construction needs to be carried out on the target software code or not;
a second selecting unit, configured to, if the selection result of the selection result obtaining unit is yes, obtain more than one target hardware platform that needs to differentiate platform building software, and call, for each target hardware platform, the following units:
the main line compiling unit is used for compiling the code of the main line of the target software code to obtain a main line compiling file packet;
the difference compiling unit is used for acquiring a group of difference code files aiming at a target hardware platform from the target software code and independently compiling the group of difference code files to obtain a group of difference compiling files corresponding to the target hardware platform;
the file writing unit is used for writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files under the packing directory;
the independent packaging unit is used for packaging the packaging catalog to obtain a software package applied to the target hardware platform;
the device also comprises an integral packaging unit which is used for integrally packaging all codes of the mainline compiled file package to obtain a corresponding integral software package.
Optionally, the apparatus further comprises:
and the difference configuration unit is used for distinguishing the difference codes belonging to different hardware platforms in the target software codes in advance through the difference configuration file before compiling the target software codes.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the methods in the first aspect.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by one or more processors to execute operation instructions included in the one or more programs for performing the method according to any of the first aspects.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
obtaining a group of difference code files aiming at a target hardware platform from a target software code, and independently compiling the group of difference code files to obtain a group of difference compilation files corresponding to the target hardware platform; writing a main line compiling file package obtained according to the target software code and the group of difference compiling files into a packing directory of a target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files; and packaging the packaged directory after replacing the file to obtain a software package applied to the target hardware platform. Therefore, the software package is constructed by distinguishing the hardware platforms, redundant codes do not exist in the constructed software package, the volume of the software package is reduced, and the codes of the current hardware platform are modified without influencing the code branches of other hardware platforms, so that the software development efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can obtain other drawings without inventive labor.
FIG. 1 is a flowchart of a software component method applied to multiple platforms according to an embodiment of the present invention;
FIG. 2 is a functional block diagram of a software building apparatus applied to multiple platforms according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
In a first aspect, an embodiment of the present invention provides a software construction method applied to multiple platforms, and as shown in fig. 1, the software construction method includes the following steps:
s101, performing code compiling of a main line on the target software code to obtain a main line compiling file package.
In the embodiment of the present specification, different hardware platforms correspond to codes that require different business processes or different logic implementations, and therefore, the code content in the target software code needs to be platform-differentiated. Specifically, the target software code may refer to a stored software code, and the types of hard disks supported by the target software code are correspondingly different on different types of storage hardware platforms. Then the hard drive code required on different storage hardware platforms is correspondingly different. For this reason, it is necessary to include a variety of hard disk drive codes corresponding to a variety of storage hardware platforms in the storage software codes.
When software is constructed for a target software code, code compilation of a main line is performed on the target software code. And performing code compiling on the main line of the target software code to obtain a main line compiling file packet which contains compiling results of all code contents in the target software code. After the code compilation of the main line is completed, the following two implementation modes can be available:
1. if it is necessary to perform software construction for distinguishing hardware platforms, the following steps S102 to S105 are directly performed after step S101.
2. If the software construction for distinguishing the hardware platforms can be selectively performed, after the step S101 is executed, a software construction mode selection result is obtained, and the software construction mode selection result indicates whether platform-distinguishing construction software needs to be performed with respect to the target software code. And if the software construction mode selection result is negative, integrally packaging the main line compiling file package to obtain a corresponding integral software package. Therefore, the method can directly enter a normal packing flow under the condition of not distinguishing hardware platform construction software, and integrally pack the main line compiling file packet to form an integral software packet which can be applied to a plurality of different hardware platforms.
In a specific implementation process, under the condition that hardware platform construction software needs to be distinguished, more than one target hardware platform of the platform construction software needs to be distinguished can be selected, so that more than one target hardware platform of the platform construction software needs to be distinguished is obtained, and for each target hardware platform of the platform construction software needs to be distinguished, the following steps S102 to S105 are executed:
step S102, a group of difference code files aiming at the target hardware platform are obtained from the target software codes, and independent compilation is carried out on the group of difference code files to obtain a group of difference compilation files corresponding to the target hardware platform.
In the embodiment of the invention, in order to obtain a group of difference code files for a target hardware platform from target software codes, difference codes belonging to different hardware platforms in the target software codes are distinguished in advance through difference configuration files. Based on this, when step S102 is executed, steps S1021 to S1022 are specifically detailed as follows:
step S1021, acquiring difference configuration information of the target hardware platform from a difference configuration file corresponding to the target software code, wherein the difference configuration file is used for distinguishing difference codes belonging to different hardware platforms in the target software code;
step S1022: and acquiring a group of difference code files aiming at the target hardware platform from the target software code according to the difference configuration information of the target hardware platform.
More specifically, the object software code includes a plurality of original code files, and the specific implementation process of step S1022 is: directly identifying a first type of difference code file belonging to a target hardware platform from a plurality of original code files of target software codes; identifying a difference code belonging to a target hardware platform from other original code files except a first type of difference code file in a plurality of original code files except a target software code by analyzing difference configuration information corresponding to the target hardware platform, and generating a second type of difference code file aiming at the target hardware platform according to the difference code belonging to the target hardware platform; and forming a group of difference code files aiming at the target hardware platform based on the first type of difference code files and the second type of difference code files.
It should be noted that the first type of difference code file refers to that all code contents in the original code file are difference codes belonging to a target hardware platform; and directly taking the original code files as difference code files belonging to the target hardware platform, and directly independently compiling each original code file to correspondingly obtain each difference compilation file aiming at the target hardware platform.
Specifically, the second type of difference code file contains two types:
1. if the difference code file contains a part of code content which belongs to the difference code of the target hardware platform, the difference code file is directly analyzed according to the difference configuration information of the target hardware platform, the difference code which belongs to the target hardware platform is identified from the original code file (the part of difference code can be directly applied to the target hardware platform), and then the difference code file which belongs to the target hardware platform is directly generated on the premise that the difference code which belongs to the target hardware platform and is identified from the original code file is not subjected to code processing.
2. If part or all of the codes in the original code file need to be further processed to generate the difference codes belonging to the target hardware platform, the difference codes belonging to the target hardware platform need to be identified from the original code file according to the difference configuration information of the target hardware platform, and the identified difference codes belonging to the target hardware platform are subjected to code processing to generate the difference code file belonging to the target hardware platform.
And independently compiling each generated second type difference code file to obtain each difference compilation file belonging to the target hardware platform.
And step S103, writing the mainline compiling file packet into a newly-built packaging directory of the target hardware platform.
Specifically, a package directory is newly created under each hardware platform that needs to be created by software, and then the main line compiled file package compiled and formed in step S101 is written into the package directory newly created under the target hardware platform in a copying manner. It should be noted that step S103 and step S102 are not necessarily executed in order.
Step S104, writing the group of difference compiling files aiming at the target hardware platform into a packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files under the packing directory of the target hardware platform.
Specifically, a set of difference compilation files for a target hardware platform includes more than one difference compilation file. The main line compilation file package comprises a plurality of compilation files, and the group of difference compilation files replace files meeting preset same conditions in the main line compilation file package under a packaging directory of a target hardware platform.
And S105, packaging the packaging catalog under the target hardware platform to obtain a software package applied to the target hardware platform.
Through the steps S101 to S105, the software package can be formed for each target hardware platform, the volume of the software package is reduced, the purpose of distinguishing hardware platforms to construct software is achieved, and the development efficiency is improved.
In a second aspect, an embodiment of the present invention provides a software building apparatus applied to multiple platforms, and as shown in fig. 2, the software building apparatus includes:
a main line compiling unit 201, configured to perform code compiling on a main line on a target software code to obtain a main line compiled file packet;
a difference compiling unit 202, configured to obtain a set of difference code files for a target hardware platform from the target software code, and perform independent compiling on the set of difference code files to obtain a set of difference compiling files corresponding to the target hardware platform;
a file writing unit 203, configured to write the main line compiled file package and the set of difference compiled files into a newly created packaging directory of the target hardware platform, and replace, in the packaging directory, a file that meets preset same conditions in the main line compiled file package with the set of difference compiled files;
and an independent packing unit 204, configured to pack the packing directory to obtain a software package applied to the target hardware platform.
In an optional implementation manner, the difference compiling unit 202 includes:
a configuration information obtaining subunit, configured to obtain difference configuration information of the target hardware platform from a difference configuration file corresponding to the target software code, where the difference configuration file is used to distinguish difference codes belonging to different hardware platforms in the target software code;
and the code acquisition subunit is used for acquiring a group of difference code files aiming at the target hardware platform from the target software code according to the difference configuration information of the target hardware platform.
In an optional implementation manner, the target software code includes a plurality of original code files, and the code obtaining subunit is specifically configured to:
directly identifying a first type of difference code file belonging to the target hardware platform from a plurality of original code files of the target software code;
for other original code files except the first type of difference code file in the plurality of original code files, identifying difference codes belonging to the target hardware platform from the other original code files by analyzing difference configuration information of the target hardware platform;
generating a second type difference code file aiming at the target hardware platform according to the difference code belonging to the target hardware platform;
forming a set of difference code files for the target hardware platform based on the first type of difference code file and the second type of difference code file.
In an optional implementation manner, the software construction apparatus further includes:
a first selecting unit 205, configured to obtain a software building manner selection result, where the software building manner selection result indicates whether platform-differentiated building software needs to be performed on the target software code;
a second selecting unit 206, configured to, if the selection result of the selection result obtaining unit is yes, obtain more than one target hardware platform that needs to differentiate platform building software, and call, for each target hardware platform, the following units:
the main line compiling unit 201 is configured to perform code compiling of a main line on a target software code to obtain a main line compiled file package;
the difference compiling unit 202 is configured to obtain a set of difference code files for a target hardware platform from the target software code, and independently compile the set of difference code files to obtain a set of difference compilation files corresponding to the target hardware platform;
the file writing unit 203 is configured to write the main line compiled file package and the set of difference compiled files into a newly created packaging directory of the target hardware platform, and replace files, which meet preset same conditions, in the main line compiled file package with the set of difference compiled files in the packaging directory;
the independent packing unit 204 is configured to pack the packing directory to obtain a software package applied to the target hardware platform;
the device further comprises an integral packaging unit 207, which is used for integrally packaging all codes of the main line compiling file package to obtain a corresponding integral software package.
In an optional implementation manner, the software building apparatus further includes a difference configuration unit, configured to distinguish, in advance, difference codes belonging to different hardware platforms in the object software code through the difference configuration file before the object software code is compiled.
It should be noted that, for implementation details of the software construction apparatus applied to multiple platforms in the second aspect, reference may be made to implementation details in the foregoing software method embodiment applied to multiple platforms, and for brevity of the description, no further details are described.
In a third aspect, based on the same inventive concept as that of the foregoing embodiment of the software construction method applied to multiple platforms, an embodiment of this specification further provides an electronic device, as shown in fig. 3, including a memory 304, a processor 302, and a computer program stored in the memory 304 and operable on the processor 302, where the processor 302 implements the steps described in the foregoing embodiment of the software construction method applied to multiple platforms when executing the program.
Where in fig. 3 a bus architecture (represented by bus 300), bus 300 may include any number of interconnected buses and bridges, bus 300 linking together various circuits including one or more processors, represented by processor 302, and memory, represented by memory 304. The bus 300 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 306 provides an interface between the bus 300 and the receiver 301 and transmitter 303. The receiver 301 and the transmitter 303 may be the same element, i.e., a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 302 is responsible for managing the bus 300 and general processing, and the memory 304 may be used for storing data used by the processor 302 in performing operations.
In a fourth aspect, based on the same inventive concept as the software construction method applied to multiple platforms in the foregoing embodiments, the present specification embodiment further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps described in the foregoing software construction method applied to multiple platforms.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (12)

1. A software construction method applied to multiple platforms is characterized by comprising the following steps:
performing code compiling of a main line on a target software code to obtain a main line compiling file packet;
acquiring a group of difference code files aiming at a target hardware platform from the target software code, and independently compiling the group of difference code files to obtain a group of difference compilation files corresponding to the target hardware platform;
writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files in the packing directory;
and packaging the packaging catalog to obtain a software package applied to the target hardware platform.
2. The method of claim 1, wherein obtaining a set of difference code files for a target hardware platform from the target software code comprises:
acquiring difference configuration information of the target hardware platform from a difference configuration file corresponding to the target software code, wherein the difference configuration file is used for distinguishing difference codes belonging to different hardware platforms in the target software code;
and acquiring a group of difference code files aiming at the target hardware platform from the target software codes according to the difference configuration information of the target hardware platform.
3. The method of claim 2, wherein the target software code comprises a plurality of original code files, and the obtaining a set of difference code files for the target hardware platform from the target software code according to the difference configuration information of the target hardware platform comprises:
directly identifying a first type of difference code file belonging to the target hardware platform from a plurality of original code files of the target software code;
for other original code files except the first type of difference code file in the plurality of original code files, identifying difference codes belonging to the target hardware platform from the other original code files by analyzing difference configuration information of the target hardware platform;
generating a second type difference code file aiming at the target hardware platform according to the difference code belonging to the target hardware platform;
forming a set of difference code files for the target hardware platform based on the first type of difference code file and the second type of difference code file.
4. The method of claim 1, after performing code compilation of a main line on the target software code to obtain a main line compiled file package, further comprising:
acquiring a software construction mode selection result, wherein the software construction mode selection result indicates whether platform construction software needs to be distinguished for the target software code;
if the selection result is yes, acquiring more than one target hardware platform needing platform-differentiated construction software, and executing the following steps aiming at each target hardware platform: performing code compiling of a main line on a target software code to obtain a main line compiling file packet; acquiring a group of difference code files aiming at a target hardware platform from the target software code, and independently compiling the group of difference code files to obtain a group of difference compilation files corresponding to the target hardware platform; writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files in the packing directory; packaging the packaging catalog to obtain a software package applied to the target hardware platform;
and if the software construction mode selection result is negative, integrally packaging all codes of the main line compiling file package to obtain a corresponding integral software package.
5. The method according to claim 2, wherein before the target software code is compiled, the difference code belonging to different hardware platforms in the target software code is distinguished in advance through the difference configuration file.
6. A software building device applied to multiple platforms is characterized by comprising:
the main line compiling unit is used for compiling the code of the main line of the target software code to obtain a main line compiling file packet;
a difference compiling unit, configured to obtain a group of difference code files for a target hardware platform from the target software code, and perform independent compiling on the group of difference code files to obtain a group of difference compiled files corresponding to the target hardware platform;
the file writing unit is used for writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files under the packing directory;
and the independent packaging unit is used for packaging the packaging catalog to obtain a software package applied to the target hardware platform.
7. The apparatus of claim 6, the difference compilation unit, comprising:
a configuration information obtaining subunit, configured to obtain difference configuration information of the target hardware platform from a difference configuration file corresponding to the target software code, where the difference configuration file is used to distinguish difference codes belonging to different hardware platforms in the target software code;
and the code acquisition subunit is used for acquiring a group of difference code files aiming at the target hardware platform from the target software code according to the difference configuration information of the target hardware platform.
8. The apparatus according to claim 7, wherein the object software code includes a plurality of original code files, and the code obtaining subunit is specifically configured to:
directly identifying a first type of difference code file belonging to the target hardware platform from a plurality of original code files of the target software code;
for other original code files except the first type of difference code file in the plurality of original code files, identifying difference codes belonging to the target hardware platform from the other original code files by analyzing difference configuration information of the target hardware platform;
generating a second type difference code file aiming at the target hardware platform according to the difference code belonging to the target hardware platform;
forming a set of difference code files for the target hardware platform based on the first type of difference code file and the second type of difference code file.
9. The apparatus of claim 6, further comprising:
the first selection unit is used for acquiring a software construction mode selection result, and the software construction mode selection result indicates whether platform-differentiated software construction needs to be carried out on the target software code or not;
a second selecting unit, configured to, if the selection result of the selection result obtaining unit is yes, obtain more than one target hardware platform that needs to differentiate platform building software, and call, for each target hardware platform, the following units:
the main line compiling unit is used for compiling the code of the main line of the target software code to obtain a main line compiling file packet;
the difference compiling unit is used for acquiring a group of difference code files aiming at a target hardware platform from the target software code and independently compiling the group of difference code files to obtain a group of difference compiling files corresponding to the target hardware platform;
the file writing unit is used for writing the main line compiling file package and the group of difference compiling files into a newly-built packing directory of the target hardware platform, and replacing files meeting preset same conditions in the main line compiling file package with the group of difference compiling files under the packing directory;
the independent packaging unit is used for packaging the packaging catalog to obtain a software package applied to the target hardware platform;
the device also comprises an integral packaging unit which is used for integrally packaging all codes of the mainline compiled file package to obtain a corresponding integral software package.
10. The apparatus of claim 7, further comprising:
and the difference configuration unit is used for distinguishing the difference codes belonging to different hardware platforms in the target software codes in advance through the difference configuration file before compiling the target software codes.
11. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
12. An electronic device comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors to perform the operational instructions of the method of any of claims 1-5.
CN202010645530.7A 2020-07-06 2020-07-06 Software construction method and device applied to multiple platforms Active CN111880803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010645530.7A CN111880803B (en) 2020-07-06 2020-07-06 Software construction method and device applied to multiple platforms

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010645530.7A CN111880803B (en) 2020-07-06 2020-07-06 Software construction method and device applied to multiple platforms

Publications (2)

Publication Number Publication Date
CN111880803A CN111880803A (en) 2020-11-03
CN111880803B true CN111880803B (en) 2022-12-27

Family

ID=73150320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010645530.7A Active CN111880803B (en) 2020-07-06 2020-07-06 Software construction method and device applied to multiple platforms

Country Status (1)

Country Link
CN (1) CN111880803B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113126974B (en) * 2021-06-17 2021-09-28 北京壁仞科技开发有限公司 Code generation/execution method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515919A (en) * 2019-08-20 2019-11-29 苏州浪潮智能科技有限公司 A kind of distributed type assemblies provide the method, equipment and readable medium of more storage services
CN111142935A (en) * 2019-12-31 2020-05-12 奇安信科技集团股份有限公司 Method, apparatus, computer system, and medium for cross-platform running of applications

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10225178B2 (en) * 2010-09-15 2019-03-05 Telefonaktiebolaget Lm Ericsson (Publ) Methods and apparatus for relocating and restoring connections through a failed serving gateway and traffic offloading

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515919A (en) * 2019-08-20 2019-11-29 苏州浪潮智能科技有限公司 A kind of distributed type assemblies provide the method, equipment and readable medium of more storage services
CN111142935A (en) * 2019-12-31 2020-05-12 奇安信科技集团股份有限公司 Method, apparatus, computer system, and medium for cross-platform running of applications

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Seadown:一种异构MapReduce集群中面向SLA的能耗管理方法;林彬等;《计算机学报》;20130515(第05期);全文 *

Also Published As

Publication number Publication date
CN111880803A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
US10579349B2 (en) Verification of a dataflow representation of a program through static type-checking
WO2020006910A1 (en) Business componentization development method and apparatus, computer device, and storage medium
JP4638484B2 (en) Data integrity in data processing equipment
US20070169004A1 (en) Automatic failure analysis of code development options
CN112685410B (en) Business rule checking method, device, computer equipment and storage medium
US9772865B2 (en) On-demand loading of dynamic scripting language code for reduced memory usage
CN110727581B (en) Crash positioning method and electronic equipment
CN110515641A (en) The update method of server firmware, apparatus and system
CN112068852B (en) Method, system, equipment and medium for installing open-source software based on domestic server
CN109032631A (en) Application program service packs acquisition methods, device, computer equipment and storage medium
CN111880803B (en) Software construction method and device applied to multiple platforms
CN109558121A (en) Development approach, device, equipment and the storage medium of interface drive program
CN115525534A (en) Test case generation method and platform based on swagger interface test
CN111596970B (en) Method, device, equipment and storage medium for dynamic library delay loading
CN116560629A (en) Serialization method, device, medium and equipment for data transmission object
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN115809076A (en) ECU software automation integration method and system
CN110765069A (en) Data migration method, device and system
JP2016128941A (en) Output determination device, output determination method, output determination program, and static analysis device
CN113342698A (en) Test environment scheduling method, computing device and storage medium
CN112114811A (en) Compiling method, device and equipment
CN116048818B (en) Resource allocation method and device
CN114091111B (en) Method and device for storing intelligent contracts of block chains
CN111881128B (en) Big data regression verification method and big data regression verification device
CN107341150B (en) Automatic publishing method and device

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
GR01 Patent grant
GR01 Patent grant