Node parameter configuration method and device, processor and electronic device
By hierarchically dividing and mapping the parameters of nodes in the cloud architecture and generating target configuration files, the management and reuse problems of node configuration parameters in the cloud architecture are solved, and the accuracy of parameter configuration is improved.
Patent Information
- Application Number
- CN202211476409.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-11-23
AI Technical Summary
It is difficult to manage parameters and reuse parameters when configuring parameters from nodes in cloud architecture, resulting in the problem of repeated parameter configuration.
By obtaining multiple original parameters for hierarchical division, mapping them into configuration resources, and parsing the configuration resources, generating target configuration files, which are used to configure nodes in the cloud architecture.
It realizes convenient management and reuse of node parameters in the cloud architecture, avoids duplicate parameter configuration, and improves the accuracy of parameter configuration.
Smart Images

Figure CN115996171B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a node parameter configuration method and device, a processor, and an electronic device. Background Art
[0002] With the transformation of IT (Internet Technology) architecture, more and more businesses are deployed in cloud clusters. Moreover, the characteristics or advantages of cloud nodes are fast elastic expansion and contraction. For example, with the arrival of business peaks, cloud nodes can quickly expand a certain number of node replicas to cope with the impact of large traffic. In addition, in order to achieve rapid expansion of nodes, the startup time of the nodes is required to be as short as possible, and the parameters of the cloud nodes are configured through the traditional configuration center. However, the traditional configuration center is a centralized configuration center. In the scenario of batch node expansion, it is often limited by its architectural problems, resulting in slow node startup or pull failure, which makes it impossible to fully utilize the ability of the cloud cluster to quickly and elastically expand and contract. Therefore, in the related technology, most of the startup configurations of cloud nodes are no longer configured through the traditional configuration center, but directly rely on the parameter configuration mechanism provided by the K8S bottom layer to provide the most basic configuration capabilities.
[0003] However, the parameter configuration provided by the underlying K8S is only associated with a certain node at the logical level, which will lead to confusion in parameter management and make it difficult to manage. For example, businesses are generally composed of multiple nodes, and there are often various connections between the nodes, which often leads to configuration files always having certain connections to a greater or lesser extent. If the parameter configuration is not reasonably abstracted, it will lead to duplication, confusion and other problems in the parameter configuration.
[0004] In the related art, when configuring parameters for nodes in a cloud architecture, it is difficult to manage and reuse parameters, resulting in repeated parameter configuration for the nodes. Currently, no effective solution has been proposed. Summary of the invention
[0005] The main purpose of the present application is to provide a node parameter configuration method and device, processor and electronic device to solve the problem in the related technology that when configuring parameters for nodes in a cloud architecture, it is difficult to manage and reuse parameters, resulting in repeated parameter configuration of the nodes.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for configuring node parameters is provided. The method comprises: obtaining multiple target parameters, wherein the multiple target parameters are parameters obtained by dividing multiple original parameters into levels, the multiple original parameters are used to configure the parameters of nodes in the cloud architecture, and each target parameter corresponds to at least one level; mapping the multiple target parameters to configuration resources; parsing the configuration resources to obtain a target configuration file; and configuring the parameters of nodes in the cloud architecture according to the target configuration file.
[0007] Furthermore, parsing the configuration resources to obtain the target configuration file includes: determining a first parameter from the multiple original parameters, wherein the first parameter is used to perform parameter configuration on the target node in the cloud architecture; parsing the configuration resources to determine a second parameter corresponding to the first parameter among the multiple target parameters; determining a level corresponding to the second parameter; determining a third parameter based on the level corresponding to the second parameter; and obtaining the target configuration file based on the third parameter.
[0008] Further, based on the third parameter, obtaining the target configuration file includes: acquiring an original configuration file, wherein the original configuration file is a configuration file generated based on the multiple original parameters; replacing the first parameter in the original configuration file with the third parameter to obtain the target configuration file.
[0009] Furthermore, determining the third parameter based on the level corresponding to the second parameter includes: if the second parameter corresponds to multiple levels, determining the applicable scope of each level; based on the applicable scope of each level, obtaining the parameter corresponding to the level with the smallest applicable scope; and using the parameter corresponding to the level with the smallest applicable scope as the third parameter.
[0010] Furthermore, obtaining a plurality of target parameters includes: obtaining the plurality of original parameters; determining an application scenario of the node; and hierarchically processing the plurality of original parameters according to the application scenario of the node to obtain the plurality of target parameters.
[0011] Furthermore, after performing hierarchical processing on the original parameters to obtain the multiple target parameters, the method also includes: obtaining a first quantity of the multiple target parameters; obtaining the multiple target parameters through a cluster in the cloud architecture; determining a second quantity of the multiple target parameters obtained by the cluster; determining whether the first quantity is the same as the second quantity; if the first quantity is the same as the second quantity, executing the step of mapping the multiple target parameters into configuration resources.
[0012] Furthermore, after mapping the multiple target parameters to configuration resources, the method also includes: determining whether the configuration resources are encrypted; if the configuration resources are encrypted, decrypting the configuration resources to obtain the decrypted configuration resources; parsing the decrypted configuration resources to obtain the target configuration file; if the configuration resources are not encrypted, directly parsing the configuration resources to obtain the target configuration file.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a node parameter configuration device is provided. The device comprises: a first acquisition unit, used to acquire multiple target parameters, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, the multiple original parameters are used to perform parameter configuration on nodes in a cloud architecture, and each target parameter corresponds to at least one hierarchy; a first mapping unit, used to map the multiple target parameters to configuration resources; a first parsing unit, used to parse the configuration resources to obtain a target configuration file; a first configuration unit, used to perform parameter configuration on nodes in a cloud architecture according to the target configuration file.
[0014] Furthermore, the first parsing unit includes: a first determination module, used to determine a first parameter from the multiple original parameters, wherein the first parameter is used to perform parameter configuration on a target node in the cloud architecture; a second determination module, used to parse the configuration resources and determine a second parameter corresponding to the first parameter among the multiple target parameters; a third determination module, used to determine a level corresponding to the second parameter; a fourth determination module, used to determine a third parameter based on the level corresponding to the second parameter; and a fifth determination module, used to obtain the target configuration file based on the third parameter.
[0015] Furthermore, the fifth determination module includes: a first acquisition submodule, used to acquire an original configuration file, wherein the original configuration file is a configuration file generated based on the multiple original parameters; a first replacement submodule, used to replace the first parameter in the original configuration file with the third parameter to obtain the target configuration file.
[0016] Furthermore, the fourth determination module includes: a first determination submodule, used to determine the applicable scope of each level if the second parameter corresponds to multiple levels; a second determination submodule, used to obtain the parameter corresponding to the level with the smallest applicable scope based on the applicable scope of each level; and a third determination submodule, used to use the parameter corresponding to the level with the smallest applicable scope as the third parameter.
[0017] Furthermore, the first acquisition unit includes: a first acquisition module, used to acquire the multiple original parameters; a sixth determination module, used to determine the application scenario of the node; and a first processing module, used to perform hierarchical processing on the multiple original parameters according to the application scenario of the node to obtain the multiple target parameters.
[0018] Furthermore, the device also includes: a second acquisition unit, used to acquire a first quantity of the multiple target parameters after performing hierarchical processing on the original parameters to obtain the multiple target parameters; a third acquisition unit, used to acquire the multiple target parameters through the cluster in the cloud architecture; a first determination unit, used to determine a second quantity of the multiple target parameters acquired by the cluster; a first judgment unit, used to judge whether the first quantity is the same as the second quantity; and a first execution unit, used to execute the step of mapping the multiple target parameters into configuration resources if the first quantity is the same as the second quantity.
[0019] Furthermore, the device also includes: a second judgment unit, used to judge whether the configuration resource is encrypted after mapping the multiple target parameters to the configuration resource; a first processing unit, used to decrypt the configuration resource if the configuration resource is encrypted to obtain the decrypted configuration resource; a second parsing unit, used to parse the decrypted configuration resource to obtain the target configuration file; and a third parsing unit, used to directly parse the configuration resource to obtain the target configuration file if the configuration resource is not encrypted.
[0020] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned node parameter configuration methods when running.
[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, which includes one or more processors and a memory, and the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the node parameter configuration method described in any one of the above-mentioned items.
[0022] Through this application, the following steps are adopted: obtaining multiple target parameters, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, and the multiple original parameters are used to configure parameters of nodes in the cloud architecture, and each target parameter corresponds to at least one level; mapping multiple target parameters to configuration resources; parsing the configuration resources to obtain a target configuration file; and configuring the nodes in the cloud architecture according to the target configuration file, thereby solving the problem that it is difficult to manage parameters and reuse parameters when configuring parameters of nodes in the cloud architecture in the related technology, resulting in repeated parameter configuration of nodes. By hierarchically dividing multiple parameters used to configure parameters of nodes in the cloud architecture, obtaining the parameters after hierarchical division, and mapping the parameters after hierarchical division to configuration resources, and then parsing the configuration resources to obtain the target configuration file, and configuring the nodes in the cloud architecture according to the target configuration file, so that when configuring parameters of nodes in the cloud architecture, it is convenient to manage parameters and reuse parameters, and at the same time avoid repeated parameter configuration of nodes, thereby achieving the effect of improving the accuracy of parameter configuration of nodes in the cloud architecture. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0024] Figure 1 is a flowchart of a node parameter configuration method provided according to an embodiment of the present application;
[0025] Figure 2 It is a schematic diagram of a management solution for hierarchical parameters based on the K8S parameter configuration mechanism in an embodiment of the present application;
[0026] Figure 3 The process of the node parameter configuration method provided in the embodiment of the present application is as follows Figure 1 ;
[0027] Figure 4 The process of the node parameter configuration method provided in the embodiment of the present application is as follows Figure 2 ;
[0028] Figure 5 The process of the node parameter configuration method provided in the embodiment of the present application is as follows Figure 3 ;
[0029] Figure 6 is a schematic diagram of a node parameter configuration device provided according to an embodiment of the present application;
[0030] Figure 7 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0032] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0035] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0036] Kubernetes: K8S for short, which is an abbreviation formed by replacing the eight characters in the middle of the name "ubernete" with "8". It is an application software, and an open source, used to manage containerized applications on multiple hosts in a cloud platform.
[0037] Pod is the smallest scheduling unit in Kubernetes. A Pod encapsulates a container (or multiple containers). The containers in the Pod share storage, network, etc. In other words, the entire pod can be regarded as a virtual machine, and each container is equivalent to a process running in the virtual machine. All containers in the same pod are arranged and scheduled uniformly.
[0038] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flowchart of a node parameter configuration method provided in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0039] Step S101, obtaining multiple target parameters, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, the multiple original parameters are used to configure parameters of nodes in the cloud architecture, and each target parameter corresponds to at least one level.
[0040] For example, Figure 2 It is a schematic diagram of a management solution for hierarchical parameters based on the K8S parameter configuration mechanism in an embodiment of the present application, such as Figure 2 As shown, the hierarchical parameter management solution based on the K8S parameter configuration mechanism mainly includes the following functional modules: parameter management function, parameter distribution agent and parameter parsing agent. The hierarchical parameters are defined through the parameter management function, that is, a specific parameter hierarchy system is defined. In other words, the parameter system (the above-mentioned multiple original parameters) can be divided into application level, service environment level (business node deployment environment), and node level. The scope of application of parameter configuration decreases successively, and the priority of parameter configuration increases successively. By grading the parameters, parameter management and parameter reuse are facilitated.
[0041] Step S102: Map multiple target parameters to configuration resources.
[0042] For example, the divided hierarchical parameters (the above-mentioned target parameters) are mapped to the parameter system provided by the underlying cloud architecture through the parameter distribution agent. Specifically, the hierarchical parameters are mapped to the underlying configuration resources (similar to the role of cache), that is, the hierarchical parameters are mapped to the underlying configuration resources that the cluster can understand, so that they can be quickly pulled and used when the container is started. For example, for a cluster with a K8S architecture at the bottom, the "hierarchical parameter metadata" can be mapped to a Configmap (a format of underlying configuration resources) or Secret (another format of underlying configuration resources) with a certain structure, so that the Pod container can be directly mounted and used when it is started.
[0043] Step S103, parsing the configuration resource to obtain a target configuration file.
[0044] For example, the mapped "underlying configuration resources" are parsed through the parameter parsing agent. Specifically, if the parameter hierarchy is application level > service environment level > node level, and when variables (parameters) are defined in all three levels, the parameters configured at the node level are used first, and the variables (parameters) with special identifiers in the configuration file are replaced to obtain the configuration file after the variables (parameters) are replaced (the target configuration file mentioned above).
[0045] Step S104, configuring parameters of nodes in the cloud architecture according to the target configuration file.
[0046] For example, according to the configuration file after replacing the variables (parameters), the parameters of the nodes in the cloud architecture are configured.
[0047] Through the above steps S101 to S104, a plurality of parameters for configuring parameters of nodes in a cloud architecture are hierarchically divided to obtain the hierarchically divided parameters, and the hierarchically divided parameters are mapped to configuration resources, and then the configuration resources are parsed to obtain a target configuration file, and according to the target configuration file, the nodes in the cloud architecture are configured with parameters, so that when configuring parameters of the nodes in the cloud architecture, the parameters can be conveniently managed and reused, and repeated parameter configuration of the nodes can be avoided, thereby achieving the effect of improving the accuracy of parameter configuration of the nodes in the cloud architecture.
[0048] In order to quickly and accurately obtain multiple target parameters, in the node parameter configuration method provided in the embodiment of the present application, multiple target parameters can also be obtained through the following steps: obtaining multiple original parameters; determining the application scenario of the node; and hierarchically processing the multiple original parameters according to the application scenario of the node to obtain multiple target parameters.
[0049] For example, the parameter management function is mainly responsible for the following four parts:
[0050] (1) Define hierarchical parameters: Define a specific parameter hierarchical system. This part can be customized according to specific application scenarios. For example, the parameter system can be divided into application level, service environment level (business node deployment environment), and node level. The scope of application of parameter configuration decreases in sequence, and the priority of parameter configuration increases in sequence. By grading parameters, parameter management and parameter reuse are facilitated.
[0051] (2) Define the storage method of parameters: According to the specific architecture of the application, you can choose the appropriate parameter metadata storage method.
[0052] (3) Define the operation method of parameters: define the interface exposed to the outside world for parameter operations.
[0053] (4) Call the underlying parameter delivery agent to complete the mapping of hierarchical parameter metadata to underlying cluster configuration resources.
[0054] Through the above scheme, the parameters are graded, and the parameters can be easily managed and reused.
[0055] In order to quickly and accurately map multiple target parameters to configuration resources, in the node parameter configuration method provided in the embodiment of the present application, multiple target parameters can also be mapped to configuration resources through the following steps: obtaining a first number of multiple target parameters; obtaining multiple target parameters through a cluster in a cloud architecture; determining a second number of multiple target parameters obtained by the cluster; determining whether the first number is the same as the second number; if the first number is the same as the second number, executing the step of mapping multiple target parameters to configuration resources.
[0056] For example, the parameter delivery agent function is mainly responsible for the following three parts:
[0057] (1) Pulling hierarchical parameter metadata in real time for reconciliation: Pulling hierarchical parameters in real time through the cluster in the cloud architecture for reconciliation. For example, if the number of hierarchical parameters after classification is the same as the number of hierarchical parameters pulled in real time by the cluster in the cloud architecture, the hierarchical parameters are mapped to the underlying configuration resources; if the number of hierarchical parameters after classification is different from the number of hierarchical parameters pulled in real time by the cluster in the cloud architecture, the hierarchical parameters are re-pulled through the cluster in the cloud architecture until the number of hierarchical parameters pulled by the cluster in the cloud architecture is the same.
[0058] (2) Mapping hierarchical parameters to the parameter system provided by the underlying cloud architecture: Map hierarchical parameters to underlying configuration resources (similar to the role of cache) so that they can be quickly pulled and used when the container is started. For example, for a cluster with a K8S architecture at the bottom, the "hierarchical parameter metadata" can be mapped to a Configmap (a format of underlying configuration resources) or Secret (another format of underlying configuration resources) with a certain structure so that the Pod can be directly mounted and used when it is started.
[0059] (3) Map the parameter mechanism provided by the underlying cloud architecture to hierarchical parameters: Map the underlying configuration resources to hierarchical parameters and expose hierarchical parameter query interfaces to the outside world, so that the underlying cloud architecture can be decoupled from the parameter management function.
[0060] Through the above solution, the hierarchical parameter management plane is separated from the underlying cloud architecture, which facilitates the flexible replacement of the cloud architecture without replacing the hierarchical parameter system. In addition, by pulling hierarchical parameter metadata in real time for reconciliation, the fault tolerance of the entire program can be improved.
[0061] In order to quickly and accurately obtain the target configuration file, in the node parameter configuration method provided in the embodiment of the present application, the target configuration file can also be obtained by the following steps: determining whether the configuration resource is encrypted; if the configuration resource is encrypted, decrypting the configuration resource to obtain the decrypted configuration resource; parsing the decrypted configuration resource to obtain the target configuration file; if the configuration resource is not encrypted, directly parsing the configuration resource to obtain the target configuration file.
[0062] For example, the parameter parsing proxy function is mainly responsible for the following three parts:
[0063] (1) Parse the mapped “underlying configuration resources”: For example, when the parameter hierarchy is application level, service environment level, and node level, when variables (parameters) are defined in all three levels, the parameters configured at the node level are used first.
[0064] (2) Parsing of special configurations such as encrypted configurations and special symbols: First determine whether the configuration resource is encrypted. If the configuration resource is encrypted, decrypt the configuration resource, parse the decrypted configuration resource, and obtain the configuration file (the above-mentioned target configuration file); if the configuration resource is not encrypted, parse the configuration resource directly and obtain the configuration file (the above-mentioned target configuration file). In addition, the configuration resource containing special symbols can also be parsed to obtain the configuration file (the above-mentioned target configuration file).
[0065] (3) Replace the application configuration file according to the hierarchical parameters obtained by reverse analysis: For example, when the parameter hierarchy system is application level > service environment level > node level, when variables (parameters) are defined in all three levels, the parameters configured at the node level are used first and replace the specially marked variables (parameters) in the configuration file.
[0066] Through the above solution, the underlying configuration resources can be parsed quickly and accurately, and the configuration file used to configure the parameters of the nodes in the cloud architecture can be obtained.
[0067] Figure 3 The process of the node parameter configuration method provided in the embodiment of the present application is as follows Figure 1 ,like Figure 3 As shown, in the node parameter configuration method provided in the embodiment of the present application, the configuration resource is parsed to obtain the target configuration file including:
[0068] Step S301, determining a first parameter from a plurality of original parameters, wherein the first parameter is used to perform parameter configuration on a target node in a cloud architecture;
[0069] Step S302, parsing the configuration resource to determine a second parameter corresponding to the first parameter among the multiple target parameters;
[0070] Step S303, determining the level corresponding to the second parameter;
[0071] Step S304, determining a third parameter according to the level corresponding to the second parameter;
[0072] Step S305: obtaining a target configuration file based on the third parameter.
[0073] For example, the underlying configuration resources are parsed through a parameter parsing agent, and based on the hierarchy of the hierarchical parameters, the parameters required for parameter configuration of a node in the cloud architecture (the target node mentioned above) are determined from the hierarchical parameters, and the parameters required for parameter configuration of the nodes in the cloud architecture determined from the hierarchical parameters are used to obtain the configuration file ultimately used for parameter configuration of the nodes in the cloud architecture.
[0074] In summary, a configuration file for configuring parameters of nodes in a cloud architecture can be obtained quickly and accurately.
[0075] Figure 4 The process of the node parameter configuration method provided in the embodiment of the present application is as follows Figure 2 ,like Figure 4 As shown, in the node parameter configuration method provided in the embodiment of the present application, determining the third parameter according to the level corresponding to the second parameter includes:
[0076] Step S401, if the second parameter corresponds to multiple levels, determine the applicable scope of each level;
[0077] Step S402, according to the applicable scope of each level, obtaining the parameters corresponding to the level with the smallest applicable scope;
[0078] Step S403: taking the parameter corresponding to the level with the smallest applicable scope as the third parameter.
[0079] For example, when the parameter hierarchy is application level>service environment level>node level, and when variables (parameters) are defined in all three levels, the parameters with the smallest application scope are used first, that is, the parameters configured at the node level are used first. That is, the parameters configured at the node level are used as the third parameters mentioned above.
[0080] In summary, according to the applicable scope of parameter configuration, the parameters required for parameter configuration of nodes in the cloud architecture can be quickly and accurately determined from the hierarchical parameters after classification.
[0081] Figure 5 The process of the node parameter configuration method provided in the embodiment of the present application is as follows Figure 3 ,like Figure 5As shown, in the parameter configuration method of the node provided in the embodiment of the present application, based on the third parameter, obtaining the target configuration file includes:
[0082] Step S501, obtaining an original configuration file, wherein the original configuration file is a configuration file generated according to a plurality of original parameters;
[0083] Step S502: Replace the first parameter in the original configuration file with the third parameter to obtain a target configuration file.
[0084] For example, a parameter required for configuring the nodes in the cloud architecture in the original configuration file is replaced, and the parameter is replaced with a parameter required for configuring the nodes in the cloud architecture determined from the hierarchical level parameters.
[0085] Through the above scheme, the parameters required for parameter configuration of nodes in the cloud architecture in the original configuration file are replaced, so that the configuration file used for parameter configuration of nodes in the cloud architecture can be obtained quickly and accurately.
[0086] Through the method provided in the embodiment of the present application, for example, the parameter system can be divided into application level, service environment level (business node deployment environment), and node level through the parameter management function. In addition, according to the above-mentioned hierarchical division, the scope of application of parameter configuration decreases successively, and the priority of parameter configuration effect increases successively. Then, the hierarchical parameters are mapped to the underlying configuration resources through the parameter distribution agent, and then the mapped underlying configuration resources are parsed through the parameter parsing agent, and the parameters required for parameter configuration of the nodes in the cloud architecture are determined from the hierarchical parameters after classification, and then the parameters required for parameter configuration of the nodes in the cloud architecture in the original configuration file are replaced with the parameters determined from the hierarchical parameters after classification, and finally a new configuration file is obtained, and this configuration file is used to configure the nodes in the cloud architecture.
[0087] In summary, the parameter configuration method of the node provided in the embodiment of the present application obtains multiple target parameters, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, and the multiple original parameters are used to configure the parameters of the nodes in the cloud architecture, and each target parameter corresponds to at least one level; the multiple target parameters are mapped to configuration resources; the configuration resources are parsed to obtain the target configuration file; according to the target configuration file, the nodes in the cloud architecture are configured with parameters, which solves the problem that it is difficult to manage parameters and reuse parameters when configuring parameters of nodes in the cloud architecture in the related technology, resulting in repeated parameter configuration of the nodes. By hierarchically dividing multiple parameters used to configure parameters of nodes in the cloud architecture, the parameters after hierarchical division are obtained, and the parameters after hierarchical division are mapped to configuration resources, and then the configuration resources are parsed to obtain the target configuration file, and according to the target configuration file, the nodes in the cloud architecture are configured with parameters, so that when configuring parameters of nodes in the cloud architecture, the parameters can be conveniently managed and reused, and the repeated parameter configuration of the nodes can be avoided, thereby achieving the effect of improving the accuracy of parameter configuration of nodes in the cloud architecture.
[0088] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0089] The embodiment of the present application also provides a node parameter configuration device. It should be noted that the node parameter configuration device of the embodiment of the present application can be used to execute the node parameter configuration method provided by the embodiment of the present application. The node parameter configuration device provided by the embodiment of the present application is introduced below.
[0090] Figure 6 Schematic diagram of a node parameter configuration device according to an embodiment of the present application. Figure 6 As shown, the device includes: a first acquisition unit 601, a first mapping unit 602, a first parsing unit 603 and a first configuration unit 604.
[0091] Specifically, the first acquisition unit 601 is used to acquire multiple target parameters, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, the multiple original parameters are used to configure parameters of nodes in the cloud architecture, and each target parameter corresponds to at least one level;
[0092] A first mapping unit 602, configured to map a plurality of target parameters into configuration resources;
[0093] A first parsing unit 603 is used to parse the configuration resource to obtain a target configuration file;
[0094] The first configuration unit 604 is used to perform parameter configuration on the nodes in the cloud architecture according to the target configuration file.
[0095] In summary, the node parameter configuration device provided in the embodiment of the present application obtains multiple target parameters through the first acquisition unit 601, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, and the multiple original parameters are used to perform parameter configuration on the nodes in the cloud architecture, and each target parameter corresponds to at least one level; the first mapping unit 602 maps the multiple target parameters to configuration resources; the first parsing unit 603 parses the configuration resources to obtain a target configuration file; the first configuration unit 604 performs parameter configuration on the nodes in the cloud architecture according to the target configuration file, which solves the problem in the related art that when configuring parameters for nodes in the cloud architecture, it is difficult to manage parameters and reuse parameters, resulting in repeated parameter configuration of the nodes. By hierarchically dividing multiple parameters used to configure parameters of nodes in a cloud architecture, the hierarchically divided parameters are obtained, and the hierarchically divided parameters are mapped to configuration resources, and then the configuration resources are parsed to obtain a target configuration file, and according to the target configuration file, the parameters of the nodes in the cloud architecture are configured. When configuring parameters of the nodes in the cloud architecture, the parameters can be conveniently managed and reused, and repeated parameter configuration of the nodes can be avoided, thereby achieving the effect of improving the accuracy of parameter configuration of the nodes in the cloud architecture.
[0096] Optionally, in the node parameter configuration device provided in the embodiment of the present application, the first parsing unit includes: a first determination module, used to determine a first parameter from multiple original parameters, wherein the first parameter is used to perform parameter configuration on a target node in a cloud architecture; a second determination module, used to parse the configuration resources and determine a second parameter corresponding to the first parameter among multiple target parameters; a third determination module, used to determine a level corresponding to the second parameter; a fourth determination module, used to determine a third parameter based on the level corresponding to the second parameter; and a fifth determination module, used to obtain a target configuration file based on the third parameter.
[0097] Optionally, in the parameter configuration device of the node provided in the embodiment of the present application, the fifth determination module includes: a first acquisition sub-module, used to obtain an original configuration file, wherein the original configuration file is a configuration file generated based on multiple original parameters; a first replacement sub-module, used to replace the first parameter in the original configuration file with a third parameter to obtain a target configuration file.
[0098] Optionally, in the parameter configuration device of the node provided in the embodiment of the present application, the fourth determination module includes: a first determination submodule, used to determine the applicable scope of each level if the second parameter corresponds to multiple levels; a second determination submodule, used to obtain the parameter corresponding to the level with the smallest applicable scope based on the applicable scope of each level; and a third determination submodule, used to use the parameter corresponding to the level with the smallest applicable scope as the third parameter.
[0099] Optionally, in the node parameter configuration device provided in the embodiment of the present application, the first acquisition unit includes: a first acquisition module, used to acquire multiple original parameters; a sixth determination module, used to determine the application scenario of the node; and a first processing module, used to perform hierarchical processing on the multiple original parameters according to the application scenario of the node to obtain multiple target parameters.
[0100] Optionally, in the parameter configuration device of the node provided in the embodiment of the present application, the device also includes: a second acquisition unit, used to obtain a first number of multiple target parameters after hierarchically processing the original parameters to obtain multiple target parameters; a third acquisition unit, used to obtain multiple target parameters through a cluster in a cloud architecture; a first determination unit, used to determine a second number of multiple target parameters obtained by the cluster; a first judgment unit, used to judge whether the first number is the same as the second number; and a first execution unit, used to execute the step of mapping multiple target parameters into configuration resources if the first number is the same as the second number.
[0101] Optionally, in the parameter configuration device of the node provided in the embodiment of the present application, the device also includes: a second judgment unit, used to judge whether the configuration resource is encrypted after mapping multiple target parameters to the configuration resource; a first processing unit, used to decrypt the configuration resource if the configuration resource is encrypted, to obtain the decrypted configuration resource; a second parsing unit, used to parse the decrypted configuration resource to obtain the target configuration file; a third parsing unit, used to directly parse the configuration resource to obtain the target configuration file if the configuration resource is not encrypted.
[0102] The parameter configuration device of the node includes a processor and a memory. The above-mentioned first acquisition unit 601, first mapping unit 602, first parsing unit 603 and first configuration unit 604 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0103] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the accuracy of parameter configuration of nodes in the cloud architecture can be improved by adjusting kernel parameters.
[0104] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0105] An embodiment of the present invention provides a processor, which is used to run a program, wherein the parameter configuration method of the node is executed when the program is running.
[0106] like Figure 7 As shown, an embodiment of the present invention provides an electronic device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: obtaining multiple target parameters, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, and the multiple original parameters are used to perform parameter configuration on nodes in a cloud architecture, and each target parameter corresponds to at least one hierarchy; mapping the multiple target parameters to configuration resources; parsing the configuration resources to obtain a target configuration file; and performing parameter configuration on nodes in the cloud architecture according to the target configuration file.
[0107] When the processor executes the program, the following steps are also implemented: parsing the configuration resources to obtain a target configuration file, including: determining a first parameter from the multiple original parameters, wherein the first parameter is used to perform parameter configuration on a target node in the cloud architecture; parsing the configuration resources to determine a second parameter corresponding to the first parameter among the multiple target parameters; determining a level corresponding to the second parameter; determining a third parameter based on the level corresponding to the second parameter; and obtaining the target configuration file based on the third parameter.
[0108] When the processor executes the program, the following steps are also implemented: based on the third parameter, obtaining the target configuration file includes: obtaining an original configuration file, wherein the original configuration file is a configuration file generated based on the multiple original parameters; replacing the first parameter in the original configuration file with the third parameter to obtain the target configuration file.
[0109] When the processor executes the program, the following steps are also implemented: determining the third parameter based on the level corresponding to the second parameter includes: if the second parameter corresponds to multiple levels, determining the applicable scope of each level; based on the applicable scope of each level, obtaining the parameter corresponding to the level with the smallest applicable scope; and using the parameter corresponding to the level with the smallest applicable scope as the third parameter.
[0110] When the processor executes the program, the following steps are also implemented: obtaining multiple target parameters includes: obtaining the multiple original parameters; determining the application scenario of the node; and hierarchically processing the multiple original parameters according to the application scenario of the node to obtain the multiple target parameters.
[0111] When the processor executes the program, the following steps are also implemented: after the original parameters are graded to obtain the multiple target parameters, the method also includes: obtaining a first quantity of the multiple target parameters; obtaining the multiple target parameters through a cluster in the cloud architecture; determining a second quantity of the multiple target parameters obtained by the cluster; determining whether the first quantity is the same as the second quantity; if the first quantity is the same as the second quantity, executing the step of mapping the multiple target parameters into configuration resources.
[0112] When the processor executes the program, the following steps are also implemented: after mapping the multiple target parameters to configuration resources, the method also includes: determining whether the configuration resources are encrypted; if the configuration resources are encrypted, decrypting the configuration resources to obtain the decrypted configuration resources; parsing the decrypted configuration resources to obtain the target configuration file; if the configuration resources are not encrypted, directly parsing the configuration resources to obtain the target configuration file.
[0113] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0114] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: obtaining multiple target parameters, wherein the multiple target parameters are parameters obtained after hierarchical division of multiple original parameters, and the multiple original parameters are used to perform parameter configuration on nodes in a cloud architecture, and each target parameter corresponds to at least one level; mapping the multiple target parameters to configuration resources; parsing the configuration resources to obtain a target configuration file; and performing parameter configuration on nodes in the cloud architecture according to the target configuration file.
[0115] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: parsing the configuration resource to obtain a target configuration file including: determining a first parameter from the multiple original parameters, wherein the first parameter is used to perform parameter configuration on a target node in the cloud architecture; parsing the configuration resource to determine a second parameter corresponding to the first parameter among the multiple target parameters; determining a level corresponding to the second parameter; determining a third parameter based on the level corresponding to the second parameter; and obtaining the target configuration file based on the third parameter.
[0116] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: based on the third parameter, obtaining the target configuration file includes: obtaining an original configuration file, wherein the original configuration file is a configuration file generated based on the multiple original parameters; replacing the first parameter in the original configuration file with the third parameter to obtain the target configuration file.
[0117] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: determining the third parameter according to the level corresponding to the second parameter, including: if the second parameter corresponds to multiple levels, determining the applicable scope of each level; according to the applicable scope of each level, obtaining the parameter corresponding to the level with the smallest applicable scope; and using the parameter corresponding to the level with the smallest applicable scope as the third parameter.
[0118] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: obtaining multiple target parameters includes: obtaining the multiple original parameters; determining the application scenario of the node; and hierarchically processing the multiple original parameters according to the application scenario of the node to obtain the multiple target parameters.
[0119] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: after the original parameters are graded to obtain the multiple target parameters, the method also includes: obtaining a first number of the multiple target parameters; obtaining the multiple target parameters through a cluster in the cloud architecture; determining a second number of the multiple target parameters obtained by the cluster; determining whether the first number is the same as the second number; if the first number is the same as the second number, executing the step of mapping the multiple target parameters into configuration resources.
[0120] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: after mapping the multiple target parameters to configuration resources, the method also includes: determining whether the configuration resources are encrypted; if the configuration resources are encrypted, decrypting the configuration resources to obtain the decrypted configuration resources; parsing the decrypted configuration resources to obtain the target configuration file; if the configuration resources are not encrypted, directly parsing the configuration resources to obtain the target configuration file.
[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0125] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0126] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0127] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0128] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0130] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A node parameter configuration method, characterized in that: include: Acquire multiple target parameters, wherein the multiple target parameters are parameters obtained by dividing multiple original parameters into levels, the multiple original parameters are used to configure parameters of nodes in the cloud architecture, and each target parameter corresponds to at least one level; mapping the plurality of target parameters into configuration resources; Parsing the configuration resource to obtain a target configuration file; According to the target configuration file, parameter configuration is performed on nodes in the cloud architecture; The configuration resource is parsed to obtain the target configuration file including: Determine a first parameter from the multiple original parameters, wherein the first parameter is used to perform parameter configuration on a target node in the cloud architecture; Parsing the configuration resource to determine a second parameter corresponding to the first parameter among the multiple target parameters; determining a level corresponding to the second parameter; Determining a third parameter according to the level corresponding to the second parameter; Based on the third parameter, obtaining the target configuration file; Wherein, determining the third parameter according to the level corresponding to the second parameter includes: If the second parameter corresponds to multiple levels, determining the applicable scope of each level; According to the applicable scope of each level, the parameters corresponding to the level with the smallest applicable scope are obtained; The parameter corresponding to the level with the smallest applicable scope is used as the third parameter.
2. The method according to claim 1, characterized in that Based on the third parameter, obtaining the target configuration file includes: Obtaining an original configuration file, wherein the original configuration file is a configuration file generated according to the multiple original parameters; The first parameter in the original configuration file is replaced by the third parameter to obtain the target configuration file.
3. The method according to claim 1, characterized in that Get multiple target parameters including: Acquire the multiple original parameters; Determining an application scenario of the node; According to the application scenario of the node, the multiple original parameters are graded to obtain the multiple target parameters.
4. The method according to claim 3, characterized in that After the original parameters are graded to obtain the plurality of target parameters, the method further includes: Acquire a first quantity of the plurality of target parameters; Acquire the plurality of target parameters through a cluster in the cloud architecture; determining a second number of the plurality of target parameters acquired by the cluster; determining whether the first quantity is the same as the second quantity; If the first number is the same as the second number, a step of mapping the plurality of target parameters to configuration resources is performed.
5. The method according to claim 1, characterized in that After mapping the plurality of target parameters to configuration resources, the method further comprises: Determining whether the configuration resource is encrypted; If the configuration resource has been encrypted, decrypting the configuration resource to obtain a decrypted configuration resource; Parsing the decrypted configuration resource to obtain the target configuration file; If the configuration resource is not encrypted, the configuration resource is directly parsed to obtain the target configuration file.
6. A node parameter configuration device, characterized in that: include: A first acquisition unit is used to acquire a plurality of target parameters, wherein the plurality of target parameters are parameters obtained by dividing a plurality of original parameters into levels, the plurality of original parameters are used to perform parameter configuration on nodes in the cloud architecture, and each target parameter corresponds to at least one level; A first mapping unit, configured to map the plurality of target parameters into configuration resources; A first parsing unit, configured to parse the configuration resource to obtain a target configuration file; A first configuration unit, configured to perform parameter configuration on nodes in the cloud architecture according to the target configuration file; The first parsing unit includes: a first determination module for determining a first parameter from the plurality of original parameters, wherein the first parameter is used to configure parameters of a target node in the cloud architecture; a second determination module for parsing the configuration resource to determine a second parameter corresponding to the first parameter among the plurality of target parameters; a third determination module for determining a level corresponding to the second parameter; a fourth determination module for determining a third parameter according to the level corresponding to the second parameter; and a fifth determination module for obtaining the target configuration file based on the third parameter. Among them, the fourth determination module includes: a first determination submodule, used to determine the applicable scope of each level if the second parameter corresponds to multiple levels; a second determination submodule, used to obtain the parameter corresponding to the level with the smallest applicable scope based on the applicable scope of each level; a third determination submodule, used to use the parameter corresponding to the level with the smallest applicable scope as the third parameter.
7. A processor, characterized in that: The processor is used to run a program, wherein the program executes the node parameter configuration method described in any one of claims 1 to 5 when running.
8. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the node parameter configuration method described in any one of claims 1 to 5.
