Cloud database capacity control method, device and equipment and readable storage medium
Through the deep Q network algorithm combined with real-time and historical data, the Q value of the cloud database expansion and capacity expansion action is calculated, which solves the problem that traditional prediction optimization models cannot accurately control the capacity of cloud databases, and realizes accurate capacity management and efficient resource utilization.
Patent Information
- Application Number
- CN202411121766.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-26
AI Technical Summary
The traditional cloud database prediction optimization model cannot accurately predict the load mode, resulting in inaccurate cloud database capacity control, resulting in wasted resources or unavailability of services.
By obtaining the real-time performance indicators of the cloud database, converting them into real-time state, and adjusting network parameters based on the deep Q network algorithm, calculating the Q value of each scaling action, and executing the action with the largest Q value to achieve capacity control, combining real-time and historical data Continuously adjust to adapt to business needs and environmental changes.
It realizes precise control of cloud database capacity, reduces resource waste, ensures service availability, and improves resource utilization efficiency.
Smart Images

Figure CN119025504A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a cloud database capacity control method, device, equipment and readable storage medium. Background Art
[0002] With the maturity of cloud computing technology and the diversification of cloud services, enterprises are increasingly inclined to migrate their businesses to the cloud. For some scenarios with surging business volume, cloud database providers often use elastic scaling functions, prediction and optimization algorithms, and dynamically adjust resources according to business needs and load changes to meet the needs of applications. Although this technology is very useful in many scenarios, traditional prediction and optimization models are usually built only through historical load data, while user behavior is often changeable and unpredictable, and there may be emergencies in the network (such as system failures or external attacks, etc.), that is, the real-time load data formed based on user behavior or network emergencies is inconsistent with the historical load data, so that the traditional prediction and optimization model cannot accurately predict the load pattern, and then cannot accurately control the capacity of the cloud database, resulting in resource waste or service unavailability.
[0003] It can be seen that how to effectively and accurately control the capacity of cloud databases to avoid resource waste or service unavailability is an issue that needs to be solved urgently. Summary of the invention
[0004] The present application provides a cloud database capacity control method, apparatus, device and readable storage medium, which can effectively realize accurate control of cloud database capacity to avoid problems such as resource waste or service unavailability.
[0005] In a first aspect, an embodiment of the present application provides a cloud database capacity control method, the cloud database capacity control method comprising:
[0006] Obtain the real-time performance indicators of the cloud database and convert the real-time performance indicators into real-time status;
[0007] Adjusting network parameters of a main network based on a deep Q network algorithm based on the real-time state, a historical state corresponding to the cloud database, and historical scaling actions and historical reward values corresponding to the historical state to form a target main network;
[0008] The target main network calculates the Q value corresponding to each expansion and contraction action in the real-time state, and executes the expansion and contraction action with the maximum Q value to achieve capacity control of the cloud database.
[0009] In combination with the first aspect, in one implementation, the historical reward value is determined based on a target reward function, and the target reward function is:
[0010] Reward=ω 1 (NewQPS-OldQPS)-ω 2 (Cost_Increase)
[0011] In the formula, Reward represents the reward value, NewQPS represents the corresponding performance index after the scaling action is executed, NewQPS represents the corresponding performance index before the scaling action is executed, Cost_Increase represents the increased cost after the scaling action is executed, ω 1 and ω 2 are all weight parameters.
[0012] In combination with the first aspect, in one implementation, the real-time performance indicators include instance utilization, CPU utilization, memory usage, fragmentation rate, query rate per second, outbound bandwidth, inbound bandwidth, cache hit rate, total number of keywords and global resources.
[0013] In combination with the first aspect, in one implementation, the scaling action includes not performing scaling, performing scaling, and performing scaling.
[0014] In a second aspect, an embodiment of the present application provides a cloud database capacity control device, the cloud database capacity control device comprising:
[0015] An indicator acquisition module is used to obtain real-time performance indicators of the cloud database and convert the real-time performance indicators into real-time status;
[0016] A parameter adjustment module, which is used to adjust the network parameters of the main network based on the deep Q network algorithm based on the real-time state, the historical state corresponding to the cloud database, and the historical expansion and contraction actions and historical reward values corresponding to the historical state to form a target main network;
[0017] The capacity control module is used to calculate the Q value corresponding to each expansion and contraction action in the real-time state through the target main network, and execute the expansion and contraction action with the maximum Q value to achieve capacity control of the cloud database.
[0018] In conjunction with the second aspect, in one implementation, the historical reward value is determined based on a target reward function, and the target reward function is:
[0019] Reward=ω 1 (NewQPS-OldQPS)-ω 2 (Cost_Increase)
[0020] In the formula, Reward represents the reward value, NewQPS represents the corresponding performance index after the scaling action is executed, OldQPS represents the corresponding performance index before the scaling action is executed, Cost_Increase represents the increased cost after the scaling action is executed, ω 1 and ω 2 are all weight parameters.
[0021] In combination with the second aspect, in one implementation, the real-time performance indicators include instance utilization, CPU utilization, memory usage, fragmentation rate, query rate per second, outbound bandwidth, inbound bandwidth, cache hit rate, total number of keywords and global resources.
[0022] In combination with the second aspect, in one implementation, the scaling action includes not performing scaling, performing scaling, and performing scaling.
[0023] In a third aspect, an embodiment of the present application provides a cloud database capacity control device, the cloud database capacity control device comprising a processor, a memory, and a cloud database capacity control program stored in the memory and executable by the processor, wherein when the cloud database capacity control program is executed by the processor, the steps of the aforementioned cloud database capacity control method are implemented.
[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a cloud database capacity control program is stored, wherein when the cloud database capacity control program is executed by a processor, the steps of the aforementioned cloud database capacity control method are implemented.
[0025] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0026] By converting the real-time performance indicators of the cloud database into real-time status, and adjusting the network parameters of the main network based on the deep Q network algorithm based on the real-time status, the historical status corresponding to the cloud database, and the historical expansion and contraction actions and historical reward values corresponding to the historical status, to form a target main network; then the Q value corresponding to each expansion and contraction action in the real-time state is calculated through the target main network, and the expansion and contraction action with the largest Q value is executed to achieve capacity control of the cloud database. This application continuously adjusts network parameters through real-time feedback and historical performance data to adapt to the ever-changing business needs and technical environment, so that the network can sensitively capture the real-time changes in the system load, accurately predict the fluctuations in the business load, and then realize intelligent decision-making of cloud database expansion and contraction operations, so as to accurately match current business needs, while ensuring the availability of services, and minimizing unnecessary resource usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1This is a flow chart of an embodiment of the cloud database capacity control method of the present application;
[0028] Figure 2 This is a schematic diagram of the Redis automatic expansion and contraction process involved in the embodiment of the present application;
[0029] Figure 3 This is a functional module diagram of an embodiment of a cloud database capacity control device of the present application;
[0030] Figure 4 This is a schematic diagram of the hardware structure of the cloud database capacity control device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0033] In a first aspect, an embodiment of the present application provides a cloud database capacity control method.
[0034] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the cloud database capacity control method of the present application. Figure 1 As shown, the cloud database capacity control method includes:
[0035] Step S10: Obtain real-time performance indicators of the cloud database and convert the real-time performance indicators into real-time status; wherein the real-time performance indicators include instance utilization, CPU utilization, memory usage, fragmentation rate, query rate per second, outbound bandwidth, inbound bandwidth, cache hit rate, total number of keywords and global resources.
[0036] For example, in this embodiment, an agent based on the deep Q network (DQN) algorithm is defined to analyze the current monitoring indicators and global resource status of the cloud database Redis instance through the agent, and then intelligently decide whether to perform operations such as expansion or reduction. Among them, the key performance indicators of the cloud database Redis can be captured in real time through the Prometheus (an open source service monitoring system and time series database) monitoring system in the cluster, and the collected monitoring data is converted into a state representation that can be recognized by the agent, so that the agent can capture the real-time changes of the system load based on the state.
[0037] Specifically, firstly, the performance indicators of the Redis instance are collected in real time through the integrated monitoring tool, and the real-time performance indicators include but are not limited to instance utilization Instance_Utilization, CPU utilization CPU_Utilization, memory utilization Memory_Utilization, fragmentation rate Fragmentation_Rate, query rate per second QPS, outbound bandwidth Outbound_Bandwidth, inbound bandwidth Inbound_Bandwidth, cache hit rate Cache_Hit_Rate, total number of keys Key_Total and global resources Global resource, etc. It can be understood that this embodiment provides comprehensive data support for intelligent decision-making through the integration of multi-dimensional real-time monitoring data.
[0038] It should be noted that the state space State in this embodiment is composed of performance indicators obtained by real-time monitoring, that is, the above real-time performance indicators are formalized as State = {Instance_Utilization, CPU_Utilization, Memory_Utilization, Fragmentation_Rate, QPS, Outbound_Bandwidth, Inbound_Bandwidth, Cache_Hit_Rate, Key_Total, Global resource}.
[0039] Step S20: Based on the real-time state, the historical state corresponding to the cloud database, and the historical scaling actions and historical reward values corresponding to the historical state, the network parameters of the main network based on the deep Q network algorithm are adjusted to form a target main network; wherein the scaling actions include not performing scaling, performing scaling, and performing scaling.
[0040] Exemplarily, in this embodiment, a reinforcement learning network (i.e., an agent) for realizing cloud database capacity control will be constructed based on the DQN algorithm. The reinforcement learning network includes a main network (Q-Network) and a target network (TargetQ-Network), and the structures of the main network and the target network are the same; wherein the main network is used to select the action a of the agent according to the current state s, i.e., to generate a prediction of the current Q value; the parameters of the target network are regularly copied from the main network, which is used to calculate the target value of the Q value. It can be understood that this embodiment can effectively process high-dimensional state space and continuous action space by adopting the advanced DQN algorithm as the decision engine of the agent, thereby improving the accuracy and adaptability of decision making.
[0041] The following combination Figure 2 The training construction process and principles of the reinforcement learning network are explained.
[0042] First, the state space and behavior space are clearly defined to provide a clear decision-making environment for the agent, that is, to convert complex monitoring data into a format that the agent can understand, and to clarify the set of actions that the agent can perform. Specifically, the state space and behavior space are defined separately: the state space State is composed of real-time monitoring performance indicators, that is, State = {Instance_Utilization, CPU_Utilization, Memory_Utilization, Fragmentation_Rate, QPS, Outbound_Bandwidth, Inbound_Bandwidth, Cache_Hit_Rate, Key_Total, Globalresource}; the agent's behavior space Actor is defined as {A1: no expansion or contraction, A2: perform expansion operations, that is, increase a specific number of resources (such as the number of CPU cores, memory capacity, etc.), A3: perform contraction operations, that is, reduce a specific number of resources (such as the number of CPU cores, memory capacity, etc.)}.
[0043] Then, different business load conditions (such as a surge in business traffic) are simulated, and a large amount of performance indicator data is written into the cloud database Redis for model training. Specifically, the key performance indicators of the cloud database Redis are captured in real time through the Prometheus monitoring system and converted into the state space State to obtain the current state s (I, C, M, F, Q, OB, IB, CH, K, G), and the parameters of the main network and the target network are initialized at the same time; then the current state s is input into the initialized main network, so that the main network can determine the expansion and contraction action a from the behavior state Actor (such as no expansion and contraction (A1), expansion (A21), ..., expansion A2n, contraction (A31), ..., contraction A3n) based on the current state s and through the ε-greedy strategy (i.e., the ε-greedy strategy, which refers to randomly selecting an action for exploration based on a small probability ε, and selecting the currently estimated optimal action for use with a large probability) and execute the expansion and contraction action a, that is, execute the corresponding expansion or contraction operation according to the action decision of the intelligent agent, so that the system automatically adjusts the resource allocation of the Redis instance.
[0044] It should be noted that the intelligent agent in this embodiment will learn and optimize its scaling strategy by continuously interacting with the environment to adapt to the ever-changing business needs and system load. That is, the intelligent agent will observe the current state of the environment and decide the actions to be taken based on this state; specifically, according to the selected scaling action a, it will interact with the environment (that is, the key performance indicators of the cloud database Redis) in real time to observe the new state s′ and reward Reward, thereby generating experience (s, a, Reward, s′), and putting the experience (s, a, Reward, s′) into the experience replay pool.
[0045] During the training process, a batch of experiences (s, a, Reward, s′) is randomly sampled from the experience pool so that the target network can calculate the target Q value Q based on the next state s′ and the expansion and contraction action a selected by the greedy strategy target , and the main network calculates the current Q value Q based on the current state s and the scaling action a old ; Then through the DQN error function (such as mean square error function), Q target and Q old To update the Q value, and use optimization algorithms such as gradient descent to update the parameters of the main network so that the new Q value Q generated by the main network newAs close to the target Q value as possible; then regularly copy the parameters of the main network to the target network, and replace the current state s with the next state s′ and repeat the above steps until the stopping condition is met (such as reaching the preset training rounds or performance indicators), and the construction of the reinforcement learning network can be realized; it can be seen that this embodiment ensures the stability and reliability of the model in different business scenarios through convergence verification, so as to ensure that the trained model can respond to changes in monitoring data in real time, and then make efficient, accurate and economical scaling decisions in various business scenarios; finally, the reinforcement learning network is deployed in the production environment to realize automated scaling management without manual intervention.
[0046] It should be noted that the update of the Q value can be achieved by following the following formula:
[0047] Q new (s,a)=Q old (s,a)+α·(Reward+γ·max a′ Q old (s′,a′)-Qold(s,a)
[0048] In the formula, Q new (s,a) represents the updated Q value of taking action a in state s, Q old (s,a) represents the Q value of taking action a in state s, max a′ Q old (s′, a′) represents the maximum Q value of all possible actions a′ in the next state s′, Reward represents the reward, α represents the learning rate, and γ represents the discount factor, which is used to consider the current value of future rewards.
[0049] In order to enable the reinforcement learning model to sensitively capture the real-time changes in system load and dynamically adjust resource allocation to accurately match current business needs, this embodiment will use the performance indicator data obtained by real-time monitoring to control the main network to continuously learn and adjust to optimize future expansion and contraction decisions. Therefore, when this embodiment actually applies the reinforcement learning network, the parameters of the main network will be adjusted based on the real-time state, the previous state corresponding to Redis, and the expansion and contraction actions and reward values corresponding to the previous state to form the target main network.
[0050] Step S30: The target main network is used to calculate the Q value corresponding to each scaling action in the real-time state, and the scaling action with the maximum Q value is executed to achieve capacity control of the cloud database.
[0051] Exemplarily, in this embodiment, in real time, the Q value of each expansion and contraction action (such as not expanding or contracting (A1), expanding (A21), ..., expanding A2n, contracting (A31), ..., contracting A3n) is calculated through the updated target main network, and the expansion and contraction action with the largest Q value is output and automatically executed to achieve automatic control of Redis capacity, thereby effectively reducing the ineffective occupation of resources and greatly improving the utilization efficiency of resources. It can be seen that this embodiment continuously adjusts network parameters through real-time feedback and historical performance data to adapt to the ever-changing business needs and technical environment, thereby enabling the network to sensitively capture real-time changes in system load, accurately predict fluctuations in business load, and then achieve intelligent decision-making for cloud database expansion and contraction operations, thereby accurately matching current business needs, while ensuring service availability, and minimizing unnecessary resource occupation.
[0052] Furthermore, in one embodiment, the historical reward value is determined based on a target reward function, and the target reward function is:
[0053] Reward=ω 1 (NewQPS-OldQPS)-ω 2 (Cost_Increase)
[0054] In the formula, Reward represents the reward value, NewQPS represents the corresponding performance index after the scaling action is executed, OldQPS represents the corresponding performance index before the scaling action is executed, Cost_Increase represents the increased cost after the scaling action is executed, ω 1 and ω 2 are all weight parameters.
[0055] For example, in this embodiment, a reward function is also constructed and designed to motivate the agent to take actions that can optimize performance and reduce costs, that is, the agent will update its strategy based on reward feedback, and optimize future scaling decisions through continuous learning and adjustment. Specifically, after executing the scaling action, the reward value is calculated based on the performance index and cost changes, and the reward value is fed back to the agent to evaluate the effect of the scaling action. Among them, the reward function Reward is constructed based on the performance index changes after scaling and the increase in cost due to resource adjustment, and its specific definition is:
[0056] Reward=ω 1 (NewQPS-OldQPS)-ω 2 (Cost_Increase)
[0057] Where NewQPS represents the performance index after the scaling action is executed, OldQPS represents the performance index before the scaling action is executed, Cost_Increase represents the increased cost after the scaling action is executed, ω 1 and ω 2 are all weight parameters used to balance performance improvement and cost increase. It should be understood that this embodiment guides the agent to learn the optimal expansion and contraction strategy by comprehensively considering the reward function of performance improvement and cost increase and balancing the relationship between the two based on the weight parameters.
[0058] In summary, this embodiment provides a cloud database Redis automatic expansion and contraction technology based on real-time monitoring and reinforcement learning. Among them, the reinforcement learning network in this embodiment can interact with the environment in real time to autonomously learn and quickly formulate the optimal resource management strategy to achieve the purpose of efficient and timely response without manual intervention, so that it can respond in time when facing emergency business scenarios such as sudden increase in traffic, tight server resources or slow response of manual operation and maintenance, thereby ensuring the continuity and stability of the service. In addition, the performance indicator data obtained by real-time monitoring enables the reinforcement learning network to sensitively capture the real-time changes in the system load and intelligently and dynamically adjust resource allocation to accurately match the current business needs, and the automated expansion and contraction process effectively reduces the ineffective occupation of resources and greatly improves the utilization efficiency of resources. At the same time, by accurately predicting the fluctuation of business load and intelligently deciding the corresponding expansion and contraction operations, it can minimize unnecessary resource occupation, thereby achieving effective cost savings and improving the economic benefits of operations. In addition, the reinforcement learning network has good universality and can be flexibly adapted to various cloud product instances, providing a general strategy for elastic expansion and contraction in different scenarios, ensuring the efficient and stable operation of various cloud services.
[0059] It should be understood that since the reinforcement learning algorithm in this embodiment takes into account service stability and response speed in the process of scaling decisions, it effectively guarantees service quality and improves user experience; and it has the ability of self-learning and continuous optimization, so that it can continuously adjust strategies based on historical data and real-time feedback to adapt to changing business needs and technical environments, and can meet the stringent requirements for resource management in modern cloud computing environments.
[0060] In a second aspect, an embodiment of the present application also provides a cloud database capacity control device.
[0061] In one embodiment, referring to Figure 3 , Figure 3 This is a functional module diagram of an embodiment of the cloud database capacity control device of the present application. Figure 3 As shown, the cloud database capacity control device includes:
[0062] An indicator acquisition module is used to obtain real-time performance indicators of the cloud database and convert the real-time performance indicators into real-time status;
[0063] A parameter adjustment module, which is used to adjust the network parameters of the main network based on the deep Q network algorithm based on the real-time state, the historical state corresponding to the cloud database, and the historical expansion and contraction actions and historical reward values corresponding to the historical state to form a target main network;
[0064] The capacity control module is used to calculate the Q value corresponding to each expansion and contraction action in the real-time state through the target main network, and execute the expansion and contraction action with the maximum Q value to achieve capacity control of the cloud database.
[0065] Furthermore, in one embodiment, the historical reward value is determined based on a target reward function, and the target reward function is:
[0066] Reward=ω 1 (NewQPS-OldQPS)-ω 2 (Cost_Increase)
[0067] In the formula, Reward represents the reward value, NewQPS represents the corresponding performance index after the scaling action is executed, OldQPS represents the corresponding performance index before the scaling action is executed, Cost_Increase represents the increased cost after the scaling action is executed, ω 1 and ω 2 are all weight parameters.
[0068] Furthermore, in one embodiment, the real-time performance indicators include instance utilization, CPU utilization, memory usage, fragmentation rate, query rate per second, outbound bandwidth, inbound bandwidth, cache hit rate, total number of keywords and global resources.
[0069] Furthermore, in one embodiment, the scaling action includes not performing scaling, performing scaling, and performing scaling.
[0070] Among them, the functional implementation of each module in the above-mentioned cloud database capacity control device corresponds to each step in the above-mentioned cloud database capacity control method embodiment, and its functions and implementation processes are no longer repeated here.
[0071] In a third aspect, an embodiment of the present application provides a cloud database capacity control device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0072] Reference Figure 4 , Figure 4Schematic diagram of the hardware structure of the cloud database capacity control device involved in the embodiment of the present application. In the embodiment of the present application, the cloud database capacity control device may include a processor, a memory, a communication interface and a communication bus.
[0073] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0074] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect components within the cloud database capacity control device, and interfaces used to interconnect the cloud database capacity control device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0075] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0076] The processor may be a general-purpose processor, and the general-purpose processor may call the cloud database capacity control program stored in the memory and execute the cloud database capacity control method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the cloud database capacity control program is called may refer to the various embodiments of the cloud database capacity control method of the present application, and will not be repeated here.
[0077] Those skilled in the art will understand that Figure 4 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0078] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0079] The readable storage medium of the present application stores a cloud database capacity control program, wherein when the cloud database capacity control program is executed by a processor, the steps of the cloud database capacity control method as described above are implemented.
[0080] Among them, the method implemented when the cloud database capacity control program is executed can refer to the various embodiments of the cloud database capacity control method of the present application, and will not be repeated here.
[0081] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0082] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings 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 limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0083] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0084] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0085] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0087] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A cloud database capacity control method, characterized in that: The cloud database capacity control method comprises: Obtain the real-time performance indicators of the cloud database and convert the real-time performance indicators into real-time status; Adjusting network parameters of a main network based on a deep Q network algorithm based on the real-time state, a historical state corresponding to the cloud database, and historical scaling actions and historical reward values corresponding to the historical state to form a target main network; The target main network calculates the Q value corresponding to each expansion and contraction action in the real-time state, and executes the expansion and contraction action with the maximum Q value to achieve capacity control of the cloud database.
2. The cloud database capacity control method according to claim 1, characterized in that: The historical reward value is determined based on the target reward function, and the target reward function is: Reward=ω1·(NewQPS-OldQPS)-ω2·(Cost_Increase) In the formula, Reward represents the reward value, NewQPS represents the corresponding performance index after the scaling action is executed, OldQPS represents the corresponding performance index before the scaling action is executed, Cost_Increase represents the increased cost after the scaling action is executed, and ω1 and ω2 are both weight parameters.
3. The cloud database capacity control method according to claim 1, characterized in that: The real-time performance indicators include instance utilization, CPU utilization, memory usage, fragmentation rate, query rate per second, outbound bandwidth, inbound bandwidth, cache hit rate, total number of keywords and global resources.
4. The cloud database capacity control method according to claim 1, characterized in that: The scaling actions include not performing scaling, performing scaling, and performing scaling.
5. A cloud database capacity control device, characterized in that: The cloud database capacity control device comprises: An indicator acquisition module is used to obtain real-time performance indicators of the cloud database and convert the real-time performance indicators into real-time status; A parameter adjustment module, which is used to adjust the network parameters of the main network based on the deep Q network algorithm based on the real-time state, the historical state corresponding to the cloud database, and the historical expansion and contraction actions and historical reward values corresponding to the historical state to form a target main network; The capacity control module is used to calculate the Q value corresponding to each expansion and contraction action in the real-time state through the target main network, and execute the expansion and contraction action with the maximum Q value to achieve capacity control of the cloud database.
6. The cloud database capacity control device according to claim 5, characterized in that: The historical reward value is determined based on the target reward function, and the target reward function is: Reward=ω1·(NewQPS-OldQPS)-ω2·(Cost_Increase) In the formula, Reward represents the reward value, NewQPS represents the corresponding performance index after the scaling action is executed, OldQPS represents the corresponding performance index before the scaling action is executed, Cost_Increase represents the increased cost after the scaling action is executed, and ω1 and ω2 are both weight parameters.
7. The cloud database capacity control device according to claim 5, characterized in that: The real-time performance indicators include instance utilization, CPU utilization, memory usage, fragmentation rate, query rate per second, outbound bandwidth, inbound bandwidth, cache hit rate, total number of keywords and global resources.
8. The cloud database capacity control device according to claim 5, characterized in that: The scaling actions include not performing scaling, performing scaling, and performing scaling.
9. A cloud database capacity control device, characterized in that: The cloud database capacity control device includes a processor, a memory, and a cloud database capacity control program stored in the memory and executable by the processor, wherein when the cloud database capacity control program is executed by the processor, the steps of the cloud database capacity control method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a cloud database capacity control program, wherein when the cloud database capacity control program is executed by a processor, the steps of the cloud database capacity control method according to any one of claims 1 to 4 are implemented.
Citation Information
Cited By
Parameter adjusting method of cloud equipment and electronic equipment
CN120743352A
