CN112463256A - Method, system, electronic device and storage medium for determining configuration file - Google Patents

Method, system, electronic device and storage medium for determining configuration file Download PDF

Info

Publication number
CN112463256A
CN112463256A CN202011458819.4A CN202011458819A CN112463256A CN 112463256 A CN112463256 A CN 112463256A CN 202011458819 A CN202011458819 A CN 202011458819A CN 112463256 A CN112463256 A CN 112463256A
Authority
CN
China
Prior art keywords
target
configuration
environment
configuration file
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011458819.4A
Other languages
Chinese (zh)
Inventor
齐云雷
李洪波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weiyiyun Hangzhou Holding Co ltd
Original Assignee
Weiyiyun Hangzhou Holding 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 Weiyiyun Hangzhou Holding Co ltd filed Critical Weiyiyun Hangzhou Holding Co ltd
Priority to CN202011458819.4A priority Critical patent/CN112463256A/en
Publication of CN112463256A publication Critical patent/CN112463256A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The embodiment of the invention discloses a method, a system, electronic equipment and a storage medium for determining a configuration file, wherein the method is applied to a packaging machine and comprises the following steps: acquiring a target operation environment type, a target operation environment name and to-be-deployed application parameter information on an environment to be compiled; when detecting that configuration information which is the same as the target operation environment type, the target operation environment name and the to-be-deployed application parameter information is stored in a configuration center, acquiring a target configuration file according to the configuration information; and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled. The technical scheme of the embodiment of the invention realizes the technical effect of calling the target configuration file matched with the current operation environment from the configuration center.

Description

Method, system, electronic device and storage medium for determining configuration file
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method, a system, electronic equipment and a storage medium for determining a configuration file.
Background
In the actual application process, the same application needs to be deployed in different operating environments, in order to solve the problem, program codes needed by different operating environments need to be written and stored in a database or a remote file server, then the operating environment is judged through a script before a project is compiled or operated, and the script can selectively read from the local or download configuration from the remote. Or, based on a centralized configuration management system, the application program directly interacts with the configuration center and implements remote configuration of the service according to specific rules of the configuration center.
When the method is adopted, the configuration management process managed in the code is complicated, each tiny modification needs to be submitted and re-issued by the application, and testers without code editing authority cannot participate in maintenance at all, so that the efficiency of the test stage is seriously reduced.
When remote service configuration is implemented based on a configuration center, basic services needing to be dynamically configured cannot directly meet the requirements of configuration acquisition, configuration isolation and the like of static applications at the front end before compiling, and the method has the problems of code intrusion and inconvenience for maintenance.
Disclosure of Invention
The invention provides a method, a system, electronic equipment and a storage medium for determining a configuration file, which are used for acquiring a target configuration file matched with a current operation environment from pre-stored configuration files under multiple environments, and improving the technical effect of convenience in determining the target configuration file.
In a first aspect, an embodiment of the present invention provides a method for determining a configuration file, where the method is applied to a packaging machine, and includes:
acquiring a target operation environment type, a target operation environment name and to-be-deployed application parameter information on an environment to be compiled;
when detecting that configuration information which is the same as the target operation environment type, the target operation environment name and the to-be-deployed application parameter information is stored in a configuration center, acquiring a target configuration file according to the configuration information;
and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled.
In a second aspect, an embodiment of the present invention further provides a system for determining a configuration file, where the system is configured in a packaging machine, and includes:
the information acquisition module is used for acquiring the type of a target operation environment, the name of the target operation environment and the information of the application parameters to be deployed on the environment to be compiled;
a target configuration file obtaining module, configured to, when it is detected that configuration information that is the same as the target operating environment type, the target operating environment name, and the to-be-deployed application parameter information is stored in a configuration center, obtain a target configuration file according to the configuration information;
and the target configuration file sending module is used for sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled.
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 executed by the one or more processors, cause the one or more processors to implement a method for determining a profile as in any of the embodiments of the invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method for determining a configuration file according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, the type of the target operation environment, the name of the target operation environment and the information of the application parameter to be deployed on the environment to be compiled are obtained; when detecting that the configuration center stores configuration information which is the same as the target operation environment type, the target operation environment name and the parameter information of the application to be deployed, acquiring a target configuration file according to the configuration information; and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled, thereby realizing the technical effect of acquiring the configuration file matched with the current operating environment from the configuration center.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a schematic flowchart of a method for determining a configuration file according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for determining a configuration file according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a system for determining a configuration file according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth 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 schematic flow chart of a method for determining a configuration file according to an embodiment of the present invention, which is applicable to a situation where a target configuration file corresponding to a current environment is obtained from configuration files in multiple environments.
Before the technical solution of the present embodiment is described, an application scenario may be exemplarily described. The same application may be deployed in multiple operating environments, and when the operating environments are different, the configuration file corresponding to the application is different, and the technical solution disclosed in this embodiment may be adopted to determine the target configuration file adapted to the current operating environment.
It should also be noted that the application is not usually compiled directly in the deployment environment, but is passed through a unified wrapper, in which case the script of the wrapper is required to be responsible for the injection of the environment variables, so that a Software Development Kit (SDK) can obtain into which runtime environment the application being processed is to be deployed.
As shown in fig. 1, the method of this embodiment includes:
s110, acquiring a target operation environment type, a target operation environment name and to-be-deployed application parameter information on the to-be-compiled environment.
Wherein, the to-be-compiled environment can be understood as an environment in which the target application is to be deployed. The target runtime environment type, INSTANCE _ NAME, is the runtime environment type to which the target application is to be deployed. The target runtime environment name is the environment name of the environment to be compiled, and may be referred to as "INSTANCE _ ENV" for short. The parameter information of the application to be deployed comprises the name of the application to be deployed and/or the storage path of the application to be deployed.
It should be noted that before the target application is deployed to the to-be-compiled environment, the parameter information of the target application, that is, the parameter information of the to-be-deployed application, such as the application name of the target application and/or the storage path of the target application, may be edited in the command editing line of the display page or the SDK.
Specifically, when the application to be deployed is deployed in the environment to be compiled, the target operating environment type, the target operating environment name, and the parameter information of the application to be deployed in the environment to be compiled may be obtained, so as to determine whether the configuration center includes the configuration file matched with the target operating environment based on the target operating environment name and the target operating environment type, and after the specific configuration file is obtained, the parameter information of the application to be deployed may be stored according to the storage path.
In this embodiment, before the obtaining the target operating environment type, the target operating environment name, and the parameter information of the application to be deployed in the environment to be compiled, the method further includes: calling a configuration center establishing module to establish a configuration center and a display webpage corresponding to the configuration center; determining the operation environment type and the operation environment name of each application to be selected deployed in each operation environment, and binding the operation environment name and the operation environment type with the application to be selected; and storing the operation environment names and the operation environment types bound with the application to be selected into the configuration center.
The configuration center establishing module is used for establishing a lightweight configuration center and a matched webpage. Corresponding configuration data can be stored based on the built configuration center, and the webpage can provide visual functions of increasing, deleting, modifying and version management. The application to be selected may be an application to be deployed to a corresponding runtime environment.
Specifically, a preset configuration center establishing module may be called to establish a configuration center and a display webpage corresponding to the configuration center. Meanwhile, the operation environment type and the operation environment name of each application to be selected, which is deployed in each operation environment, can be determined, and the operation environment name and the operation environment type are bound with the application to be selected, so that when the application to be deployed is deployed in the corresponding operation environment, the corresponding configuration file can be called from the configuration center.
In this embodiment, the determining the running environment type and the running environment name of each application to be selected, which are deployed in each running environment, and binding the running environment name and the running environment type with the application to be selected includes: determining running environment identifiers of applications to be selected and deployed in each running environment; based on the operating environment identification, carrying out configuration isolation on a production environment and a test environment corresponding to the application to be selected; and binding the application to be selected with the running environment identifier, the running environment type and the running environment name deployed in each running environment, generating a configuration name list corresponding to the application to be selected, and determining whether a target configuration file corresponding to the target running environment name is included in the configuration list.
The operating environment identification is a unique identifier corresponding to each operating environment. Configuration isolation can be understood as that a new configuration file is generated for the current or to-be-operated environment of software by splitting and recombining a plurality of configuration items of the software, so that different service scenes or related configuration items in different use purposes of the same service factory are ensured to use proper values without mutual interference.
That is, the application to be selected may be deployed in each operating environment, and the operating environment identifier of each operating environment may be determined; based on the operation environment identifier, the production environment and the test environment corresponding to the application to be selected can be configured and isolated; after configuration isolation, the application to be deployed and the operating environment identifier, the operating environment type and the operating environment name deployed in each operating environment may be bound, and a configuration name list of the application to be selected is obtained based on the binding result, so as to determine whether a configuration file corresponding to the application to be deployed exists in the configuration name list.
And S120, when the configuration center is detected to store the configuration information which is the same as the target operation environment type, the target operation environment name and the parameter information of the application to be deployed, acquiring a target configuration file according to the configuration information.
It should be noted that configuration files that are applicable to different environments of the same application may be stored in the configuration service center. Or, marking the configuration file corresponding to the same application so as to determine the application running environment according to the mark.
Specifically, after the target operating environment type, the target operating environment name, and the parameter information of the application to be deployed are obtained, whether a configuration file consistent with the parameters is included in the configuration center or not can be determined according to the information, and if the configuration file exists, the corresponding target configuration file is obtained.
Optionally, when it is detected that configuration information that is the same as the target operating environment type, the target operating environment name, and the to-be-deployed application parameter information is stored in the configuration center, acquiring a target configuration file according to the configuration information includes: calling a target configuration name list associated with the application name from the configuration center according to the application name of the application to be deployed; and when the configuration information matched with the application name and the target operation environment name is acquired from the target configuration name list, acquiring a target configuration file according to the configuration information.
Specifically, whether the application name is stored in the configuration center may be determined according to the application name of the application to be deployed, and when it is determined that the application name is stored in the configuration center, a target configuration name list associated with the application name may be called. The target configuration name list includes configuration information matched with each operating environment, and a corresponding target configuration file can be obtained according to the configuration information.
For example, a list of configuration names prefixed by { application name }/is obtained from the configuration center. According to the application details obtained in the last step, namely the parameter information of the application to be deployed, character strings such as { application name }/{ alias specified by the parameter }, { application name }/{ environment name }, and the like are obtained through splicing, completely matched character strings are searched from the configuration name list in sequence, if matching is successful, corresponding configuration is pulled from a configuration center, and configuration content is ready to be written into the path of the configuration file to be written obtained in the last step.
It should be noted that, if the corresponding configuration file is not acquired from the configuration center, the data of the remote configuration center may be initialized by using the local file content corresponding to the path of the configuration file to be written.
S130, sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled.
Specifically, after the target configuration file is obtained, the target configuration file and the executable program corresponding to the target configuration file may be sent to the environment to be compiled. When the configuration file is sent to the environment to be compiled, the configuration file and the executable program corresponding to the application to be deployed can be stored in the environment to be compiled according to the pre-edited storage path.
According to the technical scheme of the embodiment of the invention, the type of the target operation environment, the name of the target operation environment and the information of the application parameter to be deployed on the environment to be compiled are obtained; when detecting that the configuration center stores configuration information which is the same as the target operation environment type, the target operation environment name and the parameter information of the application to be deployed, acquiring a target configuration file according to the configuration information; and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled, thereby realizing the technical effect of acquiring the configuration file matched with the current operating environment from the configuration center.
Example two
Fig. 2 is another schematic flow chart illustrating a method for determining a configuration file according to a second embodiment of the present invention. On the basis of the foregoing embodiment, there is also a case where the target configuration file corresponding to the current operating environment is not acquired from the configuration center, and in this case, for a specific implementation, reference may be made to the technical solution disclosed in this embodiment. The technical terms that are the same as or corresponding to the above embodiments are not repeated herein.
As shown in fig. 2, the method includes:
s210, acquiring the type of the target running environment, the name of the target running environment and the parameter information of the application to be deployed on the environment to be compiled.
And S220, when the configuration center is detected to store the configuration information which is the same as the target operation environment type, the target operation environment name and the parameter information of the application to be deployed, acquiring a target configuration file according to the configuration information.
And S230, acquiring a target configuration file from the configuration center according to the reading sub-path.
The parameter information of the application to be deployed comprises a specified path, and the specified path comprises a reading sub-path of a reading configuration center and a sub-path to be stored. The reading sub-path is a path for reading the configuration file from the configuration center, and the storing sub-path is a path for storing the configuration file according to the storing sub-path after the configuration file is read from the configuration center.
Specifically, if a reading sub-path is defined in the application parameters to be deployed, the configuration file can be read from the configuration center based on the reading sub-path; if the read sub-path is not defined in the application to be deployed, the corresponding target configuration file can be obtained from the configuration service center based on the embodiment mode.
And S240, sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled according to the storage sub-path.
Specifically, after the target configuration file is obtained, the target configuration file may be sent to the environment to be compiled according to a pre-edited storage sub-path. That is, the configuration files may be written locally one by one according to the preset storage sub-path.
On the basis of the technical scheme, the method further comprises the following steps: after the target configuration file is obtained according to the configuration information, the method further comprises the following steps: and acquiring global variables stored in the configuration center, splicing the global variables and the target configuration file, and using the configuration file obtained after splicing as the target configuration file.
It can be understood that, reading the GLOBAL configuration, if the configuration center contains a path named as "{ application name }/[ GLOBAL ]", the GLOBAL configuration can be spliced to the end of the target configuration file, so as to provide a means of "batch modification" for the general configuration file, that is, one-time editing is performed to enable all environments to take effect, and the configuration of each environment does not need to be modified one by one, thereby realizing the technical effects of convenience and high efficiency in modifying the configuration file.
On the basis of the above technical solutions, before determining the target configuration file to be written into the environment to be compiled, syntax checking may be performed on the configuration file. This is because the configuration file stored in the remote configuration service center may leave wrong syntax during editing, resulting in failure of subsequent compilation, and therefore, before writing the configuration file into the environment to be compiled, the configuration file may be checked to determine the error in the configuration file as soon as possible before compiling, thereby helping developers to locate the error range more quickly.
According to the technical scheme of the embodiment of the invention, the type of the target operation environment, the name of the target operation environment and the information of the application parameter to be deployed on the environment to be compiled are obtained; when detecting that the configuration center stores configuration information which is the same as the target operation environment type, the target operation environment name and the parameter information of the application to be deployed, acquiring a target configuration file according to the configuration information; and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled, thereby realizing the technical effect of acquiring the configuration file matched with the current operating environment from the configuration center. The specific process of managing the configuration resources and acquiring the corresponding configuration file in this embodiment may be as follows: the front-end application (the application to be deployed) needs to access the SDK, i.e. install the corresponding npm software package, i.e. a NodeJS package management and distribution tool. The invocation of the SDK command line tool is added before the original compiling instruction. Firstly, reading an environment variable INSTANCE _ ENV and an environment variable INSTANCE _ NAME on an environment to be compiled based on the SDK, simultaneously obtaining an application NAME of an application to be deployed and application details including a path of a configuration file to be written, and optionally, reading a sub-path and/or storing the sub-path by the configuration file. If the parameter information of the application to be deployed is not written, setting a necessary default value according to a rule: json 'name field is used as the default of the application name, npm command's directory is used as the default of the item root path, and config/index.js is used as the default of the relative path to be written. After acquiring the corresponding operating environment type, operating environment name and application name of the application to be deployed, a configuration name list taking { application name }/as a prefix can be acquired from the configuration center. According to the operating environment name, the operating environment type and the application name of the application to be deployed obtained in the last step, the spliced operating environment name can be as follows: { application name }/{ alias specified by a parameter }, { application name }/{ environment name }, { application name }/{ service address specified by a parameter: port specified by a parameter }, and the like. And searching completely matched character strings from the configuration name list in sequence, if matching is successful, pulling the corresponding configuration from the configuration center, and preparing to write the configuration content into the path of the configuration file to be written obtained in the last step. If the matching fails, initializing the data of the remote configuration center by using the local file content corresponding to the path of the configuration file to be written, and taking the character string with the top rank as the remote configuration name.
On the basis of the technical scheme, the method can also comprise the following steps: reading the extension configuration, wherein the extension configuration can be a pre-written deployment parameter. If the parameter specifies a patch (profile read sub-path), it indicates that more profiles are to be read in addition. The data structure of patch expressed in JSON format is as follows
{
"remote":"local"
}
remote represents the path of the remote configuration center, and local represents the path of the configuration file to be written. When remote is a/ending string, representing the directory of the remote configuration center, local represents the directory to be written, and the SDK downloads all the files of the remote directory to the local directory from the remote. The SDK may first obtain a list of configuration names with { application name }/as prefix from the configuration center, and if remote is a directory, the SDK will "beat" the directory first to obtain a mapping map of the path, for example, the patch value is
{
"remoteDir/":"localDir",
}
The SDK remotely acquires two configuration paths of { application name }/remotedDir/a.js ', "{ application name }/remotedDir/b.js' under the 'remotedDir/' directory, and then the SDK flattens the patch to be in the state of being in the 'remotedDir/' directory
{
"remoteDir/a.js":"localDir/a.js",
"remoteDir/b.js":"localDir/b.js"
}
And then written locally one by one according to the above file path mapping.
On the basis of the technical scheme, the global configuration can be read. If the remote configuration center contains a path named "{ application name }/[ GLOBAL ]", the configuration content is completely spliced to the acquired target configuration file.
Before the configuration file is written into the environment to be compiled, file syntax check is carried out on the Javascript code file and the Typescript code file once. Because the remote configuration center file may leave wrong syntax during editing, subsequent compiling fails, and this step can help developers locate error ranges more quickly by throwing problems as soon as possible before compiling.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a system for determining a configuration file according to a third embodiment of the present invention, where the system is configured in a packaging machine, and includes: an information acquisition module 310, a target profile acquisition module 320, and a target profile transmission module 330.
The information obtaining module 310 is configured to obtain a target operating environment type, a target operating environment name, and to-be-deployed application parameter information in the to-be-compiled environment; a target configuration file obtaining module 320, configured to, when it is detected that configuration information that is the same as the target operating environment type, the target operating environment name, and the to-be-deployed application parameter information is stored in the configuration center, obtain a target configuration file according to the configuration information; a target configuration file sending module 330, configured to send the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled.
On the basis of the above technical solution, before the information obtaining module is configured to obtain the target operating environment type, the target operating environment name, and the information of the application parameter to be deployed in the environment to be compiled, the information obtaining module is further configured to: calling a configuration center establishing module to establish a configuration center and a display webpage corresponding to the configuration center; determining the operation environment type and the operation environment name of each application to be selected deployed in each operation environment, and binding the operation environment name and the operation environment type with the application to be selected; and storing the operation environment names and the operation environment types bound with the application to be selected into the configuration center.
On the basis of the above technical solution, the determining the operation environment type and the operation environment name of each application to be selected deployed in each operation environment, and binding the operation environment name and the operation environment type with the application to be selected includes: determining running environment identifiers of applications to be selected and deployed in each running environment; based on the operating environment identification, carrying out configuration isolation on a production environment and a test environment corresponding to the application to be selected; and binding the application to be selected with the running environment identifier, the running environment type and the running environment name deployed in each running environment, generating a configuration name list corresponding to the application to be selected, and determining whether a target configuration file corresponding to the target running environment name is included in the configuration list.
On the basis of the above technical solutions, when it is detected that configuration information that is the same as the target operating environment type, the target operating environment name, and the parameter information of the application to be deployed is stored in the configuration center, acquiring a target configuration file according to the configuration information includes: calling a target configuration name list associated with the application name from the configuration center according to the application name of the application to be deployed; and when the configuration information matched with the application name and the target operation environment name is acquired from the target configuration name list, acquiring a target configuration file according to the configuration information.
On the basis of the above technical solutions, the apparatus further includes: and the initialization configuration file module is used for initializing the configuration file in the configuration center according to the text content corresponding to the configuration file path in the to-be-deployed application parameter information if the configuration information matched with the application name and the target running environment is not acquired from the target configuration name list.
On the basis of the foregoing technical solutions, the to-be-deployed application parameter information includes a specified path, where the specified path includes a read sub-path and a to-be-stored sub-path of a read configuration center, and after it is detected that configuration information that is the same as the target operating environment type, the target operating environment name, and the to-be-deployed application parameter information is stored in the configuration center, acquiring a target configuration file according to the configuration information, the method further includes: acquiring a target configuration file from the configuration center according to the reading sub-path; correspondingly, the sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled includes: and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled according to the storage sub-path.
On the basis of the above technical solutions, after obtaining the target configuration file according to the configuration information, the method further includes: and acquiring a global variable stored in the configuration center, splicing the global variable and the target configuration file, and using the configuration file obtained after splicing as the target configuration file.
According to the technical scheme of the embodiment of the invention, the type of the target operation environment, the name of the target operation environment and the information of the application parameter to be deployed on the environment to be compiled are obtained; when detecting that the configuration center stores configuration information which is the same as the target operation environment type, the target operation environment name and the parameter information of the application to be deployed, acquiring a target configuration file according to the configuration information; and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled, thereby realizing the technical effect of acquiring the configuration file matched with the current operating environment from the configuration center.
The system for determining the configuration file provided by the embodiment of the invention can execute the method for determining the configuration file provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely 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 embodiment of the invention.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The electronic device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the electronic device 40, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, the electronic device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by executing programs stored in the system memory 402, for example, to implement the method for determining a configuration file provided by the embodiment of the present invention.
EXAMPLE five
An embodiment of the present invention also provides a storage medium containing computer-executable instructions which, when executed by a computer processor, perform a method of determining a profile.
The method comprises the following steps:
acquiring a target operation environment type, a target operation environment name and to-be-deployed application parameter information on an environment to be compiled;
when detecting that configuration information which is the same as the target operation environment type, the target operation environment name and the to-be-deployed application parameter information is stored in a configuration center, acquiring a target configuration file according to the configuration information;
and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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 greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of determining a configuration file for use in a strapping machine, comprising:
acquiring a target operation environment type, a target operation environment name and to-be-deployed application parameter information on an environment to be compiled;
when detecting that configuration information which is the same as the target operation environment type, the target operation environment name and the to-be-deployed application parameter information is stored in a configuration center, acquiring a target configuration file according to the configuration information;
and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled.
2. The method according to claim 1, further comprising, before the obtaining the target runtime environment type, the target runtime environment name, and the parameter information of the application to be deployed on the environment to be compiled, the following steps:
calling a configuration center establishing module, and establishing a configuration center and a display webpage corresponding to the configuration center;
determining the operation environment type and the operation environment name of each application to be selected deployed in each operation environment, and binding the operation environment name and the operation environment type with the application to be selected;
and storing the operation environment names and the operation environment types bound with the application to be selected into the configuration center.
3. The method of claim 2, wherein the determining the running environment type and the running environment name of each application to be selected deployed in each running environment and binding the running environment name and the running environment type with the application to be selected comprises:
determining running environment identifiers of applications to be selected and deployed in each running environment;
based on the operating environment identification, carrying out configuration isolation on a production environment and a test environment corresponding to the application to be selected;
and binding the application to be selected with the running environment identifier, the running environment type and the running environment name deployed in each running environment, generating a configuration name list corresponding to the application to be selected, and determining whether a target configuration file corresponding to the target running environment name is included in the configuration list.
4. The method according to claim 2, wherein when it is detected that configuration information that is the same as the target operating environment type, the target operating environment name, and the parameter information of the application to be deployed is stored in the configuration center, acquiring a target configuration file according to the configuration information includes:
calling a target configuration name list associated with the application name from the configuration center according to the application name of the application to be deployed;
and when the configuration information matched with the application name and the target operation environment name is acquired from the target configuration name list, acquiring a target configuration file according to the configuration information.
5. The method of claim 4, further comprising:
and if the configuration information matched with the application name and the target operation environment is not acquired from the target configuration name list, initializing the configuration file in the configuration center according to the text content corresponding to the configuration file path in the to-be-deployed application parameter information.
6. The method according to claim 1, wherein the to-be-deployed application parameter information includes a specified path, the specified path includes a read sub-path and a to-be-stored sub-path of a read configuration center, and after the detecting that the configuration center stores the configuration information that is the same as the target operating environment type, the target operating environment name, and the to-be-deployed application parameter information, acquiring a target configuration file according to the configuration information, the method further includes:
acquiring a target configuration file from the configuration center according to the reading sub-path;
correspondingly, the sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled includes:
and sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled according to the storage sub-path.
7. The method according to claim 1 or 6, further comprising, after obtaining a target configuration file according to the configuration information:
and acquiring a global variable stored in the configuration center, splicing the global variable and the target configuration file, and using the configuration file obtained after splicing as the target configuration file.
8. A system for determining a profile, configured in a packaging machine, comprising:
the information acquisition module is used for acquiring the type of a target operation environment, the name of the target operation environment and the information of the application parameters to be deployed on the environment to be compiled;
a target configuration file obtaining module, configured to, when it is detected that configuration information that is the same as the target operating environment type, the target operating environment name, and the to-be-deployed application parameter information is stored in a configuration center, obtain a target configuration file according to the configuration information;
and the target configuration file sending module is used for sending the target configuration file and the executable program corresponding to the target configuration file to the environment to be compiled.
9. 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 a method of determining a profile as claimed in any one of claims 1 to 7.
10. A storage medium containing computer-executable instructions for performing the method of determining a profile of any of claims 1-7 when executed by a computer processor.
CN202011458819.4A 2020-12-11 2020-12-11 Method, system, electronic device and storage medium for determining configuration file Pending CN112463256A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011458819.4A CN112463256A (en) 2020-12-11 2020-12-11 Method, system, electronic device and storage medium for determining configuration file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011458819.4A CN112463256A (en) 2020-12-11 2020-12-11 Method, system, electronic device and storage medium for determining configuration file

Publications (1)

Publication Number Publication Date
CN112463256A true CN112463256A (en) 2021-03-09

Family

ID=74803550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011458819.4A Pending CN112463256A (en) 2020-12-11 2020-12-11 Method, system, electronic device and storage medium for determining configuration file

Country Status (1)

Country Link
CN (1) CN112463256A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127096A (en) * 2021-04-27 2021-07-16 上海商汤科技开发有限公司 Task processing method and device, electronic equipment and storage medium
CN113568623A (en) * 2021-07-23 2021-10-29 上海淇玥信息技术有限公司 Application deployment method and device and electronic equipment
CN113626095A (en) * 2021-06-29 2021-11-09 欧电云信息科技(江苏)有限公司 Switching method and switching system of configuration center, electronic equipment and storage medium
CN115499488A (en) * 2022-09-15 2022-12-20 詹纳 Algorithm for fast adapting computer and network equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7451393B1 (en) * 2003-12-23 2008-11-11 Sun Microsystems, Inc. System and method for a page rendering framework
CN104539458A (en) * 2014-12-30 2015-04-22 深圳市兰丁科技有限公司 Operating environment self-adapting method and device
CN105760176A (en) * 2016-03-15 2016-07-13 青岛海信移动通信技术股份有限公司 Packaging method, starting method and corresponding devices for web application
CN106843901A (en) * 2017-02-10 2017-06-13 广州优视网络科技有限公司 A kind of page rendering and the method and apparatus of checking
CN106960235A (en) * 2017-03-30 2017-07-18 北京锤子数码科技有限公司 A kind of file call method, device and electronic equipment
CN107168726A (en) * 2017-03-30 2017-09-15 武汉斗鱼网络科技有限公司 A kind of method and apparatus of dynamic configuration application program
CN110377371A (en) * 2019-07-23 2019-10-25 中信百信银行股份有限公司 A kind of style sheet method for managing system based on Web label
CN111666099A (en) * 2020-06-12 2020-09-15 江苏云柜网络技术有限公司 Application service publishing system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7451393B1 (en) * 2003-12-23 2008-11-11 Sun Microsystems, Inc. System and method for a page rendering framework
CN104539458A (en) * 2014-12-30 2015-04-22 深圳市兰丁科技有限公司 Operating environment self-adapting method and device
CN105760176A (en) * 2016-03-15 2016-07-13 青岛海信移动通信技术股份有限公司 Packaging method, starting method and corresponding devices for web application
CN106843901A (en) * 2017-02-10 2017-06-13 广州优视网络科技有限公司 A kind of page rendering and the method and apparatus of checking
CN106960235A (en) * 2017-03-30 2017-07-18 北京锤子数码科技有限公司 A kind of file call method, device and electronic equipment
CN107168726A (en) * 2017-03-30 2017-09-15 武汉斗鱼网络科技有限公司 A kind of method and apparatus of dynamic configuration application program
CN110377371A (en) * 2019-07-23 2019-10-25 中信百信银行股份有限公司 A kind of style sheet method for managing system based on Web label
CN111666099A (en) * 2020-06-12 2020-09-15 江苏云柜网络技术有限公司 Application service publishing system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127096A (en) * 2021-04-27 2021-07-16 上海商汤科技开发有限公司 Task processing method and device, electronic equipment and storage medium
CN113626095A (en) * 2021-06-29 2021-11-09 欧电云信息科技(江苏)有限公司 Switching method and switching system of configuration center, electronic equipment and storage medium
CN113568623A (en) * 2021-07-23 2021-10-29 上海淇玥信息技术有限公司 Application deployment method and device and electronic equipment
CN115499488A (en) * 2022-09-15 2022-12-20 詹纳 Algorithm for fast adapting computer and network equipment

Similar Documents

Publication Publication Date Title
CN112463256A (en) Method, system, electronic device and storage medium for determining configuration file
US7877732B2 (en) Efficient stress testing of a service oriented architecture based application
CN110688142B (en) Method, device and storage medium for publishing application programming interface
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
US7680668B2 (en) Method for generating a language-independent regression test script
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN110673837B (en) Code repairing method and device, electronic equipment and computer readable storage medium
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
CN110515647A (en) A kind of static resource management method, device, equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN113050984A (en) Resource calling method and device, electronic equipment and storage medium
CN112769706A (en) Componentized routing method and system
CN113268245A (en) Code analysis method, device and storage medium
CN112835568A (en) Project construction method and device
CN114217789A (en) Function component expansion method, device, equipment, storage medium and program product
CN114003269A (en) Component processing method and device, electronic equipment and storage medium
US10606569B2 (en) Declarative configuration elements
CN112632425A (en) Method, device, equipment and storage medium for generating offline resource file
CN112052039A (en) Method and device for synchronously constructing multiple projects and electronic equipment
CN109582347B (en) Method and device for acquiring front-end codes
CN111309332A (en) File content on-demand loading method and device, electronic equipment and storage medium
CN111488286B (en) Method and device for independently developing Android modules
CN115080113A (en) Item code detection method and device, readable storage medium and electronic equipment

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210309