A method and device for predicting available resources

CN115202873BActive Publication Date: 2026-02-10SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210789078.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-06
Publication Date
2026-02-10
Estimated Expiration
2042-07-06

AI Technical Summary

Technical Problem

[0004]生产过程中,我们往往需要同时去做很多耗时的工作,依靠程序串行的去执行则会导致程序依次等待每一件耗时的工作,这样非常耗时

Benefits of technology

[0029] The present application judges the type of computing resources required by the specification and the available amount of computing resources before creating the computing resources, and judges whether the remaining resources of the openstack platform support the creation and change of the specification, effectively reducing unnecessary resource creation and change requests, making the interaction more humanized and the resource usage more transparent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115202873B_ABST
    Figure CN115202873B_ABST
Patent Text Reader

Abstract

The application relates to the field of openstack computing resources in a cloud computing environment, and specifically provides a method for pre-judging available resources, which has the following steps: S1, judging whether a host aggregation list exists in a current cache and whether a cache time is not overdue; S2, obtaining the host aggregation list by requesting a novaos-aggregates interface; S3, filtering a host aggregation that is unique and meets a rule from the host aggregation list obtained in step S1; S4, obtaining a use condition of a computing resource by requesting a plancement interface of the host aggregation obtained in step S3; S5, filtering the use condition of the computing resource; S6, judging whether a computing resource state list exists in a cache and whether a cache time is not overdue; S7, requesting a nova os-hypervisor interface to obtain all computing resource lists; S8, filtering the computing resource information obtained in step S6; and S9, performing information aggregation calculation. Compared with the prior art, the application effectively reduces unnecessary resource creation and change requests, makes interaction more humanized, and makes resource usage more transparent.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of openstack computing resources in a cloud computing environment, and specifically provides a usable resource prediction method and device. BACKGROUND

[0002] Under the background of cloud computing and big data, more and more users join the cloud computing platform, and under the cloud environment, the cloud computing platform will have more resource creation requests and change requests. When all requests are sent to the openstack platform and the resources are insufficient, the prompt and interception of insufficient resources by the computing platform cannot meet the experience of friendly interaction. Adding a resource prediction function before the user submits the request can make the user more clearly know what type of resource and resource specification of computing resource can be created, which can improve the user experience and avoid unnecessary resource creation requests.

[0003] Under the premise of large concurrency, how to solve the delay caused by frequent io of data and the time consumption caused by repeated calculation is the top priority. At this time, a method for temporarily storing calculation results and processes is urgently needed. Cache is applied, and java cache reduces the calculation resources and frequent io operations to a certain extent.

[0004] In the production process, we often need to do many time-consuming work at the same time, and rely on the serial execution of the program to cause the program to wait for each time-consuming work in turn, which is very time-consuming. SUMMARY

[0005] The present application is aimed at the deficiencies of the prior art, and provides a usable resource prediction method with strong practicality.

[0006] The further technical task of the present application is to provide a usable resource prediction device with reasonable design, safety and suitability.

[0007] The technical scheme adopted by the present application to solve its technical problems is:

[0008] A usable resource prediction method has the following steps:

[0009] S1, judge whether the host aggregation list exists in the current cache and the cache time is not overdue, if not, proceed to step S2;

[0010] S2, obtain the host aggregation list by requesting the nova os-aggregates interface;

[0011] S3, according to the product and resource type, filter the only host aggregation that meets the rules from the host aggregation list obtained in step S1;

[0012] S4, obtaining the usage of the computing resource through the host aggregation request plancement interface obtained in step S3;

[0013] S5, filtering the usage of the computing resource to obtain whether the specification resource can be created;

[0014] S6, judging whether the computing resource state list exists in the cache and the cache time is not expired, if not, performing step S7;

[0015] S7, requesting the nova os-hypervisor interface to obtain all the computing resource list;

[0016] S8, filtering the computing resource information obtained in step 6;

[0017] S9, performing information aggregation calculation.

[0018] Further, judging whether the host aggregation list exists in the current cache and the cache time is not expired, if not, obtaining and caching through step S2, and the host aggregation object can be directly obtained from the cache to return next time.

[0019] Further, in step S2, the host aggregation list is obtained through the request of the nova os-aggregates interface, and the host aggregation list is the classification of all computing resources, and the openstack can manage different product or different resource type computing resources through the host aggregation.

[0020] Further, in step S5, the usage of the computing resource is filtered, the available resource and the number of allowed creation of the incoming specification are calculated according to the actual computing resource usage and the computing resource usage state, the incoming specification is compared, and whether the specification resource can be created and the remaining available amount of resource are obtained.

[0021] Further, in step S6, whether the computing resource state list exists in the cache and the cache time is not expired is judged, if not, obtaining and caching through step S6, and the host aggregation object can be directly obtained from the cache to return next time.

[0022] Further, in step S7, all the computing resource list is obtained through the request of the nova os-hypervisor interface, and the computing resource list is all the computing resource state and running information.

[0023] Further, in step S8, the computing resource information obtained in step S6 is filtered, and the computing resource with normal state is filtered out, and only the computing resource with normal state can normally create an instance.

[0024] Further, in step S9, the information obtained through step S1, step S4 and step S8 is subjected to information aggregation calculation to obtain a more accurate specification of platform computing resources that can be created and the remaining amount of resources, and the program judges whether the instance of the specification can be created and calculates the remaining available resource amount.

[0025] A resource pre-judgment device, comprising: at least one memory and at least one processor;

[0026] The at least one memory is used to store a machine readable program;

[0027] The at least one processor is used to call the machine readable program to execute a resource pre-judgment method.

[0028] Compared with the prior art, the resource pre-judgment method and device of the present application has the following outstanding beneficial effects:

[0029] The present application judges the type of computing resources required by the specification and the available amount of computing resources before creating the computing resources, and judges whether the remaining resources of the openstack platform support the creation and change of the specification, effectively reducing unnecessary resource creation and change requests, making the interaction more humanized and the resource usage more transparent. BRIEF DESCRIPTION OF DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0031] Figure Figure 1 It is a flowchart of a resource pre-judgment method. DETAILED DESCRIPTION

[0032] In order to make the person skilled in the art better understand the scheme of the present application, the present application will be further described in detail below in combination with specific embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0033] The following is a best embodiment:

[0034] For example, Figure 1As shown in this embodiment, one method for predicting available resources requires the following prerequisites: the OpenStack platform is running normally and has available computing resources; Nova and Placement are running normally and can obtain computing resource details. Determining the versions of Nova and Placement can return the resource information needed in the following steps. This method involves thread pool configuration, requiring the configuration of Java thread pool information.

[0035] The specific operating method is as follows:

[0036] S1. Determine if a host aggregation list exists in the current cache and has not expired. If it does not exist or the cache has expired, retrieve and cache it via step S2. The next time a request arrives, the host aggregation object can be directly retrieved from the cache and returned. Caching here avoids the time-consuming process of directly requesting the OpenStack interface and also reduces the number of requests to the OpenStack platform.

[0037] S2. Obtain the host aggregation list by requesting the nova os-aggregates interface. This list is a classification of all computing resources. OpenStack can manage computing resources of different products or different resource types separately through host aggregation.

[0038] S3. Based on the product and resource type, filter the host aggregation list obtained in step S1 to find the only host aggregation that matches the rules.

[0039] S4. Obtain the computing resource usage information through the host aggregation request balance interface obtained in step S3. This step utilizes multithreading and asynchronous programming concepts during execution, which can avoid excessive resource consumption and time consumption during serial program execution, thus saving execution time.

[0040] S5. Filter computing resource usage. Based on the actual computing resource usage and status, calculate the available resources and the number of allowed input specifications. Compare this with the input specifications to determine whether the resource of that specification can be created, and the remaining available amount of that resource.

[0041] S6. Determine if a list of computing resource statuses exists in the cache and has not expired. If it does not exist or the cache has expired, retrieve and cache it via step S7. The next time a request arrives, the host aggregation object can be directly retrieved from the cache and returned. Caching here avoids the time-consuming process of directly requesting the OpenStack interface and reduces the number of requests to the OpenStack platform.

[0042] S7. Obtain a list of all computing resources by requesting the nova os-hypervisor interface. This list contains the status and running information of all computing resources.

[0043] S8. Filter the computing resource information obtained in step S6, filter out computing resources with normal status, and only computing resources with normal status can create instances normally.

[0044] S9. Using the information obtained in steps S1, S4, and S7, perform information aggregation calculations to obtain a relatively accurate specification of the platform computing resources that can be created and the remaining amount of resources. The program then determines whether an instance of that specification can be created and calculates the remaining available resources.

[0045] Based on the above method, an available resource prediction device in this embodiment includes: at least one memory and at least one processor;

[0046] The at least one memory is used to store a machine-readable program;

[0047] The at least one processor is used to call the machine-readable program to execute an available resource prediction method.

[0048] This invention pre-determines the resource type and specifications before requesting OpenStack resource operations. The pre-determined results display the types and specifications of resources that can be created or modified. Computational resources include CPU, memory, and disk. When operating on resource instances, this method can obtain the required resource specifications and status. This resource pre-determination method mainly involves operations such as resource creation and modification that utilize OpenStack computing resources.

[0049] This method can batch retrieve whether defined resource types and specifications can be created on the platform and whether creation will be successful. During the execution of the method, multiple requests will be made to the OpenStack interface, which will result in slow overall response. Therefore, the concepts of multithreading and asynchronous programming are used here. Multithreading can realize batch requests and can distribute the specifications queried in batches to achieve faster execution speed. The concept of asynchronous programming can obtain the execution results of multithreading, so that the main thread can continue to process subsequent jobs after obtaining the result information of multithreading execution.

[0050] This method works by exposing an interface. Users only need to call the exposed interface and pass in the resource specifications and resource type. The method will automatically obtain various required information from the OpenStack platform, aggregate and determine whether the passed resource specifications and resource type are operable.

[0051] The specific embodiments described above are merely specific examples of the present invention. The patent protection scope of the present invention includes, but is not limited to, the specific embodiments described above. Any appropriate changes or substitutions made by a person skilled in the art that conform to the claims of the present invention's available resource prediction method and apparatus should fall within the patent protection scope of the present invention.

[0052] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for predicting available resources, characterized in that, It has the following steps: S1. Determine if a host aggregation list exists in the current cache and the cache time has not expired. If it does not exist or the cache has expired, proceed to step S2. Determine if a host aggregation list exists in the current cache and the cache time has not expired. If it does not exist or the cache has expired, obtain and cache it through step S2. The next request can directly retrieve the host aggregation object from the cache and return it. S2. Obtain the host aggregation list by requesting the nova os-aggregates interface; The host aggregation list is obtained by requesting the nova os-aggregates interface. The host aggregation list is a classification of all computing resources. OpenStack can manage computing resources of different products or different resource types separately through host aggregation. S3. Based on the product and resource type, filter the host aggregation list obtained in step S1 to find the only host aggregation that matches the rules. S4. Obtain the usage status of computing resources through the host aggregation request placement interface obtained in step S3; S5. Filter the computing resource usage to determine whether the resource of this specification can be created; The system filters computing resource usage and calculates the available resources and the number of allowed input specifications based on the actual computing resource usage and usage status. It then compares these values ​​with the input specifications to determine whether the specification resources can be created and the remaining available resources. S6. Determine if a list of computing resource statuses exists in the cache and the cache time has not expired. If it does not exist or the cache has expired, proceed to step S7. Determine if a list of computing resource statuses exists in the cache and has not expired. If it does not exist or the cache has expired, retrieve and cache it through step S6. The next request can directly retrieve the host aggregation object from the cache and return it. S7. Request the nova os-hypervisor interface to obtain a list of all computing resources; The list of all computing resources is obtained by requesting the nova os-hypervisor interface. The list of computing resources includes the status and running information of all computing resources. S8. Filter the computing resource information obtained in step 6; The computing resource information obtained in step S6 is filtered to select computing resources with normal status. Only computing resources with normal status can be used to create instances. S9. Perform information aggregation calculations; The information obtained in steps S1, S4 and S8 is aggregated and calculated to obtain a more accurate specification of the platform computing resources that can be created and the remaining amount of resources. The program then determines whether an instance of that specification can be created and calculates the remaining available resources.

2. An available resource prediction device, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to execute the method of claim 1.

Citation Information

Patent Citations

  • Data request processing method and CDN server

    CN112468570A

  • Method for dynamically allocating cloud resources based on tenant exclusive host machines

    CN113504970A

  • Host scheduling method and device, equipment and storage medium

    CN114217917A