Cloud platform control method and device, electronic equipment, storage medium and program product
By selecting target nodes in the cloud platform, merging personalized and static configuration files, and generating target configuration files, the problem of flexibility when different modules run on different nodes is solved, and the operational flexibility and fluency of the cloud platform are improved.
Patent Information
- Application Number
- CN202410866512.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
AI Technical Summary
Different modules in the cloud platform have poor flexibility when running on different nodes, resulting in complex configuration parameter updates and affecting operational flexibility.
By selecting the target node in the cloud platform, the personalized parameter files and static configuration files are obtained, merged and matched, and a target configuration file is generated, which is used to configure the modules to be run and ensure their normal operation on different nodes.
It improves the configuration flexibility and fluency of modules to be run on different nodes, and improves the overall operating flexibility of the cloud platform.
Smart Images

Figure CN118733142A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud platform control, and in particular to a cloud platform control method, device, electronic device, storage medium and program product. Background Art
[0002] At present, a cloud platform usually includes many running modules. When executing different control instructions, the cloud platform may use different running modules to run on different running nodes. The configuration parameters required by different running modules on different running nodes may be different, resulting in the need to update and adjust the configuration parameters of the running modules one by one each time the running modules run to a new node. The entire running process is complicated, and the flexibility in configuring the configuration parameters of the running modules on different nodes is poor, resulting in poor flexibility of the cloud platform when it actually runs to different nodes. Summary of the invention
[0003] Embodiments of the present invention provide a cloud platform control method, device, electronic device, storage medium and program product to at least solve the technical problem in the related art that different modules of the cloud platform have poor flexibility when running on different nodes.
[0004] According to one aspect of an embodiment of the present invention, a cloud platform control method is provided, comprising: based on the module identifier of a module to be run in the cloud platform, selecting at least one target node from a plurality of processing nodes included in the cloud platform, wherein different modules to be run have different configuration parameters on the target node; obtaining a personalized parameter file of the module to be run in the cloud platform on the target node, and a static configuration file corresponding to the target node, wherein the personalized parameter file is used to store configuration parameters for controlling the normal operation of the module to be run at the target node, and the static configuration file is used to represent a file obtained by filling a static configuration template of the module to be run, and the static configuration template is used to represent a template constructed by parameters contained in the module to be run that will change with changes in the processing node; merging the personalized parameter file and the static configuration file to obtain a target configuration file; in response to detecting that the module to be run is started, configuring the module to be run based on the target configuration file, and controlling the module to be run to run after the configuration is completed, so as to control the operation of the cloud platform.
[0005] Furthermore, the personalized parameter file and the static configuration file are merged to obtain a target configuration file, including: performing security verification on the personalized parameter file and the static configuration file to obtain a security verification result; in response to the security verification result that the personalized parameter file and the static configuration file are safe, matching the personalized parameter file and the static configuration file to obtain a file matching result, wherein the file matching result is used to characterize whether the configuration parameters included in the static configuration file are the same as the configuration parameters included in the personalized parameter file; based on the file matching result, selecting a target parameter file from the personalized parameter file, wherein the target parameter file is used to characterize a parameter file that does not exist in the static configuration file; and updating the static configuration file based on the target parameter file to obtain a target configuration file.
[0006] Furthermore, the personalized parameter file and the static configuration file are matched to obtain a file matching result, including: selecting a first configuration block from the personalized parameter file in a preset manner, wherein the first configuration block contains at least one first configuration item, and the first configuration item is used to store the personalized parameters of the target node; matching the first configuration block with any second configuration block contained in the static configuration file to obtain a first matching result, wherein the first matching result is used to characterize whether there is a configuration block identical to the first configuration block in the second configuration block; in response to the existence of a third configuration block identical to the first configuration block in the second configuration block, matching the second configuration item contained in the third configuration block with the first configuration item to obtain a second matching result, wherein the second matching result is used to characterize whether there is a configuration item identical to the first configuration item in the third configuration item; and constructing a file matching result based on the first matching result and the second matching result.
[0007] Furthermore, the above method also includes: extracting features from a parameter configuration file of the module to be run to obtain configuration file features, wherein the parameter configuration file is used to store configuration parameters of the module to be run; generating an initial configuration template based on the configuration file features and a preset file format, wherein the file format of the parameter configuration file is different from the preset file format; transforming configurable parameters contained in the parameter configuration file based on a preset variable tool to obtain initial configuration parameters, wherein the preset variable tool is used to change the format of the configurable parameters, and the configurable parameters are used to characterize the parameters that need to be configured on different nodes of the module to be run; and filling the initial configuration template based on the initial configuration parameters to obtain a static configuration template.
[0008] Furthermore, the above method also includes: selecting target configuration parameters that match the target node from the initial configuration parameters included in the static configuration template, and obtaining parameter identifiers of the target configuration parameters, wherein the target configuration parameters are used to characterize the parameters included in the initial configuration parameters that will change on the target node; determining target node parameters that match the parameter identifiers from a configuration parameter table corresponding to the target node, wherein the configuration parameter table is used to store node configuration parameters corresponding to the target node, and the node configuration parameters include configuration parameters stored in a personalized parameter file; and replacing the target configuration parameters based on the target node parameters to obtain a static configuration file.
[0009] According to another aspect of an embodiment of the present invention, a cloud platform control device is also provided, including: a node selection module, used to select at least one target node from multiple processing nodes included in the cloud platform based on the module identification of the module to be run in the cloud platform, wherein different modules to be run have different configuration parameters on the target node; a file acquisition module, used to obtain a personalized parameter file of the module to be run in the cloud platform on the target node, and a static configuration file corresponding to the target node, wherein the personalized parameter file is used to store configuration parameters for controlling the normal operation of the module to be run at the target node, and the static configuration file is used to represent a file obtained by filling a static configuration template of the module to be run, and the static configuration template is used to represent a template constructed by parameters contained in the module to be run that will change with the change of the processing node; a file merging module, used to merge the personalized parameter file and the static configuration file to obtain a target configuration file; a platform control module, used to configure the module to be run based on the target configuration file in response to detecting that the module to be run is started, and control the operation of the module to be run after the configuration is completed, so as to control the operation of the cloud platform.
[0010] Furthermore, the file merging module includes: a security verification unit, which is used to perform security verification on the personalized parameter file and the static configuration file to obtain a security verification result; a file matching unit, which is used to match the personalized parameter file and the static configuration file in response to the security verification result being that the personalized parameter file and the static configuration file are safe to obtain a file matching result, wherein the file matching result is used to characterize whether the configuration parameters contained in the static configuration file are the same as the configuration parameters contained in the personalized parameter file; a file selection unit, which is used to select a target parameter file from the personalized parameter file based on the file matching result, wherein the target parameter file is used to characterize a parameter file that does not exist in the static configuration file; and a file updating unit, which is used to update the static configuration file based on the target parameter file to obtain a target configuration file.
[0011] Furthermore, the file matching unit is also used to: select a first configuration block from the personalized parameter file in a preset manner, wherein the first configuration block includes at least one first configuration item, and the first configuration item is used to store the personalized parameters of the target node; match the first configuration block with any second configuration block included in the static configuration file to obtain a first matching result, wherein the first matching result is used to characterize whether there is a configuration block identical to the first configuration block in the second configuration block; in response to the existence of a third configuration block identical to the first configuration block in the second configuration block, match the second configuration item included in the third configuration block with the first configuration item to obtain a second matching result, wherein the second matching result is used to characterize whether there is a configuration item identical to the first configuration item in the third configuration item; and construct a file matching result based on the first matching result and the second matching result.
[0012] Furthermore, the above-mentioned device also includes: a feature extraction module, which is used to extract features from a parameter configuration file of the module to be run, and obtain configuration file features, wherein the parameter configuration file is used to store configuration parameters of the module to be run; a template generation module, which is used to generate an initial configuration template based on the configuration file features and a preset file format, wherein the file format of the parameter configuration file is different from the preset file format; a parameter transformation unit, which is used to transform the configurable parameters contained in the parameter configuration file based on a preset variable tool to obtain initial configuration parameters, wherein the preset variable tool is used to change the format of the configurable parameters, and the configurable parameters are used to characterize the parameters that need to be configured on different nodes of the module to be run; a template filling unit, which is used to fill the initial configuration template based on the initial configuration parameters to obtain a static configuration template.
[0013] Furthermore, the above-mentioned device also includes: a parameter acquisition module, which is used to select target configuration parameters that match the target node from the initial configuration parameters included in the static configuration template, and obtain the parameter identifier of the target configuration parameter, wherein the target configuration parameter is used to characterize the parameters included in the initial configuration parameters that will change on the target node; a parameter determination module, which is used to determine the target node parameters that match the parameter identifier from the configuration parameter table corresponding to the target node, wherein the configuration parameter table is used to store the node configuration parameters corresponding to the target node, and the node configuration parameters include the configuration parameters stored in the personalized parameter file; a parameter replacement module, which is used to replace the target configuration parameters based on the target node parameters to obtain a static configuration file.
[0014] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.
[0015] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0016] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0017] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0018] According to another aspect of the embodiments of the present invention, a computer program is further provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.
[0019] In an embodiment of the present invention, a module identifier based on a module to be run in a cloud platform is used to select at least one target node from a plurality of processing nodes included in the cloud platform; a personalized parameter file of the module to be run in the cloud platform on the target node and a static configuration file corresponding to the target node are obtained; the personalized parameter file and the static configuration file are merged to obtain a target configuration file; in response to detecting that the module to be run is started, the module to be run is configured based on the target configuration file, and the operation of the module to be run is controlled after the configuration is completed, so as to control the operation of the cloud platform, by generating different static configuration files for different running modules and different running nodes in the cloud platform, when the module to be run runs to the target node, the static configuration file can be quickly configured according to the personalized parameter file corresponding to the target node to obtain the target configuration file, and then the target configuration file is used to configure the module to be run, so as to improve the flexibility of configuring the module to be run, improve the smoothness of the module to be run when it runs on the target node, thereby improving the flexibility of the cloud platform during operation, thereby solving the technical problem of poor flexibility of different modules of the cloud platform when running on different nodes in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 is a flow chart of a cloud platform control method according to an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of a file matching process according to an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a cloud platform control process according to an embodiment of the present application;
[0024] Figure 4 It is a structural block diagram of a cloud platform control device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Example 1
[0028] According to an embodiment of the present invention, a method embodiment of a cloud platform control is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Figure 1 is a flow chart of a cloud platform control method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0030] Step S102: based on the module identifier of the module to be run in the cloud platform, at least one target node is selected from a plurality of processing nodes included in the cloud platform.
[0031] Among them, different modules to be run have different configuration parameters on the target node.
[0032] The above-mentioned modules to be run may refer to modules deployed in the cloud platform and required to be used in the subsequent operation of the cloud platform. The above-mentioned template nodes may refer to processing nodes that the modules to be run will pass through in the subsequent operation of the cloud platform.
[0033] In an optional scheme of the present embodiment, considering that multiple running modules will be deployed in the cloud platform to execute different instructions, and different running modules may pass through different processing nodes when executing different instructions, therefore, in order to be able to stably control the operation of the cloud platform, the control system can first obtain the module identifier of the module to be run in the cloud platform, and then select a target node that matches the module identifier from the multiple processing nodes contained in the cloud platform, so as to configure the operating parameters of the module to be run for the target node, so that when the cloud platform is running, the module to be run can run smoothly on the target node, thereby improving the flexibility of the cloud platform during operation.
[0034] Step S104, obtaining a personalized parameter file of the module to be run on the target node in the cloud platform, and a static configuration file corresponding to the target node.
[0035] Among them, the personalized parameter file is used to store the configuration parameters that control the normal operation of the module to be run on the target node, the static configuration file is used to represent the file obtained by filling the static configuration template of the module to be run, and the static configuration template is used to represent the template constructed by the parameters contained in the module to be run that will change with the change of the processing node.
[0036] In an optional scheme of the present embodiment, while obtaining the target node, the control system can also obtain the configuration parameters corresponding to the normal operation of the module to be run on the target node, that is, the above-mentioned personalized parameter file, and the static configuration file corresponding to the target node, that is, the control system fills the template constructed by the parameters contained in the module to be run that will change with the change of the processing node, and the configuration file obtained, the corresponding constructed template can refer to the above-mentioned static configuration template. In order to improve the matching degree between the static configuration file and the target node, the parameters filled in the static configuration template can at least include parameters that can point to the target node, such as the address information of the target node, the node identification of the target node, and other parameters. The corresponding control system can quickly select the static configuration file corresponding to the above-mentioned target node after identifying the parameters contained in the static configuration file.
[0037] Step S106: merge the personalized parameter file and the static configuration file to obtain a target configuration file.
[0038] In an optional scheme of the present embodiment, after obtaining the personalized parameter file and the static configuration file, the two static configuration files can be merged, for example, the configuration parameters contained in the personalized parameter file are matched with the configuration parameters contained in the static configuration file, and the parameters that are not in the static configuration parameters are determined from the personalized parameters, and then the determined parameters that are not in the static configuration parameters are added to the static configuration file to obtain a target configuration file with a higher degree of completeness. By configuring the module to be run through the configuration file, the stability of the module to be run when it runs on the target node can be guaranteed. By generating different target configuration files for different target nodes, and then configuring the module to be run according to the target configuration file when the module to be run runs to the target node, the flexibility of the cloud platform during operation can be improved.
[0039] Step S108, in response to detecting that the module to be run is started, the module to be run is configured based on the target configuration file, and after the configuration is completed, the module to be run is controlled to run, so as to control the operation of the cloud platform.
[0040] In an optional scheme of the present embodiment, when it is detected that the module to be run is started, the control system can use the generated target configuration file to configure the module to be run, and control the operation of the module to be run after the control configuration is completed, thereby ensuring that the module to be run can run smoothly in the target node, so as to control the operation of the cloud platform, thereby improving the fluency and flexibility of the cloud platform during operation.
[0041] In an embodiment of the present invention, a module identifier based on a module to be run in a cloud platform is used to select at least one target node from a plurality of processing nodes included in the cloud platform; a personalized parameter file of the module to be run in the cloud platform on the target node and a static configuration file corresponding to the target node are obtained; the personalized parameter file and the static configuration file are merged to obtain a target configuration file; in response to detecting that the module to be run is started, the module to be run is configured based on the target configuration file, and the operation of the module to be run is controlled after the configuration is completed, so as to control the operation of the cloud platform, by generating different static configuration files for different running modules and different running nodes in the cloud platform, when the module to be run runs to the target node, the static configuration file can be quickly configured according to the personalized parameter file corresponding to the target node to obtain the target configuration file, and then the target configuration file is used to configure the module to be run, so as to improve the flexibility of configuring the module to be run, improve the smoothness of the module to be run when it runs on the target node, thereby improving the flexibility of the cloud platform during operation, thereby solving the technical problem of poor flexibility of different modules of the cloud platform when running on different nodes in the related art.
[0042] Furthermore, the personalized parameter file and the static configuration file are merged to obtain a target configuration file, including: performing security verification on the personalized parameter file and the static configuration file to obtain a security verification result; in response to the security verification result that the personalized parameter file and the static configuration file are safe, matching the personalized parameter file and the static configuration file to obtain a file matching result, wherein the file matching result is used to characterize whether the configuration parameters included in the static configuration file are the same as the configuration parameters included in the personalized parameter file; based on the file matching result, selecting a target parameter file from the personalized parameter file, wherein the target parameter file is used to characterize a parameter file that does not exist in the static configuration file; and updating the static configuration file based on the target parameter file to obtain a target configuration file.
[0043] In an optional scheme of the present embodiment, when merging the personalized parameter file and the static configuration file, the control system may first perform security verification on the personalized parameter file and the static configuration file to avoid file errors or potential risks in the file, which may lead to security risks during the operation of the cloud platform. When the security verification result corresponding to the security verification is that the personalized parameter file and the static configuration file are safe, the control system may match the personalized parameter file with the static configuration file to determine whether the configuration parameters contained in the static configuration file are the same as the configuration parameters contained in the personalized parameter file, thereby obtaining the above-mentioned file matching result, and then the control system may select the parameter file that does not exist in the static configuration file from the personalized parameter file according to the obtained file matching result, that is, the above-mentioned target parameter file, and finally the control system may use the target parameter file to update the static configuration file to obtain a target configuration file that can control the module to be run to run stably on the target node.
[0044] Furthermore, the personalized parameter file and the static configuration file are matched to obtain a file matching result, including: selecting a first configuration block from the personalized parameter file in a preset manner, wherein the first configuration block contains at least one first configuration item, and the first configuration item is used to store the personalized parameters of the target node; matching the first configuration block with any second configuration block contained in the static configuration file to obtain a first matching result, wherein the first matching result is used to characterize whether there is a configuration block identical to the first configuration block in the second configuration block; in response to the existence of a third configuration block identical to the first configuration block in the second configuration block, matching the second configuration item contained in the third configuration block with the first configuration item to obtain a second matching result, wherein the second matching result is used to characterize whether there is a configuration item identical to the first configuration item in the third configuration item; and constructing a file matching result based on the first matching result and the second matching result.
[0045] In an optional solution of this embodiment, during the file matching process, the control system may first select the above-mentioned first configuration block from the personalized parameter file in a preset manner, such as polling selection, random selection, traversal selection, etc., and include at least one first configuration item in the first configuration block to store the personalized parameters of the target node. After selecting the first configuration block, the control system may match the first configuration block with any second configuration block included in the static configuration file to determine whether there is a configuration block matching the first configuration block in the second configuration block, that is, the above-mentioned third configuration block, so as to obtain the above-mentioned first matching result. If there is a third configuration block, the configuration items included in the third configuration block, that is, the above-mentioned second configuration items, may be further matched with the first configuration items included in the first configuration block to determine whether there is a configuration item identical to the first configuration item in the second configuration item included in the third configuration block, that is, the configuration items having the same configuration parameters as the first configuration item, so as to obtain the above-mentioned second matching result. Finally, according to the first matching result and the second matching result, the above-mentioned file matching result may be constructed, and the file matching result may include configuration blocks not included in the static configuration file but included in the personalized parameter file, and configuration items not included in the third configuration block but included in the first configuration block.
[0046] For ease of understanding, Figure 2 is a schematic diagram of a file matching process according to an embodiment of the present application, such as Figure 2 As shown, when merging, the control system can first verify the legitimacy of the personalized parameter file and the static configuration file. If the verification fails, the execution process can be directly terminated and a prompt message can be sent to the user. If the verification passes, the two files can be loaded, each configuration block in the personalized parameter file can be traversed, and the configuration block can be matched with the configuration block in the static configuration file to determine whether the configuration block exists in the static configuration file. If not, the configuration block can be added to the static configuration file and the matching can be traversed again. If so, each configuration item contained in the configuration block can be traversed, and the configuration item can be matched with the configuration item contained in the corresponding configuration block in the static configuration file to determine whether the configuration item exists in the corresponding configuration block in the static configuration file. If not, the configuration item can be added to the corresponding configuration block in the static configuration file and the matching can be traversed again. If so, it can be determined that the static configuration file can meet the running requirements of the module to be run at the target node, and the static configuration file at this time can be the target configuration file.
[0047] Furthermore, the above method also includes: extracting features from a parameter configuration file of the module to be run to obtain configuration file features, wherein the parameter configuration file is used to store configuration parameters of the module to be run; generating an initial configuration template based on the configuration file features and a preset file format, wherein the file format of the parameter configuration file is different from the preset file format; transforming configurable parameters contained in the parameter configuration file based on a preset variable tool to obtain initial configuration parameters, wherein the preset variable tool is used to change the format of the configurable parameters, and the configurable parameters are used to characterize the parameters that need to be configured on different nodes of the module to be run; and filling the initial configuration template based on the initial configuration parameters to obtain a static configuration template.
[0048] In an optional scheme of the present embodiment, when constructing a static configuration template, the control system may first extract features from the file in the module to be run that is used to store the configuration parameters of the module to be run, that is, the above-mentioned parameter configuration file, to obtain the configuration file features of the module to be run, such as extracting the type of the parameter configuration file, the parameter usage priority, the key-value pair and other features, and then change the format of the configuration file features according to the preset file format to generate the above-mentioned initial configuration template, wherein the file format of the parameter configuration file is different from the above-mentioned preset file format. At the same time, the control system can also transform the configurable parameters through a preset variable tool that is used to change the format of the parameters that need to be configured on different nodes of the module to be run, that is, the above-mentioned configurable parameters, to obtain the initial configuration parameters. Finally, the control system can use the initial configuration parameters to fill the initial configuration template to obtain the static configuration template generated for the module to be run. By filling the static configuration template, for example, filling the directional parameters corresponding to different template nodes, different static configuration files can be generated for different target nodes.
[0049] Furthermore, the above method also includes: selecting target configuration parameters that match the target node from the initial configuration parameters included in the static configuration template, and obtaining parameter identifiers of the target configuration parameters, wherein the target configuration parameters are used to characterize the parameters included in the initial configuration parameters that will change on the target node; determining target node parameters that match the parameter identifiers from a configuration parameter table corresponding to the target node, wherein the configuration parameter table is used to store node configuration parameters corresponding to the target node, and the node configuration parameters include configuration parameters stored in a personalized parameter file; and replacing the target configuration parameters based on the target node parameters to obtain a static configuration file.
[0050] In an optional scheme of the present embodiment, when generating a static configuration file, the control system can first select the target configuration parameters that match the target node from the initial configuration parameters contained in the static configuration template, that is, the parameters contained in the initial configuration parameters that will change on different target nodes, such as the node address, node identification and other parameters, and then select the target node parameters that match the target node from the table containing the node configuration parameters of different running nodes, that is, the above-mentioned configuration parameter table, such as the target node address, target node identification and other parameters corresponding to the target node. Finally, the control system can replace the target configuration parameters with the selected target node parameters, for example, replace the node address currently contained in the static configuration template with the node address of the target node, and then generate the above-mentioned static configuration file. Among them, the node configuration parameters contained in the configuration parameter table can include the configuration parameters stored in the above-mentioned personalized parameter file.
[0051] For ease of understanding, Figure 3 is a schematic diagram of a cloud platform control process according to an embodiment of the present application, such as Figure 3 As shown, the whole process can be divided into two parts, namely before the cloud platform runs and when the cloud platform runs. Before the cloud platform runs, the control system can first split the parameter configuration file of the module to be run from the file of the module to be run, and then abstract the parameter configuration file to obtain the initial configuration template, and then use the target node parameters corresponding to the target node to render the initial configuration template, modify the template mounting method, and generate the corresponding static configuration file. When the cloud platform is running, the personalized parameter file of the target running node and the static configuration file corresponding to the target node can be obtained first, and then the two files can be merged to generate the target configuration file, and then the target configuration file can be sent to the corresponding target node. When the module to be run runs to the target node, the control system can quickly use the target configuration file to configure the module to be run, and run the module to be run after the configuration is completed, so as to realize the operation of running the cloud platform, thereby improving the adaptability of different modules to be run in the cloud platform on different target nodes, and then improving the flexibility of the cloud platform during operation.
[0052] Taking the OpenStack cloud platform as an example, the control system can first split the module to be run in the OpenStack cloud platform, such as the parameter configuration file of the keystone module, from the values.yaml file of the chart. Before the splitting, the configuration items in keystone.conf can be stored in the values.yaml file of the keystone chart in yaml format, and exist in the form of k8s configmap after deployment; when splitting, the split files can be abstracted and rendered, wherein the splitting method can be to strip the configuration items in yaml format from the values.yaml file of the chart and fill them into the j2 file described by jinja2, and then some configuration items filled in the j2 file that need to be dynamically configured during the deployment process are replaced by ansible variables, so as to generate appropriate values for these configuration items that need to be dynamically configured during the deployment process; after the splitting, jinja2 can be used to describe the configuration items in keystone.conf, and after deployment, they exist in the form of ordinary files (.j2) in the operating system.
[0053] For example, the keystone.conf configuration items before splitting can be:
[0054] conf:
[0055] keystone:
[0056] DEFAULT:
[0057] key1:value1
[0058] key2:value2
[0059] cache:
[0060] key3:value3
[0061] key4:value4
[0062] token:
[0063] key5:value5
[0064] key6:value6
[0065] The split keystone.conf configuration can be:
[0066] [DEFAULT]
[0067] key1=value1
[0068] key2={{var_value2}}
[0069] [cache]
[0070] key3=value3
[0071] key4=value4
[0072] [token]
[0073] key5=value5
[0074] key6={{var_value6}}
[0075] The process of rendering the template can be regarded as the process of actually replacing the value of the configuration item assigned by the preset variable tool in the template, such as ansible variable. For example:
[0076] The configuration template of the keystone business module contains the following configuration:
[0077] [DEFAULT]
[0078] my_ip = {{var_my_ip}}
[0079] regionname={{var_regionname}}
[0080] In cluster A, the content of the configuration file rendered for target node 1 can be:
[0081] [DEFAULT]
[0082] my_ip=192.168.100.101
[0083] regionname=regionone
[0084] In cluster A, the configuration file content rendered for target node 2 is:
[0085] [DEFAULT]
[0086] my_ip=192.168.100.102
[0087] regionname=regionone
[0088] In cluster B, the configuration file content rendered for target node 1 is:
[0089] [DEFAULT]
[0090] my_ip=192.168.100.103
[0091] regionname=regiontwo
[0092] In cluster B, the configuration file content rendered for target node 2 is:
[0093] [DEFAULT]
[0094] my_ip=192.168.100.104
[0095] regionname=regiontwo
[0096] When splitting to obtain a static configuration file, you can also specify how to mount the file.
[0097] In addition, when obtaining the personalized parameter file corresponding to the target node, taking the keystone module of the OpenStack cloud platform as an example, the personalized configuration file can refer to a file containing different configuration items required by the keystone business module on different nodes. For example, the keystone business module requires a configuration item of debug = true on node 1 and a configuration item of debug = false on node 2. Then, you can prepare personalized configuration files on nodes 1 and 2 for the keystone business module respectively:
[0098] The content of the personalized configuration file of node 1 can be as follows:
[0099] [DEFAULT]
[0100] debug=true
[0101] The content of the personalized configuration file of node 2 is as follows:
[0102] [DEFAULT]
[0103] debug=false
[0104] The personalized configuration files need to be planned according to the conditions of each node in the cluster before deployment, and the personalized configuration files required by each node in the cluster need to be manually generated.
[0105] Not all nodes need to prepare personalized configuration files. If a business module does not need personalized configuration on a certain node (that is, the general configuration can be used), then there is no need to prepare a personalized configuration file for the node. For example, the keystone authentication business module does not need to use differential configuration on node 3, so there is no need to prepare a personalized configuration file for the keystone authentication business module for node 3.
[0106] In addition, after generating the target configuration file, taking the keystone in the OpenStack cloud platform as an example, generally speaking, the keystone authentication business module will be deployed on the control node row of the OpenStack cloud platform. If the control nodes of the OpenStack cloud platform include nodes 1, 2, and 3, then during deployment, the keystone module's keystone.conf configuration file, that is, the target configuration file, needs to be distributed to nodes 1, 2, and 3 of the OpenStack cloud platform, generally placed in the / etc / openstack / keystone / directory of the node. When the module pod is started, the target configuration file is mounted to the / tmp / directory of the pod, and the business module configuration file in the / tmp / directory is loaded into the business module process using the --config-file option, so that the module can run smoothly in the target node.
[0107] Example 2
[0108] According to another aspect of an embodiment of the present invention, a cloud platform control device is further provided. Figure 4 is a structural block diagram of a cloud platform control device according to an embodiment of the present application, such as Figure 4 As shown, the device includes: a node selection module 402, a file acquisition module 404, a file merging module 406 and a platform control module 408.
[0109] Among them, the node selection module 402 is used to select at least one target node from multiple processing nodes included in the cloud platform based on the module identification of the module to be run in the cloud platform, wherein different modules to be run have different configuration parameters on the target node; the file acquisition module 404 is used to obtain the personalized parameter file of the module to be run in the cloud platform on the target node, and the static configuration file corresponding to the target node, wherein the personalized parameter file is used to store the configuration parameters for controlling the normal operation of the module to be run at the target node, and the static configuration file is used to represent the file obtained by filling the static configuration template of the module to be run, and the static configuration template is used to represent the template constructed by the parameters contained in the module to be run that will change with the change of the processing node; the file merging module 406 is used to merge the personalized parameter file and the static configuration file to obtain the target configuration file; the platform control module 408 is used to configure the module to be run based on the target configuration file in response to detecting the start of the module to be run, and control the operation of the module to be run after the configuration is completed, so as to control the operation of the cloud platform.
[0110] Furthermore, the file merging module includes: a security verification unit, which is used to perform security verification on the personalized parameter file and the static configuration file to obtain a security verification result; a file matching unit, which is used to match the personalized parameter file and the static configuration file in response to the security verification result being that the personalized parameter file and the static configuration file are safe to obtain a file matching result, wherein the file matching result is used to characterize whether the configuration parameters contained in the static configuration file are the same as the configuration parameters contained in the personalized parameter file; a file selection unit, which is used to select a target parameter file from the personalized parameter file based on the file matching result, wherein the target parameter file is used to characterize a parameter file that does not exist in the static configuration file; and a file updating unit, which is used to update the static configuration file based on the target parameter file to obtain a target configuration file.
[0111] Furthermore, the file matching unit is also used to: select a first configuration block from the personalized parameter file in a preset manner, wherein the first configuration block includes at least one first configuration item, and the first configuration item is used to store the personalized parameters of the target node; match the first configuration block with any second configuration block included in the static configuration file to obtain a first matching result, wherein the first matching result is used to characterize whether there is a configuration block identical to the first configuration block in the second configuration block; in response to the existence of a third configuration block identical to the first configuration block in the second configuration block, match the second configuration item included in the third configuration block with the first configuration item to obtain a second matching result, wherein the second matching result is used to characterize whether there is a configuration item identical to the first configuration item in the third configuration item; and construct a file matching result based on the first matching result and the second matching result.
[0112] Furthermore, the above-mentioned device also includes: a feature extraction module, which is used to extract features from a parameter configuration file of the module to be run, and obtain configuration file features, wherein the parameter configuration file is used to store configuration parameters of the module to be run; a template generation module, which is used to generate an initial configuration template based on the configuration file features and a preset file format, wherein the file format of the parameter configuration file is different from the preset file format; a parameter transformation unit, which is used to transform the configurable parameters contained in the parameter configuration file based on a preset variable tool to obtain initial configuration parameters, wherein the preset variable tool is used to change the format of the configurable parameters, and the configurable parameters are used to characterize the parameters that need to be configured on different nodes of the module to be run; a template filling unit, which is used to fill the initial configuration template based on the initial configuration parameters to obtain a static configuration template.
[0113] Furthermore, the above-mentioned device also includes: a parameter acquisition module, which is used to select target configuration parameters that match the target node from the initial configuration parameters included in the static configuration template, and obtain the parameter identifier of the target configuration parameter, wherein the target configuration parameter is used to characterize the parameters included in the initial configuration parameters that will change on the target node; a parameter determination module, which is used to determine the target node parameters that match the parameter identifier from the configuration parameter table corresponding to the target node, wherein the configuration parameter table is used to store the node configuration parameters corresponding to the target node, and the node configuration parameters include the configuration parameters stored in the personalized parameter file; a parameter replacement module, which is used to replace the target configuration parameters based on the target node parameters to obtain a static configuration file.
[0114] Example 3
[0115] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.
[0116] Example 4
[0117] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0118] Example 5
[0119] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0120] Example 6
[0121] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0122] Example 7
[0123] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0124] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0125] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0127] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0128] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0129] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0130] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A cloud platform control method, It is characterized in that include: Based on the module identifiers of the modules to be run in the cloud platform, selecting at least one target node from a plurality of processing nodes included in the cloud platform, wherein different modules to be run have different configuration parameters on the target node; Obtain a personalized parameter file of the module to be run on the target node in the cloud platform, and a static configuration file corresponding to the target node, wherein the personalized parameter file is used to store configuration parameters that control the normal operation of the module to be run on the target node, and the static configuration file is used to represent a file obtained by filling a static configuration template of the module to be run, and the static configuration template is used to represent a template constructed for parameters contained in the module to be run that will change with changes in processing nodes; Merging the personalized parameter file and the static configuration file to obtain a target configuration file; In response to detecting that the module to be run is started, the module to be run is configured based on the target configuration file, and after the configuration is completed, the module to be run is controlled to run, so as to control the operation of the cloud platform.
2. The method according to claim 1, It is characterized in that The personalized parameter file and the static configuration file are merged to obtain a target configuration file, including: Performing security verification on the personalized parameter file and the static configuration file to obtain a security verification result; In response to the security verification result that the personalized parameter file and the static configuration file are safe, matching the personalized parameter file with the static configuration file to obtain a file matching result, wherein the file matching result is used to indicate whether the configuration parameters included in the static configuration file are the same as the configuration parameters included in the personalized parameter file; Based on the file matching result, a target parameter file is selected from the personalized parameter file, wherein the target parameter file is used to represent a parameter file that does not exist in the static configuration file; The static configuration file is updated based on the target parameter file to obtain the target configuration file.
3. The method according to claim 2, It is characterized in that Matching the personalized parameter file with the static configuration file to obtain a file matching result includes: Selecting a first configuration block from the personalized parameter file in a preset manner, wherein the first configuration block includes at least one first configuration item, and the first configuration item is used to store the personalized parameters of the target node; Matching the first configuration block with any second configuration block included in the static configuration file to obtain a first matching result, wherein the first matching result is used to indicate whether there is a configuration block identical to the first configuration block in the second configuration block; In response to the presence of a third configuration block in the second configuration block being identical to the first configuration block, matching a second configuration item included in the third configuration block with the first configuration item to obtain a second matching result, wherein the second matching result is used to indicate whether a configuration item identical to the first configuration item exists in the third configuration item; The file matching result is constructed based on the first matching result and the second matching result.
4. The method according to claim 1, It is characterized in that The method further comprises: Extracting features from a parameter configuration file of the module to be run to obtain configuration file features, wherein the parameter configuration file is used to store configuration parameters of the module to be run; Based on the configuration file characteristics and the preset file format, generating an initial configuration template, wherein the file format of the parameter configuration file is different from the preset file format; Transforming the configurable parameters contained in the parameter configuration file based on a preset variable tool to obtain initial configuration parameters, wherein the preset variable tool is used to change the format of the configurable parameters, and the configurable parameters are used to characterize the parameters that need to be configured on different nodes of the module to be run; The initial configuration template is filled based on the initial configuration parameters to obtain the static configuration template.
5. The method according to claim 1, It is characterized in that The method further comprises: Selecting a target configuration parameter that matches the target node from the initial configuration parameters included in the static configuration template, and obtaining a parameter identifier of the target configuration parameter, wherein the target configuration parameter is used to characterize a parameter included in the initial configuration parameter that will change on the target node; Determine the target node parameters that match the parameter identifier from the configuration parameter table corresponding to the target node, wherein the configuration parameter table is used to store node configuration parameters corresponding to the target node, and the node configuration parameters include configuration parameters stored in the personalized parameter file; The target configuration parameters are replaced based on the target node parameters to obtain the static configuration file.
6. A cloud platform control device, It is characterized in that include: A node selection module, used to select at least one target node from a plurality of processing nodes included in the cloud platform based on the module identifier of the module to be run in the cloud platform, wherein different modules to be run have different configuration parameters on the target node; A file acquisition module, used to acquire a personalized parameter file of a module to be run on a target node in a cloud platform, and a static configuration file corresponding to the target node, wherein the personalized parameter file is used to store configuration parameters that control the normal operation of the module to be run on the target node, and the static configuration file is used to represent a file obtained by filling a static configuration template of the module to be run, and the static configuration template is used to represent a template constructed by parameters contained in the module to be run that will change with changes in processing nodes; A file merging module, used to merge the personalized parameter file and the static configuration file to obtain a target configuration file; The platform control module is used to configure the module to be run based on the target configuration file in response to detecting that the module to be run is started, and to control the operation of the module to be run after the configuration is completed, so as to control the operation of the cloud platform.
7. The device according to claim 6, It is characterized in that The file merging module comprises: A security verification unit, used to perform security verification on the personalized parameter file and the static configuration file to obtain a security verification result; A file matching unit, configured to match the personalized parameter file with the static configuration file in response to the security verification result indicating that the personalized parameter file and the static configuration file are safe, to obtain a file matching result, wherein the file matching result is used to indicate whether the configuration parameters included in the static configuration file are the same as the configuration parameters included in the personalized parameter file; A file selection unit, configured to select a target parameter file from the personalized parameter file based on the file matching result, wherein the target parameter file is used to represent a parameter file that does not exist in the static configuration file; The file updating unit is used to update the static configuration file based on the target parameter file to obtain the target configuration file.
8. An electronic device, It is characterized in that include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 5 when running.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 5.
10. A computer program product, It is characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
