Resource dynamic allocation method and device based on log traffic, equipment and storage medium
Through a dynamic resource allocation method based on log traffic, a deep learning model is used to predict traffic and set threshold levels, and resource configuration is dynamically adjusted. This solves the resource waste and service crash problems caused by traditional static allocation strategies, and achieves efficient resource utilization and service availability.
Patent Information
- Application Number
- CN202510789026.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-16
AI Technical Summary
Traditional data center resource management methods rely on static resource allocation strategies and cannot flexibly respond to traffic fluctuations, resulting in service crashes or resource waste.
By obtaining historical traffic log data, using deep learning models to predict current traffic, setting threshold ranges and levels, and dynamically adjusting resource allocation strategies, including increasing or decreasing the number of virtual machines and bandwidth allocation.
It improves the utilization rate of data center resources, avoids resource waste during non-peak periods, ensures high availability and response speed of services during peak periods, and reduces operation and maintenance costs.
Smart Images

Figure CN120658584A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a method, device, equipment and storage medium for dynamic resource allocation based on log traffic. Background Art
[0002] With the development of Internet technology, data centers and cloud computing platforms are facing increasing data processing demands. Traditional data center resource management methods usually rely on static resource allocation strategies, that is, pre-estimating peak traffic demand and allocating resources according to the maximum load.
[0003] However, the traditional resource allocation method cannot flexibly respond to traffic fluctuations because resources are fixed. When traffic increases significantly and exceeds the resource carrying capacity, service crashes will occur. In addition, this method often leads to waste of resources during non-peak hours. That is, when traffic decreases significantly, if high resources are still allocated, many resources will be idle. Summary of the Invention
[0004] The present invention provides a log traffic-based dynamic resource allocation method to achieve dynamic allocation of resources.
[0005] According to a first aspect of the present invention, there is provided a method for dynamic resource allocation based on log traffic, comprising: obtaining historical traffic log data, and predicting current traffic in advance based on the historical traffic log data;
[0006] Obtaining a threshold range that matches the current flow, and determining a corresponding threshold level when the predicted current flow exceeds the threshold range;
[0007] A resource adjustment policy corresponding to the threshold level is obtained, and resources are dynamically allocated according to the resource adjustment policy, wherein an adjustment range of the resource adjustment policy is proportional to the threshold level.
[0008] According to another aspect of the present invention, there is provided a resource dynamic allocation device based on log traffic, comprising: a traffic prediction module for acquiring historical traffic log data and predicting current traffic in advance based on the historical traffic log data;
[0009] A threshold level determination module is used to obtain a threshold range that matches the current flow rate and determine the corresponding threshold level when the predicted current flow rate exceeds the threshold range;
[0010] The resource dynamic allocation module is used to obtain a resource adjustment policy corresponding to the threshold level and dynamically allocate resources according to the resource adjustment policy, wherein the adjustment range of the resource adjustment policy is proportional to the threshold level.
[0011] According to another aspect of the present invention, there is provided an electronic device, comprising: at least one processor; and
[0012] a memory communicatively connected to the at least one processor; wherein,
[0013] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the method according to any embodiment of the present invention.
[0014] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method described in any embodiment of the present invention when executed.
[0015] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which implements the method described in any embodiment of the present invention when executed by a processor.
[0016] The beneficial technical effect of the present invention is that by dynamically adjusting resource allocation, the resource utilization of the data center can be significantly improved, and idle waste of resources during non-peak periods can be avoided. Moreover, by pre-strategizing the current traffic, it is possible to quickly respond and increase the necessary computing resources during traffic peaks, thereby ensuring high availability and response speed of the service.
[0017] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 This is a flow chart of a method for dynamic resource allocation based on log traffic according to embodiment 1 of the present invention;
[0020] Figure 2 This is a flow chart of a method for dynamic resource allocation based on log traffic according to the second embodiment of the present invention;
[0021] Figure 31 is a schematic diagram of the structure of a resource dynamic allocation device based on log traffic according to embodiment 3 of the present invention;
[0022] Figure 4 It is a structural diagram of an electronic device provided by the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions 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 embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or devices. In addition, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse
[0025] Example 1
[0026] Figure 1 The first embodiment of the present invention provides a flow chart of a method for dynamic resource allocation based on log traffic. This embodiment is applicable to the case of dynamic resource allocation. The method can be executed by a dynamic resource allocation device based on log traffic, which can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:
[0027] Step S101: Obtain historical traffic log data, and predict current traffic in advance based on the historical traffic log data.
[0028] Optionally, obtaining historical traffic log data includes: collecting traffic data in and out of the data center within a specified time range and log data from basic equipment, where the basic equipment includes servers and databases; and using the collected traffic data and log data as historical traffic log data.
[0029] Specifically, this implementation deploys traffic collectors at key network nodes in the data center, capturing and recording traffic data entering and leaving the data center in real time. Furthermore, this implementation collects log data from servers, databases, and other infrastructure devices, recording various operations and status information. This traffic data and log data are then used as traffic log data. Because traffic log data is recorded in real time, historical traffic log data within a specified timeframe is obtained for the current node, for example, traffic log data from the day before the current node.
[0030] Optionally, before predicting the current traffic in advance based on the historical traffic log data, the method further includes: preprocessing the historical traffic log data to obtain processed historical traffic log data; extracting specified features from the processed historical traffic log data using feature engineering, wherein the specified features include request type, request source, response time, and error code; and standardizing the extracted specified features to obtain standard features.
[0031] Optionally, current traffic is predicted in advance based on historical traffic log data, including: obtaining a pre-trained deep learning model, wherein the deep learning model includes a long short-term memory network model; inputting standard features within a specified time range into the long short-term memory network model to predict current traffic.
[0032] In this embodiment, before using historical traffic log data to predict current traffic, the historical traffic log data is first analyzed to obtain the standard features contained therein. Specifically, the collected historical traffic log data is transmitted to a centralized data processing center. A big data processing framework with data processing capabilities is used to clean, filter, and format the raw data. The processed data is then imported into a data warehouse to prepare for subsequent analysis. After completing data preprocessing, feature engineering is used to extract useful specified features from the processed historical traffic log data, such as request type, request source, response time, and error code. Of course, this embodiment is only an example and does not limit the specific types of specified features. The specific types can be set according to resource adjustment requirements. In addition, to eliminate the influence of different measurement units, the specified features are normalized to obtain standard features, such as using the Z-score normalization method: Z = (x-μ) / σ, where x is the original feature value, μ is the sample mean, and σ is the sample standard deviation. Of course, this embodiment is only an example and does not limit the normalization method. As long as the units of each specified feature can be unified, it is within the scope of protection of this application.
[0033] Specifically, after acquiring the standard features, this embodiment uses a pre-trained deep learning model, such as a long short-term memory network model, to predict traffic flow, capturing short-term fluctuations through the long short-term memory network model. Since the working principle of the long short-term memory network model is not the focus of this application, it will not be described in detail in this embodiment.
[0034] Step S102: obtaining a threshold range that matches the current flow, and determining a corresponding threshold level when the predicted current flow exceeds the threshold range.
[0035] Optionally, obtaining a threshold range that matches the current one includes: determining a baseline value based on historical traffic log data, and obtaining a dynamic standard deviation based on the current date; using the difference between the baseline value and the dynamic standard deviation as the lower threshold, and using the sum of the baseline value and the dynamic standard deviation as the upper threshold; determining a threshold range that matches the current one based on the lower threshold and the upper threshold.
[0036] In this embodiment, when setting thresholds, a baseline value is calculated based on historical traffic log data. This baseline value serves as the basis for threshold setting. The baseline value can be the average traffic flow over a period of time, the median, or other statistical measure. This embodiment does not specify the specific method for determining the baseline value. Furthermore, this embodiment defines a standard deviation. When actual traffic flows outside this range, it is considered an anomaly, triggering a resource adjustment mechanism. For example, μ + 2σ is set as the upper threshold, μ - 2σ as the lower threshold, and the interval formed by the upper and lower thresholds is used as the threshold range. Dynamic resource adjustments are required when traffic flows below the lower threshold or above the upper threshold. Because traffic flows may increase significantly during holidays or promotional events, it is necessary to appropriately relax the thresholds. Since the baseline value remains constant, the threshold range can be changed by adjusting the standard deviation. Therefore, in this embodiment, the standard deviation is a dynamic standard deviation, and the dynamic threshold value can be obtained based on the current date. Different current dates will result in different dynamic threshold values.
[0037] Optionally, when the predicted current traffic exceeds the threshold range, the corresponding threshold level is determined, including: when the predicted current traffic exceeds the threshold range, determining the difference between the current traffic and the lower threshold or the upper threshold; determining the threshold level based on the difference, wherein each threshold level corresponds to a different resource adjustment strategy.
[0038] Specifically, in this embodiment, multiple levels of thresholds are set, each threshold level corresponds to a different resource adjustment strategy, and different types of threshold levels are set for exceeding the upper threshold and exceeding the lower threshold. An upper threshold level is set for exceeding the upper threshold, and the specific upper threshold levels include multiple levels. For example, the upper threshold is X, when the flow rate exceeds X by 50, it corresponds to the upper threshold level 1, when the flow rate exceeds X by 50-100, it corresponds to the upper threshold level 2, and when the flow rate exceeds X by more than 100, it corresponds to the upper threshold level 3; the lower threshold is Y, when the flow rate exceeds Y by 50, it corresponds to the lower threshold level 1, when the flow rate exceeds Y by 50-100, it corresponds to the lower threshold level 2, and when the flow rate exceeds Y by more than 100, it corresponds to the lower threshold level 3. In this embodiment, only three levels are used as an example for explanation, and the specific number of threshold levels is not limited. In addition, in this embodiment, different resource adjustment strategies correspond to different threshold levels, and the adjustment range of the resource adjustment strategy is proportional to the threshold level. That is, the larger the threshold level corresponding to the current traffic, the more the corresponding resource adjustment strategy increases or decreases the number of virtual machines, and the more loans are allocated or recovered. For example, the upper threshold level one corresponds to an increase of 10% in computing resources, the upper threshold level two corresponds to an increase of 20%, etc. Of course, this embodiment is only an example, and does not limit the specific content of the resource adjustment strategy corresponding to each threshold level.
[0039] In a specific implementation, this embodiment will determine whether the current flow exceeds the threshold range, that is, it is not within the threshold range. When it exceeds the threshold range, it will further determine whether it is less than the lower threshold or greater than the upper threshold. When it is determined to be greater than the upper threshold, the difference between the current flow and the upper threshold will be calculated. When the difference is determined to be 80, it is determined that the current flow corresponds to the upper threshold level 2.
[0040] Step S103: Obtain a resource adjustment policy corresponding to the threshold level, and dynamically allocate resources according to the resource adjustment policy.
[0041] Optionally, obtain the resource adjustment strategy corresponding to the threshold level, including: when the threshold level is the upper threshold level, determine the resource expansion adjustment strategy based on the upper threshold level; when the threshold level is the lower threshold level, determine the resource reduction adjustment strategy based on the lower threshold level.
[0042] Optionally, performing dynamic resource allocation according to a resource adjustment policy includes: increasing the number of virtual machines and increasing bandwidth allocation according to a resource expansion adjustment policy, or decreasing the number of virtual machines and decreasing bandwidth allocation according to a resource reduction adjustment policy.
[0043] Specifically, in this embodiment, after obtaining that the current traffic exceeds the threshold range and determining the threshold level corresponding to the current traffic, since each threshold level corresponds to a resource adjustment policy, the resource adjustment policy corresponding to the determined threshold level is obtained. For example, when the upper threshold level is determined to be level 2, the second resource expansion adjustment policy is determined to be adopted for the current traffic, that is, the current number of virtual machines and allocated bandwidth are increased by 20%; when the lower threshold level is determined to be level 1, the first resource reduction adjustment policy is determined to be adopted for the current traffic, that is, the current number of virtual machines and allocated bandwidth are reduced by 20%. Of course, this embodiment only uses two types of resource adjustment policies as examples for explanation. The methods for other resource adjustment policies are roughly the same and will not be repeated in this embodiment.
[0044] It should be noted that in this embodiment, when the monitored traffic reaches a preset threshold, the resource adjustment mechanism is activated to automatically increase or decrease the number of virtual machines and adjust bandwidth allocation. In addition, this embodiment also monitors traffic in real time. When a sudden large traffic request occurs, the reserved elastic resource pool is immediately called upon to ensure the normal operation of the service. Although this method does not apply to the predicted current traffic, it only takes measures when the detected current traffic is abnormal. Although there is a certain lag, it can ensure service continuity.
[0045] Among them, in this embodiment, by dynamically adjusting resource allocation, the resource utilization rate of the data center can be significantly improved, and idle waste of resources in non-peak periods can be avoided; during traffic peak periods, it can quickly respond and increase necessary computing resources to ensure high availability and response speed of services; through refined resource management, unnecessary hardware investment is reduced and operation and maintenance costs are reduced; an anomaly detection mechanism is introduced, which can promptly initiate protection measures when abnormal traffic is detected to prevent service interruptions and potential security threats; it can be easily integrated into existing cloud computing platforms without the need for large-scale transformation of existing systems; through continuous learning and optimization processes, the accuracy of predictions and the effectiveness of resource allocation are continuously improved to achieve self-optimization.
[0046] In the implementation mode of the present application, by dynamically adjusting resource allocation, the resource utilization rate of the data center can be significantly improved, and idle waste of resources during non-peak periods can be avoided. In addition, by pre-strategizing the current traffic, it is possible to quickly respond and increase the necessary computing resources during traffic peaks, thereby ensuring high availability and response speed of the service.
[0047] Example 2
[0048] Figure 2This is a flow chart of a method for dynamic resource allocation based on log traffic provided by the second embodiment of the present invention. This embodiment is based on the above embodiment and, after dynamically allocating resources according to the resource adjustment strategy, further includes: detecting the result of dynamic resource allocation. Figure 2 As shown, the method includes:
[0049] Step S201: Obtain historical traffic log data, and predict current traffic in advance based on the historical traffic log data.
[0050] Optionally, obtaining historical traffic log data includes: collecting traffic data in and out of the data center within a specified time range and log data from basic equipment, where the basic equipment includes servers and databases; and using the collected traffic data and log data as historical traffic log data.
[0051] Optionally, before predicting the current traffic in advance based on the historical traffic log data, the method further includes: preprocessing the historical traffic log data to obtain processed historical traffic log data; extracting specified features from the processed historical traffic log data using feature engineering, wherein the specified features include request type, request source, response time, and error code; and standardizing the extracted specified features to obtain standard features.
[0052] Optionally, current traffic is predicted in advance based on historical traffic log data, including: obtaining a pre-trained deep learning model, wherein the deep learning model includes a long short-term memory network model; inputting standard features within a specified time range into the long short-term memory network model to predict current traffic.
[0053] Step S202: Obtain a threshold range that matches the current flow rate, and determine the corresponding threshold level when the predicted current flow rate exceeds the threshold range.
[0054] Optionally, obtaining a threshold range that matches the current one includes: determining a baseline value based on historical traffic log data, and obtaining a dynamic standard deviation based on the current date; using the difference between the baseline value and the dynamic standard deviation as the lower threshold, and using the sum of the baseline value and the dynamic standard deviation as the upper threshold; determining a threshold range that matches the current one based on the lower threshold and the upper threshold.
[0055] Optionally, when the predicted current traffic exceeds the threshold range, the corresponding threshold level is determined, including: when the predicted current traffic exceeds the threshold range, determining the difference between the current traffic and the lower threshold or the upper threshold; determining the threshold level based on the difference, wherein each threshold level corresponds to a different resource adjustment strategy.
[0056] Step S203: Obtain a resource adjustment policy corresponding to the threshold level, and dynamically allocate resources according to the resource adjustment policy.
[0057] Optionally, obtain the resource adjustment strategy corresponding to the threshold level, including: when the threshold level is the upper threshold level, determine the resource expansion adjustment strategy based on the upper threshold level; when the threshold level is the lower threshold level, determine the resource reduction adjustment strategy based on the lower threshold level.
[0058] Optionally, performing dynamic resource allocation according to a resource adjustment policy includes: increasing the number of virtual machines and increasing bandwidth allocation according to a resource expansion adjustment policy, or decreasing the number of virtual machines and decreasing bandwidth allocation according to a resource reduction adjustment policy.
[0059] Step S204: testing the result of dynamic resource allocation.
[0060] Specifically, in this embodiment, after dynamically allocating resources according to the resource adjustment policy, the results of the dynamic resource allocation are tested to determine whether the resources have been successfully allocated according to the resource adjustment policy. For example, if the first resource reduction adjustment policy is used, which reduces the current number of virtual machines and allocated bandwidth by 20%, but the current number of virtual machines and allocated bandwidth do not decrease and remain unchanged after executing the first resource reduction adjustment policy, then the adjustment policy execution has failed. The reason for the adjustment policy execution failure may be a software error or a hardware failure. In this case, a resource allocation error prompt message will be generated and sent to the human-computer interaction interface for display, so as to prompt the administrator to promptly repair the equipment or software to ensure the accuracy of the resource adjustment.
[0061] In addition, when it is determined through detection that the allocation is successfully completed according to the resource adjustment strategy, a resource allocation report will also be generated. The resource allocation report includes the specific allocation content of the resources, the service execution status before allocation, and the service execution status after allocation. Of course, this implementation is only an example and does not limit the specific content of the resource allocation report, and the generated resource allocation report will be displayed on the human-computer interaction interface.
[0062] In the implementation mode of the present application, by dynamically adjusting resource allocation, the resource utilization rate of the data center can be significantly improved, and idle waste of resources during non-peak periods can be avoided. In addition, by pre-strategizing the current traffic, it is possible to quickly respond and increase the necessary computing resources during traffic peaks, thereby ensuring high availability and response speed of the service.
[0063] Example 3
[0064] Figure 3This is a structural diagram of a resource dynamic allocation device based on log traffic provided by the third embodiment of the present invention. Figure 3 As shown, the apparatus includes: a traffic prediction module 310 , a threshold level determination module 320 and a resource dynamic allocation module 330 .
[0065] The traffic prediction module 310 is used to obtain historical traffic log data and predict the current traffic in advance based on the historical traffic log data;
[0066] The threshold level determination module 320 is used to obtain a threshold range that matches the current flow rate and determine the corresponding threshold level when the predicted current flow rate exceeds the threshold range;
[0067] The resource dynamic allocation module 330 is configured to obtain a resource adjustment policy corresponding to the threshold level and dynamically allocate resources according to the resource adjustment policy, wherein the adjustment range of the resource adjustment policy is proportional to the threshold level.
[0068] Optionally, the traffic prediction module includes a historical traffic log data acquisition unit for collecting traffic data entering and leaving the data center within a specified time range and log data from basic equipment, wherein the basic equipment includes a server and a database;
[0069] The collected traffic data and log data are used as historical traffic log data.
[0070] Optionally, the device further includes a data analysis module for pre-processing the historical traffic log data to obtain processed historical traffic log data;
[0071] Feature engineering is used to extract specified features from processed historical traffic log data. The specified features include request type, request source, response time, and error code.
[0072] The extracted specified features are standardized to obtain standard features.
[0073] Optionally, the traffic prediction module includes a traffic prediction unit, configured to obtain a pre-trained deep learning model, wherein the deep learning model includes a long short-term memory network model;
[0074] The standard features within the specified time range are input into the long short-term memory network model to predict the current traffic.
[0075] Optionally, the threshold level determination module includes a threshold range acquisition unit, which is used to determine the baseline value based on the historical traffic log data and obtain the dynamic standard deviation based on the current corresponding date;
[0076] The difference between the baseline value and the dynamic standard deviation is used as the lower threshold, and the sum of the baseline value and the dynamic standard deviation is used as the upper threshold;
[0077] The threshold range that matches the current one is determined based on the lower threshold and the upper threshold.
[0078] Optionally, the threshold level determination module includes a threshold level determination unit for determining a difference between the current flow rate and a lower threshold value or an upper threshold value when the predicted current flow rate exceeds a threshold range;
[0079] A threshold level is determined according to the difference, wherein each threshold level corresponds to a different resource adjustment strategy.
[0080] Optionally, the resource dynamic allocation module includes a resource adjustment strategy determining unit, configured to determine a resource expansion adjustment strategy according to the upper threshold level when the threshold level is the upper threshold level;
[0081] When the threshold level is the lower threshold level, a resource reduction adjustment strategy is determined according to the lower threshold level.
[0082] Optionally, the resource dynamic allocation module includes a resource dynamic allocation unit, which is used to increase the number of virtual machines and increase bandwidth allocation according to the resource expansion adjustment strategy.
[0083] Alternatively, reduce the number of virtual machines and reduce bandwidth allocation based on the resource reduction adjustment policy.
[0084] The log traffic-based dynamic resource allocation device provided in the embodiment of the present invention can execute the log traffic-based dynamic resource allocation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0085] Example 4
[0086] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0087] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0088] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0089] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for dynamic resource allocation based on log traffic.
[0090] In some embodiments, the method for dynamic resource allocation based on log traffic can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for dynamic resource allocation based on log traffic described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the method for dynamic resource allocation based on log traffic in any other appropriate manner (for example, by means of firmware).
[0091] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0092] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0093] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0095] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0096] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0097] Example 5
[0098] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the log traffic-based dynamic resource allocation method provided in any embodiment of the present application.
[0099] The computer program product may be implemented by writing computer program code for performing the operations of the present invention in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0100] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0101] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions are possible for those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for dynamic resource allocation based on log traffic, characterized in that: Methods include: Obtaining historical traffic log data and making a prediction of current traffic in advance based on the historical traffic log data; Obtaining a threshold range that matches the current flow, and determining a corresponding threshold level when the predicted current flow exceeds the threshold range; A resource adjustment policy corresponding to the threshold level is obtained, and resources are dynamically allocated according to the resource adjustment policy, wherein an adjustment range of the resource adjustment policy is proportional to the threshold level.
2. The method according to claim 1, characterized in that The obtaining of historical traffic log data includes: Collecting traffic data in and out of the data center within a specified time range, as well as log data from infrastructure equipment, including servers and databases; The collected traffic data and log data are used as the historical traffic log data.
3. The method according to claim 1, characterized in that Before predicting the current traffic in advance based on the historical traffic log data, the method further includes: Preprocessing the historical traffic log data to obtain processed historical traffic log data; extracting specified features from the processed historical traffic log data using feature engineering, wherein the specified features include request type, request source, response time, and error code; The extracted designated features are standardized to obtain standard features.
4. The method according to claim 3, characterized in that The predicting of the current traffic in advance based on the historical traffic log data includes: Obtaining a pre-trained deep learning model, wherein the deep learning model includes a long short-term memory network model; The standard features within a specified time range are input into the long short-term memory network model to predict the current traffic.
5. The method according to claim 1, wherein The obtaining of the threshold range that matches the current one includes: Determine a baseline value based on the historical traffic log data, and obtain a dynamic standard deviation based on the current corresponding date; The difference between the baseline value and the dynamic standard deviation is used as the lower threshold, and the sum of the baseline value and the dynamic standard deviation is used as the upper threshold; The threshold range that matches the current one is determined according to the lower threshold and the upper threshold.
6. The method according to claim 5, characterized in that Determining the corresponding threshold level when the predicted current flow exceeds the threshold range includes: When the predicted current flow exceeds the threshold range, determining a difference between the current flow and the lower threshold or the upper threshold; The threshold level is determined according to the difference, wherein each threshold level corresponds to a different resource adjustment strategy.
7. The method according to claim 1, characterized in that The acquiring of the resource adjustment policy corresponding to the threshold level includes: When the threshold level is an upper threshold level, determining a resource expansion adjustment strategy according to the upper threshold level; When the threshold level is a lower threshold level, a resource reduction adjustment strategy is determined according to the lower threshold level.
8. The method according to claim 7, characterized in that The dynamically allocating resources according to the resource adjustment policy includes: Increase the number of virtual machines and increase bandwidth allocation according to the resource expansion adjustment strategy, Alternatively, the number of virtual machines and bandwidth allocation are reduced according to the resource reduction adjustment policy.
9. A resource dynamic allocation device based on log traffic, characterized in that: The device comprises: A traffic prediction module is used to obtain historical traffic log data and predict the current traffic in advance based on the historical traffic log data; A threshold level determination module is used to obtain a threshold range that matches the current flow rate and determine the corresponding threshold level when the predicted current flow rate exceeds the threshold range; The resource dynamic allocation module is used to obtain a resource adjustment policy corresponding to the threshold level and dynamically allocate resources according to the resource adjustment policy, wherein the adjustment range of the resource adjustment policy is proportional to the threshold level.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. 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 processor to implement the method according to any one of claims 1 to 8 when the processor executes the computer instructions.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when executed by a processor.