CN112099841A - Method and system for generating configuration file - Google Patents

Method and system for generating configuration file Download PDF

Info

Publication number
CN112099841A
CN112099841A CN202010885912.7A CN202010885912A CN112099841A CN 112099841 A CN112099841 A CN 112099841A CN 202010885912 A CN202010885912 A CN 202010885912A CN 112099841 A CN112099841 A CN 112099841A
Authority
CN
China
Prior art keywords
embedded
configuration information
configuration
class
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010885912.7A
Other languages
Chinese (zh)
Inventor
李继永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tongbang Zhuoyi Technology Co ltd
Original Assignee
Beijing Tongbang Zhuoyi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Tongbang Zhuoyi Technology Co ltd filed Critical Beijing Tongbang Zhuoyi Technology Co ltd
Priority to CN202010885912.7A priority Critical patent/CN112099841A/en
Publication of CN112099841A publication Critical patent/CN112099841A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a system for generating a configuration file, and relates to the technical field of computers. One embodiment of the method comprises: starting the embedded system; the embedded system is used for generating configuration files and managing configuration information, is embedded in an application system, and is independent from the application system; performing, by the embedded system, the steps of: receiving configuration information submitted by a user, and storing the configuration information into an embedded database; and generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of a disk. The implementation method can solve the technical problems that the deployment structure is too large, the network is depended on or the maintenance cost is high.

Description

Method and system for generating configuration file
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and a system for generating a configuration file.
Background
In most systems, system parameters are defined by means of configuration files, which are manually configured. The user configures the attributes in the centralized configuration system, and when the application system is started, the configuration information is pulled from the centralized configuration system through the network and is stored in the memory for the application system to use.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1) the deployment structure is too bulky: the application system must rely on a centralized configuration system and cannot run independently; when the system is exported externally, a separate centralized configuration file system is often needed to be deployed.
2) The dependent network: the application system must be connected through the network to pull the configuration information from the centralized configuration system, and if the network is interrupted, the configuration information cannot be pulled, which causes system failure.
3) The maintenance cost is high: centralized configuration systems require a dedicated person to manage and maintain them.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for generating a configuration file, so as to solve the technical problems of an excessively large deployment structure, dependence on a network, or high maintenance cost.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of generating a configuration file, including:
starting the embedded system; the embedded system is used for generating configuration files and managing configuration information, is embedded in an application system, and is independent from the application system;
performing, by the embedded system, the steps of:
receiving configuration information submitted by a user, and storing the configuration information into an embedded database;
and generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of a disk.
Optionally, after saving the configuration file to a specified path of the disk, further performing, by the embedded system, the following steps:
reading the configuration information in the embedded database to display the configuration information on a user interface;
modifying the configuration information according to a modification instruction of a user, and storing a modification record of the configuration information into a modification record table of the embedded database;
and updating the configuration file in the disk.
Optionally, after saving the configuration file to a specified path of the disk, further performing, by the embedded system, the following steps:
and calling a general interface of the centralized configuration file system, and sending the configuration file to the centralized configuration file system through the general interface.
Optionally, the embedded system is embedded in the application system in a software package file format.
Optionally, the software package file format is jar file.
Optionally, initiating an embedded system, comprising:
and starting the embedded system by using a jar command in java.
Optionally, before starting the embedded system, the method further includes:
building a start loading class, a database connection class and an interface management class;
and packaging the boot loading class, the database connection class and the interface management class into jar files by adopting a packaging tool so as to construct an embedded system.
Optionally, the boot loading class is used for booting an embedded system;
the database connection class is used for reading data in the embedded database;
the interface management class is used for displaying the read data on an interface so that a user can view, configure or modify configuration information;
optionally, the start loading class is serverbotstrap.class, the database connection class is dbmanager.class, and/or the interface management class is uimanger.class.
Optionally, the configuration information includes environment configuration information of each environment in the application system and system configuration information of the application system.
Optionally, the respective environments comprise at least one of a development environment, a test environment, and a production environment; the attributes of the system configuration information include public attributes and private attributes.
Optionally, the target format comprises an xml format or a properties format.
Optionally, the embedded database comprises a SQLite database.
In addition, according to another aspect of the embodiments of the present invention, there is provided a system for generating a configuration file, including an application system, an embedded system and an embedded database, wherein the embedded system is embedded in the application system, and the embedded system is independent from the application system;
the embedded system is to:
receiving configuration information submitted by a user, and storing the configuration information into the embedded database;
and generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of a disk.
Optionally, after saving the configuration file to a specified path of the disk, the embedded system is further configured to:
reading the configuration information in the embedded database to display the configuration information on a user interface;
modifying the configuration information according to a modification instruction of a user, and storing a modification record of the configuration information into a modification record table of the embedded database;
and updating the configuration file in the disk.
Optionally, after saving the configuration file to a specified path of the disk, the embedded system is further configured to:
and calling a general interface of the centralized configuration file system, and sending the configuration file to the centralized configuration file system through the general interface.
Optionally, the embedded system is embedded in the application system in a software package file format.
Optionally, the software package file format is jar file.
Optionally, the embedded system is started by the following method:
and starting the embedded system by using a jar command in java.
Optionally, the embedded system is constructed by the following method:
building a start loading class, a database connection class and an interface management class;
and packaging the boot loading class, the database connection class and the interface management class into jar files by adopting a packaging tool.
Optionally, the boot loading class is used for booting an embedded system;
the database connection class is used for reading data in the embedded database;
the interface management class is used for displaying the read data on an interface so that a user can view, configure or modify configuration information;
optionally, the boot load class is serverbotstrap.class, the database connection class is dbmanager.class, and/or the interface management class is uimanger.class.
Optionally, the configuration information includes environment configuration information of each environment in the application system and system configuration information of the application system.
Optionally, the respective environments comprise at least one of a development environment, a test environment, and a production environment; the attributes of the system configuration information include public attributes and private attributes.
Optionally, the target format comprises an xml format or a properties format.
Optionally, the embedded database comprises a SQLite database.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: because of the adoption of the embedded system: the method comprises the steps of receiving configuration information submitted by a user, storing the configuration information in an embedded database, generating a configuration file in a target format according to the configuration information, and storing the configuration file to a disk under a specified path, so that the technical problems that a deployment structure is too large, a network is relied on, or the maintenance cost is high in the prior art are solved. The embodiment of the invention defines, modifies and takes effect the configuration through the embedded system, and generates the configuration file in a standardized way, thereby reducing the workload of repeated configuration in different environments and different systems and reducing the risk of system errors caused by modifying the configuration file manually; and the application system can read the configuration file without depending on the network, so that the dependence of a centralized configuration system is eliminated, and the maintenance cost is obviously reduced. Therefore, the embodiment of the invention reduces manual configuration operation, improves configuration efficiency and reduces configuration risk.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of generating a configuration file according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a data structure of configuration information according to an embodiment of the present invention;
FIG. 3 is a schematic view of a main flow of a method of generating a configuration file according to one referential embodiment of the present invention;
FIG. 4 is a schematic diagram of a main flow of a method of generating a configuration file according to another referenceable embodiment of the present invention;
FIG. 5 is a schematic diagram of the major modules of a system for generating a configuration file according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In a common application system, there are generally 3 environments: development environment, test environment, production environment, this time 3 sets of configuration files are needed. Special systems may also include a pre-launch environment, uat (User Acceptance Test) environment, poc (proof of Concept) environment, etc., and at this time, 6 sets of configuration files are required. According to the current popular technical route (such as microservices, microarchitectures and the like), one system is often split into a foreground system and a background system, and even one system is split into 3-5 subsystems.
At this time, the number of configuration files is multiplied, and the workload of operation and maintenance is huge. In addition, the configuration of partial environments is the same, and if one parameter is modified, multiple places are required to be modified, and the risk caused by configuration file errors is obvious.
At present, a centralized configuration system is generally used to configure attributes, and when an application system is started, configuration information is pulled from the centralized configuration system through a network and is stored in a memory for use by the application system. However, the application server using the centralized configuration system must depend on the centralized configuration system completely, and must depend on the network because it is 2 services. If a problem occurs in the centralized configuration system, the configuration information cannot be acquired. Therefore, high availability and low latency of the centrally configured system must be guaranteed. In order to solve the technical problems that a centralized configuration system is too large in deployment structure and high in maintenance cost, the embodiment of the invention provides a method for generating a configuration file, the method can visually define, modify and take effect on the configuration through an embedded system, the configuration file can be generated in a standardized manner, manual operation is reduced through automatic configuration, the efficiency is improved, and the risk is reduced; and no network is required, and no large system structure is required to be deployed.
Fig. 1 is a schematic diagram of a main flow of a method of generating a configuration file according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, the method for generating a configuration file may include:
step 101, starting an embedded system; the embedded system is embedded in an application system, and the embedded system and the application system are independent.
In an embodiment of the present invention, the embedded system is independent of external containers (such as tomcat, weblogic, etc.), the embedded system is a system for generating configuration files and managing configuration information, and the embedded system is embedded in the application system in a software package file format (such as an executable jar package file). Because the embedded system exists in the application system in the form of an executable jar package, the embedded system can be started in a mode of directly starting the java of the embedded system by a jar command in the java without depending on the application system. The embedded system is started based on a common Netty network programming framework, a simple http server is realized, and the embedded system is started through a jar command.
Optionally, before step 101, it is further required to construct an embedded system, and the step of constructing the embedded system includes: building a start loading class, a database connection class and an interface management class; and packaging the boot loading class, the database connection class and the interface management class into jar files by adopting a packaging tool so as to construct an embedded system. The boot loading class is used for starting the embedded system; the database connection class is used for reading data in the embedded database; the interface management class is used for displaying the read data on an interface so that a user can view, configure or modify the configuration information. Specifically, a 19999 port is monitored by a start loading class, when a user accesses the 19999 port through a browser, the embedded system is started by the start loading class, then the data in the embedded database is read by a database connection class, and finally the read data is processed by an interface management class, so that the user can view, modify, add and the like the configuration information on the interface.
Optionally, the boot load class is serverbotstrap. Optionally, the database connection class is DbMana ger. Optionally, the interface management class is uimanger.
It should be noted that the application system and the embedded system belong to two independent systems. The application system and the embedded system can be respectively started without mutual dependency relationship. The embedded system may be embedded in an application system and activated when needed (e.g., when configuration information needs to be checked, modified, or added). The embedded system can be independently started whether the application system is started or not.
Step 102 and step 103 are performed by the embedded system.
And 102, receiving configuration information submitted by a user, and storing the configuration information into an embedded database.
After the embedded system is started, the configuration information can be checked through the user interface, the configuration information submitted by a user is received, and then the received configuration information is stored in the embedded database in real time. To avoid non-compliant configurations or other low-level errors, rule filters (e.g., date rules, numeric rules, IP rules, mailbox rules, etc.) are predefined and the embedded system may be filtered in real-time as attributes are configured.
Optionally, the configuration information includes environment configuration information of each environment in the application system and system configuration information of the application system. Optionally, the respective environments comprise at least one of a development environment, a test environment, and a production environment; the attributes of the system configuration information include public attributes and private attributes. A project often has multiple environments (such as development environment, test environment, production environment, etc., and may also have a pre-development environment, uat environment, poc environment), so that the configuration contents need to be defined in groups. In many environments, there will be content with the same configuration, so it is also necessary to define the sharing level of the configuration: private, public, etc. Common refers to configuration items that are common between different environments; private refers to a configuration item that is unique between different environments.
As shown in fig. 2, each group represents an environment, and the configuration information of the environment needs to configure the sharing level: public or private. If the configuration item is 'public', the configuration item can be in each environment in the configuration file generated in the later period so as to reduce the workload of repeated configuration in different environments; if a configuration item is "private," it is only generated in the configured environment (which is configured by the belonging group).
The content of the configuration file is not many, and large data is not needed, so that the configuration information is stored in the embedded database in the embodiment of the invention. Optionally, the embedded database comprises a SQLite database. The SQLite is an embedded database, and the whole database is a file and does not need to depend on other components. The configuration file is copied to another place to form a new independent database. And the embedded database has small memory, and the whole database can be started in the local computer only by one file. Optionally, the embedded database may also be Progress, Empress, mSQL, or eXtremeDB, and the like, which is not limited in this embodiment of the present invention.
And 103, generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of the disk.
Optionally, in order to generate the configuration file in the target format according to the user requirement, before the embedded system performs step 102 or step 103, the format of the configuration file needs to be defined in the embedded system, for example, the target format of the configuration file is defined as an xml file or a properties file in the form of kv key value pairs.
Optionally, after saving the configuration file to a specified path of the disk, further performing, by the embedded system, the following steps: reading the configuration information in the embedded database to display the configuration information on a user interface; modifying the configuration information according to a modification instruction of a user, and storing a modification record of the configuration information into a modification record table of the embedded database; and updating the configuration file in the disk. The embodiment of the invention uses an embedded database as a database of embedded services, and records configuration information and modification records each time. For each modification, it is recorded in the embedded database for backtracking if needed. After the modification of the configuration information is completed, the configuration file on the disk is further updated to ensure that the configuration information in the configuration file is newly configured.
In the embodiment of the present invention, when generating the configuration file, a storage path of the configuration file in the disk is specified by the user, so that the configuration file in a target format (such as xml or properties) can be saved to a specified path according to the path specified by the user, and after modifying the configuration information, the configuration file in the path is updated accordingly.
It should be noted that in the embodiment of the present invention, all configuration information and modification records are stored in the embedded database, but cannot be read by the application system. Therefore, the configuration information needs to be saved to the disk in a file form for reading and use by the application system.
Optionally, after saving the configuration file to a specified path of the disk, further performing, by the embedded system, the following steps: and calling a general interface of the centralized configuration file system, and sending the configuration file to the centralized configuration file system through the general interface. Considering that in practical projects, part of application systems have access to the centralized configuration system, and therefore the configuration files configured in the embedded system are sent to the centralized system by calling the universal interface, so that the application systems can be flexibly switched between the centralized configuration system and the embedded system.
It should be noted that the application system deployed on the application server may be a parent system or a subsystem, but technically or in a deployment manner, the application system is also an independent system. The subsystems are independently deployed and independently started. If configuration information is required to be shared between parent and child systems, configuration is defined in the embedded system of the parent system, the configuration file of the parent system is copied to each subsystem, and finally the embedded system in the subsystem is subjected to configuration modification, so that the workload of repeated configuration among different systems can be reduced, and the risk of system errors caused by manual configuration file modification can be reduced.
From the various embodiments described above, it can be seen that embodiments of the present invention employ a system that is embedded through: the technical means that the configuration information submitted by a user is received, the configuration information is stored in the embedded database, the configuration file in the target format is generated according to the configuration information, and the configuration file is stored in the specified path of the disk are provided, so that the technical problems that the deployment structure is too large, the network is relied on, or the maintenance cost is high in the prior art are solved. The embodiment of the invention defines, modifies and takes effect the configuration through the embedded system, and generates the configuration file in a standardized way, thereby reducing the workload of repeated configuration in different environments and different systems and reducing the risk of system errors caused by modifying the configuration file manually; and the application system can read the configuration file without depending on the network, so that the dependence of a centralized configuration system is eliminated, and the maintenance cost is obviously reduced. Therefore, the embodiment of the invention reduces manual configuration operation, improves configuration efficiency and reduces configuration risk.
Fig. 3 is a schematic diagram of a main flow of a method of generating a configuration file according to one referential embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 3, the method for generating a configuration file may include:
step 301, an embedded system is constructed.
Specifically, the method comprises the following steps: building a start loading class, a database connection class and an interface management class; and packaging the boot loading class, the database connection class and the interface management class into jar files by adopting a packaging tool so as to construct an embedded system. The boot loading class is used for starting the embedded system; the database connection class is used for reading data in the embedded database; the interface management class is used for displaying the read data on an interface so that a user can view, configure or modify the configuration information.
Step 302, start the embedded system.
The embedded system is embedded in an application system, and the embedded system and the application system are independent. The embedded system does not depend on an external container (such as tomcat, weblogic and the like), is a system for generating configuration files and managing configuration information, and is embedded in the application system in a software package file format (such as an executable jar file). Because the embedded system exists in the application system in the form of executable jar package, the embedded system can be directly started by jar command in java, and the embedded system can be started without depending on the application system. The application system and the embedded system can be respectively started without mutual dependency relationship. The embedded system can be embedded in an application system and started when needed. The embedded system can be independently started whether the application system is started or not.
Steps 303-307 are performed by the embedded system.
Step 303, receiving the configuration information submitted by the user.
After the embedded system is started, the configuration information can be checked through the user interface, the configuration information submitted by a user is received, and then the received configuration information is stored in the embedded database in real time. To avoid non-compliant configurations or other low-level errors, rule filters (e.g., date rules, numeric rules, IP rules, mailbox rules, etc.) are predefined and the embedded system may be filtered in real-time as attributes are configured.
Step 304, storing the configuration information into an embedded database.
Optionally, the embedded database comprises a SQLite database. The SQLite is an embedded database, and the whole database is a file and does not need to depend on other components. The configuration file is copied to another place to form a new independent database. And the embedded database has small memory, and the whole database can be started in the local computer only by one file.
Step 305, the target format and storage path of the configuration file are specified.
In order to generate the configuration file in the target format according to the user requirement, before the embedded system performs step 305, the format of the configuration file needs to be defined in the embedded system, for example, the target format of the configuration file is defined as an xml file or a properties file in a kv key value pair form.
Likewise, the storage path of the configuration file on the disk needs to be specified in the inline system before step 307 is executed by the inline system.
Step 306, generating a configuration file in a target format according to the configuration information.
Step 307, saving the configuration file to a specified path of the disk.
The configuration file on the disk can be copied to other application servers, if the configuration information is the same, the application system on the application server can directly read the configuration file, if the configuration information needs to be modified, the embedded system on the application server is started, and the configuration information is updated through the embedded system, so that the configuration file on the disk is updated.
The application system deployed on the application server may be a parent system or a subsystem, but technically or in a deployment manner, the application system is also an independent system. The subsystems are independently deployed and independently started. If configuration information is required to be shared between parent and child systems, configuration is defined in the embedded system of the parent system, the configuration file of the parent system is copied to each subsystem, and finally the embedded system in the subsystem is subjected to configuration modification, so that the workload of repeated configuration among different systems can be reduced, and the risk of system errors caused by manual configuration file modification can be reduced.
In addition, in a reference embodiment of the present invention, the detailed implementation of the method for generating a configuration file is described in detail in the above-mentioned method for generating a configuration file, and therefore, the repeated content will not be described again.
Fig. 4 is a schematic diagram of a main flow of a method of generating a profile according to another referenceable embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 4, the method for generating a configuration file may include:
step 401, starting the embedded system. The embedded system is embedded in an application system, and the embedded system and the application system are independent.
Steps 402-408 are performed by the embedded system.
At step 402, configuration information submitted by a user is received.
Step 403, saving the configuration information into an embedded database.
Step 404, generating a configuration file in a target format according to the configuration information.
Step 405, saving the configuration file to the specified path of the disk.
Step 406, reading the configuration information in the embedded database to display the configuration information on a user interface.
When a user needs to modify the configuration information, the embedded system is read to read the configuration information in the embedded database, so that the configuration information is displayed on a user interface.
Step 407, modifying the configuration information according to the modification instruction of the user, and saving the modification record of the configuration information into a modification record table of the embedded database.
The embedded system modifies the configuration information in the embedded database according to the modification instruction of the user, and simultaneously stores the modification record of the configuration information into the modification record table of the embedded database so as to trace back when needed.
Step 408, updating the configuration file in the disk.
And after the configuration information is modified, updating the configuration file in the disk so that the application system reads the latest configuration information.
Optionally, after saving the configuration file to a specified path of the disk, further performing, by the embedded system, the following steps: and calling a general interface of the centralized configuration file system, and sending the configuration file to the centralized configuration file system through the general interface. Considering that in practical projects, part of application systems have access to the centralized configuration system, and therefore the configuration files configured in the embedded system are sent to the centralized system by calling the universal interface, so that the application systems can be flexibly switched between the centralized configuration system and the embedded system.
In addition, in another embodiment of the present invention, the detailed implementation of the method for generating a configuration file is described in detail in the above method for generating a configuration file, and therefore, the repeated description is not repeated here.
Fig. 5 is a schematic diagram of main modules of a system for generating a configuration file according to an embodiment of the present invention, and as shown in fig. 5, the system 500 for generating a configuration file includes an application system 501, an embedded system 502 and an embedded database 503, the embedded system is a system for generating a configuration file and managing configuration information, the embedded system 502 is embedded in the application system 501, and the embedded system 502 is independent from the application system 501;
the embedded system 502 is configured to:
receiving configuration information submitted by a user, and storing the configuration information in the embedded database 503;
and generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of a disk.
Optionally, after saving the configuration file to a specified path of the disk, the embedded system 502 is further configured to:
reading the configuration information in the embedded database 503 to display the configuration information on a user interface;
modifying the configuration information according to a modification instruction of a user, and storing a modification record of the configuration information into a modification record table of the embedded database 503;
and updating the configuration file in the disk.
Optionally, after saving the configuration file to a specified path of the disk, the embedded system 502 is further configured to:
and calling a general interface of the centralized configuration file system, and sending the configuration file to the centralized configuration file system through the general interface.
Optionally, the embedded system is embedded in the application system in a software package file format.
Optionally, the software package file format is jar file.
Optionally, the embedded system is started by the following method:
and starting the embedded system by using a jar command in java.
Optionally, the embedded system is constructed by the following method:
building a start loading class, a database connection class and an interface management class;
and packaging the boot loading class, the database connection class and the interface management class into jar files by adopting a packaging tool.
Optionally, the boot loading class is used for booting an embedded system;
the database connection class is used for reading data in the embedded database;
the interface management class is used for displaying the read data on an interface so that a user can view, configure or modify configuration information;
optionally, the boot load class is serverbotstrap.class, the database connection class is dbmanager.class, and/or the interface management class is uimanger.class.
Optionally, the configuration information includes environment configuration information of each environment in the application system and system configuration information of the application system.
Optionally, the respective environments comprise at least one of a development environment, a test environment, and a production environment; the attributes of the system configuration information include public attributes and private attributes.
Optionally, the target format comprises an xml format or a properties format; and/or the embedded database 503 comprises an SQLite database.
From the various embodiments described above, it can be seen that embodiments of the present invention employ a system that is embedded through: the technical means that the configuration information submitted by a user is received, the configuration information is stored in the embedded database, the configuration file in the target format is generated according to the configuration information, and the configuration file is stored in the specified path of the disk are provided, so that the technical problems that the deployment structure is too large, the network is relied on, or the maintenance cost is high in the prior art are solved. The embodiment of the invention defines, modifies and takes effect the configuration through the embedded system, and generates the configuration file in a standardized way, thereby reducing the workload of repeated configuration in different environments and different systems and reducing the risk of system errors caused by modifying the configuration file manually; and the application system can read the configuration file without depending on the network, so that the dependence of a centralized configuration system is eliminated, and the maintenance cost is obviously reduced. Therefore, the embodiment of the invention reduces manual configuration operation, improves configuration efficiency and reduces configuration risk.
It should be noted that, in the implementation of the system for generating configuration files according to the present invention, the method for generating configuration files described above has been described in detail, and therefore, the repeated description is omitted here.
Fig. 6 illustrates an exemplary system architecture 600 of a method of generating a configuration file or a system of generating a configuration file to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. Various messaging client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (examples only) may be placed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The background management server may analyze and otherwise process the received data such as the item information query request, and feed back a processing result (for example, target push information, item information — just an example) to the terminal device.
It should be noted that the method for generating a configuration file provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the system for generating a configuration file is generally disposed in the server 605. The method for generating the configuration file provided by the embodiment of the present invention may also be executed by the terminal devices 601, 602, and 603, and accordingly, the system for generating the configuration file may be disposed in the terminal devices 601, 602, and 603.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is placed on the drive 710 as necessary, so that a computer program read out therefrom is placed into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and placed over a network through the communication section 709, and/or placed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: starting the embedded system; the embedded system is used for generating configuration files and managing configuration information, is embedded in an application system, and is independent from the application system; performing, by the embedded system, the steps of: receiving configuration information submitted by a user, and storing the configuration information into an embedded database; and generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of a disk.
According to the technical scheme of the embodiment of the invention, the embedded system is adopted: the method comprises the steps of receiving configuration information submitted by a user, storing the configuration information in an embedded database, generating a configuration file in a target format according to the configuration information, and storing the configuration file to a disk under a specified path, so that the technical problems that a deployment structure is too large, a network is relied on, or the maintenance cost is high in the prior art are solved. The embodiment of the invention defines, modifies and takes effect the configuration through the embedded system, and generates the configuration file in a standardized way, thereby reducing the workload of repeated configuration in different environments and different systems and reducing the risk of system errors caused by modifying the configuration file manually; and the application system can read the configuration file without depending on the network, so that the dependence of a centralized configuration system is eliminated, and the maintenance cost is obviously reduced. Therefore, the embodiment of the invention reduces manual configuration operation, improves configuration efficiency and reduces configuration risk.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (15)

1. A method of generating a configuration file, comprising:
starting the embedded system; the embedded system is used for generating configuration files and managing configuration information, is embedded in an application system, and is independent from the application system;
performing, by the embedded system, the steps of:
receiving configuration information submitted by a user, and storing the configuration information into an embedded database;
and generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of a disk.
2. The method of claim 1, wherein after saving the configuration file to a specified path of the disk, further performing, by the embedded system, the steps of:
reading the configuration information in the embedded database to display the configuration information on a user interface;
modifying the configuration information according to a modification instruction of a user, and storing a modification record of the configuration information into a modification record table of the embedded database;
and updating the configuration file in the disk.
3. The method of claim 1, wherein after saving the configuration file to a specified path of the disk, further performing, by the embedded system, the steps of:
and calling a general interface of the centralized configuration file system, and sending the configuration file to the centralized configuration file system through the general interface.
4. The method of any of claims 1-3, wherein the embedded system is embedded in the application system in a software package file format.
5. The method of claim 4, wherein the package file format is jar file.
6. The method of claim 5, wherein initiating an embedded system comprises:
and starting the embedded system by using a jar command in java.
7. The method of claim 5, prior to initiating the embedded system, further comprising:
building a start loading class, a database connection class and an interface management class;
and packaging the boot loading class, the database connection class and the interface management class into jar files by adopting a packaging tool so as to construct an embedded system.
8. The method of claim 7, wherein the boot load class is used to boot an embedded system;
the database connection class is used for reading data in the embedded database;
the interface management class is used for displaying the read data on an interface so that a user can view, configure or modify the configuration information.
9. The method of claim 8, wherein the bootload class is ServerBootStrap. class, the database connection class is DbManager. class, and/or the interface management class is UiManger. class.
10. The method of claim 1, wherein the configuration information comprises environment configuration information of each environment in the application system and system configuration information of the application system.
11. The method of claim 10, wherein the respective environments comprise at least one of a development environment, a test environment, and a production environment; the attributes of the system configuration information include public attributes and private attributes.
12. The method of claim 1, wherein the embedded database comprises a SQLite database.
13. A system for generating configuration files is characterized by comprising an application system, an embedded system and an embedded database, wherein the embedded system is a system for generating configuration files and managing configuration information, the embedded system is embedded in the application system, and the embedded system and the application system are mutually independent;
the embedded system is to:
receiving configuration information submitted by a user, and storing the configuration information into the embedded database;
and generating a configuration file in a target format according to the configuration information, and storing the configuration file to a specified path of a disk.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, implement the method of any of claims 1-12.
15. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-12.
CN202010885912.7A 2020-08-28 2020-08-28 Method and system for generating configuration file Pending CN112099841A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010885912.7A CN112099841A (en) 2020-08-28 2020-08-28 Method and system for generating configuration file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010885912.7A CN112099841A (en) 2020-08-28 2020-08-28 Method and system for generating configuration file

Publications (1)

Publication Number Publication Date
CN112099841A true CN112099841A (en) 2020-12-18

Family

ID=73758307

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010885912.7A Pending CN112099841A (en) 2020-08-28 2020-08-28 Method and system for generating configuration file

Country Status (1)

Country Link
CN (1) CN112099841A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986888A (en) * 2021-12-28 2022-01-28 深圳市明源云科技有限公司 Data processing method, device, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136825A (en) * 2007-10-10 2008-03-05 中兴通讯股份有限公司 Asynchronous configuration information management method and system for client terminal/server structure
CN103186378A (en) * 2011-12-31 2013-07-03 鼎捷软件股份有限公司 Configuration method and configuration system
US20150193515A1 (en) * 2014-01-08 2015-07-09 Oracle International Corporation System and method for cluster-wide replication of embedded component configuration
CN111309390A (en) * 2020-01-19 2020-06-19 维沃移动通信有限公司 Method for acquiring configuration information and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136825A (en) * 2007-10-10 2008-03-05 中兴通讯股份有限公司 Asynchronous configuration information management method and system for client terminal/server structure
CN103186378A (en) * 2011-12-31 2013-07-03 鼎捷软件股份有限公司 Configuration method and configuration system
US20150193515A1 (en) * 2014-01-08 2015-07-09 Oracle International Corporation System and method for cluster-wide replication of embedded component configuration
CN111309390A (en) * 2020-01-19 2020-06-19 维沃移动通信有限公司 Method for acquiring configuration information and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
KKMM: "[转]Netty初探", pages 1 - 2, Retrieved from the Internet <URL:https://www.cnblogs.com/lihaozy/archive/2013/03/05/2944672.html> *
刘家佳 等编著: "《移动智能终端安全》", 30 November 2019, 西安电子科技大学出版社, pages: 35 - 36 *
林秋实: "基于Phosphor cPDM 系统的产品配置管理", 《中国优秀硕士学位论文全文数据库》, no. 2005, pages 138 - 555 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986888A (en) * 2021-12-28 2022-01-28 深圳市明源云科技有限公司 Data processing method, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
WO2021023149A1 (en) Method and apparatus for dynamically returning message
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN111427701A (en) Workflow engine system and business processing method
CN113760324A (en) Method and device for constructing micro front-end application
CN111460129A (en) Method and device for generating identification, electronic equipment and storage medium
CN112612467A (en) Method and device for processing micro front-end architecture based on qiankun
CN110795135A (en) Method and device for realizing injection-resolution configuration
CN113296828A (en) Method, server and system for issuing application
WO2024045646A1 (en) Method, apparatus and system for managing cluster access permission
CN112099841A (en) Method and system for generating configuration file
CN112596854A (en) Method and device for continuously integrating running of assembly line
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN113541987A (en) Method and device for updating configuration data
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN112257039B (en) Identity attribute adding method and device and electronic equipment
CN112463616A (en) Chaos testing method and device for Kubernetes container platform
CN113312053A (en) Data processing method and device
CN112559001A (en) Method and device for updating application
CN113448652A (en) Request processing method and device
CN112306984A (en) Data source routing method and device
CN113495747B (en) Gray scale release method and device
CN112311833B (en) Data updating method and device
CN111177183B (en) Method and device for generating database access statement
CN112925573B (en) Method, device, equipment and computer readable medium for loading web page
CN115964052A (en) Data processing method and device, electronic equipment and computer readable medium

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