Resource prediction method and device, medium and equipment
By analyzing the resource consumption prediction information of microservices and storage components, the problems of resource waste and inefficiency in microservice resource deployment are solved, enabling more accurate resource allocation and reasonable resource deployment, thereby improving the reliability and efficiency of application operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-10-21
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies suffer from resource waste and inefficient use in microservice resource deployment, especially when the performance requirements for the same microservice vary in different business scenarios, making it difficult to accurately assess resource consumption.
By obtaining the runtime attribute information of the applications to be assigned, we determine the microservices and storage components, analyze the associated applications and target runtime attributes of each microservice, combine resource consumption reference information, predict the resource consumption of each microservice under each associated application, and combine the resource consumption of the storage component to provide target resource consumption prediction information.
It improves the accuracy of resource forecasting, provides a more reliable basis for resource deployment, ensures the rationality and efficiency of application operation, and reduces resource waste.
Smart Images

Figure CN121900925A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to resource prediction methods, apparatus, media, and equipment. Background Technology
[0002] Microservices are a cloud-native architecture approach that includes numerous loosely coupled and independently deployable small components or services within a single application. This allows for the addition of new features or functionalities to the application without updating the entire application, reducing the cost of scaling the entire application. Furthermore, different technology stacks and programming languages can be used for different services or components.
[0003] For microservice resource deployment, relevant technologies primarily deduce the maximum business capacity of each microservice based on the request limit of the application's input source, and then assess the resource consumption of each microservice as the basis for resource deployment. When multiple cloud-native applications use the same microservice, different business scenarios lead to different performance requirements for the same microservice. For example, some applications need to process large images and therefore require more memory, while others need to handle high-frequency requests and therefore require more CPU (Central Processing Unit). If the resource consumption assessment and deployment methods mentioned above are used, resource waste and inefficient resource utilization will still exist. Summary of the Invention
[0004] To improve the accuracy of resource consumption prediction and thus provide a more reliable and effective basis for resource deployment, this application provides a resource prediction method, apparatus, medium, and equipment. The technical solution is as follows:
[0005] In a first aspect, this application provides a resource prediction method, the method comprising:
[0006] Obtain the runtime attribute information of at least one application to be assigned;
[0007] Determine at least one microservice corresponding to the at least one application to be assigned and at least one storage component corresponding to the at least one application to be assigned;
[0008] From the at least one application to be assigned, determine at least one associated application corresponding to each microservice in the at least one microservice;
[0009] From the runtime attribute information of the at least one application to be assigned, determine the target runtime attribute information of the at least one associated application corresponding to each microservice;
[0010] Obtain resource consumption reference information for each microservice;
[0011] Based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice, determine the first resource consumption prediction information of each microservice under each associated application of the at least one associated application;
[0012] Based on the running attribute information of the at least one application to be allocated, determine the second resource consumption prediction information for each of the at least one storage components;
[0013] Based on the first resource consumption prediction information of each microservice under each associated application in the corresponding at least one associated application and the second resource consumption prediction information of each storage component, the target resource consumption prediction information corresponding to the at least one application to be allocated is obtained.
[0014] In one embodiment of this application, the target microservice is any one of the at least one microservices. The step of determining the first resource consumption prediction information of each microservice under each of the at least one associated applications, based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice, includes:
[0015] If the target microservice does not have the ability to sample data sources, a first resource consumption relationship of the target microservice under each associated application is determined based on the resource consumption reference information of the target microservice; the first resource consumption relationship indicates the relationship between microservice resource consumption data and application device data.
[0016] Based on the target running attribute information of the at least one associated application corresponding to the target microservice, determine the actual application device data of each associated application.
[0017] Based on the actual application device data of each associated application and the first resource consumption relationship of the target microservice under each associated application, the first resource consumption prediction information of the target microservice under each associated application is determined.
[0018] In one embodiment of this application, when the target microservice lacks the ability to sample data sources, determining the first resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice includes:
[0019] From the resource consumption reference information of the target microservice, determine multiple first data groups corresponding to each associated application. Each of the multiple first data groups includes historical microservice resource consumption data and historical application device data.
[0020] Based on the multiple first data sets, a linear fit is performed to obtain the first candidate resource consumption relationship;
[0021] Determine the goodness of fit of the first candidate resource consumption relationship, wherein the goodness of fit characterizes the degree of consistency between the microservice resource consumption data predicted based on the first candidate resource consumption relationship and the historical application device data and the historical microservice resource consumption data;
[0022] If the fit meets the preset threshold condition, the first candidate resource consumption relationship is taken as the first resource consumption relationship.
[0023] In one embodiment of this application, the target microservice is any one of the at least one microservices. The step of determining the first resource consumption prediction information of each microservice under each of the at least one associated applications, based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice, includes:
[0024] If the target microservice has the ability to sample data sources, a second resource consumption relationship of the target microservice under each associated application is determined based on the resource consumption reference information of the target microservice; the second resource consumption relationship indicates the relationship between microservice resource consumption data, application device data, and application sampling frequency.
[0025] Based on the target running attribute information of the at least one associated application corresponding to the target microservice, determine the actual application device data and the actual application sampling frequency of each associated application.
[0026] Based on the actual application device data of each associated application, the actual application sampling frequency of each associated application, and the second resource consumption relationship of the target microservice under each associated application, the first resource consumption prediction information of the target microservice under each associated application is determined.
[0027] In one embodiment of this application, when the target microservice has the ability to sample data sources, determining the second resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice includes:
[0028] From the resource consumption reference information of the target microservice, determine multiple second data groups corresponding to each associated application. Each of the multiple second data groups includes historical microservice resource consumption data, historical application device data, and historical application sampling frequency.
[0029] Based on the historical microservice resource consumption data and the historical application device data in each second data group, a linear fit is performed to obtain the second candidate resource consumption relationship;
[0030] Based on the historical microservice resource consumption data and the historical application sampling frequency in each of the second data groups, a third candidate resource consumption relationship is obtained;
[0031] The second candidate resource consumption relationship and the third candidate resource consumption relationship are merged to obtain the second resource consumption relationship.
[0032] In one embodiment of this application, determining the second resource consumption prediction information for each of the at least one storage component based on the runtime attribute information of the at least one application to be allocated includes:
[0033] Based on the running attribute information, determine the running platform corresponding to the at least one application to be assigned;
[0034] Obtain the operation log information of the operating platform;
[0035] Based on the operation log information, determine the historical resource consumption information of each storage component;
[0036] Based on the historical resource consumption information of each storage component, a second resource consumption prediction information for each storage component is determined.
[0037] In one embodiment of this application, the method further includes:
[0038] Based on the resource consumption reference information of each microservice, determine the resource consumption threshold information of each microservice under the corresponding associated application;
[0039] Based on the resource consumption threshold information of each microservice under each associated application, determine the resource deployment reference information of each microservice;
[0040] Based on the first resource consumption prediction information and preset floating ratio of each microservice under each associated application, the first resource deployment information of each microservice under each associated application is determined;
[0041] Based on the resource deployment reference information of each microservice and the first resource deployment information of each microservice under each associated application, the resource deployment specification information of each microservice is determined.
[0042] In one embodiment of this application, the method further includes:
[0043] Based on the first resource consumption prediction information of each microservice under each associated application in the corresponding at least one associated application, the resource consumption prediction summary information of each microservice is determined.
[0044] Based on the resource consumption prediction summary information of each microservice and the resource deployment specification information of each microservice, the number of replicas deployed for each microservice is determined.
[0045] In one embodiment of this application, the resource consumption prediction summary information includes consumption prediction summary sub-information for each resource among the various resources involved in the corresponding microservice, and the resource deployment specification information includes deployment specification sub-information for each resource among the various resources involved in the corresponding microservice; determining the number of replicas deployed for each microservice based on the resource consumption prediction summary information and the resource deployment specification information of each microservice includes:
[0046] Based on the consumption prediction summary sub-information corresponding to each resource in the resource consumption prediction summary information and the deployment specification sub-information corresponding to each resource in the resource deployment specification information, determine the number of candidate replicas to be deployed for each resource;
[0047] The number of replicas deployed for the corresponding microservice is determined from the number of candidate replicas deployed for each type of resource, wherein the number of replicas deployed is the maximum value among the number of candidate replicas deployed for each type of resource.
[0048] In one embodiment of this application, the method further includes:
[0049] The target resource consumption prediction information is processed by data visualization to obtain resource prediction visualization information corresponding to the at least one application to be allocated.
[0050] The resource prediction visualization information is sent to the terminal so that it is displayed on the resource prediction page of the terminal.
[0051] Secondly, this application provides a resource prediction apparatus, the apparatus comprising:
[0052] The first acquisition module is used to acquire the running attribute information of at least one application to be assigned;
[0053] The microservice and component determination module is used to determine at least one microservice corresponding to the at least one application to be assigned and at least one storage component corresponding to the at least one application to be assigned.
[0054] The associated application determination module is used to determine at least one associated application corresponding to each microservice in the at least one microservice from the at least one application to be assigned;
[0055] The associated application attribute determination module is used to determine the target running attribute information of the at least one associated application corresponding to each microservice from the running attribute information of the at least one application to be assigned.
[0056] The second acquisition module is used to acquire resource consumption reference information for each microservice.
[0057] The first resource consumption prediction module is used to determine the first resource consumption prediction information of each microservice under each of the at least one associated application in the corresponding at least one associated application, based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice.
[0058] The second resource consumption prediction module is used to determine the second resource consumption prediction information of each storage component in the at least one storage component based on the running attribute information of the at least one application to be allocated.
[0059] The target prediction information determination module is used to obtain the target resource consumption prediction information corresponding to the at least one application to be allocated based on the first resource consumption prediction information of each microservice under each of the at least one associated applications and the second resource consumption prediction information of each storage component.
[0060] Thirdly, this application provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement a resource prediction method as described in the first aspect.
[0061] Fourthly, this application provides a computer device including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement a resource prediction method as described in the first aspect.
[0062] Fifthly, this application provides a computer program product comprising computer instructions that, when executed by a processor, implement a resource prediction method as described in the first aspect.
[0063] The resource prediction method, apparatus, medium, and equipment provided in this application have the following technical advantages:
[0064] The solution provided in this application first determines at least one microservice and at least one storage component corresponding to at least one application to be assigned, and determines at least one associated application corresponding to each microservice from the at least one application to be assigned, and determines the target running attribute information of the at least one associated application corresponding to each microservice from the running attribute information of the at least one application to be assigned; based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice, the first resource consumption prediction information of each microservice under each associated application in the at least one associated application can be determined; at the same time, based on the running attribute information of the at least one application to be assigned, the second resource consumption prediction information of each storage component in the at least one storage component can be determined; combining the first resource consumption prediction information of each microservice under each associated application in the at least one associated application and the second resource consumption prediction information of each storage component, the target resource consumption prediction information corresponding to at least one application to be assigned can be obtained. In other words, the solution provided in this application takes at least one application to be allocated as the whole object. By predicting the resource consumption of each microservice in at least one microservice involved in at least one application to be allocated under each corresponding associated application, and the resource consumption of each storage component in at least one storage component involved in at least one application to be allocated, the target resource consumption prediction information for at least one application to be allocated as a whole is determined. This improves the accuracy of resource prediction at the application system level, provides more reliable and effective data basis for the resource deployment of at least one application to be allocated, helps to achieve reasonable and efficient resource allocation, and ensures the running performance and reliability of at least one application to be allocated. Moreover, when predicting the resource consumption of microservices, the solution provided in this application takes into account the differences in resource consumption of the same microservice under different associated applications, which can effectively improve the accuracy of resource prediction and help to achieve more reasonable and efficient resource deployment.
[0065] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0066] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a schematic diagram of the implementation environment of a resource prediction method provided in an embodiment of this application;
[0068] Figure 2 This is a flowchart illustrating a resource prediction method provided in an embodiment of this application;
[0069] Figure 3 This is a schematic diagram illustrating resource consumption reference information for a microservice provided in an embodiment of this application;
[0070] Figure 4 This is a flowchart illustrating a method for determining first resource consumption prediction information, provided in an embodiment of this application.
[0071] Figure 5 This is a schematic diagram of a resource deployment process provided in an embodiment of this application;
[0072] Figure 6(1) is a schematic diagram of a resource prediction page provided in an embodiment of this application;
[0073] Figure 6(2) is a schematic diagram of an operation entry provided in an embodiment of this application;
[0074] Figure 7(1) is a flowchart illustrating a pop-up verification operation provided in an embodiment of this application;
[0075] Figure 7(2) is a flowchart of another pop-up verification operation provided in the embodiments of this application;
[0076] Figure 8 This is a schematic diagram of a resource prediction process for video analytics applications provided in an embodiment of this application;
[0077] Figure 9(1) is an overview diagram of resource prediction visualization information provided in an embodiment of this application;
[0078] Figure 9(2) is a schematic diagram of computing resource details provided in an embodiment of this application;
[0079] Figure 9(3) is a schematic diagram of middleware storage details provided in an embodiment of this application;
[0080] Figure 9(4) is a schematic diagram showing the details of a distributed file storage provided in an embodiment of this application;
[0081] Figure 9(5) is a schematic diagram of a resource distribution dashboard provided in an embodiment of this application;
[0082] Figure 10 This is a schematic diagram of the platform architecture of an interactive platform provided in an embodiment of this application;
[0083] Figure 11 This is a schematic diagram of a resource prediction device provided in an embodiment of this application;
[0084] Figure 12 This is a schematic diagram of the hardware structure of a device for implementing a resource prediction method provided in an embodiment of this application. Detailed Implementation
[0085] This application provides resource prediction methods, apparatus, media, and devices. The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout.
[0086] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0087] To facilitate understanding of the technical solutions and their effects described in the embodiments of this application, the relevant technical terms are explained in the embodiments of this application:
[0088] SVAP: SmartVideoAnalysis Platform is an intelligent video analysis platform based on scene understanding. It provides government and enterprise customers in various industries with hundreds of out-of-the-box algorithm applications that can meet the video analysis needs of different scenarios.
[0089] Application: By summarizing and abstracting the business scenarios and functional requirements of various industries, a general set of functions is designed to meet business needs. This set of functions can be called an application, which is implemented by at least one microservice and at least one storage component.
[0090] Resources: The hardware environment provided on the server to support the normal operation of applications, such as CPU (Central Processing Unit), memory, GPU (Graphics Processing Unit), etc.
[0091] Input source: When performing application functions, data streams including but not limited to video and images are required as data sources, and these data sources are collectively referred to as input sources.
[0092] Application performance testing: Under the premise of ensuring the normal operation of the application and providing services, obtain the resource data required by the microservices and storage components involved in the application under the specified number and type of input sources.
[0093] It is understood that in the specific implementation of this application, data related to the application's running attributes, platform version, etc., are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0094] Please see Figure 1 This is a schematic diagram illustrating the implementation environment of a resource prediction method provided in this application embodiment, such as... Figure 1 As shown, the implementation environment may include at least client 01 and server 02.
[0095] Specifically, the client 01 may include devices such as smartphones, desktop computers, tablets, laptops, in-vehicle terminals, digital assistants, smart wearable devices, and voice interaction devices. It may also include software running on the device, such as web pages provided to users by service providers, or applications provided by those service providers. Specifically, the client 01 can be used to display a resource prediction page and obtain the running attribute information of at least one application to be assigned, input by the user based on the resource prediction page. The client 01 sends the running attribute information of at least one application to be assigned to the server 02, so that the server 02, in response to the running attribute information of at least one application to be assigned, determines the target resource consumption prediction information of at least one application to be assigned. The client 01 can also receive resource prediction visualization information corresponding to at least one application to be assigned, obtained after the server 02 performs data visualization processing on the target resource consumption prediction information, and display the resource prediction visualization information on the resource prediction page.
[0096] Specifically, the server 02 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server 02 may include network communication units, processors, and memory, etc. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein. Specifically, the server 02 can be used to, after obtaining the runtime attribute information of at least one application to be assigned sent by the client 01, determine at least one microservice corresponding to at least one application to be assigned and at least one storage component corresponding to at least one application to be assigned, determine at least one associated application corresponding to each microservice of at least one microservice from at least one application to be assigned, and determine the target runtime attribute information of at least one associated application corresponding to each microservice from the runtime attribute information of at least one application to be assigned. The server 02 can also obtain resource consumption reference information for each microservice. The server 02 can determine the first resource consumption prediction information of each microservice under each of the at least one associated applications based on the resource consumption reference information of each microservice and the target running attribute information of at least one associated application corresponding to each microservice; the server 02 can determine the second resource consumption prediction information of each of the at least one storage components based on the running attribute information of at least one application to be allocated; combining the first resource consumption prediction information of each microservice under each associated application and the second resource consumption prediction information of each storage component, the target resource consumption prediction information of at least one application to be allocated as a whole can be determined.
[0097] This application embodiment can also be implemented using cloud technology. Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. It can also be understood as a general term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies based on cloud computing business models. Cloud technology requires cloud computing as its support. Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." Specifically, the server 02 and the database are located in the cloud. The server 02 can be a physical machine or a virtualized machine.
[0098] The following describes a resource prediction method provided in this application. Figure 2 This is a flowchart illustrating a resource prediction method provided in an embodiment of this application. This application provides the operational steps of the method described in the embodiments or flowchart, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the method can be executed sequentially according to the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Please refer to... Figure 2 The resource prediction method provided in this application embodiment may include the following steps:
[0099] S210: Obtain the runtime attribute information of at least one application to be assigned.
[0100] In this embodiment, at least one application to be allocated is all or part of an application running on a cloud-native architecture or platform, implementing application functionality through microservices and storage components. At least one application to be allocated may be an application selected by the user awaiting allocation or reallocation of microservice resources and storage component resources.
[0101] In this embodiment, the runtime attribute information of at least one application to be assigned is used to indicate the application's runtime characteristics on the platform, its business characteristics, and functional characteristics. For example, the at least one application to be assigned may be multiple video analytics early warning applications, namely, a safety production operation compliance analysis early warning application, an environmental hazard analysis early warning application, and a regional hazardous behavior analysis early warning application. The runtime attribute information may include the application version, business scenario type, input source data type, number of input sources, data sampling frequency, alarm data retention duration, platform version, and platform data flow duration for each video analytics early warning application. Furthermore, the at least one application to be assigned may also be different types of applications, depending on the user's resource prediction and deployment needs; this application does not limit this.
[0102] S220: Identify at least one microservice corresponding to at least one application to be assigned and at least one storage component corresponding to at least one application to be assigned.
[0103] Understandably, a common approach is to deploy microservices using multiple replicas, which means deploying multiple replicas of a microservice and distributing them across different physical servers, virtual machines, or containers for use by different applications. This also ensures that even if one replica fails, the other replicas can still continue to provide services.
[0104] In the embodiments of this application, at least one microservice corresponding to at least one application to be assigned is a set of microservice types used by at least one application to be assigned, that is, it does not include copies of microservices. The types of microservices used by different applications to be assigned may be the same or different. If the same type of microservice is used by multiple applications to be assigned, the resource requirements and performance requirements of the above-mentioned multiple applications to be assigned for the same type of microservice will be different.
[0105] In this embodiment, at least one storage component corresponding to at least one application to be assigned is a set of storage component types used by at least one application to be assigned. The types of storage components may include, but are not limited to, databases (DB), Elasticsearch (ES, a search data analysis engine), Kafka (a distributed message queue), etc.
[0106] S230: From at least one application to be assigned, determine at least one associated application corresponding to each microservice in at least one microservice.
[0107] In this application embodiment, each microservice corresponds to at least one associated application, which is a set of applications using the corresponding microservice within at least one application to be allocated. This application incorporates the resource demand differences of each microservice under different associated applications into the resource consumption prediction process, thereby improving the accuracy of resource consumption prediction.
[0108] S240: From the runtime attribute information of at least one application to be assigned, determine the target runtime attribute information of at least one associated application corresponding to each microservice.
[0109] In the embodiments of this application, the target running attribute information of at least one associated application is used to indicate the running characteristics of at least one associated application on the platform, the business characteristics and functional characteristics of the application itself, etc., which can be referred to the foregoing embodiments and will not be repeated here.
[0110] S250: Obtain reference information on resource consumption for each microservice.
[0111] In the embodiments of this application, the resource consumption reference information of each microservice is used to indicate the demand reference information of each microservice for at least one resource, wherein the at least one resource may include, but is not limited to, memory, CPU, GPU, NPU (Neural Processing Unit), and the demand reference information for at least one resource can be used to indicate the relationship between the resource quantity (dependent variable) of at least one resource and at least one resource consumption influencing factor (independent variable, such as the number of devices, sampling frequency, etc.).
[0112] In this embodiment, the resource consumption reference information for each microservice may be the resource consumption information of each microservice within a historical service period. The resource consumption reference information for each microservice may include the historical resource consumption information of each microservice on the above-mentioned at least one resource under each associated application. Alternatively, the resource consumption reference information for each microservice may be the resource consumption information of each microservice under a stress test environment. The resource consumption reference information for each microservice may include the resource consumption of the corresponding microservice on the above-mentioned at least one resource under different test conditions (such as different input data source devices).
[0113] It is feasible to first conduct stress tests on each application under different numbers of devices, and record the CPU, memory, GPU, and other resource consumption of each microservice used by each application under different numbers of devices. Collect resource consumption data as reference information for microservice resource consumption, which can be used for subsequent resource prediction. During stress testing, Grafana (a system monitoring tool) can be used to continuously monitor the running status of each microservice, such as... Figure 3 It displays and shows data metrics such as average, maximum, and minimum values of resources like CPU, GPU, and memory. Furthermore, it can display charts showing how the various resources consumed by each microservice change over time.
[0114] S260: Based on the resource consumption reference information of each microservice and the target running attribute information of at least one associated application corresponding to each microservice, determine the first resource consumption prediction information of each microservice under each associated application of the at least one associated application.
[0115] In this embodiment of the application, the resource consumption reference information of each microservice is used as a reference basis, and the target running attribute information of at least one associated application corresponding to each microservice is used as the current constraint condition. The amount of resources required by each microservice to satisfy each associated application in the at least one associated application can be predicted, thereby obtaining the first resource consumption prediction information of each microservice under each associated application in the at least one associated application.
[0116] In one embodiment of this application, the resource consumption reference information of each microservice can be used to indicate the relationship between the resource quantity (dependent variable) of at least one resource required by each microservice and at least one resource consumption influencing factor (independent variable, such as the number of devices or sampling frequency). Therefore, based on the type of each microservice and the resource consumption reference information of each microservice, the resource consumption relationship corresponding to each microservice can be fitted. Then, based on the resource consumption relationship corresponding to each microservice and the target running attribute information of at least one associated application corresponding to each microservice, the first resource consumption prediction information of each microservice under each associated application in the corresponding at least one associated application can be determined. Taking a target microservice as an example, the target microservice is any one of the at least one microservices, such as... Figure 4 As shown, step S260 can be implemented as follows:
[0117] S261: When the target microservice does not have the ability to sample the data source, determine the first resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice; the first resource consumption relationship indicates the relationship between the microservice resource consumption data and the application device data.
[0118] In an exemplary embodiment of this application, the target microservice does not have the ability to sample data sources. The amount of various resources consumed by the target microservice is mainly affected by the application device data and increases with the increase of application device data. Therefore, a first resource consumption relationship corresponding to the target microservice can be linearly fitted. It is understood that the above embodiment is based on the example that the target microservice does not have the ability to sample data sources in each corresponding associated application. Therefore, the first resource consumption relationship of the target microservice in each corresponding associated application can be the same, equivalent to the first resource consumption relationship corresponding to the target microservice described above. Specifically, step S261 may include:
[0119] S2611: From the resource consumption reference information of the target microservice, determine multiple first data groups corresponding to each associated application. Each of the multiple first data groups includes historical microservice resource consumption data and historical application device data.
[0120] In an exemplary embodiment of this application, taking GPU resources as an example, let y be the GPU resource consumption under x number of devices, b be the GPU resource consumption required to start the target microservice, and k be the GPU consumption increase for each additional application device. The specific values of x and y can be obtained from the resource consumption reference information of the target microservice. Taking two first data sets (historical application device data x1, historical microservice resource consumption data y1) and (historical application device data x2, historical microservice resource consumption data y2) as examples, formulas (1) and (2) can be obtained:
[0121] f(x1)=y1 (1)
[0122] f(x²) = y² (2)
[0123] Here, f represents the resource consumption relationship to be determined.
[0124] S2612: Based on multiple first data sets, perform linear fitting to obtain the first candidate resource consumption relationship.
[0125] In the case of linear fitting, k and b can be calculated from the above data, as shown in formulas (3) and (4):
[0126]
[0127] b = y1 - k*x1 or b = y2 - k*x2 (4)
[0128] Then, the candidate resource consumption relationship f can be fitted as follows:
[0129] f(x)=kx+b (5)
[0130] S2613: Determine the goodness of fit of the first candidate resource consumption relationship. The goodness of fit characterizes the degree of consistency between the microservice resource consumption data predicted based on the first candidate resource consumption relationship and historical application device data and the historical microservice resource consumption data.
[0131] In the above embodiments, the goodness of fit of the candidate resource consumption relationship obtained by using two sets of data for linear fitting is 100%; when using three or more sets of data for linear fitting, the goodness of fit of the candidate resource consumption relationship obtained is less than 100%.
[0132] S2614: If the fitting degree of the first candidate resource consumption relationship meets the preset threshold condition, the candidate resource consumption relationship shall be taken as the first resource consumption relationship.
[0133] Based on the aforementioned exemplary embodiments of this application, according to formulas (3), (4), and (5) and the corresponding actual application device data x 输入 The corresponding y can be calculated. 输出 Specifically, it can be shown in formula (6):
[0134]
[0135] The preset threshold condition is used to indicate the minimum value that the fit of the first resource consumption relationship needs to meet; for example, it can be 95%.
[0136] If the fit of the first candidate resource consumption relationship does not meet the preset threshold condition, multiple sets of data can be reselected and linear fitting can be performed again.
[0137] In the above embodiments, the first resource consumption relationship can be quickly determined by linear fitting.
[0138] In one embodiment of this application, the first resource consumption relationship may include a first resource consumption sub-relationship corresponding to each of the multiple resources. Each first resource consumption sub-relationship can be determined by referring to the process of the above embodiments, wherein the preset threshold conditions corresponding to the first resource consumption relationships of different resources may be different.
[0139] S262: Determine the actual application device data for each associated application based on the target runtime attribute information of at least one associated application corresponding to the target microservice.
[0140] The target runtime attribute information is information related to at least one associated application corresponding to the target microservice in the runtime attribute information. It can indicate the runtime characteristics of the above-mentioned at least one associated application on the platform, the business characteristics and functional characteristics of the application itself, etc., and can include at least the actual application device data of each of the above-mentioned at least one associated application.
[0141] In one exemplary embodiment of this application, the target microservice is a behavior recognition service, and the associated application is a regional dangerous behavior analysis and early warning application. The actual application device data of the associated application is the number of currently connected cameras.
[0142] S263: Based on the actual application device data of each associated application and the first resource consumption relationship of the target microservice under each associated application, determine the first resource consumption prediction information of the target microservice under each associated application.
[0143] Based on the first resource consumption relationship of the target microservice under each associated application and the independent variable (the actual application device data of each associated application), the specific data of the dependent variable can be determined, that is, the first resource consumption prediction information of the target microservice under each associated application can be determined. The first resource consumption prediction information may include the resource consumption data of the target microservice for each type of resource under each associated application.
[0144] In the above embodiments, when the target microservice does not have the ability to sample data sources, the first resource consumption relationship corresponding to the target microservice can be linearly fitted based on the resource consumption reference information of the target microservice. Then, based on the first resource consumption relationship corresponding to the target microservice and the target running attribute information of at least one associated application corresponding to the target microservice, the first resource consumption prediction information of the target microservice under each associated application in the at least one associated application can be determined. This can effectively reduce the complexity and cost of resource prediction and achieve reasonable and accurate resource prediction.
[0145] S264: If the target microservice has the ability to sample data sources, determine the second resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice; the second resource consumption relationship indicates the relationship between microservice resource consumption data, application device data, and application sampling frequency.
[0146] In an exemplary embodiment of this application, the target microservice has the ability to sample data sources. The amount of various resources consumed by the target microservice is mainly affected by the application device data and the application sampling frequency. It increases with the increase of application device data when the application sampling frequency remains constant, and also increases with the increase of the application sampling frequency when the application device data remains constant. Alternatively, it can be described as decreasing with the increase of the application sampling interval when the application device data remains constant. Therefore, a second resource consumption relationship corresponding to the target microservice can be linearly fitted. It is understood that the above embodiment takes the example of the target microservice having the ability to sample data sources under each corresponding associated application. Therefore, the second resource consumption relationship of the target microservice under each corresponding associated application can be the same, equivalent to the second resource consumption relationship corresponding to the target microservice described above. Specifically, step S264 may include:
[0147] S2641: From the resource consumption reference information of the target microservice, determine multiple second data groups corresponding to each associated application. Each of the multiple second data groups includes historical microservice resource consumption data, historical application device data, and historical application sampling frequency.
[0148] In an exemplary embodiment of this application, taking GPU resource computation as an example, assuming the number of devices is x and the sampling interval duration used in the test environment is i (the sampling interval duration is inversely proportional to the sampling frequency), the GPU resource consumption of the target microservice is y, the GPU resource consumption required for the microservice to start is b, and the increased GPU consumption for each additional application device is k. Here, i can be set to a fixed value during testing, and x and y can also be obtained from the resource consumption reference information of the target microservice, in multiple second data sets (x1, i1, y). 1,i1 (x1,i2,y)1,i2 (x2,i1,y) 2,i1 (x2,i2,y) 2,i2 Taking ) as an example, we can obtain formulas (7) and (8):
[0149] g(x1,i1)=y 1,i1 g(x1,i2)=y 1,i2 (7)
[0150] g(x2,i1)=y 2,i1 g(x2,i2)=y 2,i2 (8)
[0151] Where g represents the resource consumption relationship to be determined;
[0152] S2642: Based on the historical microservice resource consumption data and historical application device data in each second data group, perform linear fitting to obtain the second candidate resource consumption relationship.
[0153] In the case of linear fitting, the linear ratio k and linear bias b can be calculated using data with consistent sampling intervals, as shown in formulas (9) and (10):
[0154]
[0155] b = y 1,i1 -k*x1 or b=y 2,i1 -k*x2 (10)
[0156] Therefore, when the sampling interval is constant, the resource consumption relationship g1 of the second candidate can be expressed as:
[0157] g1(x)=kx+b (11)
[0158] S2643: Based on the historical microservice resource consumption data and historical application sampling frequency in each second data group, obtain the third candidate resource consumption relationship.
[0159] When the application device data is fixed, the resource consumption of the target microservice on the GPU is negatively correlated with the sampling interval i. The third candidate resource consumption relationship can be expressed as shown in formula (12):
[0160]
[0161] S2644: Merge the second candidate resource consumption relationship and the third candidate resource consumption relationship to obtain the second resource consumption relationship.
[0162] Based on the aforementioned exemplary embodiments of this application, according to formulas (9), (10), (11), and (12), when the actual application device data is x输入 The sampling interval for practical applications is i 输入 In this case, the corresponding y can be calculated. 输出 Specifically, it can be shown in formula (13):
[0163]
[0164] In the above embodiments, the second resource consumption relationship can be quickly determined by using linear fitting and inverse proportional relationships.
[0165] S265: Based on the target runtime attribute information of at least one associated application corresponding to the target microservice, determine the actual application device data and the actual application sampling frequency of each associated application.
[0166] The target runtime attribute information is information related to at least one associated application corresponding to the target microservice in the runtime attribute information. It can indicate the runtime characteristics of the above-mentioned at least one associated application on the platform, the business characteristics and functional characteristics of the application itself, etc., and can include at least the actual application device data of each of the above-mentioned at least one associated application and the actual application sampling frequency of each associated application.
[0167] It is understandable that the sampling frequency domain and the actual sampling interval in practical applications are reciprocals of each other.
[0168] S266: Based on the actual application device data of each associated application, the actual application sampling frequency of each associated application, and the second resource consumption relationship of the target microservice under each associated application, determine the first resource consumption prediction information of the target microservice under each associated application.
[0169] Based on the second resource consumption relationship of the target microservice under each associated application and the independent variables (actual application device data and actual application sampling frequency of each associated application), the specific data of the dependent variable can be determined, that is, the second resource consumption prediction information of the target microservice under each associated application can be determined. The second resource consumption prediction information may include the resource consumption data of the target microservice for each type of resource under each associated application.
[0170] In the above embodiments, when the target microservice has the ability to sample data sources, the second resource consumption relationship corresponding to the target microservice can be linearly fitted according to the resource consumption reference information of the target microservice. Then, based on the second resource consumption relationship corresponding to the target microservice and the target running attribute information of at least one associated application corresponding to the target microservice, the second resource consumption prediction information of the target microservice under each associated application in the at least one associated application can be determined. This can effectively reduce the complexity and cost of resource prediction and achieve reasonable and accurate prediction of resources.
[0171] It should be noted that the method provided in this application embodiment can be customized with different resource prediction strategies for microservices with different characteristics to more accurately predict resource consumption. The above prediction strategies are merely examples and do not constitute a limitation on the embodiments of this application.
[0172] Furthermore, the same target microservice can exhibit different capabilities in different associated applications. For example, it might demonstrate data sampling capabilities in associated application A but not in associated application B. Similarly, even with human body recognition, some applications might focus on the entrance to a residential community, while others focus on a classroom, leading to different resource consumption even with the same number of devices. This application's embodiments can predict the first resource consumption of a target microservice in each associated application based on its capability requirements. In other words, the method provided in this application takes into account the differences in resource consumption of the same target microservice in different associated applications, effectively improving the accuracy of resource prediction and contributing to more reasonable and efficient resource deployment.
[0173] In one embodiment of this application, besides determining the resource consumption relationship of each microservice under each corresponding associated application through linear fitting, multinomial regression can also be used to determine the fitted curve to predict the first resource consumption prediction information of each microservice under each of the at least one associated application. Furthermore, a resource prediction model can be trained using machine learning methods to determine the first resource consumption prediction information of each microservice under each of the at least one associated application based on the target running attribute information of each microservice's corresponding at least one associated application and the resource consumption reference information of each microservice. Machine learning methods, such as support vector machines, decision trees, and random forests, can also learn the resource consumption characteristics exhibited by different associated applications when simultaneously using the same microservice due to load balancing requirements, thereby improving the accuracy of the first resource consumption prediction information of each microservice under each of the corresponding associated applications.
[0174] S270: Based on the running attribute information of at least one application to be assigned, determine the second resource consumption prediction information for each of the at least one storage component.
[0175] In this embodiment, the storage component may include, but is not limited to, databases (DB), Elasticsearch (ES, a search and data analysis engine), and Kafka (a distributed message queue). The storage component can be used for communication between different microservices, data storage and querying, and communication and function calls between different applications. The resource consumption of the storage component mainly depends on its type, capacity, usage efficiency, and current load.
[0176] In one embodiment of this application, the second resource consumption prediction information for each storage component in at least one storage component can be determined based on historical resource consumption data. Therefore, step S270 can be implemented as follows:
[0177] S271: Based on the running attribute information, determine the running platform corresponding to at least one application to be assigned.
[0178] It is understandable that the runtime attribute information of at least one application to be assigned may include the runtime platform corresponding to each application.
[0179] S272: Obtain the runtime log information of the running platform.
[0180] The runtime log information of each application to be assigned can record the historical resource consumption data of the storage components involved in the application to be assigned when the application is running on the corresponding runtime platform.
[0181] S273: Determine the historical resource consumption information for each storage component based on the operation log information.
[0182] Based on the runtime log information, the historical resource consumption data of the storage components involved in each application to be assigned can be filtered out, and then merged according to the storage components to obtain the historical resource consumption information of each storage component in at least one storage component corresponding to at least one application to be assigned.
[0183] S274: Determine the second resource consumption prediction information for each storage component based on the historical resource consumption information of each storage component.
[0184] It is feasible to determine the historical maximum consumption of each storage component for various types of resources from the historical resource consumption information of each storage component, so that the historical maximum consumption of each storage component for various types of resources can be used as the second resource consumption prediction information of each storage component.
[0185] It is feasible to determine the historical average consumption of each storage component for various types of resources from the historical resource consumption information of each storage component. Thus, a certain multiple of the historical average consumption of each storage component for various types of resources can be used as the second resource consumption prediction information for each storage component.
[0186] In the above embodiments, based on the historical resource consumption data of the storage components involved when each application to be allocated runs on the corresponding running platform, the second resource consumption prediction information of each storage component is predicted. In this way, the first resource consumption prediction information of each microservice under each associated application can be combined to make a more comprehensive and accurate prediction of the resources required by at least one application to be allocated.
[0187] In another embodiment of this application, considering that the calls to components such as message middleware by different applications to be allocated are also isolated from each other, the second resource consumption prediction information of each storage component under the corresponding associated application can be determined by referring to the aforementioned process for determining the first resource consumption prediction information of each microservice under each associated application. This will not be elaborated here.
[0188] S280: Based on the first resource consumption prediction information of each microservice under each associated application in at least one associated application and the second resource consumption prediction information of each storage component, obtain the target resource consumption prediction information corresponding to at least one application to be allocated.
[0189] In the embodiments of this application, the target resource consumption prediction information corresponding to at least one application to be allocated is obtained based on the first resource consumption prediction information of each microservice under each of the at least one associated applications and the second resource consumption prediction information of each storage component. This prediction information is based on at least one application to be allocated as a whole. It can indicate the data of various types of resources required for at least one application to be allocated as a whole. In addition, it can still indicate the first resource consumption prediction information of each microservice under each of the corresponding associated applications, the second resource consumption prediction information of each storage component, or the resource consumption prediction summary information of each microservice under the at least one associated application.
[0190] It is feasible that the target resource consumption prediction information corresponding to at least one application to be assigned may include the resource consumption prediction summary information of each microservice under at least one associated application. The above resource consumption prediction summary information includes the consumption prediction summary sub-information of each microservice for various types of resources under at least one associated application, as shown in formulas (14), (15), (16), and (17), which are summarized by microservice and resource type. In the at least one application to be assigned, application 1, application 3... application m are at least one associated application corresponding to microservice 1, and application 1, application 2... application n are at least one associated application corresponding to microservice 2.
[0191] y 微服务1_gpu_总 =y 微服务1_应用1_gpu +y 微服务1_应用3_gpu +...y 微服务1_应用m_gpu (14)
[0192] y 微服务1_cpu_总 =y 微服务1_应用1_cpu +y 微服务1_应用2_cpu +...y 微服务1_应用n_cpu (15)
[0193] y 微服务2_gpu_总 =y 微服务2_应用1_gpu +y 微服务2_应用2_gpu +...y 微服务2_应用n_gpu (16)
[0194] y 微服务2_cpu_总 =y 微服务2_应用1_cpu +y 微服务2_应用2_cpu +...y 微服务2_应用n_cpu (17)
[0195] In this embodiment of the application, by determining the target resource consumption prediction information for at least one application to be allocated as a whole, the accuracy of resource prediction at the application system level can be improved, providing a more reliable and effective data basis for the resource deployment of at least one application to be allocated, which helps to achieve reasonable and efficient resource allocation, while also ensuring the operating performance and reliability of at least one application to be allocated.
[0196] In one embodiment of this application, a multi-replica deployment approach for microservices is adopted, that is, multiple replicas are deployed for each microservice and distributed across different physical servers, virtual machines, or containers for use by different applications. This also ensures that even if one replica fails, the other replicas can still continue to provide services. This application can determine the resource deployment specifications of each microservice and the number of replicas for each microservice based on the target resource consumption prediction information corresponding to at least one application to be allocated, and the first resource consumption prediction information of each microservice under each of the at least one associated application.
[0197] Specifically, such as Figure 5 As shown, the method may also include:
[0198] S291: Based on the resource consumption reference information of each microservice, determine the resource consumption threshold information of each microservice under each associated application.
[0199] It is feasible. When the resource consumption reference information for each microservice is the resource consumption information for each microservice under the stress test environment, the resource consumption reference information for each microservice can include the resource consumption of each microservice under different test conditions.
[0200] It is feasible to determine the resource consumption of each microservice under each associated application when the number of test devices is at its maximum from the resource consumption reference information of each microservice. The resource consumption of each microservice under each associated application when the number of test devices is at its maximum can be used as the resource consumption threshold information of each microservice under each associated application.
[0201] S292: Determine the resource deployment reference information for each microservice based on the resource consumption threshold information of each microservice under each associated application.
[0202] For example, applications a, b, and c all use the same algorithm microservice. The maximum number of devices used by these applications during stress testing are max_a, max_b, and max_c, respectively, and the resource consumption of the algorithm microservice is y. max_a y max_b y max_c The maximum value among the three is taken as the resource deployment reference information for each microservice. In the case of multiple resource types, the resource deployment reference information for each microservice for each type of resource can be expressed as shown in formulas (18), (19), and (20):
[0203] y gpu_max =Max(y gpu_max_a ,y gpu_max_b ,y gpu_max_c (18)
[0204] y cpu_max =Max(y cpu_max_a ,y cpu_max_b ,y cpu_max_c (19)
[0205] y memory_max =Max(y memory_max_a ,y memory_max_b ,y memory_max_c (20) ......
[0207] Therefore, the resource deployment reference information R of the above algorithm microservice can be expressed as shown in formula (21):
[0208] R = (y gpu_max ,y cpu_max ,y memory_max ,......) (twenty one)
[0209] It is feasible to also consider the resource consumption of the corresponding microservice in the algorithm as y. max_a y max_b y max_c, Determine the average value of the three values, and use a preset multiple of the average value (such as twice the average value) as the resource deployment reference information for the algorithm microservice.
[0210] It is feasible to directly set the resource consumption corresponding to the algorithm microservice as y. max_a y max_b y max_c This serves as a reference for resource deployment in algorithm microservices.
[0211] In related technologies, directly deploying resources for microservices based on the resource deployment reference information obtained from the stress test environment can easily lead to resource waste and high costs.
[0212] S293: Determine the first resource deployment information of each microservice under each associated application based on the first resource consumption prediction information and the preset floating ratio of each microservice.
[0213] It is feasible to represent the first resource consumption prediction information of each microservice under each corresponding associated application as a set {y}. 微服务s_应用t-资源q}, where application t is the associated application corresponding to microservice s.
[0214] In one embodiment of this application, a preset floating ratio is used to calculate the floating increment of the first resource consumption prediction information, such as a value within (0, 100%).
[0215] In another embodiment of this application, the preset floating ratio may also be different for different associated applications.
[0216] For example, the preset floating ratio can be expressed as buff%. Taking GPU as an example, the deployment information of microservice s on GPU under the corresponding associated application t can be expressed as shown in formula (22):
[0217] y 微服务s_应用t_gpu_buff =y 微服务s_应用t_gpu *(1+buff%) (22)
[0218] S294: Determine the resource deployment specification information for each microservice based on the resource deployment reference information for each microservice and the first resource deployment information for each microservice under each associated application.
[0219] It is feasible to compare the resource deployment reference information of each microservice with the first resource deployment information of each microservice under each associated application in the same resource dimension, obtain the comparison result, and then determine the minimum or average value according to the indication of the comparison result, and use it as the resource deployment specification information of each microservice. The resource deployment specification information includes the deployment specifications of the corresponding microservice for various resources.
[0220] For example, taking GPUs as the resource, applications a, b, and c all use the same algorithm microservice. The maximum number of devices used by these applications during stress testing are max_a, max_b, and max_c, respectively, and the GPU consumption of the algorithm microservice is y. gpu_max_a y gpu_max_b y gpu_max_c First compare y gpu_max_a y gpu_max_b y gpu_max_c The size of the first maximum value is determined as shown in formula (18), which will not be elaborated here; then the algorithm microservices are compared with the first resource deployment information y under application a, application b, and application c. 微服务s_应用a_gpu_buff y 微服务s_应用b_gpu_buff y 微服务s_应用c_gpu_buff The size of the first maximum value is used to determine the second maximum value, as shown in formula (23); then the smaller of the first maximum value and the second maximum value is used as the deployment specification information of the algorithm microservice on the GPU, as shown in formula (24).
[0221] y 微服务s_gpu_buff_max =Max(y 微服务s_应用a_gpu_buff ,y 微服务s_应用b_gpu_buf ,y 微服务s_应用c_gpu_buf )(twenty three)
[0222] y 微服务s_gpu_R =Min(y gpu_max ,y 微服务s_gpu_buff_max ) (twenty four)
[0223] Similarly, the deployment specifications of algorithm microservices for other types of resources can be obtained. The resource deployment specifications of algorithm microservices can be expressed as shown in formula (25):
[0224] R microservices s' = (y 微服务s_gpu_R ,y 微服务s_cpu_R ,y 微服务s_memory_R ,......) (25)
[0225] The comparison and value selection strategies described above are just one example, and this application does not limit them.
[0226] The above embodiments, by using the resource deployment reference information of each microservice and the first resource deployment information of each microservice under each associated application to determine the resource deployment specification information of each microservice, can effectively improve the utilization rate of resources while ensuring the stability of microservices, avoid huge waste of resources, and reduce costs.
[0227] S295: Determine the resource consumption prediction summary information for each microservice based on the first resource consumption prediction information under each associated application in at least one associated application for each microservice.
[0228] The resource consumption prediction summary information for each microservice can be found in the aforementioned embodiments and formulas (14) to (17), which will not be repeated here.
[0229] S296: Determine the number of replicas to be deployed for each microservice based on the resource consumption prediction summary information for each microservice and the resource deployment specification information for each microservice.
[0230] In one embodiment of this application, for the same microservice, the resource consumption prediction summary information includes consumption prediction summary sub-information for each of the various resources involved in the corresponding microservice, and the resource deployment specification information includes deployment specification sub-information for each of the various resources involved in the corresponding microservice; then step S296 can be implemented as follows:
[0231] S2961: Based on the consumption prediction summary sub-information for each resource in the resource consumption prediction summary information and the deployment specification sub-information for each resource in the resource deployment specification information, determine the number of candidate replicas to be deployed for each resource.
[0232] It is feasible. For microservice s, the number of candidate replicas for each resource can be calculated using formulas (26), (27), and (28), where Ceil() is a rounding function:
[0233]
[0234]
[0235] S2962: Determine the number of replicas for the corresponding microservice from the candidate replica deployment counts for each resource. The number of replicas deployed is the maximum value among the candidate replica deployment counts for each resource.
[0236] It is understandable that the deployment of each resource needs to meet the operational requirements of the microservice and avoid excessive load pressure. Therefore, the largest number among multiple candidate replica deployment numbers can be used as the final number of microservice replica deployments, as shown in formula (29):
[0237] n = Max(n gpu ,n cpu ,n memory ,......) (29)
[0238] In the above embodiments, the number of replicas of each microservice is determined by summarizing the resource consumption prediction information and the resource deployment specification information of each microservice. This can effectively improve resource utilization while ensuring the stability of microservices, avoid huge waste of resources, and reduce costs.
[0239] In one embodiment of this application, an interactive platform is also provided to enable users to perform resource prediction and deployment optimization for any at least one application to be allocated. Based on the above interactive platform, the method may include:
[0240] S310: In response to a prediction operation triggered by a resource prediction page, obtain the runtime attribute information of at least one application to be assigned.
[0241] Figure 6(1) shows a resource prediction page for video analytics applications. The page mainly includes an operation entry, a navigation bar, and evaluation results. The operation entry area is used for users to input the content to be evaluated, that is, the running attribute information of at least one application to be assigned, such as business type, SVAP version, application to be evaluated, etc. The navigation bar is used to facilitate quick navigation and display the current interface items. The evaluation results are used to display various evaluation contents.
[0242] Specifically, as shown in Figure 6(2), the user-adjustable parameters are concentrated in the operation entry point, which can be divided into tool items, platform items, and application items. In the area of the tool items, the user can obtain the evaluation result by clicking the estimate button; the tool items can also update and obtain the user-input content to be evaluated, that is, the running attribute information of at least one application to be assigned, including all inputs of platform items and application items, which is convenient for users to use. For example, the user selects a record through the drop-down box, and after clicking, the record is used to overwrite the current estimation input. In order to prevent user misoperation, the pop-up verification operation shown in Figure 7(1) and Figure 7(2) can be performed. For example, the user's current input content to be evaluated can also be stored as a new record. The record name must be unique and cannot be repeated. After adding the record, the record can be used. As shown in Figure 6(2), the platform item can be configured with service type, GPU type, SVAP version, SVAP platform storage retention days, and alarm fragment retention days. The service type can be either cluster version (default) or standalone version. The GPU type is the algorithm service runtime environment. The SVAP version is the platform deployment version. Different versions have different evaluation objects. The latest version is used by default. For example, when the version is <= SVAP1.5, middleware DB resource evaluation can be provided. When the version is between SVAP1.6 and SVAP1.7, middleware storage evaluation and distributed file storage evaluation for device management can be provided. The SVAP platform storage retention days are used to control the retention days of some storage resources. The alarm fragment retention days are used to control the retention time of alarm fragments for device management. As shown in Figure 6(2), the application item allows users to add, delete, and edit the applications to be evaluated in order to evaluate the algorithms, platform service performance resources, etc. used by these applications. The functions of each option in the application item are as follows:
[0243] PPL templates (a standard template library for graphics processing): used to select the PPL to which the application to be evaluated belongs; once determined, the specific application can be selected from the PPL template.
[0244] Application: This means selecting the application to be evaluated. Once selected, the PPL template will also be determined.
[0245] Scene selection: Select the scene in which the application will run, such as video stream, image stream, etc. The application performance will be different in different scenes;
[0246] Estimated scale: The maximum business capacity supported by the selected application, which can be the QPS (Queries-per-second) for input / retrieval or the number of devices under the application, etc.
[0247] Application Version: Select the version of the application to run. The default is the same as the SVAP version. Once confirmed, the specified version of the application will be selected first; if the specified version is not found, the oldest version closest to the specified version will be searched; if it is still not found, the latest version recorded in the tool will be used.
[0248] Number of images: The number of images that can be stored in the application's available image library;
[0249] Frame / Image Interval: Used for applications that support frame skipping interval and image interval functions. Resource consumption can be further allocated by adjusting the interval value. The default interval value is the application's own value.
[0250] Average data volume per channel: Specifies the average number of alarms generated by the application per hour when using a single device.
[0251] S320: Based on the running attribute information of at least one application to be assigned, determine the target resource consumption prediction information corresponding to at least one application to be assigned.
[0252] Figure 8 The resource prediction process for video analytics applications is illustrated, such as... Figure 8 As shown, the running attribute information of at least one application to be assigned can determine the name, application identifier, application version, running scenario of each video analysis application, estimated scale of each application, average single-channel data volume of each video analysis application calculated based on the user environment, etc., and then use the resource prediction method provided in the embodiments of this application to determine the target resource consumption prediction information corresponding to multiple video analysis applications, which will not be elaborated here.
[0253] S330: Perform data visualization processing on the target resource consumption prediction information to obtain resource prediction visualization information corresponding to at least one application to be allocated.
[0254] S340: Send resource prediction visualization information to the terminal so that the resource prediction visualization information is displayed on the terminal's resource prediction page.
[0255] Figures 9(1) to 9(5) An overview diagram and a classification diagram of the resource prediction visualization information are shown. The classification diagram includes a diagram of computing resource details, a diagram of middleware storage details, and a diagram of distributed file storage details, which correspond to Figures 9(2) to (4) respectively. The overview diagram includes a table diagram and a resource distribution dashboard diagram, which correspond to Figures 9(1) and 9(5) respectively.
[0256] In addition to displaying the target resource consumption prediction information, the resource prediction visualization information can also display the resource deployment specifications of each microservice and the number of replicas deployed for each microservice.
[0257] In the above embodiments, visualization processing makes it easy for users to view target resource consumption prediction information, thereby facilitating efficient deployment of microservices and storage components.
[0258] In one embodiment of this application, the platform architecture of the above-mentioned interactive platform is as follows: Figure 10 As shown, the front-end webUI (web user page) provides a visual interactive entry point, facilitating users to initiate requests such as application filtering and resource evaluation, and displays the execution results in styles such as tables and pie charts. It also provides a storage entry point for evaluation records. The gateway supports name routing to backend services. The front-end obtains the address and port of the deployed application through the gateway platform and initiates user requests to the specified backend. It also provides functions such as load balancing and routing. The resource evaluation in the backend services is used to receive data such as the identifier and evaluation parameters of the application to be evaluated, and to call backend services such as application management, service management, policy service, and replica evaluation to obtain the resource evaluation results. It also supports querying and updating evaluation records. The policy service is used to internally maintain customized evaluation policies. Based on the evaluation parameters provided by the user and the service performance data of the application to be evaluated, it calculates the final resource consumption. The replica evaluation is used to deduce the replica specifications and replica quantity of each service based on the resource consumption calculated by the policy service and the service performance data. The application management is used to maintain the mapping relationship between the application and the service it involves, and to manage the application's metadata. Data information, such as application identifier, application name, and whether frame sampling is possible; service management is used to maintain the performance data of services under different applications, such as the amount of GPU, CPU, memory, and other resources required for a certain number of devices, and to manage the metadata information of services, such as service identifier and service name; at the same time, the interactive platform can also store evaluation records (evaluation records initiated by users, including selected applications, evaluation parameters, etc.), application data (the mapping relationship between applications and services, application metadata information, etc.), and service performance data (the amount of GPU, CPU, memory, and other resources required by the service in associated applications and on a specified number of devices, while maintaining the metadata information of the service).
[0259] As can be seen from the above embodiments, the resource prediction method provided in this application first determines at least one microservice and at least one storage component corresponding to at least one application to be allocated, and determines at least one associated application corresponding to each microservice from the at least one application to be allocated, and determines the target running attribute information of the at least one associated application corresponding to each microservice from the running attribute information of the at least one application to be allocated; based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice, the first resource consumption prediction information of each microservice under each associated application in the at least one associated application can be determined; at the same time, based on the running attribute information of the at least one application to be allocated, the second resource consumption prediction information of each storage component in the at least one storage component can be determined; combining the first resource consumption prediction information of each microservice under each associated application in the at least one associated application and the second resource consumption prediction information of each storage component, the target resource consumption prediction information corresponding to at least one application to be allocated can be obtained. In other words, the solution provided in this application takes at least one application to be allocated as the whole object. By predicting the resource consumption of each microservice in at least one microservice involved in at least one application to be allocated under each corresponding associated application, and the resource consumption of each storage component in at least one storage component involved in at least one application to be allocated, the target resource consumption prediction information for at least one application to be allocated as a whole is determined. This improves the accuracy of resource prediction at the application system level, provides more reliable and effective data basis for the resource deployment of at least one application to be allocated, helps to achieve reasonable and efficient resource allocation, and ensures the running performance and reliability of at least one application to be allocated. Moreover, when predicting the resource consumption of microservices, the solution provided in this application takes into account the differences in resource consumption of the same microservice under different associated applications, which can effectively improve the accuracy of resource prediction and help to achieve more reasonable and efficient resource deployment.
[0260] This application embodiment also provides a resource prediction device 1100, such as... Figure 11 As shown, the device 1100 may include:
[0261] The first acquisition module 1110 is used to acquire the running attribute information of at least one application to be assigned;
[0262] The microservice and component determination module 1120 is used to determine at least one microservice corresponding to the at least one application to be assigned and at least one storage component corresponding to the at least one application to be assigned.
[0263] The associated application determination module 1130 is used to determine at least one associated application corresponding to each microservice in the at least one microservice from the at least one application to be assigned;
[0264] The associated application attribute determination module 1140 is used to determine the target running attribute information of the at least one associated application corresponding to each microservice from the running attribute information of the at least one application to be assigned.
[0265] The second acquisition module 1150 is used to acquire resource consumption reference information for each microservice.
[0266] The first resource consumption prediction module 1160 is used to determine the first resource consumption prediction information of each microservice under each of the at least one associated applications in the corresponding at least one associated application, based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice.
[0267] The second resource consumption prediction module 1170 is used to determine the second resource consumption prediction information of each storage component in the at least one storage component based on the running attribute information of the at least one application to be allocated.
[0268] The target prediction information determination module 1180 is used to obtain the target resource consumption prediction information corresponding to the at least one application to be allocated based on the first resource consumption prediction information of each microservice under each of the at least one associated applications and the second resource consumption prediction information of each storage component.
[0269] In one embodiment of this application, the target microservice is any one of the at least one microservices, and the first resource consumption prediction module 1160 may include:
[0270] The first resource consumption relationship determination unit is used to determine the first resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice when the target microservice does not have the ability to sample the data source; the first resource consumption relationship indicates the relationship between microservice resource consumption data and application device data.
[0271] The first actual data determining unit is used to determine the actual application device data of each associated application based on the target running attribute information of the at least one associated application corresponding to the target microservice.
[0272] The first prediction unit is used to determine the first resource consumption prediction information of the target microservice under each associated application based on the actual application device data of each associated application and the first resource consumption relationship of the target microservice under each associated application.
[0273] In one embodiment of this application, the first resource consumption relationship determination unit includes:
[0274] The first data group filtering subunit is used to determine multiple first data groups corresponding to each associated application from the resource consumption reference information of the target microservice. Each of the multiple first data groups includes historical microservice resource consumption data and historical application device data.
[0275] The first linear fitting subunit is used to perform linear fitting based on the plurality of first data sets to obtain the first candidate resource consumption relationship;
[0276] The goodness-of-fit determination subunit is used to determine the goodness-of-fit of the first candidate resource consumption relationship. The goodness-of-fit characterizes the degree of consistency between the microservice resource consumption data predicted based on the first candidate resource consumption relationship and the historical application device data and the historical microservice resource consumption data.
[0277] The first resource consumption relationship determination subunit is used to determine the first candidate resource consumption relationship as the first resource consumption relationship when the fitting degree meets the preset threshold condition.
[0278] In one embodiment of this application, the target microservice is any one of the at least one microservices, and the first resource consumption prediction module 1160 may include:
[0279] The second resource consumption relationship determination unit is used to determine the second resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice, when the target microservice has the ability to sample data sources; the second resource consumption relationship indicates the relationship between microservice resource consumption data, application device data, and application sampling frequency.
[0280] The second actual data determining unit is used to determine the actual application device data and the actual application sampling frequency of each associated application based on the target running attribute information of the at least one associated application corresponding to the target microservice.
[0281] The second prediction unit is used to determine the first resource consumption prediction information of the target microservice under each associated application based on the actual application device data of each associated application, the actual application sampling frequency of each associated application, and the second resource consumption relationship of the target microservice under each associated application.
[0282] In one embodiment of this application, the second resource consumption relationship determination unit includes:
[0283] The second data group filtering subunit is used to determine multiple second data groups corresponding to each associated application from the resource consumption reference information of the target microservice. Each of the multiple second data groups includes historical microservice resource consumption data, historical application device data, and historical application sampling frequency.
[0284] The second linear fitting subunit is used to perform linear fitting based on the historical microservice resource consumption data and the historical application device data in each second data group to obtain a second candidate resource consumption relationship.
[0285] The inverse relationship determination subunit is used to obtain a third candidate resource consumption relationship based on the historical microservice resource consumption data and the historical application sampling frequency in each second data group;
[0286] The second resource consumption relationship determination subunit is used to merge the second candidate resource consumption relationship and the third candidate resource consumption relationship to obtain the second resource consumption relationship.
[0287] In one embodiment of this application, the second resource consumption prediction module 1170 may include:
[0288] The running platform determination unit is used to determine the running platform corresponding to the at least one application to be assigned based on the running attribute information.
[0289] A log information acquisition unit is used to acquire the operation log information of the operating platform;
[0290] The historical resource consumption information determination unit is used to determine the historical resource consumption information of each storage component based on the operation log information.
[0291] The third prediction unit is used to determine the second resource consumption prediction information of each storage component based on the historical resource consumption information of each storage component.
[0292] In one embodiment of this application, the device 1100 may further include:
[0293] The resource consumption threshold information determination unit is used to determine the resource consumption threshold information of each microservice under the corresponding associated application based on the resource consumption reference information of each microservice.
[0294] The resource deployment reference information determination unit is used to determine the resource deployment reference information of each microservice based on the resource consumption threshold information of each microservice under the corresponding associated application;
[0295] The first resource deployment information determination unit is used to determine the first resource deployment information of each microservice under each associated application based on the first resource consumption prediction information and the preset floating ratio of each microservice under each associated application.
[0296] The resource deployment specification information determination unit is used to determine the resource deployment specification information of each microservice based on the resource deployment reference information of each microservice and the first resource deployment information of each microservice under the corresponding associated application.
[0297] In one embodiment of this application, the device 1100 may further include:
[0298] The resource consumption prediction summary information determination unit is used to determine the resource consumption prediction summary information of each microservice based on the first resource consumption prediction information of each microservice under each associated application in the corresponding at least one associated application.
[0299] The replica deployment quantity determination unit is used to determine the replica deployment quantity of each microservice based on the resource consumption prediction summary information of each microservice and the resource deployment specification information of each microservice.
[0300] In one embodiment of this application, the resource consumption prediction summary information includes consumption prediction summary sub-information for each of the various resources involved in the corresponding microservice, and the resource deployment specification information includes deployment specification sub-information for each of the various resources involved in the corresponding microservice; the replica deployment quantity determination unit includes:
[0301] The candidate replica deployment quantity determination subunit is used to determine the candidate replica deployment quantity corresponding to each resource based on the consumption prediction summary sub-information corresponding to each resource in the resource consumption prediction summary information and the deployment specification sub-information corresponding to each resource in the resource deployment specification information.
[0302] The replica deployment quantity determination subunit is used to determine the replica deployment quantity of the corresponding microservice from the candidate replica deployment quantities corresponding to each type of resource, wherein the replica deployment quantity is the maximum value among the candidate replica deployment quantities corresponding to each type of resource.
[0303] In one embodiment of this application, the device 1100 may further include:
[0304] A visualization processing unit is used to perform data visualization processing on the target resource consumption prediction information to obtain resource prediction visualization information corresponding to the at least one application to be allocated.
[0305] The display unit is used to send the resource prediction visualization information to the terminal so that the resource prediction visualization information is displayed on the resource prediction page of the terminal.
[0306] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0307] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0308] This application provides a computer device including a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement a resource prediction method as provided in the above method embodiments.
[0309] Figure 12 A schematic diagram of the hardware structure of a device for implementing a resource prediction method provided in an embodiment of this application is shown. This device may participate in or include the apparatus or system provided in the embodiment of this application. Figure 12 As shown, device 10 may include one or more processors 1002 (shown as 1002a, 1002b, ..., 1002n in the figure) 1002 (processor 1002 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 12 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, device 10 may also include a... Figure 12 The more or fewer components shown, or having the same Figure 12 The different configurations shown.
[0310] It should be noted that the aforementioned one or more processors 1002 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element within device 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0311] The memory 1004 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method described in the embodiments of this application. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, thereby realizing the resource prediction method described above. The memory 1004 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include memory remotely located relative to the processor 1002, and these remote memories can be connected to the device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0312] The transmission device 1006 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of device 10. In one example, the transmission device 1006 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 1006 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0313] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of device 10 (or a mobile device).
[0314] This application embodiment also provides a computer-readable storage medium, which can be disposed in a server to store at least one instruction or at least one program related to implementing a resource prediction method in the method embodiment. The at least one instruction or at least one program is loaded and executed by the processor to implement the resource prediction method provided in the above method embodiment.
[0315] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0316] This invention also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a resource prediction method provided in the various optional embodiments described above.
[0317] As can be seen from the embodiments of the resource prediction method, apparatus, medium and equipment provided in this application above,
[0318] The solution provided in this application first determines at least one microservice and at least one storage component corresponding to at least one application to be assigned, and determines at least one associated application corresponding to each microservice from the at least one application to be assigned, and determines the target running attribute information of the at least one associated application corresponding to each microservice from the running attribute information of the at least one application to be assigned; based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice, the first resource consumption prediction information of each microservice under each associated application in the at least one associated application can be determined; at the same time, based on the running attribute information of the at least one application to be assigned, the second resource consumption prediction information of each storage component in the at least one storage component can be determined; combining the first resource consumption prediction information of each microservice under each associated application in the at least one associated application and the second resource consumption prediction information of each storage component, the target resource consumption prediction information corresponding to at least one application to be assigned can be obtained. In other words, the solution provided in this application takes at least one application to be allocated as the whole object. By predicting the resource consumption of each microservice in at least one microservice involved in at least one application to be allocated under each corresponding associated application, and the resource consumption of each storage component in at least one storage component involved in at least one application to be allocated, the target resource consumption prediction information for at least one application to be allocated as a whole is determined. This improves the accuracy of resource prediction at the application system level, provides more reliable and effective data basis for the resource deployment of at least one application to be allocated, helps to achieve reasonable and efficient resource allocation, and ensures the running performance and reliability of at least one application to be allocated. Moreover, when predicting the resource consumption of microservices, the solution provided in this application takes into account the differences in resource consumption of the same microservice under different associated applications, which can effectively improve the accuracy of resource prediction and help to achieve more reasonable and efficient resource deployment.
[0319] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.
[0320] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device, equipment, and storage medium embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0321] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0322] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A resource forecasting method, characterized in that, The method includes: Obtain the runtime attribute information of at least one application to be assigned; Determine at least one microservice corresponding to the at least one application to be assigned and at least one storage component corresponding to the at least one application to be assigned; From the at least one application to be assigned, determine at least one associated application corresponding to each microservice in the at least one microservice; From the runtime attribute information of the at least one application to be assigned, determine the target runtime attribute information of the at least one associated application corresponding to each microservice; Obtain resource consumption reference information for each microservice; Based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice, determine the first resource consumption prediction information of each microservice under each associated application of the at least one associated application; Based on the running attribute information of the at least one application to be allocated, determine the second resource consumption prediction information for each of the at least one storage components; Based on the first resource consumption prediction information of each microservice under each associated application in the corresponding at least one associated application and the second resource consumption prediction information of each storage component, the target resource consumption prediction information corresponding to the at least one application to be allocated is obtained.
2. The method according to claim 1, characterized in that, The target microservice is any one of the at least one microservices. The step of determining the first resource consumption prediction information for each microservice under each of the at least one associated applications, based on the resource consumption reference information of each microservice and the target runtime attribute information of the at least one associated application corresponding to each microservice, includes: If the target microservice does not have the ability to sample data sources, a first resource consumption relationship of the target microservice under each associated application is determined based on the resource consumption reference information of the target microservice; the first resource consumption relationship indicates the relationship between microservice resource consumption data and application device data. Based on the target running attribute information of the at least one associated application corresponding to the target microservice, determine the actual application device data of each associated application. Based on the actual application device data of each associated application and the first resource consumption relationship of the target microservice under each associated application, the first resource consumption prediction information of the target microservice under each associated application is determined.
3. The method according to claim 2, characterized in that, In the case that the target microservice does not have the ability to sample data sources, determining the first resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice includes: From the resource consumption reference information of the target microservice, determine multiple first data groups corresponding to each associated application. Each of the multiple first data groups includes historical microservice resource consumption data and historical application device data. Based on the multiple first data sets, a linear fit is performed to obtain the first candidate resource consumption relationship; Determine the goodness of fit of the first candidate resource consumption relationship, wherein the goodness of fit characterizes the degree of consistency between the microservice resource consumption data predicted based on the first candidate resource consumption relationship and the historical application device data and the historical microservice resource consumption data; If the fit meets the preset threshold condition, the first candidate resource consumption relationship is taken as the first resource consumption relationship.
4. The method according to claim 1, characterized in that, The target microservice is any one of the at least one microservices. The step of determining the first resource consumption prediction information for each microservice under each of the at least one associated applications, based on the resource consumption reference information of each microservice and the target runtime attribute information of the at least one associated application corresponding to each microservice, includes: If the target microservice has the ability to sample data sources, a second resource consumption relationship of the target microservice under each associated application is determined based on the resource consumption reference information of the target microservice; the second resource consumption relationship indicates the relationship between microservice resource consumption data, application device data, and application sampling frequency. Based on the target running attribute information of the at least one associated application corresponding to the target microservice, determine the actual application device data and the actual application sampling frequency of each associated application. Based on the actual application device data of each associated application, the actual application sampling frequency of each associated application, and the second resource consumption relationship of the target microservice under each associated application, the first resource consumption prediction information of the target microservice under each associated application is determined.
5. The method according to claim 4, characterized in that, When the target microservice has the ability to sample data sources, determining the second resource consumption relationship of the target microservice under each associated application based on the resource consumption reference information of the target microservice includes: From the resource consumption reference information of the target microservice, determine multiple second data groups corresponding to each associated application. Each of the multiple second data groups includes historical microservice resource consumption data, historical application device data, and historical application sampling frequency. Based on the historical microservice resource consumption data and the historical application device data in each second data group, a linear fit is performed to obtain the second candidate resource consumption relationship; Based on the historical microservice resource consumption data and the historical application sampling frequency in each of the second data groups, a third candidate resource consumption relationship is obtained; The second candidate resource consumption relationship and the third candidate resource consumption relationship are merged to obtain the second resource consumption relationship.
6. The method according to claim 1, characterized in that, The step of determining the second resource consumption prediction information for each of the at least one storage component based on the running attribute information of the at least one application to be allocated includes: Based on the running attribute information, determine the running platform corresponding to the at least one application to be assigned; Obtain the operation log information of the operating platform; Based on the operation log information, determine the historical resource consumption information of each storage component; Based on the historical resource consumption information of each storage component, a second resource consumption prediction information for each storage component is determined.
7. The method according to claim 1, characterized in that, The method further includes: Based on the resource consumption reference information of each microservice, determine the resource consumption threshold information of each microservice under the corresponding associated application; Based on the resource consumption threshold information of each microservice under each associated application, determine the resource deployment reference information of each microservice; Based on the first resource consumption prediction information and preset floating ratio of each microservice under each associated application, the first resource deployment information of each microservice under each associated application is determined; Based on the resource deployment reference information of each microservice and the first resource deployment information of each microservice under each associated application, the resource deployment specification information of each microservice is determined.
8. The method according to claim 7, characterized in that, The method further includes: Based on the first resource consumption prediction information of each microservice under each associated application in the corresponding at least one associated application, the resource consumption prediction summary information of each microservice is determined. Based on the resource consumption prediction summary information of each microservice and the resource deployment specification information of each microservice, the number of replicas deployed for each microservice is determined.
9. The method according to claim 8, characterized in that, The resource consumption prediction summary information includes consumption prediction summary sub-information for each resource among the various resources involved in the corresponding microservice, and the resource deployment specification information includes deployment specification sub-information for each resource among the various resources involved in the corresponding microservice. The step of determining the number of replicas deployed for each microservice based on the resource consumption prediction summary information and the resource deployment specification information of each microservice includes: Based on the consumption prediction summary sub-information corresponding to each resource in the resource consumption prediction summary information and the deployment specification sub-information corresponding to each resource in the resource deployment specification information, determine the number of candidate replicas to be deployed for each resource; The number of replicas deployed for the corresponding microservice is determined from the number of candidate replicas deployed for each type of resource, wherein the number of replicas deployed is the maximum value among the number of candidate replicas deployed for each type of resource.
10. The method according to claim 1, characterized in that, The method further includes: The target resource consumption prediction information is processed by data visualization to obtain resource prediction visualization information corresponding to the at least one application to be allocated. The resource prediction visualization information is sent to the terminal so that it is displayed on the resource prediction page of the terminal.
11. A resource prediction device, characterized in that, The device includes: The first acquisition module is used to acquire the running attribute information of at least one application to be assigned; The microservice and component determination module is used to determine at least one microservice corresponding to the at least one application to be assigned and at least one storage component corresponding to the at least one application to be assigned. The associated application determination module is used to determine at least one associated application corresponding to each microservice in the at least one microservice from the at least one application to be assigned; The associated application attribute determination module is used to determine the target running attribute information of the at least one associated application corresponding to each microservice from the running attribute information of the at least one application to be assigned. The second acquisition module is used to acquire resource consumption reference information for each microservice. The first resource consumption prediction module is used to determine the first resource consumption prediction information of each microservice under each of the at least one associated application in the corresponding at least one associated application, based on the resource consumption reference information of each microservice and the target running attribute information of the at least one associated application corresponding to each microservice. The second resource consumption prediction module is used to determine the second resource consumption prediction information of each storage component in the at least one storage component based on the running attribute information of the at least one application to be allocated. The target prediction information determination module is used to obtain the target resource consumption prediction information corresponding to the at least one application to be allocated based on the first resource consumption prediction information of each microservice under each of the at least one associated applications and the second resource consumption prediction information of each storage component.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the resource prediction method as described in any one of claims 1 to 9.
13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the resource prediction method as described in any one of claims 1 to 9.