Service process configuration management method and device, server and storage medium
Through the method of generating feature configuration files based on usage scenarios and preset databases, the service process is automatically assembled and started, which solves the problem of low efficiency of service process configuration management in the existing technology and improves system flexibility and stability.
Patent Information
- Application Number
- CN202411057195.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-10-22
AI Technical Summary
In the existing technology, the service process configuration management efficiency is low, manual operations are complex, and it is difficult to adapt to the personalized needs of different user scenarios, resulting in high maintenance costs and system instability.
Determine the target service process based on the current usage scenario, generate feature configuration files through the preset database, assemble the target configuration file according to the priority of the features, automatically start the service process, and reduce the need for manual management.
It improves the system's flexibility and configuration management efficiency, reduces maintenance costs, and ensures the stable operation of the service process.
Smart Images

Figure CN118819682A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a configuration management method, device, server and storage medium for a service process. Background Art
[0002] A server cluster is a technical architecture that combines multiple servers to jointly process and distribute network requests. In order to meet the personalized needs of different users, products on the market need to have different characteristics in each service process according to different usage scenarios, and thus the configuration items required for the characteristics are also different. In the prior art, when a service process needs to be modified, each configuration item in the service process needs to be manually changed one by one, which has a high overall operation complexity and is not conducive to maintenance and expansion. Summary of the invention
[0003] In view of this, the present invention provides a method, device, server and storage medium for configuration management of a service process to solve the problem of low efficiency of configuration management of the service process.
[0004] In a first aspect, the present invention provides a method for configuration management of a service process, the method comprising:
[0005] Determine the target service process based on the current usage scenario;
[0006] Acquire a characteristic corresponding to the target service process, and generate a characteristic configuration file corresponding to the characteristic based on a preset database, wherein the characteristic configuration file includes configuration items and values of the configuration items;
[0007] Assembling the feature configuration files based on the priority of the feature to obtain a target configuration file;
[0008] The target service process is started based on the target configuration file.
[0009] In an optional implementation, the generating a characteristic configuration file corresponding to the characteristic based on a preset database includes:
[0010] Obtaining a preset template configuration file for the feature;
[0011] Acquire a configuration item corresponding to the characteristic and a value of the configuration item from a preset database, wherein the preset database includes a correspondence between the configuration item and the characteristic;
[0012] The preset template configuration file is assembled based on the configuration items corresponding to the characteristics and the values of the configuration items to generate the characteristic configuration file.
[0013] In an optional embodiment, the method further includes:
[0014] Based on the correspondence between the target service process and the characteristic, and the correspondence between the characteristic and the characteristic configuration file, the correspondence between the target service process and the characteristic configuration file is determined.
[0015] In an optional implementation, the assembling the feature configuration files based on the priority of the feature to obtain the target configuration file includes:
[0016] Reading the feature configuration file of each feature in the target service process;
[0017] Determine whether there are identical configuration items in each of the feature configuration files, and obtain a determination result;
[0018] When the judgment result is yes, the same configuration item in the feature configuration file corresponding to the feature with a high priority is overwritten with the same configuration item in the feature configuration file corresponding to the feature with a low priority, and a unique value of the same configuration item is determined;
[0019] A target configuration file is determined based on the different configuration items and the same configuration items in the characteristic configuration file.
[0020] In an optional implementation, the assembling the feature configuration files based on the priority of the feature to obtain the target configuration file further includes:
[0021] When the judgment result is no, the configuration items in the characteristic configuration files of all the characteristics are extracted, and the configuration items are assembled to obtain a target configuration file.
[0022] In an optional embodiment, the method further includes:
[0023] In response to the tuning switch being turned on, extracting configuration items in the feature configuration files of all the features, and combining the configuration items to obtain at least one configuration item combination;
[0024] Traversing the configuration item combinations to determine resource occupancy of each configuration item combination;
[0025] The configuration item combination with the smallest resource occupation is determined as the target configuration file.
[0026] In an optional embodiment, the method further includes:
[0027] Determine the characteristics corresponding to the service process;
[0028] Determine, from the preset database, a configuration item corresponding to the characteristic and a value of the configuration item;
[0029] Obtaining a preset template configuration file for the feature;
[0030] Assembling the preset template configuration file based on the configuration items corresponding to the characteristics and the values of the configuration items to generate the characteristic configuration file;
[0031] Saving the characteristic configuration file,
[0032] The configuration items and their values in the feature configuration file adopt a unified format;
[0033] Establishing a correspondence between the characteristic configuration file and the service process;
[0034] In response to modification of a configuration item in the characteristic configuration file, updating the characteristic configuration file;
[0035] Saving the updated feature configuration file, and establishing a corresponding relationship between the updated feature configuration file and the service process;
[0036] monitoring the characteristic profile;
[0037] When it is detected that the hash value corresponding to the updated characteristic configuration file changes, the service process is restarted.
[0038] In a second aspect, the present invention provides a configuration management device for a service process, the device comprising:
[0039] A process determination module, used to determine the target service process based on the current usage scenario;
[0040] A first configuration file determination module, used to obtain the characteristics corresponding to the target service process, and generate a characteristic configuration file corresponding to the characteristics based on a preset database, wherein the characteristic configuration file includes configuration items and values of the configuration items;
[0041] A second configuration file determination module, configured to assemble the characteristic configuration files based on the priority of the characteristic to obtain a target configuration file;
[0042] A process starting module is used to start the target service process based on the target configuration file.
[0043] In a third aspect, the present invention provides a server comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the configuration management method for the service process of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for configuring and managing a service process according to the first aspect or any corresponding embodiment thereof.
[0045] The configuration management method for the service process provided in this embodiment determines the target service process according to the current usage scenario, obtains the characteristics of the target service process, generates a characteristic configuration file corresponding to the characteristic according to a preset database, assembles the characteristic configuration file based on the priority of the characteristic, obtains the target configuration file, and starts the target service process based on the target configuration file. This method does not require manual management of the configuration file. When the service process starts, the target configuration file can be assembled automatically by setting the priority, which improves the flexibility of the system and ensures the efficiency of configuration management. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 is a flow chart of a method for configuration management of a service process according to an embodiment of the present invention;
[0048] Figure 2 is a schematic diagram of a characteristic configuration file according to an embodiment of the present invention;
[0049] Figure 3 is a schematic diagram of generating a target configuration file according to an embodiment of the present invention;
[0050] Figure 4 is a schematic diagram of a process of starting a service process according to an embodiment of the present invention;
[0051] Figure 5 is a schematic diagram of another generating target configuration file according to an embodiment of the present invention;
[0052] Figure 6 is a schematic diagram of a process for generating a characteristic configuration file according to an embodiment of the present invention;
[0053] Figure 7 is a structural block diagram of a configuration management device for a service process according to an embodiment of the present invention;
[0054] Figure 8 It is a schematic diagram of the hardware structure of the server according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0056] In the current rapidly iterating technology field, with the increasing diversification and personalization of user needs, products and services on the market have to be more refined to meet the needs of different user groups in specific usage scenarios. This trend has prompted software developers and service providers to deeply consider the various configuration items in the service process when designing products to ensure that the system can flexibly adapt to various complex and changing environments and user preferences. However, this high dependence and diversity on configuration items also brings unprecedented challenges to management and maintenance. Specifically, different user groups or the same user in different scenarios may have completely different requirements for product performance, security, user interface and even data processing methods. In order to meet these differentiated needs, corresponding parameters and settings need to be configured within the service process. These configuration items often involve multiple aspects such as the allocation of underlying resources, network communication protocols, implementation of security policies, and customization of user interfaces. These configuration items are not only huge in number, but also may have complex dependencies and constraints between each other, making management particularly complicated. Traditional configuration file management methods mostly rely on manual editing and maintenance, which is not only inefficient and error-prone, but also difficult to adapt to rapidly changing needs. As service processes become increasingly complex and configuration items continue to increase, manual management methods have gradually exposed problems such as lack of simplicity, poor scalability, and high maintenance costs. In addition, due to the dispersion and inconsistency of configuration information, it may also lead to serious consequences such as service instability, performance degradation, and even security vulnerabilities.
[0057] Based on this, an embodiment of the present invention provides a method for configuration management of a service process, which is used to manage the configuration of a service process in a cluster.
[0058] According to an embodiment of the present invention, an embodiment of a configuration management method for a service process 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.
[0059] In this embodiment, a configuration management method for a service process is provided. Figure 1is a flow chart of a method for configuration management of a service process according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0060] Step S101, determining a target service process based on a current usage scenario.
[0061] A cluster refers to a group (or several) of independent computers that use a high-speed communication network to form a larger computer service system. Each cluster node (i.e., each computer in the cluster) is an independent server running its own service. These servers can communicate with each other and work together to provide applications, system resources, and data to users, and are managed in a single system mode. According to different usage scenarios, the system starts different service processes. The various functions included in the usage scenarios can correspond to various features in the service process, and there are multiple features in the service process. According to the current usage scenario, the system determines the target service process corresponding to the current usage scenario.
[0062] Step S102: Acquire characteristics corresponding to the target service process, and generate a characteristic configuration file corresponding to the characteristics based on a preset database.
[0063] The characteristic configuration file includes configuration items and values of the configuration items.
[0064] Each feature in the service process has its corresponding configuration file, which usually contains the configuration information of the feature. The performance of the feature can be customized or adjusted by the configuration file. The configuration file contains various settings and parameters, such as feature logs, environment variables, database connection information, etc. The configuration information has an important impact on the operation and performance of the feature.
[0065] Taking the file storage usage scenario as an example, the characteristics of this usage scenario are complex and various configurations are difficult to maintain manually, such as quota characteristics, grading characteristics, self-streamlining characteristics, QOS (Quality of Service) characteristics, resource limitation parameters, network information parameters, etc.; among them, there are more than a dozen priority configuration items for configuration characteristics, including the node list of quota service deployment, heartbeat detection interval, service log, operation log, alarm log, quota types, etc.
[0066] The preset database stores configuration information for generating a feature configuration file. The configuration information corresponds to the feature. After determining the feature corresponding to the target service process, the configuration information corresponding to the feature can be queried from the preset database, and the feature configuration file of the feature can be generated based on the configuration information.
[0067] Step S103: assemble the feature configuration files based on the priority of the features to obtain a target configuration file.
[0068] For a newly initialized system, default priority values can be set for features for different service processes. During use, users can set the priority of each feature according to their needs, and when setting the priority, they can do so by assigning weights. Specifically, the weight of each feature can be calculated based on a given coefficient according to the number of user views, feature usage, etc., and the priority of each feature can be determined by assigning a weight value to each feature. Consider the priority from the perspective of user use in order to achieve the most direct business value.
[0069] Feature configuration files are assembled according to their priorities. Specifically, the configuration information in the feature configuration files of each feature can be assembled. The feature configuration files of different features may contain configuration information with the same attributes. When different features in the same service process have configuration information with the same attributes, the configuration information of the features with higher priorities is retained first, and the target configuration file is obtained after assembly.
[0070] Step S104: starting the target service process based on the target configuration file.
[0071] After determining the target configuration file, the target configuration file is saved in the memory, and the target configuration file takes effect when the target service process is started.
[0072] The configuration management method for the service process provided in this embodiment determines the target service process according to the current usage scenario, obtains the characteristics of the target service process, generates a characteristic configuration file corresponding to the characteristic according to a preset database, assembles the characteristic configuration file based on the priority of the characteristic, obtains the target configuration file, and starts the target service process based on the target configuration file. This method does not require manual management of the configuration file. When the service process starts, the target configuration file can be assembled automatically by setting the priority, which improves the flexibility of the system and ensures the efficiency of configuration management.
[0073] In this embodiment, a configuration management method for a service process is provided, and the method comprises the following steps:
[0074] Step S201, determining a target service process based on a current usage scenario.
[0075] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0076] Step S202: Acquire characteristics corresponding to the target service process, and generate a characteristic configuration file corresponding to the characteristics based on a preset database.
[0077] Specifically, the above step S202 includes: 2.2.1.3
[0078] Step S2021, obtaining a preset template configuration file of the characteristic.
[0079] A corresponding preset template configuration file is generated for each characteristic and stored. When a characteristic configuration file of a characteristic needs to be generated, the preset template configuration file corresponding to the characteristic is obtained.
[0080] Step S2022: Acquire configuration items corresponding to the characteristics and values of the configuration items from a preset database.
[0081] The preset database includes the corresponding relationship between configuration items and characteristics.
[0082] There is a correspondence between configuration items and features. One feature can correspond to multiple configuration items. Configuration items can be considered as a kind of attribute. The correspondence between each feature and configuration item is established and stored in the database config table, where default values of configuration items are also preset.
[0083] When a feature configuration file needs to be generated, the configuration items corresponding to the features and the values of the configuration items are obtained from the preset database.
[0084] Step S2023: assemble the preset template configuration file based on the configuration items corresponding to the characteristics and the values of the configuration items to generate a characteristic configuration file.
[0085] The preset template configuration file is filled according to the configuration items corresponding to the characteristics obtained from the preset database and the values of the configuration items, and the characteristic configuration file is generated by automatically assembling the preset template configuration file.
[0086] Obtain the configuration items required for each feature of the target service process. Each feature corresponds to multiple different configuration items. Store the feature configuration file of each feature. Upload the created feature configuration file to each node in the cluster for storage.
[0087] Different feature configuration files can have the same configuration items, and different features can rely on the same configuration item. The content and format of the configuration item are consistent. You can set the configuration items and their values in all feature configuration files to a unified format, for example, key:value format, where key represents the abbreviated semantics of a configuration item and value represents the value of the configuration item. For the format of feature configuration files, see Figure 2 .
[0088] Step S203: assemble the feature configuration files based on the feature priority to obtain the target configuration file. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0089] Step S204: Start the target service process based on the target configuration file. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0090] The configuration management method for the service process provided in this embodiment stores the correspondence between the characteristics and the configuration items in the preset database, and fills the preset template configuration file by obtaining the configuration items corresponding to the characteristics and the values of the configuration items from the preset database, thereby generating a characteristic configuration file corresponding to the characteristics. It is not necessary to maintain the configuration file of each characteristic separately, but only the data in the preset database needs to be maintained, which improves management efficiency.
[0091] In some optional implementations, the configuration management method of the service process further includes: determining the correspondence between the target service process and the characteristic configuration file based on the correspondence between the target service process and the characteristic, and the correspondence between the characteristic and the characteristic configuration file.
[0092] There is a correspondence between the target service process and the characteristics. One target service process can correspond to multiple characteristics. Characteristics have corresponding characteristic configuration files. Based on the above correspondence, a correspondence between the target service process and the characteristic configuration file can be established, so that the service process can be formed according to the correspondence.
[0093] Furthermore, the above step S103 includes the following steps:
[0094] Step S301, reading a characteristic configuration file of each characteristic in a target service process.
[0095] When you need to start the target service process, you need to read the target configuration file corresponding to the target service process. The target configuration file is composed of feature configuration files of multiple features. First, you need to read all the features corresponding to the target service process and the feature configuration files of each feature.
[0096] Step S302: determine whether there are identical configuration items in each characteristic configuration file, and obtain a determination result.
[0097] The feature configuration files of different features may contain the same configuration items. The values of the configuration items can be the same or different. This is determined by reading all feature configuration files.
[0098] Priorities are set between multiple features based on the usage scenarios of the service processes. For a newly initialized system, a default priority is defined between features for different service processes.
[0099] During use, users can set the priority of each feature according to their needs. When setting the priority, they can do so by assigning weights. Specifically, the weight of each feature can be calculated based on the number of user views, feature usage, etc., and the priority of each feature can be determined by giving each feature a weight value. Consider the priority from the user's perspective to achieve the most direct business value. When reading, the configuration file can be read in order from low to high priority.
[0100] Step S303, when the judgment result is yes, the same configuration item in the feature configuration file corresponding to the feature with a high priority is overwritten with the same configuration item in the feature configuration file corresponding to the feature with a low priority, and a unique value of the same configuration item is determined;
[0101] Step S304: determining a target configuration file based on different configuration items and identical configuration items in the characteristic configuration file.
[0102] Start reading from the configuration file of the lowest priority feature, and write the new configuration file in the order of configuration items. For example, the lowest priority feature 1 has configuration 1: parameter 1-1, configuration 2: parameter 1-2 and configuration 3: parameter 1-3. The three configurations are updated in the memory and a corresponding relationship is established between the processes.
[0103] When it is determined that different features have the same configuration items, they are overwritten according to the priority of the features. The features with higher priority overwrite the features with lower priority. Figure 3 For example, the configuration file of feature 1 contains configuration 1: parameter 1-1, configuration 2: parameter 1-2 and configuration 3: parameter 1-3, and the configuration file of feature 2 contains configuration 2: parameter 2-2, configuration 3: parameter 2-3 and configuration 4: parameter 2-4. Feature 2 has a higher priority than feature 1, so the configurations saved in the newly generated configuration file are configuration 1: parameter 1-1, configuration 2: parameter 2-2, configuration 3: parameter 2-3 and configuration 4: parameter 2-4. And so on, a final version of the configuration is finally generated and saved in the memory, that is, the target configuration file is generated.
[0104] In some optional implementations, when the judgment result is no, configuration items in the feature configuration files of all features are extracted, and the configuration items are assembled to obtain the target configuration file.
[0105] Start reading from the configuration file of the lowest priority feature, and write the new configuration file in the order of configuration items. For example, the lowest priority feature 1 has configuration 1: parameter 1-1, configuration 2: parameter 1-2 and configuration 3: parameter 1-3. Update the three configurations in memory and establish a corresponding relationship with the process. Then start reading from the configuration file with the second lowest priority, and fill the configuration file in the order of configuration items if there is no configuration item to be written in the new configuration file.
[0106] According to the feature list contained in the service process, unused features are skipped directly and no new configuration files are written.
[0107] The above method flow can be found in Figure 4 .
[0108] In some optional implementations, the configuration management method of the service process further includes:
[0109] Step S401, in response to the tuning switch being turned on, extracting configuration items in the feature configuration files of all features, and combining the configuration items to obtain at least one configuration item combination;
[0110] Step S402, traversing the configuration item combinations to determine the resource occupancy of each configuration item combination;
[0111] Step S403: determine the configuration item combination with the smallest resource occupation as the target configuration file.
[0112] In actual use, there is a relationship between the versions of various configurations. Some configurations in low-priority features may also meet the use requirements of high-priority features, and these configurations may allow the service process to occupy less computer resources. Therefore, based on the above solution, a configuration and parameter tuning switch is provided. When the tuning switch is turned on, the necessary configurations and parameters are retained during the configuration generation process, and other iterative configurations and parameters are sorted by priority, and then all configuration item combinations are traversed. For example Figure 5 As shown. By pre-starting the service, we can obtain the resource occupancy and service usage of different combinations. On the basis of ensuring the normal operation of the service, we can select the parameter combination with the smallest resource occupancy, and start the service process according to the configuration with the smallest resource occupancy. The switch of the tuning parameter will increase exponentially with the increase of the number of parameters. During use, you can decide whether to turn it on or off according to the actual situation.
[0113] In this embodiment, a configuration management method for a service process is provided, and the method comprises the following steps:
[0114] Step S501, determining the characteristics corresponding to the service process.
[0115] According to different usage scenarios, the system starts different service processes. The various functions included in the usage scenarios can correspond to various features in the service process, and the service process corresponds to multiple features. According to the current usage scenario, the system determines the service process corresponding to the current usage scenario and obtains the corresponding multiple features in the service process.
[0116] Step S502: determining configuration items and values of the configuration items corresponding to the characteristics from a preset database.
[0117] The preset database includes the correspondence between configuration items and features.
[0118] There is a correspondence between configuration items and features. One feature can correspond to multiple configuration items. Configuration items can be considered as a kind of attribute. The correspondence between each feature and configuration item is established and stored in the database config table, where default values of configuration items are also preset.
[0119] When a feature configuration file needs to be generated, the configuration items corresponding to the features and the values of the configuration items are obtained from the preset database.
[0120] Step S503: Obtain a preset template configuration file of the characteristic.
[0121] A corresponding preset template configuration file is generated for each characteristic and stored. When a characteristic configuration file of a characteristic needs to be generated, the preset template configuration file corresponding to the characteristic is obtained.
[0122] Step S504: assemble the preset template configuration file based on the configuration items corresponding to the characteristics and the values of the configuration items to generate a characteristic configuration file.
[0123] The preset template configuration file is filled according to the configuration items corresponding to the characteristics obtained from the preset database and the values of the configuration items, and the characteristic configuration file is generated by automatically assembling the preset template configuration file.
[0124] Step S505: Save the characteristic configuration file, in which the configuration items and the values of the configuration items are in a unified format.
[0125] Obtain the configuration items required for each feature of the target service process. Each feature corresponds to multiple different configuration items. Store the feature configuration file of each feature. Upload the created feature configuration file to each node in the cluster for storage.
[0126] Different feature configuration files can have the same configuration items, and different features can rely on the same configuration item, which has the same content and format. The configuration items and their values in all feature configuration files can be set to a unified format, for example, key:value format, where key represents the abbreviated semantics of a configuration item and value represents the value of the configuration item.
[0127] Step S506: Establish a correspondence between the characteristic configuration file and the service process.
[0128] There is a correspondence between the target service process and the characteristics. One target service process can correspond to multiple characteristics. Characteristics have corresponding characteristic configuration files. Based on the above correspondence, a correspondence between the target service process and the characteristic configuration file can be established, so that the service process can be formed according to the correspondence.
[0129] Step S507: in response to the modification of the configuration item in the characteristic configuration file, the characteristic configuration file is updated.
[0130] The configuration items of the feature can be modified according to the actual application scenario and customer requirements. If the configuration items of the feature need to be modified, the configuration file is modified to obtain a new feature configuration file.
[0131] Step S508: save the updated characteristic configuration file, and establish a corresponding relationship between the updated characteristic configuration file and the service process.
[0132] The new characteristic configuration file is saved, and a corresponding relationship between the new characteristic configuration file and the service process is established, so that the service process can be reorganized according to the corresponding relationship.
[0133] Step S509: monitoring the characteristic configuration file.
[0134] Real-time monitoring of changes in feature configuration files can be achieved through Python scripts.
[0135] Step S510: When it is detected that the hash value corresponding to the updated characteristic configuration file changes, the service process is restarted.
[0136] Initialize the md5 (hash value) of each configuration file and write it into the database. The script monitors the md5 value of the configuration file in real time. When the md5 value changes, restart the corresponding service process. After the process is successfully started, the changed md5 value will be re-stored. For some steps of the above method, please refer to Figure 6 .
[0137] The configuration management of the above service process is implemented in code and written into a script, which is then written into the service process of each node in the cluster. When the service process starts, the configuration files of each feature are obtained, and the configuration files are parsed according to the priority of the feature according to the above scheme to generate a final version of the configuration, which is saved in the memory. The service process is started according to the configuration items saved in the memory.
[0138] The example of the present invention obtains configuration files of different characteristics according to the characteristics required by the service process, determines whether the configuration sub-items corresponding to each characteristic need to be modified, and if the saved configuration file needs to be modified, the configuration file is modified to obtain a new configuration file. For each saved configuration file, according to the preset characteristic priority, starting from the characteristic with the lowest priority, a configuration item in each characteristic is saved. When a high-priority characteristic has the same configuration item as a low-priority characteristic, the high-priority characteristic shall prevail and overwrite the configuration item of the low-priority characteristic, and finally generates a configuration item suitable for the above-mentioned service process. When the process is started, it is configured according to the final configuration file. Based on the above method, there is no need to manually manage the configuration file, and the requirements for starting the service process are met by comparing the characteristics priorities.
[0139] In this embodiment, a configuration management device for a service process is also provided, which is used to implement the above-mentioned embodiments and implementation methods, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0140] This embodiment provides a configuration management device for a service process, such as Figure 7 As shown, including:
[0141] The process determination module 601 is used to determine the target service process based on the current usage scenario;
[0142] A first configuration file determination module 602 is used to obtain a characteristic corresponding to the target service process, and generate a characteristic configuration file corresponding to the characteristic based on a preset database, wherein the characteristic configuration file includes configuration items and values of the configuration items;
[0143] A second configuration file determination module 603, configured to assemble the characteristic configuration files based on the priority of the characteristic to obtain a target configuration file;
[0144] The process starting module 604 is used to start the target service process based on the target configuration file.
[0145] In some optional implementations, the first configuration file determining module 602 includes:
[0146] A template acquisition unit, used to acquire a preset template configuration file of the characteristic;
[0147] A configuration item acquisition unit, configured to acquire a configuration item corresponding to the characteristic and a value of the configuration item from a preset database, wherein the preset database includes a correspondence between the configuration item and the characteristic;
[0148] The template assembly unit is used to assemble the preset template configuration file based on the configuration items corresponding to the characteristics and the values of the configuration items to generate the characteristic configuration file.
[0149] In some optional implementations, the configuration management device for the service process further includes:
[0150] The corresponding relationship determining module is used to determine the corresponding relationship between the target service process and the characteristic configuration file based on the corresponding relationship between the target service process and the characteristic, and the corresponding relationship between the characteristic and the characteristic configuration file.
[0151] In some optional implementations, the second configuration file determining module 603 includes:
[0152] A feature configuration file reading unit, configured to read the feature configuration file of each feature in the target service process;
[0153] A judging unit, used for judging whether there are identical configuration items in each of the characteristic configuration files, and obtaining a judging result;
[0154] A configuration item overwriting unit, configured to, when the judgment result is yes, overwrite the same configuration item in the feature configuration file corresponding to the feature with a high priority with the same configuration item in the feature configuration file corresponding to the feature with a low priority, and determine a unique value of the same configuration item;
[0155] The first determining unit is configured to determine a target configuration file based on the different configuration items and the same configuration items in the characteristic configuration file.
[0156] In some optional implementations, the second configuration file determining module 603 further includes:
[0157] The second determining unit is configured to extract configuration items in the characteristic configuration files of all the characteristics when the judgment result is no, and assemble the configuration items to obtain a target configuration file.
[0158] In some optional implementations, the configuration management device for the service process further includes:
[0159] a configuration item combination unit, configured to extract configuration items in the feature configuration files of all the features in response to the activation of the tuning switch, and combine the configuration items to obtain at least one configuration item combination;
[0160] A combination traversal unit, used to traverse the configuration item combination and determine the resource occupancy of each configuration item combination;
[0161] The third determining unit is configured to determine the configuration item combination with the smallest resource occupancy as the target configuration file.
[0162] In some optional implementations, the configuration management device of the service process is further used to:
[0163] Determine the characteristics corresponding to the service process;
[0164] Determine, from the preset database, a configuration item corresponding to the characteristic and a value of the configuration item;
[0165] Obtaining a preset template configuration file for the feature;
[0166] Assembling the preset template configuration file based on the configuration items corresponding to the characteristics and the values of the configuration items to generate the characteristic configuration file;
[0167] Saving the characteristic configuration file,
[0168] The configuration items and their values in the feature configuration file adopt a unified format;
[0169] Establishing a correspondence between the characteristic configuration file and the service process;
[0170] In response to modification of a configuration item in the characteristic configuration file, updating the characteristic configuration file;
[0171] Saving the updated feature configuration file, and establishing a corresponding relationship between the updated feature configuration file and the service process;
[0172] monitoring the characteristic profile;
[0173] When it is detected that the hash value corresponding to the updated characteristic configuration file changes, the service process is restarted.
[0174] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0175] The configuration management device of the service process in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0176] The embodiment of the present invention further provides a server having the configuration management device of the above service process.
[0177] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a server provided by an optional embodiment of the present invention, such as Figure 8 As shown, the server includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the server, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple servers can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0178] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0179] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0180] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the server, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0181] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0182] The server further comprises a communication interface 30 for the server to communicate with other devices or a communication network.
[0183] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0184] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0185] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A configuration management method for a service process, characterized in that: The method comprises: Determine the target service process based on the current usage scenario; Acquire a characteristic corresponding to the target service process, and generate a characteristic configuration file corresponding to the characteristic based on a preset database, wherein the characteristic configuration file includes configuration items and values of the configuration items; Assembling the feature configuration files based on the priority of the feature to obtain a target configuration file; The target service process is started based on the target configuration file.
2. The method according to claim 1, characterized in that The generating a characteristic configuration file corresponding to the characteristic based on a preset database includes: Obtaining a preset template configuration file for the feature; Acquire a configuration item corresponding to the characteristic and a value of the configuration item from a preset database, wherein the preset database includes a correspondence between the configuration item and the characteristic; The preset template configuration file is assembled based on the configuration items corresponding to the characteristics and the values of the configuration items to generate the characteristic configuration file.
3. The method according to claim 1, characterized in that: The method further comprises: Based on the correspondence between the target service process and the characteristic, and the correspondence between the characteristic and the characteristic configuration file, the correspondence between the target service process and the characteristic configuration file is determined.
4. The method according to claim 3, characterized in that The step of assembling the feature configuration files based on the priority of the feature to obtain a target configuration file includes: Reading the feature configuration file of each feature in the target service process; Determine whether there are identical configuration items in each of the feature configuration files, and obtain a determination result; When the judgment result is yes, the same configuration item in the feature configuration file corresponding to the feature with a high priority is overwritten with the same configuration item in the feature configuration file corresponding to the feature with a low priority, and a unique value of the same configuration item is determined; A target configuration file is determined based on the different configuration items and the same configuration items in the characteristic configuration file.
5. The method according to claim 4, characterized in that The step of assembling the feature configuration files based on the priority of the feature to obtain a target configuration file further includes: When the judgment result is no, the configuration items in the characteristic configuration files of all the characteristics are extracted, and the configuration items are assembled to obtain a target configuration file.
6. The method according to claim 1, characterized in that The method further comprises: In response to the tuning switch being turned on, extracting configuration items in the feature configuration files of all the features, and combining the configuration items to obtain at least one configuration item combination; Traversing the configuration item combinations to determine resource occupancy of each configuration item combination; The configuration item combination with the smallest resource occupation is determined as the target configuration file.
7. The method according to claim 1, characterized in that The method further comprises: Determine the characteristics corresponding to the service process; Determine, from the preset database, a configuration item corresponding to the characteristic and a value of the configuration item; Obtaining a preset template configuration file for the feature; Assembling the preset template configuration file based on the configuration items corresponding to the characteristics and the values of the configuration items to generate the characteristic configuration file; Saving the characteristic configuration file, The configuration items and their values in the feature configuration file adopt a unified format; Establishing a correspondence between the characteristic configuration file and the service process; In response to modification of a configuration item in the characteristic configuration file, updating the characteristic configuration file; Saving the updated feature configuration file, and establishing a corresponding relationship between the updated feature configuration file and the service process; monitoring the characteristic profile; When it is detected that the hash value corresponding to the updated characteristic configuration file changes, the service process is restarted.
8. A configuration management device for a service process, characterized in that: The device comprises: A process determination module, used to determine the target service process based on the current usage scenario; A first configuration file determination module, configured to obtain a characteristic corresponding to the target service process, and generate a characteristic configuration file corresponding to the characteristic based on a preset database, wherein the characteristic configuration file includes configuration items and values of the configuration items; A second configuration file determination module, configured to assemble the characteristic configuration files based on the priority of the characteristic to obtain a target configuration file; A process starting module is used to start the target service process based on the target configuration file.
9. A server, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the configuration management method for the service process according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the configuration management method for the service process according to any one of claims 1 to 7.
Citation Information
Cited By
Cluster configuration method and device, computer equipment, readable storage medium and program product
CN120429035A
Large model service configuration management method and system
CN121455557A
