CN113467820A - Method and device for generating configuration file - Google Patents

Method and device for generating configuration file Download PDF

Info

Publication number
CN113467820A
CN113467820A CN202010239019.7A CN202010239019A CN113467820A CN 113467820 A CN113467820 A CN 113467820A CN 202010239019 A CN202010239019 A CN 202010239019A CN 113467820 A CN113467820 A CN 113467820A
Authority
CN
China
Prior art keywords
configuration file
version number
preset
item
dependency
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
CN202010239019.7A
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 Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010239019.7A priority Critical patent/CN113467820A/en
Publication of CN113467820A publication Critical patent/CN113467820A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

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

Abstract

The invention discloses a method and a device for generating a configuration file, and relates to the technical field of computers. One embodiment of the method comprises: acquiring configuration information of a module; determining a dependency corresponding to the module according to the configuration information; updating the dependent item according to the version number of a preset dependent item to generate a first configuration file; and updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate the configuration file. The implementation method can achieve the technical effects of reducing the cost of manual management of the dependent item in the process of building the model by multiple modules and reducing the resource investment of the management of the dependent item in the subsequent generation process of the model.

Description

Method and device for generating configuration file
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a configuration file.
Background
In the prior art, in the process of building a model by multiple modules, along with the increase of the modules, the diversity of versions on which each module depends is increased, and then the conflict problem of the diversity of dependence under the multi-module building model exists, so that the existing engineering management and technical mode cannot meet the increasing engineering scale.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. when the prior art adopts the API with the management function to configure each module, the technical problem that the final dependency relationship needs to be determined according to the overall environment exists.
2. When the prior art adopts the global dependence replacement principle to configure each module, the management cost needs to be input, and the technical defect of high input cost exists.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a configuration file generation method, which can achieve the technical effects of reducing the cost of dependent item artificial management in the process of building a model by multiple modules, and reducing resources for dependent item management in the subsequent model generation process.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of generating a configuration file, including:
acquiring configuration information of a module;
determining a dependency corresponding to the module according to the configuration information;
updating the dependent item according to the version number of a preset dependent item to generate a first configuration file;
updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate a configuration file;
the dependency item is other modules for the module to achieve a preset purpose according to business requirements.
Optionally, updating the dependent item according to a version number of a preset dependent item, and generating a first configuration file, including:
step A, calculating the dependence items corresponding to the configuration information according to a preset rule to determine a first calculation result;
b, judging whether the version number corresponding to the first operation result is the same as the version number of a preset dependency item or not according to the first operation result;
if not, modifying the version number of the dependent item, and executing the step A and the step B again;
and if so, setting the configuration information as a first configuration file.
Optionally, determining, according to the configuration information, a dependency corresponding to the module includes:
determining a corresponding first dependent item in the configuration information;
determining a dependency item tree of the configuration information according to the first dependency item;
and determining all the dependent items in the dependent item tree as all the dependent items corresponding to the configuration information.
Optionally, updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate the configuration file, where the updating includes:
determining a first version number of a compilation environment on which the first configuration file depends;
acquiring a version number of a preset compiling environment;
judging whether the first version number is the same as the version number of the preset compiling environment or not;
if not, updating the first version number to a preset compiling environment version number;
and if so, generating a configuration file according to the compiling environment corresponding to the first configuration file.
According to an aspect of the embodiments of the present invention, there is provided an apparatus for generating a configuration file, including:
the acquisition unit is used for acquiring the configuration information of the module;
a dependent item determining unit for determining the dependent item corresponding to the module according to the configuration information
The first configuration file generation unit is used for updating the dependency items according to the version numbers of preset dependency items to generate a first configuration file;
and the configuration file generating unit is used for updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate the configuration file.
Optionally, updating the dependent item according to a version number of a preset dependent item, and generating a first configuration file, including:
step A, calculating the dependence items corresponding to the configuration information according to a preset rule to determine a first calculation result;
b, judging whether the version number corresponding to the first operation result is the same as the version number of a preset dependency item or not according to the first operation result;
if not, modifying the version number of the dependent item, and executing the step A and the step B again;
and if so, setting the configuration information as a first configuration file.
Optionally, determining, according to the configuration information, a dependency corresponding to the module includes:
determining a corresponding first dependent item in the configuration information;
determining a dependency item tree of the configuration information according to the first dependency item;
and determining all the dependent items in the dependent item tree as all the dependent items corresponding to the configuration information.
Optionally, updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate the configuration file, where the updating includes:
determining a first version number of a compilation environment on which the first configuration file depends;
acquiring a version number of a preset compiling environment;
judging whether the first version number is the same as the version number of the preset compiling environment or not;
if not, updating the first version number to a preset compiling environment version number;
and if so, generating a configuration file according to the compiling environment corresponding to the first configuration file.
According to another aspect of the embodiments of the present invention, there is provided an electronic device for generating a configuration file, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating a configuration file provided by the present invention.
According to a further aspect of the embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method for generating a configuration file provided by the present invention.
One embodiment of the above invention has the following advantages or benefits:
by means of the technical means of unifying the dependency items in the configuration information and the corresponding compiling environments, the technical defects that in the prior art, the final dependency relationship needs to be determined according to the overall environment, the investment management cost is high when the global dependency replacement principle needs to be adopted for configuring each module, and the investment cost is high are overcome, and the technical effects that the cost of manual management of the dependency items is reduced in the process of building the model by multiple modules and the resources managed by the dependency items are reduced in the subsequent model generation process are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of generating a configuration file according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a specific process of generating a first configuration file according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a detailed flow of a method for generating a configuration file according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main modules of an apparatus for generating a configuration file according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the prior art, mostly, gradable (Gradle is a JVM-based construction tool, is a general and flexible construction tool, supports maven, Ivy warehouse, supports transitive dependency management, does not need a remote warehouse or pom.xml and ivy.xml configuration files, and is written by using Groovy based on a build script) is adopted as a common project structure in a multi-module construction system of a project construction tool, and a multi-module construction model tool is adopted for a common project structure.
In the actual process of managing each module, the multi-module construction model is mostly used for the business form of cross-team and cross-department, the construction content of each module is determined by each team or department, and the dependency relationship has diversity.
The diversity of the dependency relationship is mainly reflected by the difference of the version numbers of the dependent items, and in the overall construction process of the multi-module construction model, the dependency conflict of the multiple-module construction model with consistent dependency diversity exists.
Although the advantage of the multi-module building model is "divide and conquer", the disadvantage is that as the number of modules increases, and the diversity of the versions of the dependent items in the modules increases, the investment of engineering management is increasingly increased. In a multi-module building model, the problem of avoiding dependency conflict through an engineering management mode is a common means at present, but with the increase of the number of modules and complexity, the mode adopted by the prior art is increasingly inefficient, and a large amount of management cost is increased to control the problem caused by dependency diversity in the multi-module building model.
Specifically, the step of constructing the model by using multiple modules mainly comprises the following steps:
an Initialization phase (Initialization), the main purpose of which is to identify the specifically constructed modules and to instantiate module (Project) objects for these modules;
a Configuration phase (Configuration) in which the step of generating the Configuration file is carried out, based on the characteristics of the multi-module build model, each module being an initialized module (Project) object, which internally maintains its own build logic and dependency information;
execution (Execution), based on the configuration file of the second step, the build task will be executed.
Through the steps of building the model by multiple modules, the second step is found to be a key point, the part with configuration dependence errors in the traditional building process is processed in the second step in a centralized manner, if the processing fails, the building task is terminated, and the building task is continuously executed after the dependence relationship of each module is continuously adjusted to reach the building standard.
Fig. 1 is a schematic diagram of a main flow of a method for generating a configuration file according to an embodiment of the present invention, as shown in fig. 1, including:
s101, acquiring configuration information of a module;
step S102, determining a dependence item corresponding to the module according to the configuration information;
step S103, updating the dependency item according to the version number of a preset dependency item to generate a first configuration file;
step S104, updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate a configuration file;
the dependency item is other modules for the module to achieve a preset purpose according to business requirements.
If the built multi-module model has the conditions that the versions of items depended on by the modules are different and the depended environments are also different, the multi-module model needs to be managed through a manual management technical means, and further the technical defect of high management cost exists.
Each configuration information includes information of a corresponding module, and specifically, the configuration information includes: a dependent item and attribute information of the dependent item.
The step S102 may be integrated into auto _ dependencies, and specifically, the auto _ dependencies is a custom Task (Task).
According to the method and the device, by means of unifying the dependency items in the configuration information and the corresponding compiling environments, the technical defect that in the prior art, the final dependency relationship needs to be determined according to the whole environment, the overall dependency replacement principle is adopted to configure each module, the cost of investment management is high, the cost of manual management of the dependency items is reduced in the process of building the model by multiple modules, the trend of reducing the resource investment of the dependency item management in the subsequent model building is shown, and the technical effect of replacing the management means through the technical means is achieved.
Namely, in the multi-module construction model, the construction configuration stage is intervened through technical means, the technical problem that the dependence item has diversity, namely, the dependence conflict brings about a large amount of model management cost improvement under the multi-module construction model is solved, and the technical effect of reducing the engineering management cost is achieved through intervening the construction configuration stage.
The multi-module model building means that a model is built by a plurality of modules, and particularly, Gradle is mostly adopted as a building tool of the multi-module model building.
The dependency item refers to a business layer needing to achieve a certain purpose and needing to use other (engineering package, module, engineering) modules, and the other modules are collectively called the dependency item.
The environment strong dependence item refers to an dependence item with strong dependence on the environment.
Dependency diversity refers to the diversity of versions that a dependency depends on.
Specifically, the step S102 of updating the dependent item according to the version number of the preset dependent item includes, before generating the first configuration file:
determining a dependency corresponding to the module according to the configuration information, specifically comprising:
determining a corresponding first dependent item in the configuration information; determining a dependency item tree of the configuration information according to the first dependency item; and determining all the dependent items in the dependent item tree as all the dependent items corresponding to the configuration information.
Specifically, all configuration information in a module is collected, dependency information is gathered, a dependency tree is generated under a specific rule, if an error occurs in the process, the rest links cannot be executed continuously, and in order to guarantee the legality of the dependency, the dependency is interfered before the dependency tree is generated, and firstly, the dependency is interfered through an auto _ dependencies task.
Step A, calculating the dependence items corresponding to the configuration information according to a preset rule to determine a first calculation result; the rules include using a maximum version, using a minimum version, or using a specified version;
b, judging whether the version number corresponding to the first operation result is the same as the version number of a preset dependency item or not according to the first operation result; that is, the obtained dependency items are subjected to validity detection, and if the dependency items identical to the preset version number appear, the version numbers of the identical dependency items are reset according to a preset rule;
if not, modifying the version number of the dependent item, and executing the step A and the step B again;
and if so, setting the configuration information as a first configuration file.
The specific steps are described in detail below with an embodiment.
Fig. 2 is a schematic diagram of a specific process of generating a first configuration file according to an embodiment of the present invention, as shown in fig. 2, including:
s101, acquiring configuration information of a module;
step S1021, determining all dependent items corresponding to the modules and attribute information of the dependent items according to the configuration information;
step S1022, judging whether the attribute information of the dependency item and the dependency item is matched with a preset rule;
if not, executing step S1023 to modify the version number of the dependent item;
if yes, executing step S1024 to modify the configuration of the module;
and step S1025, generating a first configuration file.
By analyzing the version rule, the version numbers of the dependent items that do not conform to the version rule are unified, and finally, a first configuration file of each module is generated, and the modified dependent items are written in and used as output for executing the next step S103. Specifically, step S103 is integrated in Auto _ build.
In the multi-module building model, there are dependent items having strong dependency on the environment at runtime, and the dependent items are processed in a dependent diversity manner in step S103.
The Auto _ help step is similar to the Auto _ dependencies operation step, and firstly, when the output of Auto _ dependencies is received, the output contains the compiling information in all the configuration stage modules,
optionally, in step S103, updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number, and generating the configuration file, where the method includes:
determining a first version number of a compilation environment on which the first configuration file depends;
acquiring a version number of a preset compiling environment;
judging whether the first version number is the same as the version number of the preset compiling environment or not; that is, the preset compiling environment is read to compare the corresponding compiling environment in the module, and the version number of the module compiling environment which does not accord with the rule is modified.
If not, updating the first version number to a preset compiling environment version number;
and if so, generating a configuration file according to the compiling environment corresponding to the first configuration file.
And finally, updating and outputting the first configuration files of the modules and transmitting the updated first configuration files to the next task, so that the whole intervention process is finished.
FIG. 3 is a schematic diagram illustrating a detailed flow of a method for generating a configuration file according to an embodiment of the present invention; as shown in fig. 3, includes:
s301, acquiring configuration information of a module;
step S1021, determining all dependent items corresponding to the modules and attribute information of the dependent items according to the configuration information; step S1022, judging whether the attribute information of the dependency item and the dependency item is matched with a preset rule; if not, executing step S1023 to modify the version number of the dependent item; if yes, executing step S1024 to modify the configuration of the module; step S1025, generating a first configuration file;
step S1031, determining a first version number of a compiling environment which the first configuration file depends on according to the first configuration file; step S1032, judging whether the first version number is matched with the version number of the preset compiling environment; if not, executing step S1033 to update the first version number to a preset compilation environment version number; if yes, executing step S1034 to modify the configuration of the module; step 1035, generating a configuration file according to the compiling environment corresponding to the first configuration file;
in practical application, the method can further comprise the following steps: step S304, judging the validity of each module according to the configuration file; if the module is legal, executing step S305 to generate a dependency tree between modules according to each module; step S306, detecting the legality of the dependency relationship among the modules in the dependency tree; if yes, step S307 executes another task.
FIG. 4 is a schematic diagram of the main modules of an apparatus for generating a configuration file according to an embodiment of the present invention; as shown in fig. 4, there is provided an apparatus 400 for generating a configuration file, comprising:
an obtaining unit 401, configured to obtain configuration information of a module;
a dependent item determining unit 402, configured to determine, according to the configuration information, a dependent item corresponding to the module
A first configuration file generating unit 403, configured to update the dependent item according to a version number of a preset dependent item, and generate a first configuration file;
a configuration file generating unit 404, configured to update the compiling environment corresponding to the first configuration file according to a preset compiling environment version number, so as to generate a configuration file.
Optionally, updating the dependent item according to a version number of a preset dependent item, and generating a first configuration file, including:
step A, calculating the dependence items corresponding to the configuration information according to a preset rule to determine a first calculation result;
b, judging whether the version number corresponding to the first operation result is the same as the version number of a preset dependency item or not according to the first operation result;
if not, modifying the version number of the dependent item, and executing the step A and the step B again;
and if so, setting the configuration information as a first configuration file.
Optionally, determining, according to the configuration information, a dependency corresponding to the module includes:
determining a corresponding first dependent item in the configuration information;
determining a dependency item tree of the configuration information according to the first dependency item;
and determining all the dependent items in the dependent item tree as all the dependent items corresponding to the configuration information.
Optionally, updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate the configuration file, where the updating includes:
determining a first version number of a compilation environment on which the first configuration file depends;
acquiring a version number of a preset compiling environment;
judging whether the first version number is the same as the version number of the preset compiling environment or not;
if not, updating the first version number to a preset compiling environment version number;
and if so, generating a configuration file according to the compiling environment corresponding to the first configuration file.
Fig. 5 illustrates an exemplary system architecture 500 to which a method or apparatus for generating a profile may be applied, according to an embodiment of the invention.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for generating a configuration file provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus for generating a configuration file is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a transmitting unit, an obtaining unit, a determining unit, and a first processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the sending unit may also be described as a "unit sending a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
acquiring configuration information of a module;
determining a dependency corresponding to the module according to the configuration information;
updating the dependent item according to the version number of a preset dependent item to generate a first configuration file;
and updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate the configuration file.
According to the technical scheme of the embodiment of the invention, the following beneficial effects can be achieved:
according to the method and the device, by means of the technical means for unifying the dependency items in the configuration information and the corresponding compiling environments, the technical defects that in the prior art, the final dependency relationship needs to be determined according to the whole environment, the investment management cost is high when the global dependency replacement principle needs to be adopted for configuring each module, and the investment cost is high are overcome, so that the technical effects that in the process of building a model by multiple modules, the cost of artificial management of the dependency items is reduced, the resource investment of the dependency item management is reduced in the subsequent engineering construction, and the management means is replaced by the technical means are achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of generating a configuration file, comprising:
acquiring configuration information of a module;
determining a dependency corresponding to the module according to the configuration information;
updating the dependent item according to the version number of a preset dependent item to generate a first configuration file;
updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate a configuration file;
the dependency item is other modules for the module to achieve a preset purpose according to business requirements.
2. The method of claim 1, wherein updating the dependent item according to a version number of a preset dependent item to generate a first configuration file comprises:
step A, calculating the dependence items corresponding to the configuration information according to a preset rule to determine a first calculation result;
b, judging whether the version number corresponding to the first operation result is the same as the version number of a preset dependency item or not according to the first operation result;
if not, modifying the version number of the dependent item, and executing the step A and the step B again;
and if so, setting the configuration information as a first configuration file.
3. The method of claim 2, wherein determining the dependency corresponding to the module according to the configuration information comprises:
determining a corresponding first dependent item in the configuration information;
determining a dependency item tree of the configuration information according to the first dependency item;
and determining all the dependent items in the dependent item tree as all the dependent items corresponding to the configuration information.
4. The method of claim 1, wherein updating the compilation environment corresponding to the first configuration file according to a preset compilation environment version number to generate the configuration file comprises:
determining a first version number of a compilation environment on which the first configuration file depends;
acquiring a version number of a preset compiling environment;
judging whether the first version number is the same as the version number of the preset compiling environment or not;
if not, updating the first version number to a preset compiling environment version number;
and if so, generating a configuration file according to the compiling environment corresponding to the first configuration file.
5. An apparatus for generating a configuration file, comprising:
the acquisition unit is used for acquiring the configuration information of the module;
a dependent item determining unit for determining the dependent item corresponding to the module according to the configuration information
The first configuration file generation unit is used for updating the dependency items according to the version numbers of preset dependency items to generate a first configuration file;
and the configuration file generating unit is used for updating the compiling environment corresponding to the first configuration file according to a preset compiling environment version number to generate the configuration file.
6. The apparatus of claim 5, wherein updating the dependent item according to a version number of a preset dependent item, and generating a first configuration file comprises:
step A, calculating the dependence items corresponding to the configuration information according to a preset rule to determine a first calculation result;
b, judging whether the version number corresponding to the first operation result is the same as the version number of a preset dependency item or not according to the first operation result;
if not, modifying the version number of the dependent item, and executing the step A and the step B again;
and if so, setting the configuration information as a first configuration file.
7. The apparatus of claim 6, wherein determining the dependency corresponding to the module according to the configuration information comprises:
determining a corresponding first dependent item in the configuration information;
determining a dependency item tree of the configuration information according to the first dependency item;
and determining all the dependent items in the dependent item tree as all the dependent items corresponding to the configuration information.
8. The apparatus of claim 5, wherein updating the compilation environment corresponding to the first configuration file according to a preset compilation environment version number to generate the configuration file comprises:
determining a first version number of a compilation environment on which the first configuration file depends;
acquiring a version number of a preset compiling environment;
judging whether the first version number is the same as the version number of the preset compiling environment or not;
if not, updating the first version number to a preset compiling environment version number;
and if so, generating a configuration file according to the compiling environment corresponding to the first configuration file.
9. An electronic device that generates a configuration file, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN202010239019.7A 2020-03-30 2020-03-30 Method and device for generating configuration file Pending CN113467820A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010239019.7A CN113467820A (en) 2020-03-30 2020-03-30 Method and device for generating configuration file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010239019.7A CN113467820A (en) 2020-03-30 2020-03-30 Method and device for generating configuration file

Publications (1)

Publication Number Publication Date
CN113467820A true CN113467820A (en) 2021-10-01

Family

ID=77865168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010239019.7A Pending CN113467820A (en) 2020-03-30 2020-03-30 Method and device for generating configuration file

Country Status (1)

Country Link
CN (1) CN113467820A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855131A (en) * 2011-06-30 2013-01-02 国际商业机器公司 Device and method for software configuration management
CN105893104A (en) * 2016-03-28 2016-08-24 乐视控股(北京)有限公司 Code compiling method and device
CN107391104A (en) * 2017-05-31 2017-11-24 杭州大搜车汽车服务有限公司 A kind of client and the renewal of react native codes rely on management method, apparatus and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855131A (en) * 2011-06-30 2013-01-02 国际商业机器公司 Device and method for software configuration management
CN105893104A (en) * 2016-03-28 2016-08-24 乐视控股(北京)有限公司 Code compiling method and device
CN107391104A (en) * 2017-05-31 2017-11-24 杭州大搜车汽车服务有限公司 A kind of client and the renewal of react native codes rely on management method, apparatus and system

Similar Documents

Publication Publication Date Title
CN108920222B (en) Business processing method and device based on rule engine
US20160381151A1 (en) Dynamically generating solution stacks
US10055393B2 (en) Distributed version control of orchestration templates
CN111427701A (en) Workflow engine system and business processing method
CN111125064B (en) Method and device for generating database schema definition statement
CN109960212B (en) Task sending method and device
CN112947919A (en) Method and device for constructing service model and processing service request
CN112817562A (en) Service processing method and device
CN112596854A (en) Method and device for continuously integrating running of assembly line
CN112579151A (en) Method and device for generating model file
CN112052152A (en) Simulation test method and device
CN111026629A (en) Method and device for automatically generating test script
CN113779122B (en) Method and device for exporting data
CN113467820A (en) Method and device for generating configuration file
CN114995719A (en) List rendering method, device, equipment and storage medium
CN114625458A (en) Page data processing method and device, electronic equipment and storage medium
CN113312900A (en) Data verification method and device
CN113297081A (en) Execution method and device of continuous integration assembly line
CN112099841A (en) Method and system for generating configuration file
CN112214500A (en) Data comparison method and device, electronic equipment and storage medium
CN112559001A (en) Method and device for updating application
CN112835609A (en) Method and device for modifying dependent package download address
US20220237021A1 (en) Systems and methods of telemetry diagnostics
US20230246916A1 (en) Service map conversion with preserved historical information
CN113760316A (en) Application configuration system and method

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