CN113010180A - Firmware generation method, system, device and medium - Google Patents

Firmware generation method, system, device and medium Download PDF

Info

Publication number
CN113010180A
CN113010180A CN202110271766.3A CN202110271766A CN113010180A CN 113010180 A CN113010180 A CN 113010180A CN 202110271766 A CN202110271766 A CN 202110271766A CN 113010180 A CN113010180 A CN 113010180A
Authority
CN
China
Prior art keywords
firmware
components
compiling
source code
related part
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
CN202110271766.3A
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.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer 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 Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110271766.3A priority Critical patent/CN113010180A/en
Publication of CN113010180A publication Critical patent/CN113010180A/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

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a firmware generation method, which comprises the following steps: acquiring source codes corresponding to a plurality of components of firmware; compiling the source code corresponding to each component by using different processes respectively to obtain the plurality of components; respectively storing the plurality of components obtained by compiling at different preset positions; in response to receiving a firmware generation instruction, the plurality of components are acquired from the preset position and are merged and compressed to obtain the firmware. The invention also discloses a system, a computer device and a readable storage medium. The scheme provided by the invention can greatly reduce the code branches of the firmware and reduce the version control flow.

Description

Firmware generation method, system, device and medium
Technical Field
The present invention relates to the field of firmware, and in particular, to a firmware generation method, system, device, and storage medium.
Background
Because the mirror image of the current Firmware is distinguished according to the type of the server and the clients, the server of each type has several or even dozens of clients, and development engineers need to correspondingly create different projects and compile and package to generate corresponding Firmware versions.
Due to the current situation, code branches of Firmware are more and more, management and control of the Firmware version are more and more difficult, and great maintenance workload is brought to development engineers.
Disclosure of Invention
In view of the above, in order to overcome at least one aspect of the above problems, an embodiment of the present invention provides a firmware generation method, including:
acquiring source codes corresponding to a plurality of components of firmware;
compiling the source code corresponding to each component by using different processes respectively to obtain the plurality of components;
respectively storing the plurality of components obtained by compiling at different preset positions;
in response to receiving a firmware generation instruction, the plurality of components are acquired from the preset position and are merged and compressed to obtain the firmware.
In some embodiments, obtaining source code corresponding to a plurality of components of the firmware further comprises:
dividing the firmware into a file system part, a hardware-related part and a user-requirement-related part;
and respectively generating source codes of the file system part, the hardware related part and the user requirement related part.
In some embodiments, storing the compiled components in different preset locations respectively further includes:
and storing the user requirement related part consisting of a plurality of sub-functions obtained after compiling into different folders according to the function types respectively.
In some embodiments, further comprising:
and in response to the source code of the file system part and/or the hardware related part being modified, recompiling and restoring the modified source code to the corresponding preset position.
In some embodiments, further comprising:
in response to receiving an instruction for modifying parameters of a plurality of sub-functions in the user demand related part, modifying the parameters of the plurality of sub-functions according to configuration information in the instruction.
In some embodiments, further comprising:
acquiring and compiling source codes of newly added subfunctions of the user demand related part;
and storing the newly added sub-functions obtained by compiling to the corresponding preset positions.
In some embodiments, compiling the source code corresponding to each of the components by using different processes, further includes:
compiling the source code corresponding to the relevant part of the user requirement into a dynamic library form.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a firmware generation system, including:
an acquisition module configured to acquire source codes corresponding to a plurality of components of firmware;
the compiling module is configured to compile the source code corresponding to each component by using different processes respectively to obtain the plurality of components;
a storage module configured to store the plurality of compiled components in different preset positions, respectively;
a merging module configured to, in response to receiving a firmware generation instruction, obtain the plurality of components from the preset location and merge and compress to obtain the firmware.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer apparatus, including:
at least one processor; and
a memory storing a computer program operable on the processor, wherein the processor executes the program to perform any of the steps of the firmware generation method described above.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program which, when executed by a processor, performs the steps of any of the firmware generation methods described above.
The invention has one of the following beneficial technical effects: the scheme provided by the invention can greatly reduce the code branches of the firmware and reduce the version control flow.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a firmware generation method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a firmware generation system according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a computer device provided in an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
According to an aspect of the present invention, an embodiment of the present invention provides a firmware generation method, as shown in fig. 1, which may include the steps of:
s1, acquiring source codes corresponding to a plurality of components of the firmware;
s2, compiling the source code corresponding to each component by using different processes respectively to obtain the components;
s3, storing the compiled components in different preset positions respectively;
s4, responding to the received firmware generation instruction, acquiring the components from the preset position, merging and compressing to obtain the firmware.
The scheme provided by the invention can greatly reduce the code branches of the firmware and reduce the version control flow.
In some embodiments, S1, obtaining source code corresponding to the plurality of components of the firmware, further includes:
dividing the firmware into a file system part, a hardware-related part and a user-requirement-related part;
and respectively generating source codes of the file system part, the hardware related part and the user requirement related part.
Specifically, the firmware may include a file system part, a hardware-related part, and a user-requirement-related part, where the file system part may be a file system that is fixed in content and does not change for a long time. The hardware-related parts may include uboot and kernel, which are parts related to hardware (e.g., server model), and these two contents are not substantially changed once the hardware is determined. The user requirement related part can be a configuration file and information of each application process, and can be changed according to different user requirements so as to realize a plurality of sub-functions according to the user requirements.
In some embodiments, uboot and kernel may account for 6M size, the file system may account for 16M size, and the configuration files and application processes may account for 10M size.
In some embodiments, S2, compiling the source code corresponding to each of the components by using different processes, further includes:
compiling the source code corresponding to the relevant part of the user requirement into a dynamic library form.
In some embodiments, storing the compiled components in different preset locations respectively further includes:
and storing the user requirement related part consisting of a plurality of sub-functions obtained after compiling into different folders according to the function types respectively.
Specifically, the source code of each component may be compiled in a blocking and multi-process manner, that is, the source code of each component is compiled by different processes. And after compiling is completed, the generated uboot and kernel are placed in a folder, and the file system is placed in a folder. And compiling the configuration file of the firmware and the application process into a dynamic library form according to clients and requirements, and respectively storing the dynamic library form in different folders named by item names.
In some embodiments, further comprising:
and in response to the source code of the file system part and/or the hardware related part being modified, recompiling and restoring the modified source code to the corresponding preset position.
Specifically, when the file system part and/or the hardware-related part needs to be modified, the source code of the file system part and/or the hardware-related part needs to be modified, then recompiled and stored in a corresponding preset position, such as a folder, and finally, the required file system part, the hardware-related part and the user-required part are respectively selected from a plurality of folders, merged and compressed to obtain the final required firmware.
In some embodiments, further comprising:
in response to receiving an instruction for modifying parameters of a plurality of sub-functions in the user demand related part, modifying the parameters of the plurality of sub-functions according to configuration information in the instruction.
Specifically, since the user requirement related part is compiled in the form of a dynamic library, when configuration parameters of a plurality of functions are required to be modified, corresponding sub-functions in the compiled user requirement related part can be directly modified.
It should be noted that the compiled user requirement related part may include a plurality of sub-functions, and the plurality of sub-functions may be stored in different folders, and then may be selected as needed when performing the compression and merging in step S4.
In some embodiments, further comprising:
acquiring and compiling source codes of newly added subfunctions of the user demand related part;
and storing the newly added sub-functions obtained by compiling to the corresponding preset positions.
Specifically, when a sub-function needs to be added to the part related to the user requirement, the source code corresponding to the sub-function may be compiled first, then stored in the corresponding preset location, and step S4 is performed again to merge and compress the source code to obtain the final firmware.
The scheme provided by the invention adapts to the customer requirements by adopting the modes of requirement classification, replacement and newly adding a dynamic library. According to the classification principle, the customer requirements are divided into all functional modules and code folders corresponding to the functional modules are established, and if the requirements are modified, codes for generating relevant parts of the customer requirements are replaced or newly added. And finally, combining the file system part, the hardware related part and the user requirement part into a firmware file in a bin format. If the file system part, the hardware related part and the user requirement part in the firmware need to be modified, the file system part, the hardware related part and the user requirement part are directly replaced and then merged and compressed.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a firmware generation system 400, as shown in fig. 2, including:
an obtaining module 401, where the obtaining module 401 is configured to obtain source codes corresponding to a plurality of components of firmware;
a compiling module 402, where the compiling module 402 is configured to compile a source code corresponding to each of the components by using different processes, respectively, to obtain the components;
a storage module 403, where the storage module 403 is configured to store the compiled multiple components at different preset positions respectively;
a merging module 404, where the merging module 404 is configured to, in response to receiving a firmware generation instruction, obtain the plurality of components from the preset location and merge and compress the components to obtain the firmware.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 3, an embodiment of the present invention further provides a computer apparatus 501, comprising:
at least one processor 520; and
the memory 510, the memory 510 stores a computer program 511 that is executable on the processor, and the processor 520 executes the program to perform the steps of any of the above firmware generation methods.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 4, an embodiment of the present invention further provides a computer-readable storage medium 601, where the computer-readable storage medium 601 stores computer program instructions 610, and the computer program instructions 610, when executed by a processor, perform the steps of any of the above firmware generation methods.
Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above.
Further, it should be appreciated that the computer-readable storage media (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A firmware generation method, comprising the steps of:
acquiring source codes corresponding to a plurality of components of firmware;
compiling the source code corresponding to each component by using different processes respectively to obtain the plurality of components;
respectively storing the plurality of components obtained by compiling at different preset positions;
in response to receiving a firmware generation instruction, the plurality of components are acquired from the preset position and are merged and compressed to obtain the firmware.
2. The method of claim 1, wherein obtaining source code corresponding to a plurality of components of firmware, further comprises:
dividing the firmware into a file system part, a hardware-related part and a user-requirement-related part;
and respectively generating source codes of the file system part, the hardware related part and the user requirement related part.
3. The method of claim 2, wherein the plurality of compiled components are stored in different predetermined locations, respectively, further comprising:
and storing the user requirement related part consisting of a plurality of sub-functions obtained after compiling into different folders according to the function types respectively.
4. The method of claim 2, further comprising:
and in response to the source code of the file system part and/or the hardware related part being modified, recompiling and restoring the modified source code to the corresponding preset position.
5. The method of claim 2, further comprising:
in response to receiving an instruction for modifying parameters of a plurality of sub-functions in the user demand related part, modifying the parameters of the plurality of sub-functions according to configuration information in the instruction.
6. The method of claim 2, further comprising:
acquiring and compiling source codes of newly added subfunctions of the user demand related part;
and storing the newly added sub-functions obtained by compiling to the corresponding preset positions.
7. The method of claim 2, wherein the source code corresponding to each of the components is compiled using a different process, respectively, further comprising:
compiling the source code corresponding to the relevant part of the user requirement into a dynamic library form.
8. A firmware generation system, comprising:
an acquisition module configured to acquire source codes corresponding to a plurality of components of firmware;
the compiling module is configured to compile the source code corresponding to each component by using different processes respectively to obtain the plurality of components;
a storage module configured to store the plurality of compiled components in different preset positions, respectively;
a merging module configured to, in response to receiving a firmware generation instruction, obtain the plurality of components from the preset location and merge and compress to obtain the firmware.
9. A computer device, comprising:
at least one processor; and
memory storing a computer program operable on the processor, wherein the processor executes the program to perform the steps of the method according to any of claims 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 7.
CN202110271766.3A 2021-03-12 2021-03-12 Firmware generation method, system, device and medium Pending CN113010180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110271766.3A CN113010180A (en) 2021-03-12 2021-03-12 Firmware generation method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110271766.3A CN113010180A (en) 2021-03-12 2021-03-12 Firmware generation method, system, device and medium

Publications (1)

Publication Number Publication Date
CN113010180A true CN113010180A (en) 2021-06-22

Family

ID=76406431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110271766.3A Pending CN113010180A (en) 2021-03-12 2021-03-12 Firmware generation method, system, device and medium

Country Status (1)

Country Link
CN (1) CN113010180A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721915A (en) * 2021-07-28 2021-11-30 苏州浪潮智能科技有限公司 Code compiling method, device and equipment and computer readable storage medium
CN113794589A (en) * 2021-08-31 2021-12-14 新华三技术有限公司成都分公司 AC firmware packaging method, AP upgrading method and AC

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110276954A1 (en) * 2010-05-06 2011-11-10 International Business Machines Corporation Simultaneous compiler binary optimizations
CN104765593A (en) * 2014-01-06 2015-07-08 北京深思数盾科技有限公司 Firmware customizing method and hardware apparatus for customizing firmware
CN109491662A (en) * 2018-10-31 2019-03-19 珠海市筑巢科技有限公司 Code packaging method, computer installation and computer readable storage medium, code packaging system
CN109542463A (en) * 2018-10-26 2019-03-29 深圳壹账通智能科技有限公司 Compiling file packet transmission method, device, computer equipment and storage medium
CN110245468A (en) * 2019-05-24 2019-09-17 阿里巴巴集团控股有限公司 A kind of Compilation Method, device, equipment and system
CN111045713A (en) * 2019-12-19 2020-04-21 浪潮(北京)电子信息产业有限公司 Method, system and device for upgrading computer system
CN111124420A (en) * 2019-12-19 2020-05-08 北京百度网讯科技有限公司 Compiling method, device, electronic equipment and readable storage medium
CN111597140A (en) * 2020-04-27 2020-08-28 深圳市有方科技股份有限公司 Multi-core device function configuration method and device
CN111752572A (en) * 2020-06-29 2020-10-09 百度在线网络技术(北京)有限公司 Compiling method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110276954A1 (en) * 2010-05-06 2011-11-10 International Business Machines Corporation Simultaneous compiler binary optimizations
CN104765593A (en) * 2014-01-06 2015-07-08 北京深思数盾科技有限公司 Firmware customizing method and hardware apparatus for customizing firmware
CN109542463A (en) * 2018-10-26 2019-03-29 深圳壹账通智能科技有限公司 Compiling file packet transmission method, device, computer equipment and storage medium
CN109491662A (en) * 2018-10-31 2019-03-19 珠海市筑巢科技有限公司 Code packaging method, computer installation and computer readable storage medium, code packaging system
CN110245468A (en) * 2019-05-24 2019-09-17 阿里巴巴集团控股有限公司 A kind of Compilation Method, device, equipment and system
CN111045713A (en) * 2019-12-19 2020-04-21 浪潮(北京)电子信息产业有限公司 Method, system and device for upgrading computer system
CN111124420A (en) * 2019-12-19 2020-05-08 北京百度网讯科技有限公司 Compiling method, device, electronic equipment and readable storage medium
CN111597140A (en) * 2020-04-27 2020-08-28 深圳市有方科技股份有限公司 Multi-core device function configuration method and device
CN111752572A (en) * 2020-06-29 2020-10-09 百度在线网络技术(北京)有限公司 Compiling method, device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721915A (en) * 2021-07-28 2021-11-30 苏州浪潮智能科技有限公司 Code compiling method, device and equipment and computer readable storage medium
CN113721915B (en) * 2021-07-28 2023-07-14 苏州浪潮智能科技有限公司 Code compiling method, device, equipment and computer readable storage medium
CN113794589A (en) * 2021-08-31 2021-12-14 新华三技术有限公司成都分公司 AC firmware packaging method, AP upgrading method and AC
CN113794589B (en) * 2021-08-31 2023-11-07 新华三技术有限公司成都分公司 Packaging method of AC firmware, upgrading method of AP and AC

Similar Documents

Publication Publication Date Title
US10915429B2 (en) Employing code overlays to facilitate software development
CN102289378B (en) Method for automatically generating APP (Application)
US20220179642A1 (en) Software code change method and apparatus
CN111459539B (en) Continuous integration pipeline operation method and device based on mirror layering
CN113010180A (en) Firmware generation method, system, device and medium
CN110806868A (en) Single-page building and loading method
JP2010250378A (en) Software development support apparatus, system, function extension method for software development support apparatus and program
CN109144511B (en) Method and system for automatically generating numerical simulation graphical user interface
CN110704031A (en) Software application project creating method and device and electronic equipment
CN116149747A (en) Interface arrangement method, device, electronic equipment and computer readable storage medium
CN115878092A (en) Code generation method, device and medium based on micro-service architecture
US11416455B2 (en) Version control of electronic files defining a model of a system or component of a system
CN111159301A (en) Data creating method, device, equipment and storage medium based on intelligent contract
CN115525534A (en) Test case generation method and platform based on swagger interface test
AU2016378425B2 (en) Application program running method and apparatus
CN111427568A (en) Interface configuration method and device
CN115576560A (en) Hot reloading method, device, equipment and medium for dynamic loader
CN109725905A (en) Software architecture and implementation method based on source code collection, plug-in unit and application method for compiling pins component
CN115857999A (en) Method and system for obtaining micro front-end system architecture based on vue system architecture transformation
CN114968225A (en) Micro-service unified construction method, environment generation method and related equipment
CN115292169A (en) UI automation test method and system
JP2014228990A (en) Control program creation apparatus and control program creation method
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device
CN114579135B (en) Installation package generation method and device
CN111221551B (en) Database upgrading 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