CN113535225B - Environment configuration file processing method, device, equipment and medium of application software - Google Patents

Environment configuration file processing method, device, equipment and medium of application software Download PDF

Info

Publication number
CN113535225B
CN113535225B CN202110843110.4A CN202110843110A CN113535225B CN 113535225 B CN113535225 B CN 113535225B CN 202110843110 A CN202110843110 A CN 202110843110A CN 113535225 B CN113535225 B CN 113535225B
Authority
CN
China
Prior art keywords
environment
attribute
environment configuration
application software
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110843110.4A
Other languages
Chinese (zh)
Other versions
CN113535225A (en
Inventor
吴瑾
邓方
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank 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 Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202110843110.4A priority Critical patent/CN113535225B/en
Publication of CN113535225A publication Critical patent/CN113535225A/en
Application granted granted Critical
Publication of CN113535225B publication Critical patent/CN113535225B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Abstract

The embodiment of the invention discloses a method, a device, equipment and a medium for processing an environment configuration file of application software. The method is applied to an application software development operation platform and comprises the following steps: determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; and according to the model placeholder in the current environment configuration template, acquiring a corresponding attribute value from the preset environment configuration model, and filling the attribute value into the current environment configuration template to generate a current environment configuration file of the application software deployed in the environment to be configured. The method, the device, the equipment and the medium for processing the environment configuration file of the application software improve the generation efficiency of the environment configuration file of the application software.

Description

Environment configuration file processing method, device, equipment and medium of application software
Technical Field
The embodiment of the invention relates to a computer software development technology, in particular to a method, a device, equipment and a medium for processing an environment configuration file of application software.
Background
With the rapid development of application software, software development needs to respond to business requirements more quickly, and high-quality application products meeting the business requirements are delivered continuously and rapidly. Delivery of application software requires repeated rigorous testing, inspection, etc. processes, and therefore application software typically needs to be deployed in multiple different environments for testing.
The traditional DevOps (combination of Development and Operations) platform is a collective term for a group of processes, methods and systems, and is used for facilitating communication, collaboration and integration between Development of application software, technical operation and Quality Assurance (QA) departments. When application software development is performed based on the DevOps platform, the application software needs to be deployed in multiple environments to run tests.
The application software is deployed in a plurality of environments, and each application software needs to edit different configuration files aiming at each deployment environment, so that the application software can be smoothly deployed in the environment to run. However, the existing method for editing the environment configuration file for the application software has high labor cost and low efficiency.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for processing an environment configuration file of application software, so as to improve the generation efficiency of the environment configuration file of the application software.
In a first aspect, an embodiment of the present invention provides an environment configuration file processing method for application software, which is applied to an application software development operating platform, and the method includes:
acquiring a pre-environment configuration file of application software, and determining an environment to be configured of the application software;
determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; the preset environment configuration model comprises an environment, an attribute and an attribute value, and a mapping relation exists between the attribute value and the environment and the attribute;
adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model;
acquiring corresponding attribute values from the preset environment configuration model according to the model placeholders in the current environment configuration template, and filling the attribute values into the current environment configuration template to generate a current environment configuration file of the application software deployed in the environment to be configured;
and deploying the application software in the environment to be configured according to the current environment configuration file, and running the application software.
In a second aspect, an embodiment of the present invention further provides an apparatus for processing an environment configuration file of application software, configured on an application software development operating platform, where the apparatus includes:
the device comprises a to-be-configured environment determining module, a to-be-configured environment determining module and a configuration module, wherein the to-be-configured environment determining module is used for acquiring a pre-environment configuration file of application software and determining a to-be-configured environment of the application software;
the attribute to be configured determining module is used for determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; the preset environment configuration model comprises an environment, an attribute and an attribute value, and a mapping relation exists between the attribute value and the environment and the attribute;
the current environment configuration template generation module is used for adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model;
a current environment configuration file generation module, configured to obtain a corresponding attribute value from the preset environment configuration model according to a model placeholder in the current environment configuration template, and fill the attribute value into the current environment configuration template to generate a current environment configuration file in which the application software is deployed in the environment to be configured;
and the application software deployment module is used for deploying the application software in the environment to be configured according to the current environment configuration file and running the application software.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
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 processing the environment profile of any application software according to the first aspect.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for processing an environment configuration file of any application software according to the first aspect.
The method, the device, the equipment and the medium for processing the environment configuration file of the application software provided by the embodiment of the invention can be used for determining the attribute to be configured from the preset environment configuration model by editing the preset environment configuration model which comprises the environment, the attribute and the attribute value, wherein the attribute value has a mapping relation with the environment and the attribute so as to generate the current environment configuration template by using the preset configuration attribute value in the preset environment configuration file of the application software and the environment to be configured of the application software, adding the model placeholder of the attribute to be configured into the preset environment configuration file to replace the attribute value, so as to establish the association with the attribute value in the preset environment configuration model, further acquiring the corresponding attribute value from the preset environment configuration model according to the model placeholder in the current environment configuration template, filling the corresponding attribute value into the current environment configuration template, and rapidly establishing the current environment configuration file of the application software deployed in the environment to be configured, the method and the device have the advantages that the current environment configuration template and the current environment configuration file are automatically generated for the developer by reversely searching the preset environment configuration model based on the front environment configuration file and the environment to be configured provided by the developer, the developer does not need to manually write different configuration files for each environment deployed by the application software, the working complexity is greatly simplified, the labor cost is reduced, and the environment configuration file generation efficiency of the application software is improved.
Drawings
Fig. 1 is a flowchart of an environment configuration file processing method for application software according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a preset environment configuration model according to an embodiment of the present invention;
fig. 3 is a flowchart of an environment configuration file processing method for application software according to a second embodiment of the present invention;
fig. 4 is a flowchart of an environment configuration file processing method of application software according to a third embodiment of the present invention;
fig. 5 is a flowchart of an environment configuration file processing method for application software according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an environment configuration file processing apparatus for application software according to a fifth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of an environment configuration file processing method for application software according to an embodiment of the present invention, where the embodiment is applicable to an application software development operating platform, for example, when the application software is developed based on a DevOps platform, the application software is deployed in multiple environments to run a test, and the method may be executed by an environment configuration apparatus for application software according to an embodiment of the present invention, where the apparatus may be implemented by hardware and/or software, and may generally be integrated in an electronic device, for example, the application software development operating platform. As shown in fig. 1, the method for processing the environment configuration file of the application software specifically includes the following steps:
s110, acquiring a pre-environment configuration file of the application software, and determining an environment to be configured of the application software.
The application software refers to application software to be deployed, and the application software may be any application software, which is not limited in this embodiment.
The pre-environment configuration file refers to an existing environment configuration file, and the environment configuration file refers to a configuration file of the application software for each deployment environment.
The environment to be configured refers to the environment in which the application software is currently deployed.
In this embodiment, the environment configuration file is generated for the environment to be configured by obtaining a pre-environment configuration file of the application software and determining the environment to be configured of the application software.
Optionally, obtaining the pre-environment configuration file of the application software, and determining the to-be-configured environment of the application software includes:
the method comprises the steps of obtaining an environment configuration file used by a previous deployment environment of the application software as the pre-environment configuration file, and determining an environment to be configured of the application software according to a deployment strategy input or preset by a developer.
The application software is usually required to be deployed and operated in a plurality of environments in sequence, the pre-environment configuration file may be an environment configuration file used by the application software in a previous deployment environment, and after the deployment and operation of the application software in the environment to be configured are completed, the environment configuration file used by the application software in the environment to be configured may be used as the pre-environment configuration file of the application software in a next deployment environment.
If the application software is deployed in the first environment, the pre-environment configuration file may be an environment configuration file of other application software when the application software is deployed in the environment to be configured, or the pre-environment configuration file may also be a default environment configuration file manually input by a developer, and the pre-environment configuration file may be obtained through multiple ways, which is not limited in this embodiment.
Alternatively, the environment to be configured of the application software may be input by the developer, that is, the developer determines the environment in which the application software is to be deployed currently.
In other embodiments, the environment to be configured of the application software may also be determined by a preset deployment policy, where the preset deployment policy may be set manually by a developer, and the preset deployment policy may include in which environments the application software performs deployment tests, a deployment sequence of the application software in each environment, and the like, which is not limited in this embodiment.
S120, determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; the preset environment configuration model comprises an environment, attributes and attribute values, and a mapping relation exists between the attribute values and the environment and the attributes.
The preset environment configuration model is an environment configuration model pre-stored by a developer, and fig. 2 is an exemplary schematic diagram of a preset environment configuration model according to an embodiment of the present invention, and as shown in fig. 2, the preset environment configuration model may be formed by manually editing and inputting by the developer, and may include an environment, an attribute, and an attribute value.
The environment refers to an environment of an application software development operating platform, the application software development operating platform generally includes a plurality of environments, each environment has a corresponding environment name, and the application software is generally deployed into the plurality of environments for running tests.
Optionally, the environment of the application software development operating platform includes at least one of the following: the system comprises a development test environment, an internal test environment, a business test environment, a quasi-production test environment, a pressure test environment, a simulation environment and a production environment.
One skilled in the art can deploy the application software into any of the above environments for testing according to actual testing requirements.
It should be noted that the environment of the application development operating platform is not limited to the above listed environment, and in practical cases, the application development operating platform may include more environments to meet the development test requirements of the application.
The attribute refers to an attribute name, and the attribute value refers to a specific parameter value corresponding to the attribute name, for example, when the attribute name is a domain name, the attribute value corresponding to the domain name is a specific address composed of a series of names separated by dots.
Optionally, the attribute comprises at least one of: domain name, address, port, username, and password.
Of course, the attributes are not limited to the above listed attributes, and in practical cases, the required attributes may be set according to the development test requirements of the application software.
In the preset environment configuration model, there is a mapping relationship between the attribute value and the environment and the attribute, and the mapping value of each attribute in the corresponding environment is the attribute value, for example, as shown in fig. 2, the mapping value 1 of the attribute 1 in the corresponding environment is the attribute value 1 corresponding to the attribute 1 in the environment, and so on. It can be understood that, in the preset environment configuration model, because there is a mapping relationship between the attribute value and the environment and the attribute, the environment and the attribute may determine a corresponding attribute value, and the environment and the attribute value may also determine a corresponding attribute.
In this embodiment, the pre-environment configuration file includes a plurality of pre-configuration attribute values, and since a mapping relationship exists between the attribute values and the environment and the attributes in the pre-environment configuration model, the attributes corresponding to the pre-configuration attribute values in the environment to be configured are determined from the pre-environment configuration model as the attributes to be configured according to the pre-configuration attribute values in the pre-environment configuration file based on the environment to be configured.
S130, adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value, so as to generate a current environment configuration template according to the preposed environment configuration file; the model placeholder is an index pointing to an attribute value in the preset environment configuration model.
The model placeholder is an index pointing to an attribute value in the preset environment configuration model, and the model placeholder of the attribute to be configured is equivalent to an index of the attribute value corresponding to the attribute to be configured in the preset environment configuration model, so that the attribute value corresponding to the attribute to be configured can be inquired in the preset environment configuration model by using the model placeholder of the attribute to be configured.
In this embodiment, the model placeholder is used to replace the attribute value, and the model placeholder of the attribute to be configured is added to the pre-environment configuration file to generate the current environment configuration template.
The current environment configuration template comprises attributes and model placeholders corresponding to the attributes, so that convenience in adding the attribute values can be improved by matching the corresponding attribute values through the model placeholders.
Optionally, the model placeholder includes a binary of an entity and an attribute.
The entity refers to the classification of the attributes, the entity has an entity name, the entity name refers to the classification name of the attributes, and each entity corresponds to a plurality of attributes. For example, as shown in fig. 2, one entity includes an attribute 1, an attribute 2, and an attribute 3, and the number of attributes included in each entity may be set according to actual requirements.
It should be noted that the generated current environment configuration template further includes information of the environment to be configured, that is, the current environment configuration template already points to the environment to be configured, and according to the environment to be configured pointed by the current environment configuration template and the entity and the attribute in the model placeholder, the corresponding attribute value can be obtained in the preset environment configuration model.
Optionally, the classification entity to which the attribute belongs includes at least one of: database services, a configuration center, a registry, a mirror repository, and server addresses.
For example, the classification entity to which the attribute belongs includes a database service entity, and the database service entity may include attributes such as URL, port, user, and the like. For another example, the attribute belonging classification entity includes a configuration center entity, and the configuration center entity may include attributes such as a domain name, an address, a port, a user name, and a password.
Certainly, the classification entity to which the attribute belongs is not limited to the above listed entities, and in other embodiments, the entities may further include a connection pool entity, a thread pool entity, and the like, and those skilled in the art may edit the entities in the preset environment configuration model according to the development test requirements of the application software, so as to provide the entities for the application software developer to select.
S140, according to the model placeholder in the current environment configuration template, acquiring a corresponding attribute value from the preset environment configuration model, and filling the attribute value into the current environment configuration template to generate a current environment configuration file of the application software deployed in the environment to be configured.
In this embodiment, according to the model placeholder in the current environment configuration template, a corresponding attribute value may be obtained from the preset environment configuration model, and the corresponding attribute value is filled in the current environment configuration template, so as to automatically generate a current environment configuration file in which the application software is deployed in the environment to be configured, where the current environment configuration file includes an attribute required by the application software to be deployed in the environment to be configured and an attribute value corresponding to the attribute.
S150, deploying the application software in the environment to be configured according to the current environment configuration file, and operating the application software.
After the application software is deployed in the current environment configuration file of the environment to be configured, the application software is deployed in the environment to be configured according to the current environment configuration file, and the application software is operated, so that the test of the application software in the environment to be configured is completed.
The running time of the application software in the environment to be configured can be manually set by a developer according to the test requirement, in other embodiments, the running time of the application software in the environment to be configured can also be determined by an index set by the developer, for example, when the application software runs in the environment to be configured, after the index set by the developer is reached, the application software is automatically transferred to the next environment for testing, so that the automatic deployment of the application software is realized.
The method for processing the environment configuration file of the application software provided by the embodiment of the invention comprises the steps of editing a preset environment configuration model, wherein the preset environment configuration model comprises an environment, attributes and attribute values, a mapping relation exists between the attribute values and the environment and the attributes, determining the attributes to be configured from the preset environment configuration model through the preset configuration attribute values in the preset environment configuration file of the application software and the environment to be configured of the application software, adding the model placeholder of the attributes to be configured into the preset environment configuration file to replace the attribute values to generate a current environment configuration template, so as to establish association with the attribute values in the preset environment configuration model, further acquiring the corresponding attribute values from the preset environment configuration model according to the model placeholder in the current environment configuration template, filling the corresponding attribute values into the current environment configuration template, and quickly establishing the current environment configuration file of the application software deployed in the environment to be configured, the method and the device have the advantages that the current environment configuration template and the current environment configuration file are automatically generated for the developer by reversely searching the preset environment configuration model based on the front environment configuration file and the environment to be configured provided by the developer, the developer does not need to manually write different configuration files for each environment deployed by the application software, the working complexity is greatly simplified, the labor cost is reduced, and the environment configuration file generation efficiency of the application software is improved.
Example two
Fig. 3 is a flowchart of an environment configuration file processing method for application software according to a second embodiment of the present invention, which is applicable to an application software development operating platform.
In this embodiment, a further refinement of "determining the attribute to be configured from the preset environment configuration model according to the value of the pre-configuration attribute in the pre-environment configuration file and based on the environment to be configured" is performed on the basis of the above embodiment, that is, the operation includes:
and matching the attribute values of the environment to be configured in the preset environment configuration model aiming at each preset configuration attribute value in the preset environment configuration file.
And if the number of the matched same attribute values is one, determining that the attribute corresponding to the attribute value is the attribute to be configured.
And if the number of the matched same attribute values is more than two, determining the attribute with high similarity as the attribute to be configured according to the attribute name of the attribute corresponding to the same attribute value and the attribute name in the preposed environment configuration file.
And if the number of the matched attribute values is more than two, displaying the attribute names of the attributes corresponding to the same attribute values so that a developer can select and determine the attributes as the attributes to be configured.
Explanations of the same or corresponding terms as those of the above-described embodiments will not be repeated herein.
The following describes, with reference to fig. 3, an environment configuration file processing method for application software provided in the second embodiment, which specifically includes the following steps:
s210, acquiring a pre-environment configuration file of the application software, and determining an environment to be configured of the application software.
S220, aiming at each prepositive configuration attribute value in the prepositive environment configuration file, matching the attribute values of the environment to be configured in the preset environment configuration model; the preset environment configuration model comprises an environment, attributes and attribute values, and a mapping relation exists between the attribute values and the environment and the attributes.
S221, if the number of the matched same attribute values is one, determining that the attribute corresponding to the attribute value is the attribute to be configured.
S222, if the number of the matched same attribute values is more than two, determining the attribute with high similarity as the attribute to be configured according to the attribute name of the attribute corresponding to the same attribute value and the attribute name in the pre-environment configuration file.
And S223, if the number of the matched same attribute values is more than two, displaying the attribute names of the attributes corresponding to the same attribute values so that a developer can select and determine the attributes as the attributes to be configured.
In the above process, for each pre-configured attribute value in the pre-environment configuration file, the attribute value of the environment to be configured in the pre-environment configuration model is traversed, and the attribute value of the environment to be configured in the pre-environment configuration model is matched with each pre-configured attribute value in the pre-environment configuration file.
And if the number of the matched same attribute values is one, namely only one attribute value in the preset environment configuration model is matched with a preset configuration attribute value in the preset environment configuration file based on the environment to be configured, directly determining the attribute corresponding to the attribute value as the attribute to be configured.
If the number of the matched attribute values is more than two, namely more than two attribute values are matched with the pre-configuration attribute values in the pre-environment configuration file based on the environment to be configured in the preset environment configuration model, comparing the attribute names of the attributes corresponding to the same attribute values with the attribute names in the pre-environment configuration file, and taking the attribute with high similarity to the attribute names in the pre-environment configuration file as the attribute to be configured.
Optionally, if the number of the matched attribute values is more than two, that is, more than two attribute values are matched with the pre-configured attribute value in the pre-environment configuration file based on the environment to be configured in the pre-environment configuration model, the attribute names of the attributes corresponding to the same attribute values are displayed and selected by a developer, so that which attribute is taken as the attribute to be configured is determined manually.
Illustratively, if the number of the matched same attribute values is more than two, the attribute names of the attributes corresponding to the same attribute values are compared with the attribute names in the pre-environment configuration file, the attributes corresponding to the same attribute values are arranged in sequence according to the similarity of the attribute names in the pre-environment configuration file, the attribute with the high similarity to the attribute name in the pre-environment configuration file is used as the attribute to be configured by default, and the attributes corresponding to other same attribute values are highlighted for the developer to select.
S230, adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model.
S240, according to the model placeholder in the current environment configuration template, acquiring a corresponding attribute value from the preset environment configuration model, and filling the attribute value into the current environment configuration template to generate a current environment configuration file of the application software deployed in the environment to be configured;
and S250, deploying the application software in the environment to be configured according to the current environment configuration file, and operating the application software.
Optionally, after matching the attribute values of the environment to be configured in the preset environment configuration model, the method further includes:
and if the same attribute value is not matched, adding the attribute value, the environment to be configured and the name of the attribute into the preset environment configuration model.
After traversing the attribute value of the environment to be configured in the preset environment configuration model, if the attribute value matched with the pre-configuration attribute value in the pre-environment configuration file is not found, adding the attribute value which is not matched in the environment to be configured, the pre-environment configuration file and the attribute corresponding to the attribute value in the pre-environment configuration file into the preset environment configuration model, and creating a corresponding entity for multiplexing of other subsequent application software.
Optionally, after matching the attribute values of the environment to be configured in the preset environment configuration model, the method further includes:
if the same attribute value is not matched, in the generated current environment configuration template, priority configuration prompt is carried out on the attribute corresponding to the unmatched attribute value, so that a developer sets the unmatched attribute value as a priority generation value.
After traversing the attribute values of the environment to be configured in the preset environment configuration model, if an attribute value matching the pre-configuration attribute value in the pre-environment configuration file is not found, the attribute value may be an attribute value manually set by a developer, instead of a general attribute value in the preset environment configuration model.
For example, the unmatched attribute value may be an attribute value personalized and customized by the developer according to the actual test requirement, and the attribute value better meets the test requirement of the application software in the environment to be tested, so that the attribute corresponding to the unmatched attribute value is subjected to a priority configuration prompt to prompt the developer that the attribute can be set as the unmatched attribute value or as the attribute value in the preset environment configuration model, or simultaneously set as the unmatched attribute value and the attribute value in the preset environment configuration model, and the unmatched attribute value and the attribute value in the preset environment configuration model take effect under different conditions, wherein the developer can take the unmatched attribute value as a priority generation value to enable the unmatched attribute value to take effect in priority over the universal attribute value in the preset environment configuration model, so that when the subsequent application software is deployed in the environment to be tested, the unmatched attribute values are preferentially used without being influenced by the attribute values in the preset environment configuration model, so that the test requirement of the application software in the environment to be tested is met.
EXAMPLE III
Fig. 4 is a flowchart of an environment configuration file processing method for application software according to a third embodiment of the present invention, which is applicable to an application software development operating platform in this embodiment.
In this embodiment, based on the above embodiment, further optimization is performed, and a specific operation before the corresponding attribute value is obtained from the preset environment configuration model according to the model placeholder in the current environment configuration template and the current environment configuration template is filled in is provided, and explanations of terms that are the same as or corresponding to the above embodiment are omitted here.
Specifically, before obtaining the corresponding attribute value from the preset environment configuration model according to the model placeholder in the current environment configuration template and filling the attribute value into the current environment configuration template, the method further includes:
and displaying the current environment configuration template, and receiving the editing operation of a developer on attribute values and/or model placeholders in the current environment configuration template so as to update the current environment configuration template.
The following describes, with reference to fig. 4, a method for processing an environment configuration file of application software provided in the third embodiment, which specifically includes the following steps:
s310, acquiring a pre-environment configuration file of the application software, and determining an environment to be configured of the application software.
S320, determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; the preset environment configuration model comprises an environment, attributes and attribute values, and a mapping relation exists between the attribute values and the environment and the attributes.
S330, adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model.
S340, displaying the current environment configuration template, and receiving the editing operation of a developer on the attribute values and/or the model placeholders in the current environment configuration template so as to update the current environment configuration template.
After the current environment configuration template is generated, the current environment configuration template is displayed, so that a developer can edit the attribute values and/or the model placeholders in the current environment configuration template, and the attribute values and/or the model placeholders in the current environment configuration template can be adjusted according to actual test requirements.
S350, according to the model placeholder in the current environment configuration template, acquiring a corresponding attribute value from the preset environment configuration model, and filling the attribute value into the current environment configuration template to generate a current environment configuration file of the application software deployed in the environment to be configured;
and S360, deploying the application software in the environment to be configured according to the current environment configuration file, and operating the application software.
Optionally, receiving an editing operation of a developer on the attribute values and/or the model placeholders in the current environment configuration template to update the current environment configuration template includes:
and setting a priority validation strategy for at least one attribute according to the editing operation of the developer on the attribute values and/or the model placeholders in the current environment configuration template.
Correspondingly, the running of the application software comprises the following steps:
in the process of running the application software, if the effective condition in the priority effective strategy of the attribute is met, updating the attribute value of the attribute according to the adjustment strategy in the priority effective strategy, and redeploying the application software.
According to the editing operation of the developer on the attribute values and/or the model placeholders in the current environment configuration template, setting a priority validation policy for at least one attribute, namely when the current environment configuration template is displayed, the developer can set the priority validation policy for at least one attribute in the current environment configuration template. The priority validation policy includes validation conditions and an adjustment policy for indicating how the attribute values are adjusted when the validation conditions are satisfied.
In the subsequent process of running the application software, if the effective condition in the priority effective strategy of the attribute is met, updating the attribute value of the attribute according to the adjustment strategy in the priority effective strategy, and redeploying the application software.
Optionally, the attribute for setting the priority validation policy may be a database connection pool, timeout time, a thread pool, a threshold, and the like, and those skilled in the art may set the attribute according to actual requirements.
Optionally, the validation condition in the priority validation policy includes at least one of the following:
the monitoring index of the running environment of the application software reaches a set threshold value or reaches the attribute value of the attribute;
and the running time of the application software reaches a set time condition.
Illustratively, the developer sets a priority validation policy for the database connection pool, where the validation condition of the priority validation policy may be that the number of database connections in the monitoring index of the environment where the application software operates reaches the attribute value of the database connection pool in the current environment configuration file, when the adjustment policy of the priority validation policy reaches the validation condition, the attribute value is added by 5, and the adjusted new attribute value is used as the priority validation value of the application software in the environment to be tested, that is, the adjusted new attribute value takes effect in preference to the original attribute value, in the subsequent process of operating the application software, assuming that the attribute value of the database connection pool is 5, when the number of database connections in the monitoring index reaches the attribute value of the database connection pool in the current environment configuration file, the attribute value of the database connection pool is added by 5 according to the priority validation policy, that is, that the attribute value of the database connection pool is updated to 10, and redeploying the application software to achieve the normal operation of the application software. Meanwhile, by the method, the automatic generation of the attribute value of the database connection pool based on the database connection number of the monitoring index is realized, and the optimal attribute value configuration of the application software under the current pressure condition can be automatically generated on the premise that the pressure condition is not changed, so that the labor cost is reduced.
In other embodiments, the validation condition may also be set as that the running time of the application software reaches the set time condition, for example, the developer sets a priority validation policy for the database connection timeout time, the validation condition of the priority validation policy may be an attribute value that the database connection timeout time exceeds the database connection timeout time, when the adjustment policy of the priority validation policy reaches the validation condition, the attribute value of the database connection timeout time is added by 2 seconds, and the adjusted new attribute value is used as a priority validation value of the application software in the environment to be tested, during the subsequent running of the application software, it is assumed that the attribute value of the database connection timeout time is 3 seconds, when the database connection timeout time exceeds 3 seconds, the attribute value of the database connection timeout time is added by 2 seconds according to the priority validation policy, that is, the attribute value of the database connection timeout time is updated to 5 seconds, and redeploying the application software.
Optionally, the adjustment policy includes at least one of:
an effective value corresponding to the effective condition;
and (4) changing the adjustment value in a gradient way.
In reference to the above embodiment, the adjustment policy may include a gradual change adjustment value, that is, when the effective condition of the priority effective policy is reached, the addition and subtraction operation is performed on the corresponding attribute value.
In other embodiments, the adjustment policy may also be set to a validation value corresponding to the validation condition.
For example, a developer sets a priority validation policy for a database connection pool, the validation condition of the priority validation policy is that the running time of application software is in a simulation traffic peak period, when the adjustment policy of the priority validation policy is that the validation condition is reached, the attribute value of the database connection number is adjusted to 7, in the subsequent running process of the application software, the attribute value of the database connection pool is assumed to be 5, when the running time of the application software is in the simulation traffic peak period, the attribute value of the database connection pool is updated to 7 according to the priority validation policy, and the application software is redeployed.
It should be noted that after the attribute values of the attributes are updated, the application software can be redeployed through hot loading to be automatically effective, so that the operation of the application software is not influenced.
On the basis of any of the above embodiments, optionally, the dependency relationship of the environment configuration file on the environment and the attribute in the preset environment configuration model is recorded according to the model placeholder in the environment configuration file.
The environment configuration file is recorded according to the model placeholder in the environment configuration file, namely, the environment and the attribute in the preset environment configuration model are referred by the attribute value in the environment configuration file through the model placeholder, so that a developer can conveniently inquire and maintain the environment and the attribute in the preset environment configuration model.
On the basis of any of the above embodiments, optionally, when it is monitored that the attribute value in the preset environment configuration model changes, according to the dependency relationship between the environment configuration file and the attribute, the corresponding environment configuration file is triggered to be updated, and the application software is redeployed according to the updated environment configuration file.
When the attribute values in the preset environment configuration model change, for example, the server is replaced to support the change, so that the attribute values such as the domain name and the address of the server change, according to the dependency relationship between the environment configuration files and the attributes, the corresponding attribute values of all the environment configuration files which refer to the changed attribute values through the model placeholders are updated, and the application software is redeployed according to the updated environment configuration files without sequentially manually editing all the environment configuration files which depend on the changed attribute values, so that the difficulty in maintaining the environment configuration files is greatly reduced, and the labor cost is reduced.
Optionally, when the attribute value in the preset environment configuration model changes, the change of the attribute value in the preset environment configuration model is recorded in a log for a developer to query, so that when an exception occurs or other requirements are generated, the environment configuration file is conveniently maintained.
Example four
Fig. 5 is a flowchart of an environment configuration file processing method for application software according to a fourth embodiment of the present invention, where the embodiment is applicable to an application software development operating platform.
In this embodiment, based on the above embodiments, the method for processing the environment configuration file of the application software is applied to the preferred embodiment of the DevOps platform, and explanations of terms identical to or corresponding to the above embodiments are omitted here for brevity.
When the DevOps platform deploys the application software, each application software needs to edit different environment configuration files for each deployment environment, and configures complex parameters for continuous integration and continuous deployment pipelines of different environments, so that the application is smoothly deployed into the environment.
The DevOps platform generally needs to configure a plurality of continuous integration and continuous deployment pipelines, and edit a plurality of sets of environment configuration files of different environments, so that the DevOps platform is high in repeated operation and is not beneficial to a project manager to uniformly manage the environment configuration files of each application software.
The inventor researches and discovers that in actual project development, different application software in the same project group can reuse some basic configurations, such as the possibility of using the same database service, configuration center, registration center, mirror warehouse, server address and the like. Meanwhile, with the development of technologies, distributed technologies such as micro-services and the like are more common in complex systems, and the deployment configuration of application software and the redundancy repetition degree of configuration files of the application software in such service clusters are significantly increased. When each application software in the DevOps platform configures the continuous integration and continuous deployment pipeline, attribute values need to be input separately, attribute values used in configuration files of each application software also need to be edited separately, and when the attribute values are changed, each application software needs to be maintained separately. For a project group with a plurality of application software, especially for a project group adopting micro-service distribution technology, the use cost and the maintenance cost are not small.
In order to solve the above problem of repeated environment configuration in which application software is deployed in multiple environments in a DevOps platform, the problem of multiplexing the multiple application software for environment configuration, and the problem of management and maintenance of application configuration files, a fourth embodiment of the present invention provides a method for processing an environment configuration file of application software based on a DevOps platform.
Next, an environment configuration file processing method of application software according to a fourth embodiment is described with reference to fig. 5, and as shown in fig. 5, the environment configuration file processing method of application software includes:
and S1, providing a preset environment configuration model.
The preset environment configuration model can be formed by manually editing and inputting in a DevOps platform for a project group administrator in a project group, and includes an environment, attributes and attribute values, wherein in fig. 5, the classification of the attributes is represented by entities, each entity corresponds to a plurality of attributes (not shown in the figure), and there is a mapping relationship between the attribute values and the environment and the attributes.
And S2, acquiring the pre-environment configuration file of the application software, and determining the environment to be configured of the application software. And determining the attribute to be configured from the preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file. And adding the model placeholder of the attribute to be configured into a preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template according to the preposed environment configuration file.
The environment configuration file used in the previous deployment environment of the application software may be acquired as a pre-environment configuration file, and if the application software is deployed in the first environment, the pre-environment configuration file may be an environment configuration file of other application software when the application software is deployed in an environment to be configured, or the pre-environment configuration file may also be a default environment configuration file manually input by a developer, and the pre-environment configuration file may be obtained through multiple ways, which is not limited in this embodiment.
The model placeholder is an index pointing to an attribute value in the preset environment configuration model, and may include a binary set of an entity and an attribute.
S3, according to the model placeholder in the current environment configuration template, acquiring the corresponding attribute value from the preset environment configuration model, and filling the attribute value into the current environment configuration template to generate the current environment configuration file of the application software deployed in the environment to be configured.
Wherein, the developer in the project group can add the operation of generating the current environment configuration file by the current environment configuration template when configuring the continuous integration pipeline. And when the pipeline is triggered, selecting a corresponding environment to be tested, and acquiring a corresponding attribute value from a preset environment configuration model according to the environment to be tested and the model placeholder in the current environment configuration template so as to generate a current environment configuration file of the application software deployed in the environment to be configured.
And S4, deploying the application software in the environment to be configured according to the current environment configuration file, and operating the application software.
According to the method for processing the environment configuration file of the application software, provided by the embodiment of the invention, a project group does not need to independently compile an environment configuration file for each environment deployed by the application software, only needs to provide a preposed environment configuration file required by the deployment of the application software in a first environment, and the environment configuration files used by the application software in each subsequent environment are automatically generated based on the environment configuration file used by the application software in the previous deployment environment, so that circulation is carried out, different configuration files do not need to be manually compiled for each environment deployed by the application software, the working complexity is greatly simplified, and the labor cost is reduced.
With reference to fig. 5, optionally, before obtaining the corresponding attribute value from the preset environment configuration model according to the model placeholder in the current environment configuration template and filling the attribute value into the current environment configuration template, the method further includes:
and displaying the current environment configuration template, and receiving the editing operation of a developer on the attribute values and/or the model placeholders in the current environment configuration template so as to update the current environment configuration template.
After the current environment configuration template is generated, the current environment configuration template is displayed, so that a developer can edit the attribute values and/or the model placeholders in the current environment configuration template, and the attribute values and/or the model placeholders in the current environment configuration template can be adjusted according to actual test requirements.
With reference to fig. 5, optionally, when it is monitored that the attribute value in the preset environment configuration model changes, according to the dependency relationship between the environment configuration file and the attribute, triggering to update the corresponding environment configuration file, and redeploying the application software according to the updated environment configuration file.
The mapping values of the entities and the environments configured in the preset environment configuration model by the project group administrator can be repeatedly used in a plurality of applications, the project group administrator only needs to complete attribute value configuration once in the preset environment configuration model, all application software depending on the attribute values can obtain corresponding environment configuration files through the model placeholders in the current environment configuration template, all environment configuration files depending on the attribute values do not need to be manually edited in sequence, the difficulty of maintaining the environment configuration files is greatly reduced, and the labor cost is reduced.
It can be understood that the project group administrator can uniformly manage the environment configuration files of the application software by managing the preset environment configuration model, and realize the batch maintenance of the environment configuration files and the pipelines. When the attribute value in the preset environment configuration model changes, if the database is migrated to a new address, the mapping value of the corresponding entity in the preset environment configuration model in the environment is only required to be modified, and the application software can synchronously update the new attribute value. It should be noted that, if the running application software needs to enable a new attribute value, a batch restart function of the corresponding pipeline and a batch regeneration upload function of the environment configuration file need to be provided.
With continued reference to fig. 5, optionally, the dependency relationship of the environment configuration file on the environment and the attribute in the preset environment configuration model is recorded according to the model placeholder in the environment configuration file.
The dependency relationship between the environment and the attributes in the preset environment configuration model is recorded by the environment configuration file according to the model placeholder in the environment configuration file, and a developer subsequently inquires the dependency relationship.
The dependency relationship may be queried through multiple dimensions, for example, the attribute of a certain entity in the preset environment configuration model is used by the environment configuration files of which application software, the attribute of a certain entity in the preset environment configuration model is used by the pipeline of which application software, the environment configuration files and the pipeline of a certain application software use the entity and the attribute in the preset environment configuration model, the value of a certain attribute is the mapping value of which entity in the preset environment configuration model in the environment, the value of a certain mapping value is used in which application software, and the like.
With reference to fig. 5, optionally, when the attribute value in the preset environment configuration model changes, the change of the attribute value in the preset environment configuration model is recorded in a log for a developer to query, so that when an exception occurs or other requirements are generated, the environment configuration file is conveniently maintained.
The change of the attribute values in the preset environment configuration model affects the deployment of multiple application software, the generation of environment configuration files and other processes, so that a developer needs to clearly view each entity in the preset environment configuration model and a modification log of the mapping values of the entities in each environment.
EXAMPLE five
Fig. 6 is a schematic structural diagram of an environment configuration file processing apparatus for application software according to a fifth embodiment of the present invention. The apparatus is configured on an application software development operating platform, can be implemented by hardware and/or software, and can be integrated in a computer system, as shown in fig. 6, the apparatus includes:
the to-be-configured environment determining module 410 is configured to obtain a pre-environment configuration file of the application software, and determine the to-be-configured environment of the application software.
A to-be-configured attribute determining module 420, configured to determine, according to a pre-configured attribute value in the pre-environment configuration file, an attribute to be configured from a preset environment configuration model based on the to-be-configured environment; the preset environment configuration model comprises an environment, attributes and attribute values, and a mapping relation exists between the attribute values and the environment and the attributes.
A model placeholder adding module 430, configured to add the model placeholder of the attribute to be configured to the pre-environment configuration file, instead of the attribute value, to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model.
A current environment configuration file determining module 440, configured to obtain a corresponding attribute value from the preset environment configuration model according to the model placeholder in the current environment configuration template, and fill the attribute value into the current environment configuration template, so as to generate a current environment configuration file in which the application software is deployed in the environment to be configured.
The application software deploying module 450 is configured to deploy the application software in the environment to be configured according to the current environment configuration file, and run the application software.
Optionally, the to-be-configured environment determining module 410 is specifically configured to obtain an environment configuration file used by a previous deployment environment of the application software, as the previous environment configuration file, and determine the to-be-configured environment of the application software according to a deployment policy input by a developer or preset.
Optionally, the attribute-to-be-configured determining module 420 is specifically configured to, for each pre-configured attribute value in the pre-environment configuration file, match among the attribute values of the environment to be configured in the preset environment configuration model; if the number of the matched same attribute values is one, determining the attribute corresponding to the attribute value as the attribute to be configured; if the number of the matched same attribute values is more than two, determining the attribute with high similarity as the attribute to be configured according to the attribute name of the attribute corresponding to the same attribute value and the attribute name in the preposed environment configuration file; and if the number of the matched attribute values is more than two, displaying the attribute names of the attributes corresponding to the same attribute values so that a developer can select and determine the attributes as the attributes to be configured.
Optionally, the apparatus for processing an environment configuration file of application software according to the embodiment of the present invention further includes a preset environment configuration model adding module, where the preset environment configuration model adding module is configured to, after matching is performed on the attribute values of the environment to be configured in the preset environment configuration model, add the attribute values, the environment to be configured, and the names of the attributes to the preset environment configuration model if the same attribute values are not matched.
Optionally, the device for processing an environment configuration file of application software according to the embodiment of the present invention further includes a priority configuration prompting module, where the priority configuration prompting module is configured to perform, after matching is performed on the attribute values of the environment to be configured in the preset environment configuration model, if the same attribute value is not matched, perform priority configuration prompting on an attribute corresponding to the unmatched attribute value in the generated current environment configuration template, so that a developer sets the unmatched attribute value as a priority generation value.
Optionally, the model placeholder includes a binary of an entity and an attribute.
Optionally, the apparatus for processing an environment configuration file of application software according to the embodiment of the present invention further includes a current environment configuration template display module, where the current environment configuration template display module is configured to display the current environment configuration template before the corresponding attribute value is obtained from the preset environment configuration model according to the model placeholder in the current environment configuration template and the current environment configuration template is filled with the corresponding attribute value, and receive an editing operation of a developer on the attribute value and/or the model placeholder in the current environment configuration template, so as to update the current environment configuration template.
Optionally, the current environment configuration template display module is further configured to set a priority validation policy for at least one attribute according to an editing operation of the developer on an attribute value and/or a model placeholder in the current environment configuration template.
Correspondingly, the application software deployment module 450 is further configured to, in the process of running the application software, if an effective condition in the priority effectiveness policy of the attribute is satisfied, update the attribute value of the attribute according to an adjustment policy in the priority effectiveness policy, and redeploy the application software.
Optionally, the validation condition in the priority validation policy includes at least one of the following:
the monitoring index of the running environment of the application software reaches a set threshold value or reaches the attribute value of the attribute; and the running time of the application software reaches a set time condition.
Optionally, the adjustment policy includes at least one of:
an effective value corresponding to the effective condition; and (4) changing the adjustment value in a gradient way.
Optionally, the environment of the application software development operating platform includes at least one of the following: the system comprises a development test environment, an internal test environment, a business test environment, a quasi-production test environment, a pressure test environment, a simulation environment and a production environment.
Optionally, the classification entity to which the attribute belongs includes at least one of: database service, configuration center, registration center, mirror repository and server address; the attribute includes at least one of: domain name, address, port, username, and password.
Optionally, the device for processing an environment configuration file of application software according to the embodiment of the present invention further includes a dependency relationship recording module, where the dependency relationship recording module is configured to record a dependency relationship of the environment configuration file on an environment and an attribute in a preset environment configuration model according to a model placeholder in the environment configuration file.
Optionally, the apparatus for processing an environment configuration file of application software according to the embodiment of the present invention further includes an environment configuration file updating module, where the environment configuration file updating module is configured to, when it is monitored that an attribute value in a preset environment configuration model changes, trigger to update a corresponding environment configuration file according to a dependency relationship between the environment configuration file and an attribute, and redeploy the application software according to the updated environment configuration file.
The device for processing the environment configuration file of the application software provided by the embodiment of the invention can execute the method for processing the environment configuration file of the application software provided by any embodiment of the invention, has corresponding functions and beneficial effects of the execution method, and is not described again here.
EXAMPLE six
Fig. 7 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention, as shown in fig. 7, the electronic device includes a processor 510, a storage device 520, an input device 530, and an output device 540; the number of the processors 510 in the electronic device may be one or more, and one processor 510 is taken as an example in fig. 7; the processor 510, the storage 520, the input 530, and the output 540 in the electronic device may be connected by a bus or other means, and fig. 7 illustrates an example of a connection by a bus.
The storage device 520 is a computer-readable storage medium and can be used for storing one or more software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the environment profile processing method of the application software in the embodiment of the present invention (for example, the environment-to-be-configured determining module 410, the property-to-be-configured determining module 420, the model placeholder adding module 430, the current environment profile determining module 440, and the application software deploying module 450 in the environment profile processing device of the application software). The processor 510 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the storage device 520, that is, implements the above-described environment profile processing method of application software.
The storage device 520 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Additionally, storage 520 may include high speed random access storage and may also include non-volatile storage, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 520 may further include storage remotely located from processor 510, which may be connected to an electronic device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 530 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus. The output device 540 may include a display device such as a display screen.
When the one or more programs are executed by the one or more processors 510, the one or more processors 510 implement the method for processing the environment configuration file of the application software provided in any of the above embodiments, so that the corresponding functions and advantages of the execution method are provided, and details are not described herein.
EXAMPLE seven
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, the computer program being configured to execute an environment profile processing method of application software when executed by a computer processor, the method including:
the method comprises the steps of obtaining a pre-environment configuration file of application software, and determining an environment to be configured of the application software.
Determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; the preset environment configuration model comprises an environment, attributes and attribute values, and a mapping relation exists between the attribute values and the environment and the attributes.
Adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model.
And according to the model placeholder in the current environment configuration template, acquiring a corresponding attribute value from the preset environment configuration model, and filling the attribute value into the current environment configuration template to generate a current environment configuration file of the application software deployed in the environment to be configured.
And deploying the application software in the environment to be configured according to the current environment configuration file, and running the application software.
Of course, in the computer-readable storage medium storing the computer program provided in the embodiment of the present invention, the computer program is not limited to the method operations described above, and may also perform related operations in the method for processing the environment configuration file of the application software provided in any embodiment of the present invention, so that the method has corresponding functions and beneficial effects of the execution method, and details are not described here.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the environment profile processing apparatus for application software, the included units and modules are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.

Claims (16)

1. The method for processing the environment configuration file of the application software is characterized by being applied to an application software development operating platform, wherein the environment of the application software development operating platform comprises at least one of the following: developing a test environment, an internal test environment, a business test environment, a quasi-production test environment, a pressure test environment, a simulation environment and a production environment;
the method comprises the following steps:
acquiring a pre-environment configuration file of application software, and determining an environment to be configured of the application software;
determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; the preset environment configuration model comprises an environment, an attribute and an attribute value, and a mapping relation exists between the attribute value and the environment and the attribute;
adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model;
acquiring corresponding attribute values from the preset environment configuration model according to the model placeholders in the current environment configuration template, and filling the attribute values into the current environment configuration template to generate a current environment configuration file of the application software deployed in the environment to be configured;
and deploying the application software in the environment to be configured according to the current environment configuration file, and running the application software.
2. The method of claim 1, wherein obtaining a pre-environment configuration file of application software and determining a to-be-configured environment of the application software comprises:
the method comprises the steps of obtaining an environment configuration file used by a previous deployment environment of the application software as the pre-environment configuration file, and determining an environment to be configured of the application software according to a deployment strategy input or preset by a developer.
3. The method of claim 1, wherein determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the value of the pre-configuration attribute in the pre-environment configuration file comprises:
matching the attribute values of the environment to be configured in the preset environment configuration model aiming at each prepositioned configuration attribute value in the prepositioned environment configuration file;
if the number of the matched same attribute values is one, determining the attribute corresponding to the attribute value as the attribute to be configured;
if the number of the matched same attribute values is more than two, determining the attribute with high similarity as the attribute to be configured according to the attribute name of the attribute corresponding to the same attribute value and the attribute name in the preposed environment configuration file;
and if the number of the matched attribute values is more than two, displaying the attribute names of the attributes corresponding to the same attribute values so that a developer can select and determine the attributes as the attributes to be configured.
4. The method according to claim 3, further comprising, after matching among the attribute values of the environment to be configured in the preset environment configuration model:
and if the same attribute value is not matched, adding the attribute value, the environment to be configured and the name of the attribute into the preset environment configuration model.
5. The method according to claim 3, further comprising, after matching among the attribute values of the environment to be configured in the preset environment configuration model:
if the same attribute value is not matched, in the generated current environment configuration template, priority configuration prompt is carried out on the attribute corresponding to the unmatched attribute value, so that a developer sets the unmatched attribute value as a priority generation value.
6. The method of claim 1, wherein the model placeholder comprises a binary set of an entity and an attribute.
7. The method according to claim 1, wherein obtaining corresponding attribute values from the preset environment configuration model according to the model placeholder in the current environment configuration template, and before filling in the current environment configuration template, further comprising:
and displaying the current environment configuration template, and receiving the editing operation of a developer on attribute values and/or model placeholders in the current environment configuration template so as to update the current environment configuration template.
8. The method of claim 7, wherein receiving developer editing operations on property values and/or model placeholders in the current environment configuration template to update the current environment configuration template comprises:
setting a priority validation strategy for at least one attribute according to the editing operation of the developer on the attribute values and/or the model placeholders in the current environment configuration template;
correspondingly, the running of the application software comprises the following steps:
in the process of running the application software, if the effective condition in the priority effective strategy of the attribute is met, updating the attribute value of the attribute according to the adjustment strategy in the priority effective strategy, and redeploying the application software.
9. The method of claim 8, wherein the validation conditions in the priority validation policy comprise at least one of:
the monitoring index of the running environment of the application software reaches a set threshold value or reaches the attribute value of the attribute;
and the running time of the application software reaches a set time condition.
10. The method of claim 8, wherein the adjustment policy comprises at least one of:
an effective value corresponding to the effective condition;
and (4) changing the adjustment value in a gradient way.
11. The method of claim 1, wherein the classification entity to which the attribute belongs comprises at least one of: database service, configuration center, registration center, mirror repository and server address; the attribute includes at least one of: domain name, address, port, username, and password.
12. The method of claim 1, further comprising:
and recording the dependency relationship of the environment configuration file on the environment and the attributes in the preset environment configuration model according to the model placeholder in the environment configuration file.
13. The method of claim 1, further comprising:
when the attribute value in the preset environment configuration model is monitored to be changed, the corresponding environment configuration file is triggered to be updated according to the dependency relationship between the environment configuration file and the attribute, and the application software is redeployed according to the updated environment configuration file.
14. An environment configuration file processing device of application software, which is configured on an application software development operating platform, wherein the environment of the application software development operating platform comprises at least one of the following: developing a test environment, an internal test environment, a business test environment, a quasi-production test environment, a pressure test environment, a simulation environment and a production environment;
the device comprises:
the device comprises a to-be-configured environment determining module, a to-be-configured environment determining module and a configuration module, wherein the to-be-configured environment determining module is used for acquiring a pre-environment configuration file of application software and determining a to-be-configured environment of the application software;
the attribute to be configured determining module is used for determining the attribute to be configured from a preset environment configuration model based on the environment to be configured according to the preset configuration attribute value in the preset environment configuration file; the preset environment configuration model comprises an environment, an attribute and an attribute value, and a mapping relation exists between the attribute value and the environment and the attribute;
the current environment configuration template generation module is used for adding the model placeholder of the attribute to be configured into the preposed environment configuration file to replace an attribute value so as to generate a current environment configuration template; the model placeholder is an index pointing to an attribute value in the preset environment configuration model;
a current environment configuration file generation module, configured to obtain a corresponding attribute value from the preset environment configuration model according to a model placeholder in the current environment configuration template, and fill the attribute value into the current environment configuration template, so as to generate a current environment configuration file in which the application software is deployed in the environment to be configured;
and the application software deployment module is used for deploying the application software in the environment to be configured according to the current environment configuration file and running the application software.
15. An electronic device, characterized in that the electronic device comprises:
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 for environment profile processing for application software according to any one of claims 1-13.
16. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for environment profile processing of application software according to any one of claims 1 to 13.
CN202110843110.4A 2021-07-26 2021-07-26 Environment configuration file processing method, device, equipment and medium of application software Active CN113535225B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110843110.4A CN113535225B (en) 2021-07-26 2021-07-26 Environment configuration file processing method, device, equipment and medium of application software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110843110.4A CN113535225B (en) 2021-07-26 2021-07-26 Environment configuration file processing method, device, equipment and medium of application software

Publications (2)

Publication Number Publication Date
CN113535225A CN113535225A (en) 2021-10-22
CN113535225B true CN113535225B (en) 2022-08-05

Family

ID=78088952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110843110.4A Active CN113535225B (en) 2021-07-26 2021-07-26 Environment configuration file processing method, device, equipment and medium of application software

Country Status (1)

Country Link
CN (1) CN113535225B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115016785B (en) * 2022-08-09 2022-11-11 杭州湛联科技有限公司 Front-end item packaging method and device for multi-environment sharing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645900A (en) * 2013-12-13 2014-03-19 上海浦东物流云计算有限公司 Method and device for releasing software
CN106406949A (en) * 2016-09-18 2017-02-15 北京百度网讯科技有限公司 A configuration file processing method and device
CN108762769A (en) * 2018-06-04 2018-11-06 万惠投资管理有限公司 Micro services application layout and dispositions method, device and terminal
CN110543330A (en) * 2019-09-11 2019-12-06 上海米哈游网络科技股份有限公司 environment data management system, environment deployment method, device and storage medium
CN111130962A (en) * 2019-12-30 2020-05-08 联想(北京)有限公司 Automatic configuration method, equipment, system and storage medium for switch
CN111694750A (en) * 2020-06-29 2020-09-22 深圳前海微众银行股份有限公司 Method and device for constructing software testing environment
CN112395196A (en) * 2020-11-18 2021-02-23 上海浦东发展银行股份有限公司 Data operation development test method, device, equipment, system and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7756903B2 (en) * 2006-12-12 2010-07-13 Yahoo! Inc. Configuring a search engine results page with environment-specific information
US20140359261A1 (en) * 2013-05-31 2014-12-04 Vordel Limited Environmentalization technique for promotion of application programming interface (api) server in lifecycle succession of deployments
US9645806B2 (en) * 2014-09-30 2017-05-09 International Business Machines Corporation Method to convey an application's development environment characteristics to the hosting provider to facilitate selection of hosting environment or the selection of an optimized production operation of the application

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645900A (en) * 2013-12-13 2014-03-19 上海浦东物流云计算有限公司 Method and device for releasing software
CN106406949A (en) * 2016-09-18 2017-02-15 北京百度网讯科技有限公司 A configuration file processing method and device
CN108762769A (en) * 2018-06-04 2018-11-06 万惠投资管理有限公司 Micro services application layout and dispositions method, device and terminal
CN110543330A (en) * 2019-09-11 2019-12-06 上海米哈游网络科技股份有限公司 environment data management system, environment deployment method, device and storage medium
CN111130962A (en) * 2019-12-30 2020-05-08 联想(北京)有限公司 Automatic configuration method, equipment, system and storage medium for switch
CN111694750A (en) * 2020-06-29 2020-09-22 深圳前海微众银行股份有限公司 Method and device for constructing software testing environment
CN112395196A (en) * 2020-11-18 2021-02-23 上海浦东发展银行股份有限公司 Data operation development test method, device, equipment, system and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Docker的CaaS管理平台架构研究与设计;张琦;《计算机应用与软件》;20181112(第11期);全文 *

Also Published As

Publication number Publication date
CN113535225A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
US20210273972A1 (en) Dynamic Hierarchical Tagging System and Method
US20230275815A1 (en) Method and device for terminal device management based on right control
CN110297672A (en) Page dynamic creation method, device, computer equipment and storage medium
US11431558B2 (en) Data shipper agent management and configuration systems and methods
US20050262501A1 (en) Software distribution method and system supporting configuration management
US7464132B1 (en) Method and apparatus for reference model change generation in managed systems
US8150948B2 (en) Complex software deployment
US8839107B2 (en) Context based script generation
CN109857451B (en) Method, device, equipment and medium for generating IP core file
CN112631686A (en) Data processing method, data processing device, computer equipment and storage medium
CN113535225B (en) Environment configuration file processing method, device, equipment and medium of application software
CN110825395B (en) Multi-plug-in layered deployment system, device and medium
CN114185577A (en) Configuration management system, configuration management method, server, and storage medium
CN113568693B (en) Form rendering method and form rendering system
CN112948099B (en) Task issuing flow method and device, computer equipment and storage medium
CN114089889A (en) Model training method, device and storage medium
CN111708536A (en) Page building method and equipment based on component configuration and readable storage medium
CN116483707A (en) Test method, test device, test apparatus, test program, and test program
CN105893445A (en) Data processing method, server and terminal device
US8438379B2 (en) Method for verifying user changeable configuration settings and selectively modifying non-supported setting values to supported setting values in user selected and non-selected content units
CN114936152A (en) Application testing method and device
CN114564854A (en) Operation method and equipment of data node supporting FMEA bidirectional relationship tree
CN114493493A (en) Decision engine and decision engine implementation method
CN112418796A (en) Sub-process node activation method and device, electronic equipment and storage medium
CN111930718B (en) Node adjustment method and device for configuration management database

Legal Events

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