CN112486497A - Compiling configuration file generation method and device, electronic equipment and storage medium - Google Patents

Compiling configuration file generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112486497A
CN112486497A CN202011357122.8A CN202011357122A CN112486497A CN 112486497 A CN112486497 A CN 112486497A CN 202011357122 A CN202011357122 A CN 202011357122A CN 112486497 A CN112486497 A CN 112486497A
Authority
CN
China
Prior art keywords
configuration
preset
function
configuration parameter
configuration file
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
CN202011357122.8A
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.)
Beijing Ziroom Information Technology Co Ltd
Original Assignee
Beijing Ziroom Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ziroom Information Technology Co Ltd filed Critical Beijing Ziroom Information Technology Co Ltd
Priority to CN202011357122.8A priority Critical patent/CN112486497A/en
Publication of CN112486497A publication Critical patent/CN112486497A/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
    • 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)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of communication of the Internet of things, and discloses a method and a device for generating a compiling configuration file, electronic equipment and a storage medium. Wherein, the method comprises the following steps: acquiring at least one function module corresponding to a preset item and partition information of configuration parameters, wherein each configuration parameter unit in the partition information is used for realizing a preset function and comprises at least one configuration parameter; determining a configuration parameter unit corresponding to each functional module by using the division information of the configuration parameters; and generating a target configuration file corresponding to the preset project according to each functional module and the corresponding configuration parameter unit. By implementing the invention, each functional module corresponds to respective configuration file, the problem that the development iteration needs to search the corresponding configuration parameter again due to too high coupling degree of the configuration parameters of different functional modules is solved, the re-debugging is avoided, the development iteration and the function maintenance of the functional modules are facilitated, and the development efficiency is improved.

Description

Compiling configuration file generation method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of communication of the Internet of things, in particular to a method and a device for generating a compiling configuration file, electronic equipment and a storage medium.
Background
With the development of the internet of things technology, more and more products are developed by adopting the openwrt system based on the internet of things technology. When the openwrt system is used for product development, a developer needs to select corresponding configuration information according to own project requirements, and then compile firmware. In the process of generating the configuration file in the existing openwrt system, usually, a make menuconfig is executed to generate a graphical interface of the configuration information, an option to be configured is selected in the graphical interface, and then, the storage and exit are selected, so as to generate the configuration file, config, used for compiling. If new function iteration needs to be added in the development process, adding codes of a new module according to needs, then executing make menuconfig again for configuration, and storing the latest config. However, because the configuration coupling degree of different functional modules is too high, all the configuration information is put into a unified config file, if other developers need to call some functional modules, because other developers do not know the configuration information of the required functional modules, the debugging record of the previous developer needs to be searched or the debugging needs to be carried out again to find the corresponding configuration parameters, which is not beneficial to development iteration and module maintenance of the developers.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for generating a compiled configuration file, so as to solve the problem that all configuration information is stored in the same config file, which is not beneficial to development iteration and function maintenance.
According to a first aspect, an embodiment of the present invention provides a method for generating a configuration file, including the following steps: acquiring at least one function module corresponding to a preset item and partition information of configuration parameters, wherein each configuration parameter unit in the partition information is used for realizing a preset function and comprises at least one configuration parameter; determining a configuration parameter unit corresponding to each functional module by using the division information of the configuration parameters; and generating a target configuration file corresponding to the preset project according to each functional module and the corresponding configuration parameter unit thereof.
According to the method for generating the compiling configuration file, which is provided by the embodiment of the invention, the configuration parameter units corresponding to the function modules are determined by using the partition information of the configuration parameters through acquiring the function modules corresponding to the preset items and the partition information of the configuration parameters, and the target configuration file corresponding to the preset items is generated according to the function modules and the corresponding configuration parameter units. According to the method, the configuration parameters are divided, so that different function modules correspond to different configuration parameter units, each function module corresponds to a respective configuration file, developers can add the corresponding function module according to the preset project requirements, the developers can quickly find the configuration parameters corresponding to the function modules, the problem that the developers need to find the corresponding configuration parameters again when development iteration is carried out due to too high coupling degree of the configuration parameters of the different function modules is solved, re-debugging is avoided, development iteration and function maintenance of the function modules are facilitated, and the development efficiency is improved.
With reference to the first aspect, in a first implementation manner of the first aspect, the obtaining the partition information of the configuration parameter includes: acquiring all configuration parameters; combining one or more configuration parameters for realizing each preset function to respectively obtain the configuration parameter units for realizing the preset functions; and determining the division information of the configuration parameters according to each configuration parameter unit.
According to the generation method of the compiling configuration file provided by the embodiment of the invention, all configuration parameters are obtained; the method and the device have the advantages that one or more configuration parameters for realizing each preset function are combined, the configuration parameter units for realizing the preset functions are determined, the division information of the configuration parameters is determined according to each configuration parameter unit, the configuration parameters are divided according to the function modules, developers can rapidly determine the configuration parameters according to the function modules, and the development efficiency is improved.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the determining, by using the partition information of the configuration parameter, a configuration parameter unit corresponding to each of the function modules includes: determining at least one preset function corresponding to at least one functional module based on at least one functional module; and determining at least one configuration parameter unit corresponding to at least one preset function according to at least one preset function and the division information of the configuration parameters.
According to the method for generating the compiling configuration file, one or more configuration parameter units corresponding to the function modules are determined according to one or more preset functions required to be realized by the function modules, so that the configuration parameter units corresponding to the function modules are determined, different function modules correspond to different configuration parameter units, the problem that developers need to search for corresponding configuration parameters again when development iteration is carried out due to too high coupling degree of the configuration parameters of different function modules is solved, re-debugging is avoided, development iteration and functions of the function modules are facilitated, and development efficiency is improved.
With reference to the second implementation manner of the first aspect, in a third implementation manner of the first aspect, the generating a target configuration file corresponding to the preset item according to each of the function modules and the corresponding configuration parameter units thereof includes: acquiring a preset configuration file of the preset project; and determining a target configuration file corresponding to the preset project according to the preset configuration file, each functional module and the corresponding configuration parameter unit.
According to the method for generating the compiling configuration file, which is provided by the embodiment of the invention, the target configuration file corresponding to the preset project is determined according to the preset configuration file, each functional module and the corresponding configuration parameter unit thereof by acquiring the preset configuration file of the preset project. Each functional module corresponds to a respective configuration parameter unit, developers can add corresponding functional modules according to preset project requirements without respectively selecting configuration parameters for each functional module, the problem that the developers need to search corresponding configuration parameters again when development iteration is carried out due to too high coupling degree of the configuration parameters of different functional modules is solved, the determination time of the configuration parameters is saved, and the development efficiency is improved.
With reference to the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the determining, according to the preset configuration file, the each function module and the corresponding configuration parameter unit thereof, a target configuration file corresponding to the preset item includes: compiling the configuration parameter unit corresponding to each functional module to generate each configuration file corresponding to each functional module; and combining the configuration files corresponding to the functional modules to obtain the target configuration file.
According to the method for generating the compiling configuration file, the configuration parameter units corresponding to the functional modules are compiled to generate the configuration files corresponding to the functional modules, the configuration files corresponding to the functional modules are combined to obtain the target configuration file, and the functional modules correspond to the configuration files. Developers can add corresponding functional modules according to the requirements of the preset project, and merge all the configuration files into the preset configuration files of the preset project to obtain the target configuration files, so that development iteration and function maintenance of the functional modules are facilitated, and development efficiency is improved.
With reference to the fourth implementation manner of the first aspect, in a fifth implementation manner of the first aspect, the compiling each configuration parameter unit to generate each configuration file corresponding to each function module includes: scanning the preset configuration file, and determining each function module of the configuration file to be generated and a corresponding configuration parameter unit thereof; compiling each function module of the configuration file to be generated and a corresponding configuration parameter unit thereof to obtain each compiled file; and generating each configuration file corresponding to each functional module based on each compiled file.
According to the compiling configuration file generating method provided by the embodiment of the invention, each function module of the configuration file to be generated and the corresponding configuration parameter unit are determined by scanning the preset configuration file, each function module of the configuration file to be generated and the corresponding configuration parameter unit are compiled to obtain each compiling file, each configuration file corresponding to each function module is generated based on each compiling file, each function module is enabled to correspond to each configuration file, so that developers can add corresponding function modules according to the preset project requirements, the situation that configuration parameters corresponding to the function modules need to be searched again due to too high coupling degree of the configuration parameters of different function modules is avoided, the re-debugging is avoided, and the development efficiency is improved.
With reference to the first aspect or any one of the first to fifth embodiments of the first aspect, in a sixth embodiment of the first aspect, the method further comprises: detecting the preset item, and judging whether a new function module is added to the preset item or not; when detecting that a new function module is added to the preset project, acquiring a new configuration parameter unit corresponding to the new function module; and updating the target configuration file according to the new functional module and the corresponding new configuration parameter unit.
According to the method for generating the compiling configuration file, provided by the embodiment of the invention, whether a new function module is added to a preset project is judged by detecting the preset project, when the new function module is added to the preset project, a new configuration parameter unit corresponding to the new function module is obtained, and the target configuration file is updated according to the new function module and the new configuration parameter unit corresponding to the new function module, so that developers can quickly find the configuration parameter corresponding to the new function module, the situation that the configuration parameters corresponding to the new function module need to be searched again for in developing iteration due to too high coupling degree of the configuration parameters of different function modules is avoided, the developing iteration of the function modules is facilitated, and the developing efficiency is improved.
According to a second aspect, an embodiment of the present invention provides an apparatus for generating a compilation configuration file, including: the system comprises an acquisition module, a configuration module and a processing module, wherein the acquisition module is used for acquiring at least one function module corresponding to a preset item and partition information of configuration parameters, each configuration parameter unit in the partition information is used for realizing a preset function, and the configuration parameter unit comprises at least one configuration parameter; the determining module is used for determining the configuration parameter unit corresponding to each functional module by using the division information of the configuration parameters; and the generating module is used for generating a target configuration file corresponding to the preset project according to each functional module and the corresponding configuration parameter unit.
The compiling configuration file generating device provided by the embodiment of the invention determines the configuration parameter unit corresponding to each function module by acquiring each function module corresponding to the preset item and the partition information of the configuration parameters and utilizes the partition information of the configuration parameters, and generates the target configuration file corresponding to the preset item according to each function module and the corresponding configuration parameter unit. The device divides the configuration parameters, different functional modules correspond to different configuration parameter units, each functional module corresponds to respective configuration files, developers can add corresponding functional modules according to preset project requirements, so that the developers can quickly find the configuration parameters corresponding to the functional modules, the problem that the developers need to search the corresponding configuration parameters again when development iteration is carried out due to too high coupling degree of the configuration parameters of different functional modules is solved, re-debugging is avoided, development iteration and function maintenance of the functional modules are facilitated, and the development efficiency is improved.
According to a third aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing therein computer instructions, and the processor executing the computer instructions to perform the method for generating a compilation configuration file according to the first aspect or any embodiment of the first aspect.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to cause a computer to execute the method for generating a compilation configuration file according to the first aspect or any implementation manner of the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method of configuration file generation according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of configuration file generation according to an embodiment of the present invention;
fig. 3 is a block diagram of a configuration file generation apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the process of generating the configuration file in the existing openwrt system, usually, a make menuconfig is executed to generate a graphical interface of the configuration information, an option to be configured is selected in the graphical interface, and then, the storage and exit are selected, so as to generate the configuration file, config, used for compiling. If new function iteration needs to be added in the development process, adding codes of a new module according to needs, then executing make menuconfig again for configuration, and storing the latest config. However, because the configuration coupling degree of different functional modules is too high, all the configuration information is put into a unified config file, if other developers need to call some functional modules, because other developers do not know the configuration information of the required functional modules, the debugging record of the previous developer needs to be searched or the debugging needs to be carried out again to find the corresponding configuration parameters, which is not beneficial to development iteration and module maintenance of the developers.
Based on this, the technical scheme of the invention divides all the configuration parameters according to the function modules to obtain the configuration parameters corresponding to each function module, so that different function modules correspond to different configuration parameter units, and each function module corresponds to respective configuration files, so that developers can add corresponding function modules and corresponding configuration parameters according to preset project requirements, re-debugging is avoided, development iteration and function maintenance of the function modules are facilitated, and development efficiency is improved.
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for generating a configuration file, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
In this embodiment, a method for generating a configuration file is provided, which may be used in an electronic device, such as a computer, a mobile phone, a tablet computer, and the like, fig. 1 is a flowchart of a method for generating a configuration file according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
s11, obtaining at least one function module corresponding to the preset item and the partition information of the configuration parameters, wherein each configuration parameter unit in the partition information is used for realizing the preset function, and the configuration parameter unit comprises at least one configuration parameter.
The preset items are application programs for realizing functions based on software programs, such as a house renting application program, a take-out application program and the like. The function module is a function implementation program in a preset project, for example, a renting application program may include a co-renting function module, a whole renting function module, a price selection function module, a region selection function module, and the like. Different function modules can correspond to different configuration parameters, the division information of the configuration parameters is configuration parameter units corresponding to various preset functions, and the configuration parameter units corresponding to the preset functions comprise one or more configuration parameters. For example, to implement the preset function of the internet protocol ipv6, the configuration parameters in the configuration parameter unit corresponding to the preset function may be expressed as follows:
CONFIG_IPV6=y
#CONFIG_PACKAGE_dnsmasq-dhcpv6=y
#CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y
CONFIG_PACKAGE_kmod-ip6tables=y
CONFIG_PACKAGE_kmod-ip6=y
CONFIG_PACKAGE_libip6tc=y
CONFIG_PACKAGE_ip6tables=y
#CONFIG_PACKAGE_ip6tables–extra is not set
#CONFIG_PACKAGE_ip6tables–mod-nat is not set
#CONFIG_PACKAGE_iputils–ping6 is not set
#CONFIG_PACKAGE_iputils–tracepath6 is not set
#CONFIG_PACKAGE_iputils–traceroute6 is not set
CONFIG_PACKAGE_odhacp6c=y
CONFIG_PACKAGE_odhacp6c_ext_prefix_class=0
CONFIG_PACKAGE_odhacp6c_ext_cer_id=0
CONFIG_PACKAGE_odhacpd=y
CONFIG_PACKAGE_odhacpd_ext_prefix_class=0
CONFIG_PACKAGE_odhacpd_ext_cer_id=0
CONFIG_PACKAGE_znat6=y
CONFIG_PACKAGE_6to4=y。
of course, the functional modules required by the preset items and the configuration parameters of the preset functions may be determined by those skilled in the art according to the needs, and are not limited specifically here.
And S12, determining the configuration parameter units corresponding to the function modules by using the division information of the configuration parameters.
The functional modules correspond to the configuration parameter units one by one, and each functional module is provided with the configuration parameter unit corresponding to the functional module. And determining a preset function corresponding to the functional module according to the function to be realized by the functional module. And determining a configuration parameter unit corresponding to the preset function according to the preset function. For example, the preset item a needs three function modules, the preset functions to be implemented by the three function modules are a firewall function, a network time htpdate function, and an internet protocol ipv6 function, and at this time, a configuration parameter unit corresponding to the firewall function, a configuration parameter unit corresponding to the network time htpdate function, and a configuration parameter unit corresponding to the internet protocol ipv6 function may be determined respectively.
And S13, generating a target configuration file corresponding to the preset item according to each functional module and the corresponding configuration parameter unit.
And calling a configuration file generation script to compile each function module and the corresponding configuration parameter unit thereof, respectively generating configuration files corresponding to each function module, storing each configuration file corresponding to each function module into one configuration file, executing the configuration file generation script and combining each configuration file into a target configuration file corresponding to a preset project. For example, if the preset item a corresponds to 10 function modules, 10 configuration files corresponding to the 10 function modules are stored in one configuration file, and then the 10 configuration files are combined into a complete config file, i.e., a target configuration file, by the configuration generation script.
In the method for generating a compiling configuration file provided by this embodiment, by obtaining each function module corresponding to a preset item and the partition information of the configuration parameter, the configuration parameter unit corresponding to each function module is determined by using the partition information of the configuration parameter, and a target configuration file corresponding to the preset item is generated according to each function module and the configuration parameter unit corresponding to the function module. According to the method, the configuration parameters are divided, so that different function modules correspond to different configuration parameter units, each function module corresponds to a respective configuration file, developers can add the corresponding function module according to the preset project requirements, the developers can quickly find the configuration parameters corresponding to the function modules, the problem that the developers need to find the corresponding configuration parameters again when development iteration is carried out due to too high coupling degree of the configuration parameters of the different function modules is solved, re-debugging is avoided, development iteration and function maintenance of the function modules are facilitated, and the development efficiency is improved.
In this embodiment, a method for generating a configuration file is provided, which may be used in an electronic device, such as a computer, a mobile phone, a tablet computer, and the like, fig. 2 is a flowchart of a method for generating a configuration file according to an embodiment of the present invention, and as shown in fig. 2, the flowchart includes the following steps:
and S21, acquiring at least one function module corresponding to the preset item and the partition information of the configuration parameters, wherein each configuration parameter unit in the partition information is used for realizing the preset function, and the configuration parameter unit comprises at least one configuration parameter.
Specifically, the step S21 may include the following steps:
s211, acquiring at least one function module corresponding to the preset item.
For the description of the preset items and the function modules, reference is made to the relevant description corresponding to the above embodiments, and details are not repeated here. The electronic device can identify a program corresponding to a preset project input by a developer, and determine one or more functional modules required for realizing the current preset project.
S212, all configuration parameters are acquired.
The configuration parameters are parameters for realizing preset functions, and the operating system of each electronic device has an official configuration file and config corresponding to the operating system, and all the configuration parameters of the operating system are contained in the configuration file. For example, in the process of developing a preset project by using an openwrt system, an official configuration file corresponding to the openwrt system can be acquired by accessing a memory of the openwrt system, and all configuration parameters are analyzed in the official configuration file; in the process of developing the preset project by using the linux system, the official configuration file corresponding to the linux system can be obtained by accessing the memory of the linux system, and all configuration parameters are analyzed in the official configuration file.
S213, combining one or more configuration parameters for implementing each preset function to obtain a configuration parameter unit for implementing the preset function respectively.
Respectively determining one or more configuration parameters corresponding to each preset function, and respectively combining the one or more configuration parameters for realizing each preset function to obtain a configuration parameter unit corresponding to each preset function.
S214, determining the division information of the configuration parameters according to each configuration parameter unit.
All the configuration parameters are divided according to the obtained configuration parameter units to obtain the division information of the configuration parameters, so that the configuration parameters are divided according to functions, developers can rapidly determine the configuration parameters according to the function modules, and the development efficiency is improved.
And S22, determining the configuration parameter units corresponding to the function modules by using the division information of the configuration parameters.
Specifically, the step S22 may include the following steps:
s221, determining at least one preset function corresponding to at least one functional module based on the at least one functional module.
The preset project may include a plurality of function modules, different function modules correspond to different preset functions, and the preset function corresponding to each function module is determined according to the function to be implemented by the function module. For example, the preset item a includes 4 function modules, and at this time, it is required to determine the preset functions to be respectively realized by the 4 function modules included in the preset item a.
S222, determining at least one configuration parameter unit corresponding to at least one preset function according to the at least one preset function and the division information of the configuration parameters.
According to the preset function to be realized by the function module, the configuration parameter units corresponding to the preset function are traversed in the partition information of the configuration parameters, and then each configuration parameter unit corresponding to each function module can be determined. For example, if the preset function to be implemented by the function module is a firewall function, the partition information of the configuration parameters is traversed, it is determined that the configuration parameter unit corresponding to the firewall function traverses the partition information of the configuration parameters, and it is determined that the configuration parameter unit corresponding to the network time htpdate function is configured if the preset function to be implemented by the function module is a network time htpdate function.
And S23, generating a target configuration file corresponding to the preset item according to each functional module and the corresponding configuration parameter unit.
Specifically, the step S23 may include the following steps:
s231, acquiring a preset configuration file of the preset item.
The preset configuration file is an initial configuration file generated when a preset project is created. When a software program corresponding to a preset project is created, an initial configuration file corresponding to the preset project is generated, and the initial configuration file and the software program corresponding to the preset project are stored in the same directory. The electronic device can obtain a preset configuration file corresponding to the preset item by accessing the directory where the preset item is located.
S232, determining a target configuration file corresponding to the preset project according to the preset configuration file, each functional module and the corresponding configuration parameter unit.
The target configuration file is a final configuration file corresponding to the preset project. And adding each functional module and the configuration parameter unit corresponding to each functional module into a preset configuration file to generate a target configuration file. Specifically, each configuration parameter unit in the preset configuration file may be compiled to generate a configuration file corresponding to each functional module, and the target configuration file is determined according to each configuration file and the preset configuration file.
Specifically, the step S232 may include the following steps:
(1) and compiling the configuration parameter units corresponding to the functional modules to generate configuration files corresponding to the functional modules.
And compiling the configuration parameter units corresponding to the functional modules by adopting a compiler to respectively obtain compiled files corresponding to the functional modules, and processing the compiled files by using a configuration file generation script to respectively generate the configuration files corresponding to the functional modules. Specifically, each functional module corresponds to each identification information, a compiler program may be set in the configuration generation script, and the compiler program may determine the functional module corresponding to the compiled configuration parameter unit according to the identification information to obtain a compiled file corresponding to each functional module, and then process each compiled file through the configuration file generation script to generate each configuration file corresponding to each functional module.
(2) And combining the configuration files corresponding to the functional modules to obtain a target configuration file.
And combining the combined configuration file with a preset configuration file to obtain a target configuration file corresponding to the preset project. For example, the config profile corresponding to the preset item a can be generated by executing the profile generation script make _ a _ zh.
Specifically, the step (1) may include the steps of:
(11) scanning a preset configuration file, and determining each function module of the configuration file to be generated and a corresponding configuration parameter unit.
The electronic equipment scans the preset configuration file to acquire the information contained in the preset configuration file. According to the contained information of the preset configuration file, each function module required to be added to the current preset project can be determined, and then the corresponding configuration parameter unit can be determined according to each function module.
(12) Compiling each function module of the configuration file to be generated and the corresponding configuration parameter unit thereof to obtain each compiled file.
And compiling the configuration parameter units corresponding to the functional modules respectively by adopting a compiler to obtain compiled files corresponding to the functional modules. For example, if the preset item a includes 3 functional modules, the 3 functional modules are compiled respectively, and 3 compiled files corresponding to the 3 functional modules are determined.
(13) And generating each configuration file corresponding to each functional module based on each compiled file.
And executing the configuration file generation script to generate configuration files corresponding to the compiling files, namely the configuration files corresponding to the functional modules. For example, if the preset item a includes 3 function modules, the configuration file generation script is executed, and configuration files corresponding to the 3 function modules can be obtained respectively.
Optionally, the method for generating the compiling configuration file further includes:
and S24, detecting the preset item, and judging whether the preset item is added with a new function module.
When function iteration occurs to a function module in a preset project, a new function module needs to be added to realize the function iteration of the preset project. And detecting the preset item in real time, and judging whether the preset item needs to be added with a new function module. When the preset item needs to add a new function module, step S25 is executed, otherwise, the detection is continued.
And S25, acquiring a new configuration parameter unit corresponding to the new functional module.
And when detecting that a new function module is added to the preset project, acquiring a new configuration parameter unit corresponding to the new function module. And the new configuration parameter unit is determined according to the preset function to be realized by the new function module. Specifically, a configuration parameter unit corresponding to a preset function is determined in the partition information of the configuration parameter based on the preset function corresponding to the new function module.
And S26, updating the target configuration file according to the new function module and the corresponding new configuration parameter unit.
And adding the new functional module and the corresponding new configuration parameter unit thereof into a target configuration file of a preset project, generating a configuration file corresponding to the new functional module through a configuration text generation script, and further combining the configuration file and the target configuration file to obtain an updated target configuration file.
According to the generation method of the compiling configuration file provided by the embodiment of the invention, one or more configuration parameter units corresponding to the function modules are determined according to one or more preset functions required to be realized by the function modules, so that the configuration parameter units corresponding to the function modules are determined, different function modules are corresponding to different configuration parameter units, the problem that developers need to search corresponding configuration parameters again when development iteration is carried out due to too high coupling degree of the configuration parameters of different function modules is solved, re-debugging is avoided, development iteration and functions of the function modules are facilitated, and the development efficiency is improved; the method comprises the steps of detecting a preset project, judging whether the preset project is added with a new function module, obtaining a new configuration parameter unit corresponding to the new function module when the preset project is detected to be added with the new function module, and updating a target configuration file according to the new function module and the new configuration parameter unit corresponding to the new function module, so that a developer can quickly find the configuration parameter corresponding to the new function module, the situation that the development iteration needs to be searched again for the configuration parameter corresponding to the new function module due to too high coupling degree of the configuration parameters of different function modules is avoided, the development iteration of the function modules is facilitated, and the development efficiency is improved.
In this embodiment, a device for generating a compiled configuration file is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
The present embodiment provides a compiling configuration file generating apparatus, as shown in fig. 3, including:
the obtaining module 31 is configured to obtain at least one function module corresponding to a preset item and partition information of configuration parameters, where each configuration parameter unit in the partition information is used to implement a preset function, and the configuration parameter unit includes at least one configuration parameter. For a detailed description, refer to the corresponding related description of the above embodiments, which is not repeated herein.
The determining module 32 is configured to determine the configuration parameter unit corresponding to each functional module by using the partition information of the configuration parameter. For a detailed description, refer to the corresponding related description of the above embodiments, which is not repeated herein.
And the generating module 33 is configured to generate a target configuration file corresponding to the preset item according to each functional module and the corresponding configuration parameter unit thereof. For a detailed description, refer to the corresponding related description of the above embodiments, which is not repeated herein.
The compiling configuration file generating device provided by the embodiment of the invention determines the configuration parameter unit corresponding to each function module by acquiring each function module corresponding to the preset item and the partition information of the configuration parameters and utilizes the partition information of the configuration parameters, and generates the target configuration file corresponding to the preset item according to each function module and the corresponding configuration parameter unit. The device divides the configuration parameters, different functional modules correspond to different configuration parameter units, each functional module corresponds to respective configuration files, developers can add corresponding functional modules according to preset project requirements, so that the developers can quickly find the configuration parameters corresponding to the functional modules, the problem that the developers need to search the corresponding configuration parameters again when development iteration is carried out due to too high coupling degree of the configuration parameters of different functional modules is solved, re-debugging is avoided, development iteration and function maintenance of the functional modules are facilitated, and the development efficiency is improved.
The compiled configuration file generating means in this embodiment is presented in the form of functional units, where a unit refers to an ASIC circuit, a processor and a memory executing one or more software or fixed programs, and/or other devices that can provide the above-described functionality.
Further functional descriptions of the modules are the same as those of the corresponding embodiments, and are not repeated herein.
An embodiment of the present invention further provides a mobile terminal, which has the apparatus for generating a compiled configuration file shown in fig. 3.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a terminal according to an alternative embodiment of the present invention, and as shown in fig. 4, the terminal may include: at least one processor 41, such as a CPU (Central Processing Unit), at least one communication interface 43, memory 44, and at least one communication bus 42. Wherein a communication bus 42 is used to enable the connection communication between these components. The communication interface 43 may include a Display (Display) and a Keyboard (Keyboard), and the optional communication interface 43 may also include a standard wired interface and a standard wireless interface. The Memory 44 may be a high-speed RAM Memory (volatile Random Access Memory) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The memory 44 may alternatively be at least one memory device located remotely from the aforementioned processor 41. Wherein the processor 41 may be in connection with the apparatus described in fig. 3, an application program is stored in the memory 44, and the processor 41 calls the program code stored in the memory 44 for performing any of the above-mentioned method steps.
The communication bus 42 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 42 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The memory 44 may include a volatile memory (RAM), such as a random-access memory (RAM); the memory may also include a non-volatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (english: hard disk drive, abbreviated: HDD) or a solid-state drive (english: SSD); the memory 44 may also comprise a combination of the above-mentioned kinds of memories.
The processor 41 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of CPU and NP.
The processor 41 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
Optionally, the memory 44 is also used to store program instructions. Processor 41 may invoke program instructions to implement a method of compiling a configuration file as shown in the embodiments of fig. 1 and 2 of the present application.
The embodiment of the invention also provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the processing method of the generation method of the compiling configuration file in any method embodiment. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A method for generating a configuration file is characterized by comprising the following steps:
acquiring at least one function module corresponding to a preset item and partition information of configuration parameters, wherein each configuration parameter unit in the partition information is used for realizing a preset function and comprises at least one configuration parameter;
determining a configuration parameter unit corresponding to each functional module by using the division information of the configuration parameters;
and generating a target configuration file corresponding to the preset project according to each functional module and the corresponding configuration parameter unit thereof.
2. The method of claim 1, wherein the obtaining the partition information of the configuration parameter comprises:
acquiring all configuration parameters;
combining one or more configuration parameters for realizing each preset function to respectively obtain the configuration parameter units for realizing the preset functions;
and determining the division information of the configuration parameters according to each configuration parameter unit.
3. The method according to claim 2, wherein the determining the configuration parameter unit corresponding to each of the functional modules by using the partition information of the configuration parameters includes:
determining at least one preset function corresponding to at least one functional module based on at least one functional module;
and determining at least one configuration parameter unit corresponding to at least one preset function according to at least one preset function and the division information of the configuration parameters.
4. The method according to claim 3, wherein the generating a target configuration file corresponding to the preset item according to each of the function modules and the corresponding configuration parameter units thereof comprises:
acquiring a preset configuration file of the preset project;
and determining a target configuration file corresponding to the preset project according to the preset configuration file, each functional module and the corresponding configuration parameter unit.
5. The method according to claim 4, wherein the determining a target configuration file corresponding to the preset item according to the preset configuration file, the function modules and the corresponding configuration parameter units thereof comprises:
compiling the configuration parameter unit corresponding to each functional module to generate each configuration file corresponding to each functional module;
and combining the configuration files corresponding to the functional modules to obtain the target configuration file.
6. The method according to claim 5, wherein the compiling each configuration parameter unit to generate each configuration file corresponding to each functional module comprises:
scanning the preset configuration file, and determining each function module of the configuration file to be generated and a corresponding configuration parameter unit thereof;
compiling each function module of the configuration file to be generated and a corresponding configuration parameter unit thereof to obtain each compiled file;
and generating each configuration file corresponding to each functional module based on each compiled file.
7. The method of any one of claims 1-6, further comprising:
detecting the preset item, and judging whether a new function module is added to the preset item or not;
when detecting that a new function module is added to the preset project, acquiring a new configuration parameter unit corresponding to the new function module;
and updating the target configuration file according to the new functional module and the corresponding new configuration parameter unit.
8. An apparatus for generating a compiled configuration file, comprising:
the system comprises an acquisition module, a configuration module and a processing module, wherein the acquisition module is used for acquiring at least one function module corresponding to a preset item and partition information of configuration parameters, each configuration parameter unit in the partition information is used for realizing a preset function, and the configuration parameter unit comprises at least one configuration parameter;
the determining module is used for determining the configuration parameter unit corresponding to each functional module by using the division information of the configuration parameters;
and the generating module is used for generating a target configuration file corresponding to the preset project according to each functional module and the corresponding configuration parameter unit.
9. An electronic device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the compiling configuration file generating method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer instructions for causing a computer to execute the method for generating a compilation configuration file according to any one of claims 1 to 7.
CN202011357122.8A 2020-11-26 2020-11-26 Compiling configuration file generation method and device, electronic equipment and storage medium Pending CN112486497A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011357122.8A CN112486497A (en) 2020-11-26 2020-11-26 Compiling configuration file generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011357122.8A CN112486497A (en) 2020-11-26 2020-11-26 Compiling configuration file generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112486497A true CN112486497A (en) 2021-03-12

Family

ID=74936131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011357122.8A Pending CN112486497A (en) 2020-11-26 2020-11-26 Compiling configuration file generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112486497A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114448791A (en) * 2021-12-16 2022-05-06 苏州浪潮智能科技有限公司 Configuration method and device of routing module, electronic equipment and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049423A (en) * 2011-10-13 2013-04-17 上海可鲁系统软件有限公司 Method for configuration management of client application platforms and function modules and device thereof
CN106775745A (en) * 2016-12-28 2017-05-31 广州华多网络科技有限公司 The method and device of consolidation procedure code
CN109202898A (en) * 2018-08-07 2019-01-15 北京云迹科技有限公司 Method for parameter configuration and device
CN109413472A (en) * 2018-12-06 2019-03-01 北京四达时代软件技术股份有限公司 A kind of configuration method and system of STB terminal
CN109871229A (en) * 2019-01-16 2019-06-11 平安普惠企业管理有限公司 Management method, device, storage medium and the terminal device of code text
CN111142927A (en) * 2019-12-04 2020-05-12 中盈优创资讯科技有限公司 Configuration file merging and splitting processing method and device
CN111309379A (en) * 2020-02-27 2020-06-19 平安健康保险股份有限公司 Project generation method and device, computer equipment and storage medium
CN111651219A (en) * 2020-05-27 2020-09-11 泰康保险集团股份有限公司 Method and equipment for managing multi-module project configuration file

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049423A (en) * 2011-10-13 2013-04-17 上海可鲁系统软件有限公司 Method for configuration management of client application platforms and function modules and device thereof
CN106775745A (en) * 2016-12-28 2017-05-31 广州华多网络科技有限公司 The method and device of consolidation procedure code
CN109202898A (en) * 2018-08-07 2019-01-15 北京云迹科技有限公司 Method for parameter configuration and device
CN109413472A (en) * 2018-12-06 2019-03-01 北京四达时代软件技术股份有限公司 A kind of configuration method and system of STB terminal
CN109871229A (en) * 2019-01-16 2019-06-11 平安普惠企业管理有限公司 Management method, device, storage medium and the terminal device of code text
CN111142927A (en) * 2019-12-04 2020-05-12 中盈优创资讯科技有限公司 Configuration file merging and splitting processing method and device
CN111309379A (en) * 2020-02-27 2020-06-19 平安健康保险股份有限公司 Project generation method and device, computer equipment and storage medium
CN111651219A (en) * 2020-05-27 2020-09-11 泰康保险集团股份有限公司 Method and equipment for managing multi-module project configuration file

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114448791A (en) * 2021-12-16 2022-05-06 苏州浪潮智能科技有限公司 Configuration method and device of routing module, electronic equipment and readable storage medium
CN114448791B (en) * 2021-12-16 2023-08-25 苏州浪潮智能科技有限公司 Configuration method and device of routing module, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
JP6198939B2 (en) Method for loading driver and embedded device
CN110209520B (en) Method and device for improving SSD (solid State disk) testing efficiency, computer equipment and storage medium
CN113961919B (en) Malicious software detection method and device
CN109684008A (en) Card rendering method, device, terminal and computer readable storage medium
CN111338616A (en) Protocol analysis code generation method and device and electronic equipment
CN107341106B (en) Application compatibility detection method, development terminal and storage medium
CN106681767B (en) Light application adding method and device
CN113419971B (en) Android system service vulnerability detection method and related device
CN112486497A (en) Compiling configuration file generation method and device, electronic equipment and storage medium
CN110688320A (en) Global variable detection method and device and terminal equipment
CN114879985B (en) Method, device, equipment and storage medium for installing certificate file
CN110889116A (en) Advertisement blocking method and device and electronic equipment
US11947966B2 (en) Identifying computer instructions enclosed by macros and conflicting macros at build time
CN114297088A (en) Method, device, equipment and medium for testing front end vue frame assembly
CN112804315B (en) Micro-application integration method and device
CN115292178A (en) Test data searching method, device, storage medium and terminal
CN109408063B (en) Instruction pile inserting method and device based on virtual machine
CN113157274A (en) Software development method and device based on micro front end, electronic equipment and storage medium
CN112543104A (en) Application program packaging method and device, electronic equipment and storage medium
CN112631931A (en) Version testing method and device, storage medium and electronic equipment
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN112068814A (en) Method, device, system and medium for generating executable file
CN117640364A (en) Cluster deployment method and device of message system and electronic equipment
CN112732332B (en) Software package management method and device suitable for koji management system and electronic equipment
CN110764997B (en) Database interface conformance testing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination