CN114816418A - Method, device, equipment and medium for building embedded operating system - Google Patents

Method, device, equipment and medium for building embedded operating system Download PDF

Info

Publication number
CN114816418A
CN114816418A CN202210409836.1A CN202210409836A CN114816418A CN 114816418 A CN114816418 A CN 114816418A CN 202210409836 A CN202210409836 A CN 202210409836A CN 114816418 A CN114816418 A CN 114816418A
Authority
CN
China
Prior art keywords
building block
information
target
building
operating system
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
CN202210409836.1A
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202210409836.1A priority Critical patent/CN114816418A/en
Publication of CN114816418A publication Critical patent/CN114816418A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a method, a device, equipment and a medium for building an embedded operating system, wherein the method comprises the following steps: building a target environment; acquiring identification information of a first building block component and target parameter information matched with an embedded operating system; downloading the first building block component and a script file corresponding to the first building block component to a target environment at least according to the identification information of the first building block component; downloading a second building block component and a script file corresponding to the second building block component to a target environment at least according to building block dependence information in the script file corresponding to the first building block component; and compiling the target building block assembly according to the building block configuration information in the script file corresponding to the target building block assembly and the identification information of the set functional module in the target parameter information to obtain a compiled executable file serving as an embedded operating system. According to the method and the system, the target environment is built, the target parameter information is configured only once, the embedded operating system can be built in a one-stop mode, the process is simple, and the building efficiency is improved.

Description

Method, device, equipment and medium for building embedded operating system
Technical Field
The present application relates to the field of computers, and in particular, to a method, an apparatus, a device, and a medium for building an embedded operating system.
Background
An embedded operating system is an operating system for embedded devices, such as resource-constrained devices like intelligent light fixtures, air conditioners, refrigerators, and the like. Different from an operating system used for a mobile phone and a PC (personal computer), the operating system environment of an embedded operating system is complex, and usable resources also have large and small sizes, for example, the embedded operating system can operate in Bluetooth low-power-consumption equipment with dozens of K memories, also can operate in dozens of M memories and network equipment capable of operating wifi and communicating networks, because the complex system environment means that the embedded operating system is difficult to standardize, and various problems can be encountered when the operating system is constructed.
At present, the building of an embedded operation system generally comprises three main steps, wherein the first step is the building of a compiling environment, various software needs to be installed in the building of the compiling environment at present, and due to the fact that the building environment difference is large, problems such as software version conflict can occur frequently, a large amount of time has to be spent on debugging and solving the problems, and time consumption and low efficiency are caused; the second step is to download related codes (i.e. software modules), all source codes can be downloaded from a software warehouse at present, the source codes contain both the software required by the project and some unnecessary software, developers usually need to spend several days to determine which modules are required and which are not required, and a great deal of time is also consumed for the developers; the third step is that according to the requirements of the system, functions need to be cut and configured in a certain file through a macro or other modes, each software module is generally configured in different header files, even a single software module is configured in different places for multiple times, and the configurable files are not in the same configuration header file, so that related configurations are easily omitted, confusion is caused, and development efficiency is influenced.
In summary, due to the large difference of the building environments, the complex configuration and the like, the existing building method of the embedded operating system has the defects of difficult building and low development efficiency, and needs to be solved urgently.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, a device and a medium for building an embedded operating system, so as to solve the problems of difficult building and low development efficiency in the prior art, and the technical scheme is as follows:
a building method of an embedded operating system comprises the following steps:
building a target environment;
acquiring identification information of a first building block assembly and target parameter information matched with an embedded operating system, wherein the first building block assembly is a root building block assembly in the target building block assembly, script files corresponding to each building block assembly contained in the target building block assembly comprise building block dependence information and building block configuration information, the building block dependence information is used for describing dependence between the corresponding building block assembly and other building block assemblies, the building block configuration information is used for describing whether a plurality of function modules forming the corresponding building block assembly are set function modules required for building the embedded operating system, and the target parameter information at least comprises the identification information of the set function modules;
downloading the first building block component and a script file corresponding to the first building block component into a target environment at least according to the identification information of the first building block component;
downloading a second building block component and a script file corresponding to the second building block component into a target environment at least according to building block dependence information in the script file corresponding to the first building block component, wherein the second building block component is other building block components except the first building block component in the target building block component;
and compiling the downloaded target building block assembly according to the building block configuration information in the script file corresponding to the target building block assembly and the identification information of the set functional module in the target parameter information to obtain a compiled executable file which is used as the built embedded operating system.
Optionally, the building of the target environment on the embedded device includes:
and (3) building a target environment by using a virtual environment technology and target sandbox software, or creating a docker virtual image.
Optionally, the obtaining target parameter information matched with the embedded operating system includes:
and rewriting the preset initial parameter information to obtain target parameter information matched with the embedded operating system, or writing the target parameter information matched with the embedded operating system.
Optionally, the script information of any building block component further includes version information of the building block component;
downloading the script files corresponding to the first building block component and the first building block component to a target environment at least according to the identification information of the first building block component, wherein the downloading comprises the following steps:
determining a software sub-warehouse where a first building block assembly is located as a first software sub-warehouse according to identification information of the first building block assembly and preset warehouse information, wherein the warehouse information comprises a corresponding relation between the identification information of the building block assembly and the identification information of the software sub-warehouse, and the first software sub-warehouse comprises script files corresponding to the first building block assemblies under a plurality of versions and the first building block assemblies under a plurality of versions respectively;
if the target parameter information does not include the first version information, downloading the first building block component in the latest version and the script file corresponding to the first building block component in the latest version from the first software sub-warehouse to a target environment, wherein the first version information is the version information of the first building block component needing to be downloaded;
and if the target warehouse information comprises the first version information, downloading the first building block component under the first version information and the script file corresponding to the first building block component under the first version information from the first software sub-warehouse into the target environment.
Optionally, at least according to the building block dependency information in the script file corresponding to the first building block assembly, downloading the script file corresponding to the second building block assembly and the second building block assembly into the target environment, including:
if the target parameter information does not include second version information, downloading the second building block assembly in the latest version and the script file corresponding to the second building block assembly in the latest version to a target environment according to building block dependence information and warehouse information in the script file corresponding to the first building block assembly, wherein the second version information is version information of the second building block assembly needing to be downloaded;
and if the target parameter information comprises second version information, downloading a second building block component under the second version information and a script file corresponding to the second building block component under the second version information into the target environment according to building block dependence information and warehouse information in the script file corresponding to the first building block component.
Optionally, according to building block dependency information and warehouse information in the script file corresponding to the first building block assembly, downloading a second building block assembly under the second version information and a script file corresponding to the second building block assembly under the second version information to the target environment, including:
determining identification information of a second software sub-warehouse according to building block dependence information and warehouse information in the script file corresponding to the first building block assembly, wherein the second software sub-warehouse is a software sub-warehouse where the second building block assembly is located;
constructing a dependency tree for the embedded operating system according to building block dependency information, second version information and identification information of a second software sub-warehouse in a script file corresponding to a first building block component, wherein each node of the dependency tree corresponds to one building block component in a target building block component, the node corresponding to the first building block component comprises first version information and identification information of the first software sub-warehouse, and the node corresponding to the second building block component comprises second version information and identification information of the second software sub-warehouse;
and downloading a second building block component under the second version information and a script file corresponding to the second building block component under the second version information from a second software sub-warehouse indicated by the identification information of the second software sub-warehouse into the target environment according to the dependency tree.
Optionally, compiling the downloaded target building block assembly according to building block configuration information in the script file corresponding to the target building block assembly and identification information of the set function module in the target parameter information to obtain a compiled executable file, including:
setting identification information of the functional module according to building block configuration information in a script file corresponding to the target building block assembly and identification information of the target parameter information to obtain a target configuration file;
cutting the downloaded target building block assembly according to the target configuration file to obtain a cut target building block assembly;
generating a target compiling file according to the target configuration file, wherein the target compiling file is used for indicating how to compile the cut target building block components;
and compiling the cut target building block assembly according to the target compiling file to obtain a compiled executable file.
Optionally, the obtaining of the target configuration file according to the building block configuration information in the script file corresponding to the target building block component and the identification information of the function module set in the target parameter information includes:
and modifying the building block configuration information in the script file corresponding to the target building block assembly according to the identification information of the set functional module in the target parameter information, and obtaining the target configuration file according to the modified building block configuration information.
Optionally, according to the target configuration file, the downloaded target building block assembly is cut to obtain a cut target building block assembly, including:
and cutting off other functional modules except the set functional module in the downloaded target building block assembly according to the target configuration file to obtain the cut target building block assembly.
Optionally, the script file corresponding to the target building block component further includes building block post-processing information;
compiling the downloaded target building block assembly according to building block configuration information in the script file corresponding to the target building block assembly and identification information of the set function module in the target parameter information, and after obtaining a compiled executable file, further comprising:
and performing post-processing on the compiled executable file according to the building block post-processing information, wherein the post-processed executable file is used as the built embedded operating system.
Optionally, according to the building block post-processing information, post-processing is performed on the compiled executable file, including:
if the building block post-processing information comprises encryption processing, acquiring an encryption command from an external designated position, and encrypting the compiled executable file based on the encryption command;
and/or the presence of a gas in the gas,
if the building block post-processing information comprises packet header adding processing, acquiring a packet header adding command from an external designated position, and adding packet header information to the compiled executable file based on the packet header adding command;
and/or the presence of a gas in the gas,
and if the building block post-processing information comprises function printing processing, acquiring a function printing command from an external designated position, and printing and outputting the function list information corresponding to the compiled executable file based on the function printing command.
A building device of an embedded operating system comprises: the system comprises a target environment building module, an information acquisition module, a first downloading module, a second downloading module and a compiling module;
the target environment building module is used for building a target environment;
the information acquisition module is used for acquiring identification information of a first building block assembly and target parameter information matched with an embedded operating system, wherein the first building block assembly is a root building block assembly in the target building block assembly, script files corresponding to each building block assembly contained in the target building block assembly comprise building block dependence information and building block configuration information, the building block dependence information is used for describing dependence relations between the corresponding building block assembly and other building block assemblies, the building block configuration information is used for describing whether a plurality of functional modules forming the corresponding building block assembly are set functional modules required for building the embedded operating system, and the target parameter information at least comprises the identification information of the set functional modules;
the first downloading module is used for downloading the first building block component and the script file corresponding to the first building block component into the target environment at least according to the identification information of the first building block component;
the second downloading module is used for downloading script files corresponding to a second building block component and a second building block component into a target environment at least according to building block dependence information in the script file corresponding to the first building block component, wherein the second building block component is other building block components except the first building block component in the target building block component;
and the compiling module is used for compiling the downloaded target building block assembly according to the building block configuration information in the script file corresponding to the target building block assembly and the identification information of the set functional module in the target parameter information to obtain a compiled executable file which is used as the built embedded operating system.
The building equipment of the embedded operating system comprises a memory and a processor;
a memory for storing a program;
and the processor is used for executing the program and realizing the steps of the building method of the embedded operating system.
A readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the method of building an embedded operating system as in any one of the above.
According to the technical scheme, the method for building the embedded operating system firstly builds the target environment, then obtaining the identification information of the first building block component and the target parameter information matched with the embedded operating system, then, at least according to the identification information of the first building block component, downloading the first building block component and the script file corresponding to the first building block component into the target environment, then, at least according to the building block dependence information in the script file corresponding to the first building block component, downloading the second building block component and the script file corresponding to the second building block component to the target environment, finally, according to the building block configuration information in the script file corresponding to the target building block component and the identification information of the function module set in the target parameter information, and compiling the downloaded target building block assembly to obtain a compiled executable file which is used as a built embedded operating system. Therefore, the method shields the difference of compiling and constructing the operating system to be operated and the platform software of the embedded operating system by adopting the mode of constructing the target environment, the method can build the compiling environment in a one-stop mode, and the method can maintain the existing software module in a building block assembly mode, when the embedded operating system is built, only the target building block components related to the embedded operating system are downloaded according to the needs without downloading all the building block components, thereby saving the downloading time, in addition, the time of the developer is saved as the developer does not need to pay attention to the downloaded building block assemblies, and the developer does not need to the downloaded building block assemblies, and in addition, the embedded operating system can be built in a one-stop mode only by configuring target parameter information matched with the embedded operating system at one time, so that the building process is simple, and the building efficiency of the embedded operating system is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for building an embedded operating system provided in an embodiment of the present application;
FIG. 2a is a diagram illustrating an embedded operating system architecture provided in the prior art;
FIG. 2b is a schematic diagram of the architecture of an embedded operating system built by the present application;
fig. 3 is a schematic structural diagram of a setup device of an embedded operating system according to an embodiment of the present application;
fig. 4 is a hardware structure block diagram of a building device of an embedded operating system provided in the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all 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 view of the problems in the prior art, the inventors of the present application have conducted intensive studies, and finally propose a method for building an embedded operating system, and then describe in detail the method for building an embedded operating system provided in the present application through the following embodiments.
Referring to fig. 1, a flow diagram of a building method of an embedded operating system provided in an embodiment of the present application is shown, where the building method of the embedded operating system may include:
and S101, building a target environment.
Considering that a lot of time is consumed in building the compiling environment due to different desktop operating systems, different compiling software versions, different functional software and the like when the embedded operating system is built, the step can build the target environment, so that the difference of the operating systems (such as a Windows system, a Linux system and the like) can be shielded in the minimum space.
It should be noted that, unlike the prior art, the present application builds an embedded operating system based on a target environment, and therefore, tool software (such as a building tool and building software, where the building software may be CMake or Make software, for example) used in the process of building the embedded operating system also needs to be pre-installed in the target environment, that is, the tool software used in the process of building the embedded operating system needs to be run in the target environment.
In addition, specific implementation manners of the step can be various, and the application provides, but is not limited to, the following two implementation manners.
The first method comprises the following steps: and creating a docker virtual image, and correspondingly pre-installing all tool software in the image.
This first method requires the establishment of an operating system image, which occupies a larger disk space, and based on this, the following second implementation may be preferably adopted in this step.
And the second method comprises the following steps: and building a target environment by using virtual environment technology and target sandbox software.
Optionally, the virtual environment technology may specifically be Python virtual environment technology, and the target sandbox software may be miniconda software or other Python sandbox software, that is, the step may use Python virtual environment technology, and use miniconda software or other Python sandbox software to build the target environment.
Optionally, the target environment established in this embodiment may be locally operated when the system is constructed, or may be downloaded from a software repository for operation.
In conclusion, the virtualization and appointed software pre-installation technology is adopted in the step, the difference of the operating system is shielded, the difference of the platform software is shielded, all needed tool software is installed in advance, time consumption for a developer to select and install the software is saved, and the developer builds a compiling environment in a one-stop mode.
And S102, acquiring identification information of the first building block assembly and target parameter information matched with the embedded operating system.
The first building block assembly is a root building block assembly in the target building block assembly, script files corresponding to each building block assembly contained in the target building block assembly comprise building block dependence information and building block configuration information, the building block dependence information is used for describing dependence relations between the corresponding building block assembly and other building block assemblies, the building block configuration information is used for describing whether a plurality of function modules forming the corresponding building block assembly are set function modules required for building an embedded operating system, and the target parameter information at least comprises identification information of the set function modules.
"building elements" will be described first so that those skilled in the art will understand more about the "building elements" provided in this embodiment.
Referring to fig. 2a, in the prior art (before building block modularization transformation), the whole embedded operating system is a unified whole, and different software modules are distinguished in the whole; in this embodiment, the existing software modules may be subjected to modular building processing in advance to obtain building blocks corresponding to each software module, and then when the embedded operating system is built in this step, the building blocks may be used as basic units of the embedded operating system, based on which, the schematic architecture diagram of the built embedded operating system may be shown in fig. 2 b.
Alternatively, the present embodiment may write a building block component modification tool for performing component building processing on software modules through a high-level language (e.g., Python), and then process each existing software module into a building block component based on the written building block component modification tool.
It should be noted that, in the prior art, each software module is composed of a plurality of functional modules, and accordingly, after the software module is subjected to modular building processing, each building block assembly is composed of the functional modules, for example, building block assembly a is composed of the functional modules 1 to 5, building block assembly B is composed of the functional modules 6 to 7, building block assembly C is composed of the functional modules 8 to 10, building block assembly D is composed of the functional module 11, and the like.
In this embodiment, after each software module in the prior art is transformed into a building block assembly, a corresponding script file can be compiled for each building block assembly, so that the script file describes the relevant information of the building block assembly according to which the building process of the embedded operating system needs to be based.
In an optional embodiment, the script file corresponding to any block component at least includes block dependency information and block configuration information.
The building block dependency information in the script file corresponding to one building block element is used to describe the dependency relationship between the building block element and other building block elements, for example, the script file corresponding to the first building block element includes the dependency relationship between the first building block element and the lower building block element (i.e., the second layer of building block elements).
Optionally, the dependency relationship may be described by a dependency table, that is, the dependency table represents upper and lower layer dependency relationships between the building element and other building elements; since the upper layer building block component may call the interface provided by the lower layer building block component, optionally, the building block dependency information may specifically include interface dependency information.
The building block configuration information in the script file corresponding to a building block assembly is used to describe whether a plurality of function modules constituting the building block assembly are set function modules required for building an embedded operating system (when the embedded operating system is built, some or all function modules of a certain building block assembly may be used, and in this embodiment, the function modules used when the embedded operating system is built are defined as the set function modules).
Optionally, in this embodiment, Y and N may be used to indicate whether each function module is a set function module, where if a function module is configured as Y, it indicates that the function module is a set function module, and if the function module is configured as N, it indicates that the function module is not a set function module, and both the function modules may be configured as Y or N in the initial situation.
For example, the block configuration information for a block element (journal element) is:
Feature_config:
LOG _ SUPPORT _ ASYNC (where N may also be Y)
LOG _ SUPPORT _ FS N (where N may also be Y)
LOG _ SUPPORT _ CLOUD N (where N may also be Y)
Here, "LOG _ SUPPORT _ ASYNC", "LOG _ SUPPORT _ FS", and "LOG _ SUPPORT _ closed" are three functional modules constituting a LOG component, where "LOG _ SUPPORT _ ASYNC" represents an asynchronous LOG function, if Y indicates that the built embedded operating system SUPPORTs an asynchronous LOG, and if N indicates that it does not SUPPORT; the LOG _ SUPPORT _ FS represents that the LOG is stored in the file system function, if Y represents that the built embedded operating system SUPPORTs the LOG to be stored in the file system, and if N represents that the built embedded operating system does not SUPPORT the LOG; the LOG _ SUPPORT _ group represents that the LOG is transmitted to the CLOUD service front-end function, if the built embedded operating system is represented by Y, the LOG is transmitted to the CLOUD service front-end, and if the built embedded operating system is represented by N, the LOG is not supported.
It should be noted that Y and N are only examples, and other labels may be used besides the examples, and the present application is not limited to this.
Optionally, the script file can be implemented by using script languages such as YAML, JSON, XML and the like, and is easy for developers to read and write and easy to process by using a high-level language. Preferably, the script file may be implemented using a YAML script language.
It can be understood that there may be some functions that need to be implemented by the embedded operating system, related codes are not yet developed, that is, there is no software module corresponding to the function in the prior art, at this time, the building block assembly corresponding to the function that needs to be implemented may still be generated by the building block assembly modification tool written in this embodiment, and because related codes are not yet developed, the content of the building block assembly corresponding to the function that needs to be implemented is empty. In order to add information such as relevant codes in the empty building block component based on the functions to be realized subsequently, scaffold codes of the building block component corresponding to the empty building block component can be automatically generated according to the undeveloped relevant codes.
Optionally, the building block assembly scaffold code includes the following information: firstly, a component information file is used for automatically adding related information according to a code directory name; secondly, a default code directory structure is used for scanning the code directory and automatically generating directory information; thirdly, default system configuration options are used for reserving space to facilitate customization of developers according to needs; and fourthly, a compiling option is defaulted, and the compiling option is used for reserving space so as to be convenient for developers to customize according to requirements. Of course, the building block assembly scaffold code may also include other information, which is not limited in this application.
In this step, the first building element is the building element within the dashed box shown in fig. 2, which is the first layer of building elements required for building the embedded operating system.
Optionally, the first building block component is generally an application level component, where the application level component includes a hardware component and a solution component that are applicable to a current hardware platform (a hardware platform corresponding to an embedded operating system to be currently built), for example, the first building block component may be a Helloworld component, a device cloud component, or the like.
It is noted that the embedded operating system to be built may correspond to only one first building element or to a plurality of first building elements, for example, fig. 2b shows a plurality of first building elements.
The step can also obtain target parameter information matched with the embedded operating system to be built currently. Here, the target parameter information at least includes identification information of the set function module, and which function modules are the set function modules and which function modules are not the set function modules can be determined by the identification information included in the target parameter information.
Optionally, there may be multiple specific implementation manners of "obtaining target parameter information matched with the embedded operating system" in this step, and the present application provides, but is not limited to, the following two implementation manners.
The first method comprises the following steps: and rewriting the preset initial parameter information to obtain target parameter information matched with the embedded operating system.
Here, the preset initial parameter information is parameter information written for other projects (i.e., other embedded operating systems), and in this step, only the initial parameter information needs to be rewritten into the target parameter information required by this project, so that the target parameter information matched with the embedded operating system to be built in this embodiment can be obtained.
And the second method comprises the following steps: and compiling target parameter information matched with the embedded operating system.
It can be understood that there may be a case where the initial parameter information is not written in advance, and at this time, the target parameter information may also be written directly for the embedded operating system to be built.
And S103, downloading the first building block assembly and the script file corresponding to the first building block assembly into a target environment at least according to the identification information of the first building block assembly.
Here, if the first building block element includes a plurality of building block elements, the script file corresponding to the first building block element refers to script files respectively corresponding to the building block elements included in the first building block element; similarly, the script file corresponding to the second building block component refers to script files corresponding to the building blocks contained in the second building block component, and the script file corresponding to the target building block component refers to script files corresponding to the building blocks contained in the target building block component.
As described in the foregoing steps, in this embodiment, a building tool is pre-installed in the target environment, and in this step, the script file corresponding to the first building element and the first building element may be downloaded by the building tool.
And S104, downloading the second building block component and the script file corresponding to the second building block component to a target environment at least according to the building block dependence information in the script file corresponding to the first building block component.
And the second building block component is other building block components except the first building block component in the target building block component. Here, the target building elements are all building elements required for building the current embedded operating system, i.e. all building elements shown in fig. 2b, and the second building elements are all building elements outside the dashed box shown in fig. 2 b.
Specifically, in this step, the building block dependency information in the script file corresponding to the first building block assembly describes a dependency relationship between the first building block assembly and the second building block assembly, the second building block assembly on which the first building block assembly depends can be determined through the dependency relationship, and correspondingly, the script file corresponding to each building block assembly in the second building block assembly can be determined; building block dependency information in the script file corresponding to the second layer of building blocks describes the dependency relationship between the second layer of building blocks and the third layer of building blocks, the third layer of building blocks on which the second layer of building blocks depend can be determined through the dependency relationship, and correspondingly, the script file corresponding to each building block in the third layer of building blocks can be determined; by analogy, script files corresponding to all second building block components and second building block components can be determined, and therefore the script files corresponding to the second building block components and the second building block components can be downloaded to the target environment.
As described in the foregoing steps, in this embodiment, a building tool is pre-installed in the target environment, and in this step, the script file corresponding to the second building block element and the second building block element may be downloaded by the building tool.
Through the steps and the steps, all the building block assemblies (namely target building block assemblies) and the script files corresponding to the building block assemblies, which are required when the embedded operating system is built, can be downloaded to a target environment, so that the embedded operating system can be built based on the target building block assemblies subsequently.
And S105, compiling the downloaded target building block assembly according to building block configuration information in the script file corresponding to the target building block assembly and identification information of the set functional module in the target parameter information to obtain a compiled executable file serving as the built embedded operating system.
As described in the foregoing steps, in this embodiment, the building tool and the building software are preinstalled in the target environment, and optionally, in this step, when the building system is not installed with the building software, the building software may be automatically downloaded from the software warehouse, and then, the identification information of the function module may be set according to the building block configuration information and the target parameter information in the script file corresponding to the target building block assembly, and the target building block assembly downloaded in the foregoing step is compiled using the installed building tool, building software and building software, and the compiling information is output, and when an error occurs in the compiling, the compiling error information is also output.
The method for building the embedded operating system comprises the steps of building a target environment, obtaining identification information of a first building block assembly and target parameter information matched with the embedded operating system, downloading script files corresponding to the first building block assembly and the first building block assembly into the target environment at least according to the identification information of the first building block assembly, downloading script files corresponding to a second building block assembly and the second building block assembly into the target environment at least according to building block dependence information in the script files corresponding to the first building block assembly, compiling the downloaded target building block assembly according to building block configuration information in the script files corresponding to the target building block assembly and identification information of a set function module in the target parameter information, obtaining a compiled executable file, and using the compiled executable file as the built embedded operating system. Therefore, the method shields the difference of compiling and constructing the operating system to be operated and the platform software of the embedded operating system by adopting the mode of constructing the target environment, the method can build the compiling environment in a one-stop mode, and the method can maintain the existing software module in a building block assembly mode, when the embedded operating system is built, only the target building block components related to the embedded operating system are downloaded according to the needs without downloading all the building block components, thereby saving the downloading time, in addition, the time of the developer is saved as the developer does not need to pay attention to the downloaded building block assemblies, and the developer does not need to the downloaded building block assemblies, and in addition, the embedded operating system can be built in a one-stop mode only by configuring target parameter information matched with the embedded operating system at one time, so that the building process is simple, and the building efficiency of the embedded operating system is improved.
Experiments prove that the target environment establishment provided by the application can enable developers to establish the embedded operating system in a one-stop mode on Windows, Linux, MAC OS and other systems, and only spends more than ten minutes.
In an optional embodiment, a process of "step S103, downloading the first building block element and the script file corresponding to the first building block element into the target environment at least according to the identification information of the first building block element" is described.
In a possible implementation manner, in order to facilitate maintenance of the building blocks, in this embodiment, a large building block software warehouse may be split into a plurality of software sub-warehouses, and each software sub-warehouse stores one building block, so that in the large building block software warehouse, software sub-warehouses of different component levels may be maintained in a building block manner.
Then, when downloading the first building block component and the corresponding script file, it is necessary to know which software sub-warehouse the first building block component and the corresponding script file to be downloaded are in. Based on this, the process of step S103 may include: and downloading the first building block assembly and the script file corresponding to the first building block assembly into the target environment according to the identification information of the first building block assembly and the preset warehouse information.
In another possible implementation manner, the building elements may have a plurality of version information (e.g., version numbers), and the above "storing one building element per software sub-warehouse" specifically means that each software sub-warehouse stores several versions of one building element. In this embodiment, the version information of the building block element may be written into a script file, that is, the script information of any building block element further includes the version information of the building block element.
When the embedded operating system is built, the target building block assemblies can be built based on the same version information or different version information, and based on the target building block assemblies, the first building block assembly of which version is downloaded needs to be known in advance, so that the first building block assembly can be downloaded to the corresponding software sub-warehouse.
Optionally, version information to be downloaded (for convenience of subsequent description, the version information to be downloaded corresponding to the first building block element is defined as first version information) may be written into target parameter information associated with the embedded operating system, that is, the target parameter information associated with the embedded operating system may include the first version information of the first building block element, and at this time, optionally, the process of step S103 may include: and downloading the first building block component under the first version information and the script file corresponding to the first building block component to a target environment according to the identification information of the first building block component and preset warehouse information.
Specifically, the process of downloading the script file corresponding to the first building block component and the first building block component under the first version information to the target environment according to the identification information of the first building block component and the preset warehouse information includes:
step a1, determining a software sub-warehouse where the first building block assembly is located as a first software sub-warehouse according to the identification information and warehouse information of the first building block assembly, wherein the warehouse information includes a corresponding relationship between the identification information of the building block assembly and the identification information of the software sub-warehouse, and the first software sub-warehouse includes script files corresponding to the first building block assemblies under a plurality of versions and the first building block assemblies under a plurality of versions respectively.
Step a2, downloading the first building block element in the first version information and the script file corresponding to the first building block element in the first version information from the first software sub-warehouse to the target environment.
The above steps a 1-a 2 describe in detail the detailed process of downloading the script file corresponding to the first building element and the first building element itself when the target parameter information includes the first version information. It is understood that there may be a case where the first version information is not included in the target parameter information, and the process of step S103 may include: and downloading the first building block component under the latest version and a script file corresponding to the first building block component to a target environment according to the identification information of the first building block component and preset warehouse information. Here, the specific implementation process is similar to the process of the above steps a1 and a2, and reference may be made to the description in the foregoing steps for details, which are not described herein again.
That is, in this embodiment, if the first version information is not included in the target parameter information, the process of step S103 may include: downloading script files corresponding to the first building block component under the latest version and the first building block component under the latest version to a target environment according to the identification information and the warehouse information of the first building block component; if the target parameter information includes the first version information, the process of step S103 may include: and downloading the first building block component under the first version information and the script file corresponding to the first building block component under the first version information into the target environment according to the identification information of the first building block component and the preset warehouse information.
It should be noted that, the above embodiment shows two specific implementations of step S103, however, the embodiment of step S103 is not limited to these two implementations, and other implementations are possible, for example, all building elements and corresponding script files may be stored in a large building element software repository, if each building element in the first building element has only one version, step S103 may download the first building element and the script file corresponding to the first building element into the target environment only according to the identification information of the first building element, and if each building element in the first building element includes multiple versions, step S103 may download the first building element and the script file corresponding to the first building element into the target environment according to the identification information and the first version information of the first building element.
In summary, the above embodiment shows four implementation manners of step S103, which are as follows:
in a first implementation manner, if all the building blocks and corresponding script files are stored in a large building block software repository, and each building block in the first building block has only one version, the process of step S103 may include: and downloading the first building block component and the script file corresponding to the first building block component into the target environment according to the identification information of the first building block component.
In a second implementation manner, if all the building blocks and corresponding script files are stored in a large building block software repository, and each building block in the first building block includes multiple versions, the process of step S103 may include: if the target parameter information does not include the first version information, downloading the first building block component in the latest version and the script file corresponding to the first building block component in the latest version to the target environment according to the identification information of the first building block component; and if the target parameter information comprises first version information, downloading the first building block component under the first version information and a script file corresponding to the first building block component under the first version information into the target environment according to the identification information of the first building block component.
Here, the first version information refers to version information of the first building block component that needs to be downloaded, and in this embodiment, the first version information may be written in target parameter information associated with the embedded operating system.
In a third implementation manner, if each building element in the first building element is stored in a software sub-warehouse and each building element in the first building element has only one version, the process of step S103 may include: and downloading the first building block component and the script file corresponding to the first building block component to the target environment according to the identification information and the warehouse information of the first building block component.
In a fourth implementation manner, if each building element in the first building elements is stored in a software sub-warehouse, and each building element in the first building elements includes multiple versions, the process of step S103 may include: if the target parameter information does not include the first version information, downloading the first building block component in the latest version and the script file corresponding to the first building block component in the latest version to the target environment according to the identification information and the warehouse information of the first building block component; and if the target parameter information comprises first version information, downloading the first building block component under the first version information and the script file corresponding to the first building block component under the first version information into the target environment according to the identification information and the warehouse information of the first building block component.
The embodiment of step S103 is not limited to the above-mentioned several implementation manners, and other implementation manners are possible, and the present application is not limited to this.
According to the embodiment, the first building block assembly and the script file thereof which need to be downloaded can be quickly located through the warehouse information and/or the first version information, so that the downloading time is saved, and the downloading efficiency is improved.
In an embodiment of the present application, a process of step S104, downloading a second building block component and a script file corresponding to the second building block component into a target environment at least according to the building block dependency information in the script file corresponding to the first building block component is described.
In the present embodiment, the process of step S104 includes a plurality of implementations, and the following implementations are given but not limited to.
In a first implementation manner, if all building blocks and corresponding script files are stored in a large building block software repository, and each building block in the second building block has only one version, the process of step S104 may include: and downloading the second building block component and the script file corresponding to the second building block component to the target environment according to the building block dependence information in the script file corresponding to the first building block component.
In a second implementation manner, if all the building blocks and corresponding script files are stored in a large building block software repository, and each building block in the second building block includes multiple versions, the process of step S104 may include: if the target parameter information does not include the second version information, downloading the second building block component in the latest version and the script file corresponding to the second building block component in the latest version to the target environment according to the building block dependence information in the script file corresponding to the first building block component; and if the target parameter information comprises second version information, downloading a second building block component under the second version information and a script file corresponding to the second building block component under the second version information into the target environment according to the building block dependence information in the script file corresponding to the first building block component.
Here, the second version information refers to version information of the second building block component that needs to be downloaded, and in this embodiment, the second version information may be written in target parameter information associated with the embedded operating system.
In a third implementation manner, if each block element in the second block elements is stored in a software sub-warehouse, and each block element in the second block elements has only one version, the process of step S104 may include: and downloading the second building block assembly and the script file corresponding to the second building block assembly to the target environment according to the building block dependence information and the warehouse information in the script file corresponding to the first building block assembly.
In a fourth implementation, if each of the second building elements is stored in a software sub-warehouse, and each of the second building elements includes multiple versions, the process of step S104 may include: if the target parameter information does not include second version information, downloading the second building block assembly in the latest version and the script file corresponding to the second building block assembly in the latest version to a target environment according to building block dependence information and warehouse information in the script file corresponding to the first building block assembly; and if the target parameter information comprises second version information, downloading a second building block component under the second version information and a script file corresponding to the second building block component under the second version information into the target environment according to building block dependence information and warehouse information in the script file corresponding to the first building block component.
The embodiment of step S104 is not limited to the above-mentioned several implementation manners, and other implementation manners are possible, and the present application is not limited to this.
According to the embodiment, the second building block assembly and the script file thereof which need to be downloaded can be quickly located through the warehouse information and/or the second version information, so that the downloading time is saved, and the downloading efficiency is improved.
In an optional embodiment, in step S104, the process of "downloading the second building block component under the second version information and the script file corresponding to the second building block component under the second version information to the target environment according to the building block dependency information and the warehouse information in the script file corresponding to the first building block component" may include:
and b1, determining identification information of a second software sub-warehouse according to the building block dependency information and warehouse information in the script file corresponding to the first building block component, wherein the second software sub-warehouse is the software sub-warehouse where the second building block component is located.
B2, constructing a dependency tree for the embedded operating system according to the building block dependency information, the second version information and the identification information of the second software sub-warehouse in the script file corresponding to the first building block component, wherein each node of the dependency tree corresponds to one building block component in the target building block component, the node corresponding to the first building block component comprises the first version information and the identification information of the first software sub-warehouse, and the node corresponding to the second building block component comprises the second version information and the identification information of the second software sub-warehouse.
And b3, downloading the second building block component under the second version information and the script file corresponding to the second building block component under the second version information from the second software sub-warehouse indicated by the identification information of the second software sub-warehouse into the target environment according to the dependency tree.
Specifically, in this embodiment, according to the building block dependency information in the script file corresponding to the first building block assembly, the second layer building block assembly on which the first building block assembly depends may be determined, and according to the building block dependency information included in the script file corresponding to the second layer building block assembly, the third layer building block assembly on which each building block assembly in the second layer building block assembly depends may be determined, so as to analogize to construct the dependency tree for the embedded operating system.
After the dependency tree is built, according to the second version information in the dependency tree and the identification information of the second software sub-warehouse, a second building block assembly under the second version information is determined from the second software sub-warehouse indicated by the identification information of the second software sub-warehouse by using a building tool, and the determined second building block assembly under the second version information and a script file corresponding to the second building block assembly under the second version information are downloaded to a target environment.
Optionally, if there is no second building element under the second version information, the building tool may also download the second building element under the latest version.
Optionally, in order to find the downloaded target building block assembly quickly, a corresponding directory may be created according to the classification information file in each building block assembly, and building block assembly codes of the same type are stored in each directory, that is, a required solution may be constructed by one key.
In the above embodiment, "step S105, compiling the downloaded target building block component according to the building block configuration information in the script file corresponding to the target building block component and the identification information of the function module set in the target parameter information, so as to obtain a compiled executable file" is described below.
The foregoing embodiment has been described, in which the target parameter information includes identification information of the set function module and/or first version information and second version information, for example, the target parameter information includes: building an embedded operating system of version V2.0 requires functional modules 1 and 3 of building set a (version V2.0), and requires functional modules 6 and 7 of building set B (version V1.8), and requires functional module 10 of building set C (version V2.0), and so on.
Optionally, the process of "step S105, compiling the downloaded target building block assembly according to the building block configuration information in the script file corresponding to the target building block assembly and the identification information of the function module set in the target parameter information to obtain a compiled executable file" may include the following steps c1 to c 4:
and c1, generating a target configuration file according to the building block configuration information in the script file corresponding to the target building block component and the identification information of the set function module in the target parameter information.
Specifically, in this step, the building tool may generate a unified configuration file, which is the target configuration file, according to the building block configuration information included in the script file corresponding to the target building block component and the identification information of the set function module included in the target parameter information, collectively according to the dependency tree.
In an alternative embodiment, the process of this step may include: and modifying the building block configuration information in the script file corresponding to the target building block assembly according to the identification information of the set functional module in the target parameter information, and obtaining the target configuration file according to the modified building block configuration information.
It can be understood that, in an initial situation, the building block configuration information in the script file corresponding to the target building block assembly is usually not matched with the currently built embedded operating system, and the building block configuration information in the script file corresponding to the target building block assembly needs to be modified into the configuration information matched with the currently built embedded operating system through the modification process of this step, that is, which functional module is needed by the currently built embedded operating system, the configuration information of the functional module is modified into the configuration information corresponding to the set functional module.
For example, taking the LOG component shown in step S102 as an example, assuming that the target building block component includes the LOG component, and assuming that the target parameter information includes the identification information of the function modules "LOG _ SUPPORT _ ASYNC" and "LOG _ SUPPORT _ group", the modified building block configuration information obtained after modifying the building block configuration information in the script file of the LOG component is:
Feature_config:
LOG_SUPPORT_ASYNC Y
LOG_SUPPORT_FS N
LOG_SUPPORT_CLOUD Y
in the above block configuration information, "LOG _ SUPPORT _ ASYNC" included in the LOG component is configured as Y, and "LOG _ SUPPORT _ ASYNC" is represented as a setting function module.
In this step, the building block configuration information in the script file corresponding to each building block component included in the target building block component is modified, and the target configuration file can be obtained from the modified building block configuration information corresponding to the target building block component.
And c2, cutting the downloaded target building block assembly according to the target configuration file to obtain the cut target building block assembly.
Specifically, in this step, according to the target configuration file, the other function modules except the set function module in the downloaded target building block assembly are cut off to obtain the cut target building block assembly.
Since the target configuration file is generated based on the identification information of the set function module included in the target parameter information, how to clip the downloaded target building block component can be known according to the target configuration file. For example, based on the target configuration file obtained from the modified building block configuration file shown in c1, this step can cut the "LOG _ SUPPORT _ FS" function block from the LOG component, resulting in a clipped LOG component consisting of "LOG _ SUPPORT _ ASYNC" and "LOG _ SUPPORT _ group".
And c3, generating a target compiling file according to the target configuration file.
Wherein the target compiling file is used for indicating how to compile the clipped target building block component.
In this step, the target configuration file is used as an input file of the target building block component, and a target compiling file for instructing how to compile the cut target building block component can be constructed as required. Here, the target compiled file is a compiled file required for the build software installed in advance.
The step can automatically generate the target compiling file according to the target configuration file, so that developers do not need to manually compile the compiling file any more, and the time of the developers is saved.
Alternatively, the target compiled file may be a makefile or a CMakeLists file.
And c4, compiling the cut target building block assembly according to the target compiling file to obtain a compiled executable file.
In this step, the building system may automatically invoke the building software according to the target compilation file, and then compile the cut target building block assembly according to the target compilation file, the building software and the compilation software to obtain a compiled executable file.
In summary, in this embodiment, identification information of a function module can be set according to building block configuration information and target parameter information in a script file corresponding to a target building block assembly, and a process of cutting and compiling a downloaded target building block assembly is performed first, and the whole process is automatically executed, so that a developer does not need to do any additional work (in the prior art, the developer needs to modify in each software module and often has multiple modifications, or since the software modules are coupled, the configuration is not uniform, and thus the developer needs to spend a large amount of time for debugging), thereby saving the time of the developer, and greatly reducing the possibility of errors.
In some scenarios, after the target building block assembly is compiled in step S105, post-processing, such as encryption processing, packet header adding processing, printing processing, etc., may be further performed on the compiled executable file.
Optionally, in this embodiment, the post-processing information may be written into a script file corresponding to a certain or some of the target building blocks, for example, the post-processing information is written into a script file corresponding to the first building block assembly, or the post-processing information is written into a script file corresponding to the target building block assembly, so that after step S105, the compiled executable file may be post-processed according to the building block post-processing information written into the script file corresponding to the first building block assembly (or the target building block assembly), and the post-processed executable file serves as the built embedded operating system.
It should be noted that, when the building block post-processing information included in the script file is only used to instruct to build the embedded operating system, what post-processing needs to be performed on the executable file, but what is specifically performed is instructed by the external command.
For example, if the block post-processing information in the script file corresponding to the target block component is encrypted, it will be described how to encrypt the executable file, but what the encryption algorithm is indicated by the external encryption command. That is, the process of "performing post-processing on the compiled executable file according to the building block post-processing information" in this embodiment includes: and if the building block post-processing information comprises encryption processing, acquiring an encryption command from an external designated position, and encrypting the compiled executable file based on the encryption command.
For another example, if the building block post-processing information included in the script file corresponding to the target building block component is the header adding process, it is described how header information needs to be added to the executable file, but how to add the header is performed, and what the added header information is indicated by the external header adding command. That is, the process of "performing post-processing on the compiled executable file according to the building block post-processing information" in this embodiment includes: and if the building block post-processing information comprises packet header adding processing, acquiring a packet header adding command from an external designated position, and adding packet header information to the compiled executable file based on the packet header adding command.
For another example, if the post-building processing information included in the script file corresponding to the target building block assembly is function printing processing, it is described that the information related to the set function module used when the embedded operating system is built needs to be printed and output, but how to print the information is instructed by the external function printing command is specifically described. That is, the process of "performing post-processing on the compiled executable file according to the building block post-processing information" in this embodiment includes: and if the building block post-processing information comprises function printing processing, acquiring a function printing command from an external designated position, and printing and outputting function list information corresponding to the compiled executable file based on the function printing command, wherein the function list information is related information of the set function module, such as identification information and the like.
In summary, the present embodiment can perform various post-processing operations after the building block component is compiled, so that the embedded operating system provided by the present embodiment has richer functions.
In the foregoing embodiments, it is described in detail that the script file corresponding to any building block element includes version information of the building block element, building block dependency information for describing a dependency relationship between the building block element and another building block element, building block configuration information, building block post-processing information, and the like, and in addition, the script file provided in this embodiment may further include other information, for example, in an embodiment, the script file corresponding to a building block element may include the following contents:
first, building block basic information contains the name of a building block component, version information of independent management of the building block component, simple description of the building block component, type classification of the building block component, license information of the building block component, and the like.
And secondly, the dependency information of the building blocks comprises dependency tables of the building blocks, the dependency tables represent the upper and lower layer dependency relationships of the building blocks, and optionally, the building block dependency information can be interface dependency information, and the upper layer building blocks can call the interfaces provided by the lower layer building blocks.
And thirdly, the appearance information of the building block comprises board-level component related information for running the embedded operating system, a CPU, a chip set, a development board component and the like.
Fourth, the building block compilation information comprises separate compilation information for building block components independent of the project.
Fifth, the building block configuration information includes configuration information associated with the building block assembly. By configuring information, the components can be freely cut, so that the building block components can be made large or small.
And sixthly, building block post-processing information (optional) comprises various post-processing work information after the building block assembly is compiled.
Therefore, the script file is used for enabling each building block assembly to provide an externally unified and tailorable configured functional assembly set and an API calling function with a unified style.
The script file is only an example, and is not a limitation to the script file of the present application.
The embodiment of the application also provides a device for building the embedded operating system, which is described below, and the device for building the embedded operating system described below and the method for building the embedded operating system described above can be referred to correspondingly.
Referring to fig. 3, a schematic structural diagram of a building device of an embedded operating system provided in an embodiment of the present application is shown, and as shown in fig. 3, the building device of the embedded operating system may include: a target environment building module 301, an information obtaining module 302, a first downloading module 303, a second downloading module 304 and a compiling module 305.
And the target environment building module 301 is used for building a target environment.
An information obtaining module 302, configured to obtain identification information of the first building block component and target parameter information associated with the embedded operating system.
A first downloading module 303, configured to download, to a target environment, script files corresponding to a first building block assembly and the first building block assembly according to at least identification information of the first building block assembly, where the first building block assembly is a root building block assembly in the target building block assembly, each script file corresponding to each building block assembly included in the target building block assembly includes building block dependency information and building block configuration information, the building block dependency information is used to describe a dependency relationship between the corresponding building block assembly and other building block assemblies, the building block configuration information is used to describe whether a plurality of function modules forming the corresponding building block assembly are set function modules required for setting up an embedded operating system, and the target parameter information at least includes identification information of the set function modules.
And a second downloading module 304, configured to download, to the target environment, script files corresponding to a second building block element and a second building block element according to at least the building block dependency information in the script file corresponding to the first building block element, where the second building block element is another building block element other than the first building block element in the target building block element.
And the compiling module 305 is configured to compile the downloaded target building block assembly according to the building block configuration information in the script file corresponding to the target building block assembly and the identification information of the set function module in the target parameter information, so as to obtain a compiled executable file, which is used as the built embedded operating system.
In summary, the working principle of the device for building an embedded operating system disclosed in this embodiment is the same as that of the method for building an embedded operating system disclosed in the above embodiment, and reference may be made to the description in the foregoing embodiment for details, which are not described herein again.
The embodiment of the application also provides the building equipment of the embedded operating system. Optionally, fig. 4 shows a block diagram of a hardware structure of a building device of an embedded operating system, and referring to fig. 4, the hardware structure of the building device of the embedded operating system may include: at least one processor 401, at least one communication interface 402, at least one memory 403 and at least one communication bus 404;
in the embodiment of the present application, the number of the processor 401, the communication interface 402, the memory 403 and the communication bus 404 is at least one, and the processor 401, the communication interface 402 and the memory 403 complete communication with each other through the communication bus 404;
processor 401 may be a central processing unit CPU, or an application Specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention, or the like;
the memory 403 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein the memory 403 stores a program and the processor 401 may call the program stored in the memory 403 for:
building a target environment;
acquiring identification information of a first building block component and target parameter information matched with an embedded operating system;
downloading script files corresponding to a first building block assembly and the first building block assembly into a target environment at least according to identification information of the first building block assembly, wherein the first building block assembly is a root building block assembly in the target building block assembly, the script files corresponding to each building block assembly contained in the target building block assembly comprise building block dependence information and building block configuration information, the building block dependence information is used for describing dependence relations between the corresponding building block assembly and other building block assemblies, the building block configuration information is used for describing whether a plurality of functional modules forming the corresponding building block assembly are set functional modules required for building an embedded operating system, and the target parameter information at least comprises identification information of the set functional modules;
downloading a second building block component and a script file corresponding to the second building block component into a target environment at least according to building block dependence information in the script file corresponding to the first building block component, wherein the second building block component is other building block components except the first building block component in the target building block component;
and compiling the downloaded target building block assembly according to building block configuration information in the script file corresponding to the target building block assembly and identification information of the set functional module in the target parameter information to obtain a compiled executable file which is used as the built embedded operating system.
Alternatively, the detailed function and the extended function of the program may be as described above.
The embodiment of the application also provides a readable storage medium, wherein a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the method for building the embedded operating system is realized.
Alternatively, the detailed function and the extended function of the program may be as described above.
Finally, it is further noted that, herein, relational terms such as, for example, and the like may be 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.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (14)

1. A building method of an embedded operating system is characterized by comprising the following steps:
building a target environment;
acquiring identification information of a first building block assembly and target parameter information matched with the embedded operating system, wherein the first building block assembly is a root building block assembly in a target building block assembly, script files corresponding to each building block assembly contained in the target building block assembly comprise building block dependence information and building block configuration information, the building block dependence information is used for describing dependence between the corresponding building block assembly and other building block assemblies, the building block configuration information is used for describing whether a plurality of functional modules forming the corresponding building block assembly are set functional modules required for building the embedded operating system, and the target parameter information at least comprises the identification information of the set functional modules;
downloading the first building block component and a script file corresponding to the first building block component to the target environment at least according to the identification information of the first building block component;
downloading a second building block component and a script file corresponding to the second building block component to the target environment at least according to the building block dependence information in the script file corresponding to the first building block component, wherein the second building block component is the other building block components except the first building block component in the target building block component;
and compiling the downloaded target building block assembly according to building block configuration information in the script file corresponding to the target building block assembly and identification information of the set functional module in the target parameter information to obtain a compiled executable file which is used as the built embedded operating system.
2. The method for building the embedded operating system according to claim 1, wherein the building of the target environment comprises:
and building the target environment by using a virtual environment technology and target sandbox software, or creating a docker virtual image.
3. The method for building the embedded operating system according to claim 1, wherein the step of acquiring target parameter information matched with the embedded operating system comprises the following steps:
and rewriting preset initial parameter information to obtain target parameter information matched with the embedded operating system, or writing the target parameter information matched with the embedded operating system.
4. The method for building the embedded operating system according to claim 1, wherein the script information of any building block component further comprises version information of the building block component;
downloading the first building block component and the script file corresponding to the first building block component to the target environment at least according to the identification information of the first building block component, including:
determining a software sub-warehouse where the first building block assembly is located as a first software sub-warehouse according to the identification information of the first building block assembly and preset warehouse information, wherein the warehouse information comprises the corresponding relation between the identification information of the building block assembly and the identification information of the software sub-warehouse, and the first software sub-warehouse comprises a plurality of versions of first building block assemblies and script files corresponding to the plurality of versions of the first building block assemblies respectively;
if the target parameter information does not include first version information, downloading a first building block component in a latest version and a script file corresponding to the first building block component in the latest version from the first software sub-warehouse into the target environment, wherein the first version information is version information of the first building block component needing to be downloaded;
and if the target warehouse information comprises the first version information, downloading a first building block component under the first version information and a script file corresponding to the first building block component under the first version information from the first software sub-warehouse into the target environment.
5. The method for building the embedded operating system according to claim 4, wherein downloading a second building block component and a script file corresponding to the second building block component into the target environment at least according to the building block dependency information in the script file corresponding to the first building block component comprises:
if the target parameter information does not include second version information, downloading a second building block component in a latest version and a script file corresponding to the second building block component in the latest version to the target environment according to building block dependency information and the warehouse information in the script file corresponding to the first building block component, wherein the second version information is version information of the second building block component needing to be downloaded;
and if the target parameter information comprises the second version information, downloading a second building block component under the second version information and a script file corresponding to the second building block component under the second version information into the target environment according to building block dependence information in the script file corresponding to the first building block component and the warehouse information.
6. The method for building an embedded operating system according to claim 5, wherein the downloading, according to the building block dependency information and the warehouse information in the script file corresponding to the first building block component, the second building block component under the second version information and the script file corresponding to the second building block component under the second version information into the target environment includes:
determining identification information of a second software sub-warehouse according to building block dependency information and the warehouse information in the script file corresponding to the first building block component, wherein the second software sub-warehouse is a software sub-warehouse where the second building block component is located;
constructing a dependency tree for the embedded operating system according to building block dependency information, the second version information and identification information of the second software sub-warehouse in a script file corresponding to the first building block component, wherein each node of the dependency tree corresponds to one building block component in the target building block component, a node corresponding to the first building block component comprises the first version information and the identification information of the first software sub-warehouse, and a node corresponding to the second building block component comprises the second version information and the identification information of the second software sub-warehouse;
and downloading a second building block component under the second version information and a script file corresponding to the second building block component under the second version information from a second software sub-warehouse indicated by the identification information of the second software sub-warehouse into the target environment according to the dependency tree.
7. The method for building an embedded operating system according to claim 1, wherein the step of compiling the downloaded target building block assembly according to building block configuration information in a script file corresponding to the target building block assembly and identification information of a set function module in the target parameter information to obtain a compiled executable file comprises the steps of:
obtaining a target configuration file according to building block configuration information in a script file corresponding to the target building block assembly and identification information of a set function module in the target parameter information;
according to the target configuration file, cutting the downloaded target building block assembly to obtain a cut target building block assembly;
generating a target compiling file according to the target configuration file, wherein the target compiling file is used for indicating how to compile the cut target building block components;
and compiling the cut target building block assembly according to the target compiling file to obtain the compiled executable file.
8. The method for building an embedded operating system according to claim 7, wherein obtaining the target configuration file according to the building block configuration information in the script file corresponding to the target building block assembly and the identification information of the set function module in the target parameter information comprises:
and modifying the building block configuration information in the script file corresponding to the target building block assembly according to the identification information of the set functional module in the target parameter information, and obtaining the target configuration file according to the modified building block configuration information.
9. The method for building an embedded operating system according to claim 7, wherein the step of cutting the downloaded target building block assembly according to the target configuration file to obtain a cut target building block assembly comprises:
and cutting off other functional modules except the set functional module in the downloaded target building block assembly according to the target configuration file to obtain the cut target building block assembly.
10. The method for building the embedded operating system according to claim 1, wherein the script file corresponding to the target building block assembly further comprises building block post-processing information;
compiling the downloaded target building block assembly according to building block configuration information in the script file corresponding to the target building block assembly and identification information of the set functional module in the target parameter information to obtain a compiled executable file, and further comprising:
and post-processing the compiled executable file according to the building block post-processing information, wherein the post-processed executable file is used as the built embedded operating system.
11. The method for building the embedded operating system according to claim 10, wherein the post-processing the compiled executable file according to the building block post-processing information includes:
if the building block post-processing information comprises encryption processing, acquiring an encryption command from an external designated position, and encrypting the compiled executable file based on the encryption command;
and/or the presence of a gas in the gas,
if the building block post-processing information comprises packet header adding processing, acquiring a packet header adding command from the external designated position, and adding packet header information to the compiled executable file based on the packet header adding command;
and/or the presence of a gas in the gas,
and if the building block post-processing information comprises function printing processing, acquiring a function printing command from the external designated position, and printing and outputting function list information corresponding to the compiled executable file based on the function printing command.
12. A device for building an embedded operating system is characterized by comprising: the system comprises a target environment building module, an information acquisition module, a first downloading module, a second downloading module and a compiling module;
the target environment building module is used for building a target environment;
the information acquisition module is used for acquiring identification information of a first building block assembly and target parameter information matched with the embedded operating system, wherein the first building block assembly is a root building block assembly in a target building block assembly, a script file corresponding to each building block assembly contained in the target building block assembly comprises building block dependence information and building block configuration information, the building block dependence information is used for describing dependence between the corresponding building block assembly and other building block assemblies, the building block configuration information is used for describing whether a plurality of functional modules forming the corresponding building block assembly are set functional modules required for building the embedded operating system, and the target parameter information at least comprises the identification information of the set functional modules;
the first downloading module is configured to download the first building block component and a script file corresponding to the first building block component to the target environment at least according to the identification information of the first building block component;
the second downloading module is configured to download, to the target environment, a second building block component and a script file corresponding to the second building block component at least according to the building block dependency information in the script file corresponding to the first building block component, where the second building block component is another building block component in the target building block component except for the first building block component;
and the compiling module is used for compiling the downloaded target building block assembly according to the building block configuration information in the script file corresponding to the target building block assembly and the identification information of the set function module in the target parameter information to obtain a compiled executable file which is used as the built embedded operating system.
13. The building equipment of the embedded operating system is characterized by comprising a memory and a processor;
the memory is used for storing programs;
the processor is used for executing the program and realizing each step of the construction method of the embedded operating system according to any one of claims 1 to 11.
14. A readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the method for building an embedded operating system according to any one of claims 1 to 11.
CN202210409836.1A 2022-04-19 2022-04-19 Method, device, equipment and medium for building embedded operating system Pending CN114816418A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210409836.1A CN114816418A (en) 2022-04-19 2022-04-19 Method, device, equipment and medium for building embedded operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210409836.1A CN114816418A (en) 2022-04-19 2022-04-19 Method, device, equipment and medium for building embedded operating system

Publications (1)

Publication Number Publication Date
CN114816418A true CN114816418A (en) 2022-07-29

Family

ID=82505495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210409836.1A Pending CN114816418A (en) 2022-04-19 2022-04-19 Method, device, equipment and medium for building embedded operating system

Country Status (1)

Country Link
CN (1) CN114816418A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115686620A (en) * 2022-12-12 2023-02-03 深圳市欧瑞博科技股份有限公司 Intelligent household system integrated management method, electronic equipment and computer storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115686620A (en) * 2022-12-12 2023-02-03 深圳市欧瑞博科技股份有限公司 Intelligent household system integrated management method, electronic equipment and computer storage medium

Similar Documents

Publication Publication Date Title
US7996830B2 (en) Programming model generic application deployment
Arcangeli et al. Automatic deployment of distributed software systems: Definitions and state of the art
CN110912724B (en) Parameter-driven automatic service arrangement method and device
US20090064196A1 (en) Model based device driver code generation
Perchat et al. Component based framework to create mobile cross-platform applications
US11389960B2 (en) Systems and methods for robotic process automation
CN111459539B (en) Continuous integration pipeline operation method and device based on mirror layering
CN111399840B (en) Module development method and device
CN111897570A (en) Multi-dependency file extraction method and device based on Maven plug-in
US11481197B1 (en) Distributed software development pipeline for coherent graphical user interface
KR102052776B1 (en) Installation engine and package format for parallelizable, reliable installations
CN112148278A (en) Visual block chain intelligent contract framework and intelligent contract development and deployment method
US20220405092A1 (en) Orchestrating multi-level tools for the deployment of a network product
CN104699503A (en) Method and device for replacing function execution logic in Android system
Harzenetter et al. Pattern-based deployment models revisited: automated pattern-driven deployment configuration
CN113312046A (en) Sub-application page processing method and device and computer equipment
US20220300262A1 (en) Method for constructing, running and implementing cross-platform application, terminal, server and system
CN114816418A (en) Method, device, equipment and medium for building embedded operating system
CN111683005B (en) Internet of things intelligent gateway equipment and construction method thereof
Chakravarthy et al. Edicts: implementing features with flexible binding times
CN114816475A (en) Method, device, equipment and medium for updating embedded operating system
CN115658140A (en) SDK packaging method, device, terminal and storage medium
CN115729604A (en) Micro application integration method, system, electronic device and storage medium
Dantas et al. Developing adaptive j2me applications using AspectJ.
CN113961232A (en) Terminal, method and platform server for providing integrated development environment

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