CN114840213A - Service instance configuration management method and device - Google Patents
Service instance configuration management method and device Download PDFInfo
- Publication number
- CN114840213A CN114840213A CN202210454994.9A CN202210454994A CN114840213A CN 114840213 A CN114840213 A CN 114840213A CN 202210454994 A CN202210454994 A CN 202210454994A CN 114840213 A CN114840213 A CN 114840213A
- Authority
- CN
- China
- Prior art keywords
- configuration
- node
- nodes
- instance
- value
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a service instance configuration management method and a device, wherein the method comprises the following steps: when the service instance is managed, acquiring a configuration template, wherein the configuration template comprises nodes; traversing the nodes and determining the node types corresponding to the nodes; analyzing the node according to the node type to generate a configuration item; receiving configuration values submitted for the configuration items; and generating an instance configuration file according to the configuration value so as to manage the service instance through the instance configuration file. The embodiment of the invention can ensure that the generated instance configuration file is not limited to a single format, and the configuration template is modified to realize the expansion of the configuration items without readjusting the format, thereby reducing the development cost brought by the expansion of new configuration; the management of the service instance can be realized by modifying the configuration value of the configuration template.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a service instance configuration management method, a service instance configuration management apparatus, an electronic device, and a storage medium.
Background
In a complex application scenario, a set of business systems often deploy different service instances in different scenarios. Each deployed instance will use a different configuration. As business systems scale up, a very large number of service instances are generated. There are two main aspects to manage multiple service instances in a business system: generating instance configuration when creating a new service instance; and performing management operations such as deployment, updating, query and deletion on the service instance. It can be seen that how to implement management of each service instance is a very complicated problem.
In the related art, a micro service management system (e.g., a Consul system) is often used for managing service instances, and the micro service management system is a problem of discovering and monitoring a service system and does not provide a function of discovering and managing instances inside the service system. For configuration generation, it is often adopted to implement configuration in code, or automatically generate in code based on a template, but if a new configuration type is added, great development labor and time costs are required.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed to provide a service instance configuration management method, a corresponding service instance configuration management apparatus, an electronic device and a storage medium that overcome or at least partially solve the above problems.
The embodiment of the invention discloses a service instance configuration management method, which comprises the following steps:
when the service instance is managed, a configuration template is obtained, wherein the configuration template comprises nodes;
traversing the nodes and determining the node types corresponding to the nodes;
analyzing the node according to the node type to generate a configuration item;
receiving configuration values submitted for the configuration items;
and generating an instance configuration file according to the configuration value so as to manage the service instance through the instance configuration file.
Optionally, before the step of generating the instance profile according to the configuration value, the method further includes:
checking whether the configuration item matches the configuration value;
when the configuration values are matched, executing the step of generating the instance configuration file according to the configuration values;
when not matched, an error identification is fed back.
Optionally, the step of checking whether the configuration item matches the configuration value includes:
detecting whether there is a matching configuration value for the configuration item, an
Whether the matched configuration value meets a preset data format or not;
when the configuration item has a matched configuration value and the matched configuration value meets a preset data format, determining that the configuration item is matched with the configuration value;
when the configuration item has no matched configuration value or the matched configuration value does not meet a preset data format, determining that the configuration item is not matched with the configuration value.
Optionally, when there are multiple configuration items, the method further includes:
and combining the configuration items to generate a configuration management page.
Optionally, the configuration template is a tree structure; the step of determining the node type corresponding to the node comprises:
and determining the type of the node as a leaf node or a non-leaf node.
Optionally, when the type of the node is a leaf node, the step of parsing the node according to the type of the node to generate a configuration item includes:
analyzing the configuration name and the content box corresponding to the leaf node; and combining the configuration name and the content box to generate a configuration item.
Optionally, the step of parsing the configuration name and the content box corresponding to the leaf node includes:
reading the key words of the nodes and determining a configuration name;
and creating a content box matched with the configuration name according to the field of the node.
Optionally, the configuration name corresponds to a configuration right, and the method further includes:
acquiring management authority;
when the management authority is higher than the configuration authority, the step of combining the configuration name and the content box to generate a configuration item is executed.
Optionally, the non-leaf node includes a list node, the step of parsing the node according to the node type and generating a configuration item further includes:
analyzing the list nodes to generate leaf nodes;
and analyzing the leaf nodes to generate configuration items.
Optionally, the non-leaf node further includes a dictionary node, the step of parsing the node according to the node type and generating a configuration item further includes:
recursively analyzing the dictionary nodes to generate the leaf nodes;
and analyzing the leaf nodes to generate configuration items.
Optionally, the configuration template further comprises an interface; the method further comprises the following steps:
receiving definition information for the interface;
determining a hypertext transfer protocol interface according to the definition information;
and sending the instance configuration file to a target address through the hypertext transfer protocol interface.
The embodiment of the invention also discloses a service instance configuration management device, which comprises:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a configuration template when aiming at service instance management, and the configuration template comprises nodes;
the traversal module is used for traversing the nodes and determining the node types corresponding to the nodes;
the analysis module is used for analyzing the nodes according to the node types to generate configuration items;
a first receiving module, configured to receive the submitted configuration value for the configuration item;
and the configuration module is used for generating an instance configuration file according to the configuration value so as to manage the service instance through the instance configuration file.
The embodiment of the invention also discloses an electronic device, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the service instance configuration management method are realized.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the service instance configuration management method are realized.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, when the service instance is managed, a configuration template is obtained, wherein the configuration template comprises nodes; traversing the nodes and determining the node types corresponding to the nodes; analyzing the node according to the node type to generate a configuration item; receiving configuration values submitted for the configuration items; and generating an instance configuration file according to the configuration value so as to manage the service instance through the instance configuration file. Generating a configuration item for a user to configure based on a configuration template, and generating a configuration file required by a new service instance according to a configuration value submitted by the user; the generated instance configuration file is not limited to a single format, the configuration template is modified to realize the expansion of the configuration items without readjusting the format, and the development cost brought by the expansion of new configuration is reduced.
Drawings
FIG. 1 is a flowchart illustrating the steps of a service instance configuration management method according to an embodiment of the present invention;
FIG. 2 is a flow chart of steps in another embodiment of a method for service instance configuration management in accordance with the present invention;
FIG. 3 is an exemplary diagram of a configuration management page of the present invention;
FIG. 4 is a flowchart illustrating first steps of an exemplary method for managing a service instance configuration according to the present invention;
FIG. 5 is a flowchart illustrating second steps of an exemplary method for managing service instance configuration according to the present invention;
FIG. 6 is a flowchart illustrating the steps of a further embodiment of a method for managing service instance configuration;
FIG. 7 is a flowchart illustrating steps of another example of a service instance configuration management method of the present invention;
FIG. 8 is a flowchart illustrating steps of an example of a further method for managing service instance configurations in accordance with the present invention;
FIG. 9 is a flowchart illustrating steps of an example of a further method for service instance configuration management in accordance with the present invention;
FIG. 10 is a block diagram of an embodiment of a service instance configuration management method apparatus according to the present invention;
fig. 11 is a block diagram of an electronic device according to an embodiment of the present invention;
fig. 12 is a block diagram of a storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
There are two main aspects to managing service instances: firstly, generating instance configuration when creating a new service instance; and secondly, management operations such as deployment, updating, query and deletion are carried out on the service instances.
In the aspect of instance management, currently, micro service management systems such as consul and the like are generally used, and the main functions of these systems are to realize discovery and monitoring of service instances on a system level and to emphasize management on an operation and maintenance level of a service system, and the main solution is to discover and monitor the service system, and the functions of discovering and managing the service instances inside the service system are not provided. Meanwhile, Consul does not provide a function of sending an instruction from the Consul system to the service system, and thus the management of the service instance in the service system by the management system cannot be realized through the Consul. In addition, although Consul provides a Key-Value storage system for configuration management, Consul does not specify and limit the configured format, and in the actual application process, the configured format needs to be customized by a user, and the configuration format is unreasonable in design, so that the requirements of various complex business scenarios cannot be met, and the service instances are difficult to be managed in a unified manner.
The configuration file generation aspect is generally implemented in the following two ways: the first is to implement configuration generation logic in the code, and generate a configuration file according to the configuration generation logic in the process of compiling the code. The method has the advantages of strong flexibility and capability of adapting to various application scenes. However, expanding and adding new configuration types requires high development labor and time cost, and as the configuration types are increased, codes become bloated and difficult to maintain. The second is a template based on configuration, which is automatically generated by codes, and has the advantages of low development cost, and various configurations can be generated by only once developing and testing and only modifying the configuration template after the configuration template is on line. However, the expansibility is poor, and configuration generation codes need to be re-developed for configuration types which are not supported by the template.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a service instance configuration management method according to the present invention is shown, which may specifically include the following steps:
in practical applications, when a new service instance needs to be created, the configuration of the service instance needs to be modified, and the like, for managing the service instance, a configuration template for configuring the service instance can be acquired from a specified address. In the configuration module, a plurality of nodes exist, and different nodes correspond to different contents of service instance configuration. The designated address may be a storage address of a system local storage space, or may be a cloud space storage address. The embodiment of the present invention is not particularly limited thereto.
Further, the format for the configuration template may be a JSON (Object Notation) format to facilitate writing of the configuration template by a developer.
and traversing all nodes in the configuration template, and determining the node type corresponding to each node. For example, when nodes in the configuration template are stored in a Key-Value form, each Key-Value may be traversed, and the type of the node may be determined by reading a field in the Value.
103, analyzing the node according to the node type to generate a configuration item;
and after the node type of each node is determined, analyzing the nodes by adopting an analysis process matched with the node type to generate a configuration item, so that a user can configure the specific content of the service instance through the configuration item. It should be noted that, depending on the node type, at least one configuration item can be parsed out by a node.
Further, when all nodes in the configuration template are analyzed to obtain a plurality of configuration items, the configuration items can be combined to generate a configuration management page. So that the user can see the configuration items to be configured on one page.
104, receiving the configuration value submitted by the configuration item;
after showing the configuration items, the user can configure each configuration item, write a specific configuration value in each configuration item, and submit the configuration values. User-submitted configuration values for each configuration item may be received. For example, when the configuration item is "a", the user may set the configuration value to "1", and the user may submit the configuration value "1" to the configuration item "a", so that the configuration item has a specific configuration value.
After receiving the configuration values, the configuration items with the configuration values can be associated according to the configuration item relationship specified by the configuration template to generate an instance configuration file. The service instance may be subsequently managed by invoking the instance profile. The format of the generated instance configuration file supports common file formats, such as YAML (YAML Ain't Markup Language), xml (Extensible Markup Language), and other common formats, in addition to json (javascript Object notification) format.
In the embodiment of the invention, when the service instance is managed, a configuration template is obtained, wherein the configuration template comprises nodes; traversing the nodes and determining the node types corresponding to the nodes; analyzing the node according to the node type to generate a configuration item; receiving configuration values submitted for the configuration items; and generating an instance configuration file according to the configuration value so as to manage the service instance through the instance configuration file. Generating a configuration item for a user to configure based on a configuration template, and generating a configuration file required by a new service instance according to a configuration value submitted by the user; the generated instance configuration file is not limited to a single format, the configuration template is modified to realize the expansion of the configuration items without readjusting the format, and the development cost brought by the expansion of new configuration is reduced.
Referring to fig. 2, a flowchart of steps of another embodiment of a service instance configuration management method according to the present invention is shown, where the method may be applied to a management system, where the management system is a background system used by an operator (user) for managing a plurality of used service systems. The service system is a system for realizing specific service requirements, and different service systems are used for realizing different service requirements. The service instance configuration management method may specifically include the following steps:
it should be noted that, the service instance is a service provided by the business system for different application scenarios, and is generated according to the special requirements of each scenario. Management of service instances includes, but is not limited to, addition or deletion of service instances, modification of service instance content, placement of service instances, discovery of service embodiments.
The configuration template is obtained when a user manages for a service instance using a management system. Specifically, when a user performs a management operation on a service instance, an operation instruction may be issued, where the operation instruction includes a storage address of a configuration template, and the configuration template is obtained from the storage address and a graphical configuration value filling interface is displayed in the management system.
Further, the configuration template may be a tree structure, that is, the content in the configuration template continuously extends from a root node to a leaf node.
and traversing all nodes in the tree structure, and respectively determining the node type corresponding to each node. For the traversal mode, one of a pre-order traversal, a middle-order traversal and a post-order traversal may be adopted, which is not specifically limited in the embodiment of the present invention. It should be noted that the specific access manner of the first-order traversal is to access the root node first, then access the left node, and finally access the right node. The specific access mode of the middle-order traversal is to access the left node, then access the root node and finally access the right node. The specific access mode of the subsequent traversal is to access the left node, then access the right node and finally access the root node.
Further, the step of determining the node type corresponding to the node may specifically include: and determining the type of the node as a leaf node or a non-leaf node.
In the process of traversing the nodes of the tree structure, whether each node has a child node or not can be determined, and if the current node has at least one child node, the node can be determined to be a non-leaf node. If the current node does not have a child node, i.e., the node is the end of the tree structure, it may be determined that the node is a leaf node.
and analyzing the node by adopting a corresponding analysis process according to the type of the node to generate a configuration item corresponding to the node.
Further, when the type of the node is a leaf node, analyzing a configuration name and a content box corresponding to the leaf node; and combining the configuration name and the content box to generate a configuration item.
In practical application, when the class behavior of a node is a leaf node, the node is illustrated to represent a specific configuration item in the configuration. The configuration name corresponding to the leaf node can be parsed as the name of the configuration item, for example: "key" and "value". The content box corresponding to the leaf node can be analyzed, and is used for submitting attributes such as value types, value ranges, default values, format check rules, authority management and the like. And combining the configuration name and the content box to generate the configuration item.
Specifically, a node in the tree structure may be expressed by using a keyword and a field corresponding to the keyword, and therefore, the keyword of the node may be read, and the keyword may be used as a configuration name. Such as "key 1". And then creating a content box matched with the configuration name according to the field corresponding to the keyword. The content boxes include, but are not limited to, text boxes, list boxes, date boxes. One skilled in the art can determine different content boxes as desired.
In an optional embodiment of the present invention, the configuration name corresponds to a configuration right, and the method further includes:
step S1, acquiring management authority;
step S2, when the management authority is higher than the configuration authority, executing the step of combining the configuration name and the content box to generate the configuration item.
In practical application, whether the configuration item is displayed or not can be determined according to the authority of the user; therefore, the management authority of the user can be acquired before the configuration items are generated. When the management authority of the user is higher than the configuration authority of the configuration item, the configuration name and the content box can be combined to generate the configuration item so as to determine the safety of the configuration.
Further, when the type of the node is a non-leaf node, it may be further determined whether the node includes a plurality of child nodes of the same type, and whether all the child nodes are leaf nodes.
When the non-leaf node includes a plurality of child nodes of the same type, and whether the child nodes are all leaf nodes, it may be determined that the non-leaf node is a list (list) node, and the list node may be resolved into a plurality of configuration items of the same type of child configuration. For example: the configuration items have specific names, the value types, the value ranges, the default values, the format check rules, the authority management and other attributes. And the values of the list nodes can only be leaf nodes.
Specifically, the list node may be analyzed first, all leaf nodes included in the list node are determined, and each leaf node is analyzed by using the analysis flow of the leaf node in the embodiment of the present invention, so as to generate the configuration item with the plurality of sub-configuration items. For example: "key 1: key1a, key1b ". For the analysis process of the leaf node, the above analysis of the leaf node may be referred to, and details are not described herein.
Still further, when the non-leaf node includes a plurality of child nodes, but the child nodes are not all leaf nodes, the non-leaf node may be determined to be a dictionary (fact) node.
When the non-leaf node is a dictionary (fact) node, the dictionary node can be analyzed in a recursion mode until the leaf node is processed; that is, recursive judgment is performed on the dictionary node, and the child nodes of the dictionary node are determined until the leaf nodes are determined. Then, each leaf node is analyzed by adopting the analysis flow aiming at the leaf node in the embodiment of the invention, and a plurality of specific configuration items are generated. For the analysis process of the leaf node, the above analysis of the leaf node may be referred to, and details are not described herein.
In an optional embodiment of the present invention, when there are multiple configuration items, the configuration items are combined to generate a configuration management page.
In practical application, when the configuration items are multiple, the configuration items can be combined to generate a configuration management page, so that a user can configure the content of one service instance on a management system conveniently. It should be noted that, in the process of generating the configuration management page, the relationship between the configuration items is maintained, that is, there is a case where a plurality of child configuration items are set under the parent configuration item. The specific content of the parent configuration item is determined according to each subordinate child configuration item, and the user only needs to configure the child configuration items. Specifically, as shown in fig. 3, "key 2" is a parent configuration item, which does not need to be configured, and is configured for two subordinate child configuration items "key 2 a" and "key 2 b", thereby determining "key 2".
the user may set a specific configuration value for each configuration item on the management system and submit on the management system to receive the configuration values. Wherein, the submitting mode can be that the corresponding configuration value is submitted every time one configuration item is processed; or submit all configuration values at a time after all the configuration items in the configuration template are completely processed, which is not specifically limited in the embodiment of the present invention.
after the configuration values are submitted, whether each configuration item is matched with the corresponding configuration value can be checked, and whether the format of the configuration value corresponding to the configuration item is correct or not can be determined, so that the abnormal service instance caused by the error of the example configuration file can be avoided.
Specifically, whether the configuration item has a matched configuration value or not and whether the matched configuration value meets a preset data format or not can be detected;
in practical application, whether each configuration item has a configuration value or not can be detected, and omission of the configuration items is avoided. For the detection mode, whether the number of the configuration items is consistent with the number of the configuration values can be compared, and when the number of the configuration items is consistent with the number of the configuration values, the configuration items can be determined to have matched configuration values.
Whether the configuration value conforms to the preset data format or not can be checked, and when the data format of the configuration value is one of the preset data formats, the configuration value conforms to the preset data format. The preset data format is a data format supported by the configuration template.
Further, when the configuration item has a matched configuration value and the matched configuration value meets a preset data format, determining that the configuration item is matched with the configuration value; namely, the configuration items are complete and the configuration value data format submitted by the user is correct, so that the configuration items can be determined to be matched with the configuration values.
When the configuration item has no matched configuration value or the matched configuration value does not meet a preset data format, determining that the configuration item is not matched with the configuration value. That is, as long as there is a case where the configuration items are not complete or there is an error in the submitted configuration value data format of the user, the configuration items are considered not to match the configuration values.
when a configuration item matches a configuration value, an example configuration file may be generated in accordance with the configuration value. So that the management system can manage the service instance via the instance profile.
And step 207, feeding back an error identification when the data are not matched.
When the configuration item is not matched with the configuration value, the management system can feed back an error identifier to remind a user that the configuration item has a configuration value which is not written into the configuration item or the configuration value is wrong, so that the user can modify the configuration item conveniently.
In the embodiment of the invention, a configuration item for a user to configure is generated based on a configuration template, and a configuration file required by a new service instance is generated according to a configuration value submitted by the user; the generated instance configuration file is not limited to a single format, the configuration template is modified to realize the expansion of the configuration items, the format needs to be readjusted, and the development cost brought by the expansion of new configuration is reduced. And format check is carried out on the configuration items and the configuration values, so that the situations of omission of the configuration items and configuration errors are avoided, and the accuracy of the example configuration file is improved.
In order to enable a person skilled in the art to better understand the embodiments of the present invention, the following description is given by way of an example:
referring to fig. 4, when managing a service instance, a configuration template may be obtained, and nodes in the configuration template are represented by Key-Value.
Traversing Key-Value, reading type field in Key-Value, and judging node type.
And when the node type is a leaf node, executing a node analysis process. For the node analysis process, referring to fig. 5, reading a configuration template, and generating a webpage label by using a Key as a configuration name; acquiring management authority, and judging whether the display can be performed or not according to the management authority; and when the display is determined to be available, generating a webpage component of the content box according to the Value field, combining the webpage label and the webpage component, and generating a layer configuration management page.
When the node type is a list node, it may be determined that all the child nodes included in the node type are leaf nodes, and therefore, a node parsing process is performed on each leaf node in the list node.
When the node type is a dictionary node, the above steps (template analysis process) need to be recursively executed on the dictionary node until the dictionary node is processed to a leaf node.
And after the current node is processed, repeating the steps to process the next node until each node in the configuration template is analyzed into a corresponding configuration item.
And finally, generating a configuration generation file according to the configuration values submitted aiming at the configuration items.
Referring to fig. 6, a flowchart illustrating steps of another embodiment of a service instance configuration management method according to the present invention is shown, which may specifically include the following steps:
601, when aiming at service instance management, acquiring a configuration template, wherein the configuration template comprises a node and an interface;
when the service instance is managed, a configuration template of a tree structure is obtained, wherein the configuration template comprises a plurality of tree nodes and related interface parameters of the service instance.
traversing the tree nodes by adopting a preset convenient mode, and determining the node type corresponding to each node.
and analyzing each node by adopting an analysis flow matched with the node type to generate a corresponding configuration item.
configuration values submitted by a user on the management system for the configuration items are received.
and giving specific numerical values to the configuration items according to the configuration values to generate an example configuration file. So that the management system can manage the service instance via the instance profile.
in the embodiment of the present invention, when the service system manages the system during access, the user may also describe the service instance interface of the service system, and write definition information for the interface, so as to implement registration of the service instance. Specifically, the definition information may specifically include: an instance common configuration path; the example interface configures an interface path; the instance basic attribute is used for setting and storing basic information of the instance; the instance statistical data pull interface path and the configuration format are used for managing the statistical data of the pull instance of the system; and the instance interface definition description specification is used for realizing that the management system sends an operation instruction to the service instance.
and configuring the interfaces of the instances according to the definition information, and determining corresponding hypertext transfer protocol (HTTP) interfaces when the storage path rule is consistent with the interface return format, so that the management system can send an operation instruction to the service instances through the HTTP interfaces.
When the user modifies the service instance through the management system and generates the instance configuration file, the instance configuration file can be sent to the target address through the management system to manage the service instance. If the target address is the address of the storage system, the service instance can be automatically generated, and the automatic generation of the service instance is realized.
In the embodiment of the invention, the configuration items for the configuration of the user are generated based on the configuration template, and the configuration files required by the new service instance are generated according to the configuration values submitted by the user; the generated instance configuration file is not limited to a single format, the configuration template is modified to realize the expansion of the configuration items, the format needs to be readjusted, and the development cost brought by the expansion of new configuration is reduced. And through the definition information of the interface, the user can realize various management functions of the service instance by identifying and calling the interface through the management system.
In order to enable a person skilled in the art to better understand the embodiments of the present invention, the following describes the embodiments of the present invention by way of examples of three different usage scenarios:
description of service system access flow:
referring to fig. 7, basic information of the business system, such as name, product order number, etc., may be extracted; synchronized to the management system. And describing interface parameters by adopting the interface definition information (configuration specification), and synchronizing the created configuration template of the instance interface to the management system. And finally, the management system displays according to the synchronous interface definition information and the basic information of the service system so as to determine that the service system is accessed into the management system.
Create/update example flow description:
referring to fig. 8, the management system reads the configuration template of the service system creation instance, parses specific configuration items according to the configuration template, and combines the configuration items to generate a configuration (management) page. An administrator (user) fills in the configuration page with the configuration values for each configuration item and submits to the management system. And the management system sends the instance configuration file generated according to the configuration value to a designated address of the service system through the HTTP interface, and informs the service system to create a new service instance.
Flow description of management System control service instance:
referring to fig. 9, the service system synchronizes to the management system according to the interface definition information in the configuration template, the management system generates an interface call interface according to the interface definition information, initiates an interface call according to the interface parameters manually filled by the administrator, the management system sends an instance configuration file through the interface, and the service system receives the instance configuration file through the interface and performs processing.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 10, a block diagram of a service instance configuration management apparatus according to an embodiment of the present invention is shown, which may specifically include the following modules:
a first obtaining module 1001, configured to obtain a configuration template when managing a service instance, where the configuration template includes a node;
a traversal module 1002, configured to traverse the node, and determine a node type corresponding to the node;
the analysis module 1003 is configured to analyze the node according to the node type to generate a configuration item;
a first receiving module 1004 for receiving the submitted configuration values for the configuration items;
a configuration module 1005, configured to generate an instance configuration file according to the configuration value, so as to manage the service instance through the instance configuration file.
In an optional embodiment of the invention, the apparatus further comprises:
the checking module is used for checking whether the configuration item is matched with the configuration value;
a first execution module, configured to execute the step of generating the instance configuration file according to the configuration value when the configuration value is matched;
and the second execution module is used for feeding back the error identification when the error identification is not matched.
In an optional embodiment of the invention, the checking module comprises:
a checking submodule for checking whether there are matching configuration values for the configuration items, an
Whether the matched configuration value meets a preset data format or not;
the first feedback module is used for determining that the configuration item is matched with the configuration value when the configuration item has the matched configuration value and the matched configuration value meets a preset data format;
the second feedback module is used for determining that the configuration item is not matched with the configuration value when the configuration item does not have the matched configuration value or the matched configuration value does not meet a preset data format.
In an optional embodiment of the present invention, when there are multiple configuration items, the apparatus further includes:
and the combination module is used for generating a configuration management page for the configuration item.
In an optional embodiment of the present invention, the configuration template is a tree structure; the traversal module 1002 includes:
and the determining submodule is used for determining the type of the node as a leaf node or a non-leaf node.
In an optional embodiment of the present invention, when the type of the node is a leaf node, the parsing module 1003 includes:
the first analysis submodule is used for analyzing the configuration name and the content box corresponding to the leaf node; and combining the configuration name and the content box to generate a configuration item.
In an optional embodiment of the present invention, the first parsing sub-module includes:
the reading unit is used for reading the key words of the nodes and determining the configuration names;
and the creating unit is used for creating a content box matched with the configuration name according to the field of the node.
In an optional embodiment of the present invention, the configuration name corresponds to a configuration right, and the apparatus further includes:
the second acquisition module is used for acquiring management authority;
and the authority determining module is used for executing the step of combining the configuration name and the content box to generate the configuration item when the management authority is higher than the configuration authority.
In an optional embodiment of the present invention, the non-leaf node includes a list node, and the parsing module 1003 further includes:
the second analysis module is used for analyzing the list nodes to generate leaf nodes;
and the third analysis module is used for analyzing the leaf nodes and generating configuration items.
In an optional embodiment of the present invention, the non-leaf node further includes a dictionary node, and the parsing module 1003 further includes:
the fourth analysis module is used for recursively analyzing the dictionary nodes to generate the leaf nodes;
and the fifth analysis module is used for analyzing the leaf nodes and generating configuration items.
In an optional embodiment of the present invention, the configuration template further comprises an interface; the device further comprises:
a second receiving module, configured to receive definition information for the interface;
the interface determining module is used for determining a hypertext transfer protocol interface according to the definition information;
and the sending module is used for sending the instance configuration file to a target address through the hypertext transfer protocol interface.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, as shown in fig. 11, including:
a processor 1101 and a storage medium 1102, wherein the storage medium 1102 stores a computer program executable by the processor 1101, and when the electronic device runs, the processor 1101 executes the computer program to perform the method according to any one of the embodiments of the present invention. The specific implementation manner and technical effects are similar to those of the method embodiment, and are not described herein again.
An embodiment of the present invention further provides a computer-readable storage medium, as shown in fig. 12, where a computer program 1201 is stored on the storage medium, and when being executed by a processor, the computer program 1201 performs the method according to any one of the embodiments of the present invention. The specific implementation manner and technical effects are similar to those of the method embodiment, and are not described herein again.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The service instance configuration management method and device provided by the present invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (14)
1. A method for managing service instance configuration, comprising:
when the service instance is managed, acquiring a configuration template, wherein the configuration template comprises nodes;
traversing the nodes and determining the node types corresponding to the nodes;
analyzing the node according to the node type to generate a configuration item;
receiving configuration values submitted for the configuration items;
and generating an instance configuration file according to the configuration value so as to manage the service instance through the instance configuration file.
2. The method of claim 1, wherein prior to the step of generating an instance profile from the configuration values, the method further comprises:
checking whether the configuration item matches the configuration value;
when the configuration values are matched, executing the step of generating the instance configuration file according to the configuration values;
when not matched, an error identification is fed back.
3. The method of claim 2, wherein the step of checking whether the configuration item matches the configuration value comprises:
detecting whether there is a matching configuration value for the configuration item, an
Whether the matched configuration value meets a preset data format or not;
when the configuration item has a matched configuration value and the matched configuration value meets a preset data format, determining that the configuration item is matched with the configuration value;
when the configuration item has no matched configuration value or the matched configuration value does not meet a preset data format, determining that the configuration item is not matched with the configuration value.
4. The method of claim 3, wherein when there are a plurality of configuration items, the method further comprises:
and combining the configuration items to generate a configuration management page.
5. The method according to any of claims 1-4, wherein the configuration template is a tree structure; the step of determining the node type corresponding to the node comprises:
and determining the type of the node as a leaf node or a non-leaf node.
6. The method of claim 5, wherein when the type of the node is a leaf node, the step of parsing the node according to the type of the node and generating the configuration item comprises:
analyzing the configuration name and the content box corresponding to the leaf node; and combining the configuration name and the content box to generate a configuration item.
7. The method according to claim 6, wherein the step of parsing the configuration name and the content box corresponding to the leaf node comprises:
reading the key words of the nodes and determining a configuration name;
and creating a content box matched with the configuration name according to the field of the node.
8. The method of claim 6, wherein the configuration name corresponds to a configuration right, and the method further comprises:
acquiring management authority;
when the management authority is higher than the configuration authority, the step of combining the configuration name and the content box to generate a configuration item is executed.
9. The method of claim 6, wherein the non-leaf nodes comprise list nodes, wherein parsing the nodes according to the node type further comprises:
analyzing the list nodes to generate leaf nodes;
and analyzing the leaf nodes to generate configuration items.
10. The method of claim 9, wherein the non-leaf nodes further comprise dictionary nodes, wherein parsing the nodes according to the node type, and wherein generating configuration items further comprises:
recursively analyzing the dictionary nodes to generate the leaf nodes;
and analyzing the leaf nodes to generate configuration items.
11. The method of any of claims 1-4, wherein the configuration template further comprises an interface; the method further comprises the following steps:
receiving definition information for the interface;
determining a hypertext transfer protocol interface according to the definition information;
and sending the instance configuration file to a target address through the hypertext transfer protocol interface.
12. A service instance configuration management apparatus, comprising:
the system comprises a first acquisition module, a first management module and a second acquisition module, wherein the first acquisition module is used for acquiring a configuration template when aiming at service instance management, and the configuration template comprises nodes;
the traversal module is used for traversing the nodes and determining the node types corresponding to the nodes;
the analysis module is used for analyzing the nodes according to the node types to generate configuration items;
a first receiving module, configured to receive the submitted configuration value for the configuration item;
and the configuration module is used for generating an instance configuration file according to the configuration value so as to manage the service instance through the instance configuration file.
13. An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the service instance configuration management method according to any one of claims 1 to 11.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the service instance configuration management method according to any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210454994.9A CN114840213A (en) | 2022-04-24 | 2022-04-24 | Service instance configuration management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210454994.9A CN114840213A (en) | 2022-04-24 | 2022-04-24 | Service instance configuration management method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114840213A true CN114840213A (en) | 2022-08-02 |
Family
ID=82567094
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210454994.9A Pending CN114840213A (en) | 2022-04-24 | 2022-04-24 | Service instance configuration management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114840213A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116483948A (en) * | 2023-03-17 | 2023-07-25 | 深圳融易学教育科技有限公司 | Cloud computing-based SaaS operation and maintenance management method, system, device and storage medium |
CN116679990A (en) * | 2022-10-26 | 2023-09-01 | 荣耀终端有限公司 | Unified method for initializing service state and electronic equipment |
-
2022
- 2022-04-24 CN CN202210454994.9A patent/CN114840213A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116679990A (en) * | 2022-10-26 | 2023-09-01 | 荣耀终端有限公司 | Unified method for initializing service state and electronic equipment |
CN116679990B (en) * | 2022-10-26 | 2024-04-05 | 荣耀终端有限公司 | Unified method for initializing service state and electronic equipment |
CN116483948A (en) * | 2023-03-17 | 2023-07-25 | 深圳融易学教育科技有限公司 | Cloud computing-based SaaS operation and maintenance management method, system, device and storage medium |
CN116483948B (en) * | 2023-03-17 | 2023-10-20 | 深圳融易学教育科技有限公司 | Cloud computing-based SaaS operation and maintenance management method, system, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20180278494A1 (en) | Automated constructing method of cloud manufacturing service and cloud manufacturing system | |
US11080305B2 (en) | Relational log entry instituting system | |
US10621211B2 (en) | Language tag management on international data storage | |
JP7316349B2 (en) | Customizable enterprise automation test framework | |
CN113986226B (en) | Micro front end architecture based on qiankun and Web Component and construction method thereof | |
CN114840213A (en) | Service instance configuration management method and device | |
US20210334149A1 (en) | Api adapter creation device, api adapter creation method, and api adapter creation program | |
CN104657274B (en) | software interface test method and device | |
JP5949222B2 (en) | Operation management support apparatus, method and program | |
CN112463261B (en) | Interface calling method, device, electronic equipment, medium and product | |
CN113535587A (en) | Target application detection method and device and computer equipment | |
US20200379435A1 (en) | Method and electronic generation device for generating at least one configuration file for an automation tool, related computer program | |
CN117693734A (en) | Front-end item processing method, device, equipment, management system and storage medium | |
CN113885860A (en) | Method and equipment for automatically configuring management page to generate interface service | |
CN113721973A (en) | Configuration file generation method, device, equipment and medium | |
CN117667884A (en) | Data migration method, device, equipment and storage medium | |
US20210200833A1 (en) | Health diagnostics and analytics for object repositories | |
CN115357269A (en) | Configuration information updating method and device, computer equipment and storage medium | |
CN112765188B (en) | Configuration information processing method, configuration management system, electronic device and storage medium | |
KR101728786B1 (en) | Component-based dynamic image display system and method using the svg file format | |
CN109388400B (en) | Automatic page generation method and device | |
CN113312426A (en) | Data synchronization method, device, equipment and medium | |
CN111125565A (en) | Method and equipment for inputting information in application | |
US11960560B1 (en) | Methods for analyzing recurring accessibility issues with dynamic web site behavior and devices thereof | |
CN117077592B (en) | Regression data monitoring method, monitoring device and monitoring system |
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 |