A cloud service acquisition method and terminal

By dividing the instance resources of the cloud service into two pools, and dynamically adjusting the instance in the resource pool during the change of supply and demand, the problem of excessive acquisition costs for seizing instances has been solved, and user experience and resource utilization rates are improved.

CN114860422BActive Publication Date: 2025-01-28TECHFISH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210313760.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-01-28
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

The cost of obtaining preemptive instances of existing cloud services is likely to increase too quickly due to changes in supply and demand, resulting in a decrease in user experience.

Method used

By dividing the instance resource into the first instance resource pool and the second instance resource pool, the instance in the first instance resource pool is transferred to the second instance resource pool when needed to maintain the number of instances of the second instance resource pool , Avoid the prevalence of the seized instance too fast.

Benefits of technology

Effectively improved the experience of user use and purchase of cloud services, and met the costs of grabbing instances stably to meet the needs of different users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860422B_ABST
    Figure CN114860422B_ABST
Patent Text Reader

Abstract

The present invention discloses a cloud service acquisition method and a terminal. By dividing instance resources into a first instance resource pool and a second instance resource pool, users with different instance requirements can be differentiated to meet the different requirements of the users, and the instances in the second instance resource pool are used to allocate preemptive instances to meet the user's requirements for preemptive instances. When the instance resources in the second instance resource pool continue to decrease, the use cost of the preemptive instances will increase due to the supply and demand relationship. At this time, the instance resources in the first instance resource pool are transferred to the second instance resource pool, so that the number of instances in the second instance resource pool is increased, so as to avoid the price of the preemptive instances increasing too quickly and causing a decrease in user experience, thereby improving the user experience of using and purchasing cloud services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing, and in particular to a cloud service acquisition method and terminal. Background Art

[0002] Cloud services refer to the on-demand and scalable access to required services through the Internet. They are the addition, use and interaction patterns of related services based on the Internet, usually involving the provision of dynamic, scalable and often virtualized resources through the Internet. Such services can be IT and software, Internet-related or other services. This means that computing power can also be circulated as a commodity through the Internet.

[0003] At present, cloud service billing usually includes two modes: prepaid and postpaid. For example, prepaid services such as annual, quarterly and monthly packages can be used for a long period of time after being purchased in advance; another example is the postpaid mode in which payment is made according to the length of use, but the price of the postpaid mode is relatively expensive, which limits user usage. Therefore, another postpaid mode has emerged: preemptible instances. The market price of preemptible instances will fluctuate with changes in supply and demand. That is, when the user's bid is higher than the real-time market price, the user can successfully preempt the instance and use the cloud service at an ideal price. However, as the demand for cloud services increases, it is difficult for users to preempt instances at an ideal price, which reduces the user experience of using and purchasing cloud services. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a cloud service acquisition method and terminal to improve the user experience of using and purchasing cloud services.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A cloud service acquisition method, comprising the steps of:

[0007] receiving an instance allocation request;

[0008] Obtain user information, determine whether the instance allocation request is an instance preemption request, and if not, obtain an instance from the first instance resource pool according to the current user information; if so, obtain an instance from the second instance resource pool;

[0009] It is determined whether the number of instances in the second instance resource pool is less than a first threshold, and if so, the instances in the first instance resource pool are added to the second instance resource pool.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] A cloud service acquisition terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the above-mentioned cloud service acquisition method are implemented:

[0012] receiving an instance allocation request;

[0013] Obtain user information, determine whether the instance allocation request is an instance preemption request, and if not, obtain an instance from the first instance resource pool according to the current user information; if so, obtain an instance from the second instance resource pool;

[0014] It is determined whether the number of instances in the second instance resource pool is less than a first threshold, and if so, the instances in the first instance resource pool are added to the second instance resource pool.

[0015] The beneficial effect of the present invention is that by dividing instance resources into a first instance resource pool and a second instance resource pool, users with different instance requirements can be differentiated to meet the different requirements of the users, and the instances in the second instance resource pool are used to allocate preemptible instances to meet the users' requirements for preemptible instances. When the instance resources in the second instance resource pool continue to decrease, the cost of using the preemptible instances will increase due to the supply and demand relationship. At this time, by transferring the instance resources in the first instance resource pool to the second instance resource pool, the number of instances in the second instance resource pool is increased, thereby avoiding the price of preemptible instances increasing too quickly and causing a decrease in user experience, thereby improving the user experience of using and purchasing cloud services. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flowchart of a method for obtaining cloud services in an embodiment of the present invention;

[0017] Figure 2 A schematic diagram of the structure of a cloud service acquisition terminal in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.

[0019] Please refer to Figure 1 , a cloud service acquisition method, comprising the steps of:

[0020] receiving an instance allocation request;

[0021] Obtain user information, determine whether the instance allocation request is an instance preemption request, and if not, obtain an instance from the first instance resource pool according to the current user information; if so, obtain an instance from the second instance resource pool;

[0022] It is determined whether the number of instances in the second instance resource pool is less than a first threshold, and if so, the instances in the first instance resource pool are added to the second instance resource pool.

[0023] From the above description, it can be seen that the beneficial effect of the present invention is that by dividing instance resources into a first instance resource pool and a second instance resource pool, users with different instance requirements can be differentiated to meet the different needs of users, and the instances in the second instance resource pool are used to allocate preemptible instances to meet the user's needs for preemptible instances. When the instance resources in the second instance resource pool continue to decrease, the cost of using preemptible instances will increase due to the supply and demand relationship. At this time, by transferring the instance resources in the first instance resource pool to the second instance resource pool, the number of instances in the second instance resource pool is increased, thereby avoiding the price of preemptible instances increasing too quickly and causing a decrease in user experience, thereby improving the user experience of using and purchasing cloud services.

[0024] Further, the acquiring of user information and determining whether the instance allocation request is an instance preemption request, if not, acquiring an instance from the first instance resource pool according to the current user information comprises:

[0025] Determine whether the instance is successfully acquired, and if so, acquire the system time to obtain the first system time;

[0026] Obtaining usage information of the instance;

[0027] Determine in real time whether the instance has finished the job, and if so, obtain the current system time again as the second system time; generate a timestamp according to the first system time and the second system time;

[0028] Obtain user data according to the user information, the timestamp, and usage information of the instance;

[0029] If yes, then adding the instance in the first instance resource pool to the second instance resource pool includes:

[0030] Adding instances in the first instance resource pool to the second instance resource pool according to the user data.

[0031] From the above description, it can be seen that when the instance allocation request corresponding to the user information is not a request to preempt an instance, the current system time is obtained after the instance is successfully acquired to obtain the first system time, and when the use of the instance is completed, the current system time is obtained again to obtain the second system time, the time the user uses the instance is recorded to generate user information, and further according to the corresponding user information, the idle instances in the first instance resource pool are reasonably allocated. Therefore, when there are idle instances in the first instance resource pool, it is possible to determine whether the instances in the first instance resource pool can be allocated to the second instance resources according to the time the user uses the instance, thereby improving the utilization rate of the instances in the first instance resource pool while ensuring the usage experience of prepaid users.

[0032] Further, adding the instance in the first instance resource pool to the second instance resource pool according to the user data includes:

[0033] Aggregate the user data having the same user information to obtain a user data set;

[0034] Analyzing the user data set to obtain a user usage schedule corresponding to the user information;

[0035] The instances in the first instance resource pool are added to the second instance resource pool according to the user usage schedule.

[0036] From the above description, it can be seen that the information of the same user's usage instance is counted to obtain a user data set, and further based on the user data set, a timetable for the user's usage of the instance is obtained, and the user's instance usage time period is obtained through the user usage timetable. When the user is likely not to use the instance for a large period of time, the corresponding number of instances in the first instance resource are added to the second instance resource; wherein, the user refers to the user of the prepaid account, and the idle instances of the prepaid account user are allocated to the postpaid user for use, thereby increasing the supply of preemptive instances, thereby providing lower prices for preemptive users on the premise of ensuring the normal use of prepaid users, reducing the number of idle instances, and improving the utilization rate of instances.

[0037] Furthermore, the second instance resource pool includes a main resource pool and a temporary resource pool;

[0038] The adding the instance in the first instance resource pool to the second instance resource pool according to the user data further includes:

[0039] Add instances in the first instance resource pool to the temporary resource pool.

[0040] From the above description, it can be seen that by dividing the second instance resource pool into a main resource pool and a temporary resource pool, and adding the instances from the first instance resource pool to the temporary resource pool, it is possible to distinguish the instances from the first resource pool from the original instances in the second instance resource pool, that is, to distinguish the instance resources temporarily stored in the second resource pool for prepaid users from the instance resources used by postpaid users, so as to avoid the instance resources dedicated to prepaid users being used as preempted instances for a long time, resulting in problems such as disordered instance resource allocation; it not only makes it convenient for the first instance resource pool to add the instances therein to the second instance resource pool and manage the instances, but also improves the instance allocation efficiency.

[0041] Furthermore, it also includes:

[0042] Determine in real time whether the number of instances in the first instance resource pool is less than a second threshold value. If so, recycle the instances in the second instance resource pool to the first instance resource pool; if not, add the instances in the first instance resource pool to the second instance resource pool.

[0043] From the above description, it can be seen that by real-time judgment of the instance data in the first instance resource pool, when the number of instances in the first instance resource pool is less than the second threshold, the instances originally allocated from the first instance resource pool to the second instance resource pool are recovered, thereby avoiding the problem that when the number in the first instance resource pool decreases, users with priority use rights, such as prepaid users, cannot obtain instances. This improves instance utilization while also improving user experience.

[0044] Further, recycling the instances in the second instance resource pool to the first instance resource pool includes:

[0045] According to the user usage schedule and the usage of the instances in the temporary resource pool, the instances meeting the recycling conditions are recycled into the first instance resource pool.

[0046] From the above description, it can be seen that the instances in the temporary resource pool are recycled by combining the user usage schedule and the usage of the instances in the temporary resource pool, and the instances that meet the recycling conditions are preferentially recycled to the first instance resource pool. For example, when an instance in the temporary resource pool is in an idle state and it is known from its corresponding user usage schedule that the current user has a high probability of needing to use the instance, the instance can be recycled to the first instance resource pool in a timely manner, so that the instances in the first instance resource pool can be effectively allocated according to the actual usage needs of the user, thereby improving the utilization rate of idle instances.

[0047] Further, the acquiring of user information and determining whether the instance allocation request is an instance preemption request, and if so, acquiring an instance from the second instance resource pool includes:

[0048] Determine whether an instance in the second instance resource pool matches the user information, and if not, continue to query and match instances matching the user information within a preset time;

[0049] Acquire corresponding job information according to the user information;

[0050] After the instance is preempted, the job is automatically executed according to the job information.

[0051] From the above description, it can be seen that when a preemptible instance matching the user's needs cannot be obtained, allocation requests will continue to be issued within a preset time period, and when the job tasks required by the user can be configured in advance, by obtaining the corresponding pending job information, when the system obtains the instance resources, it can automatically execute the job tasks according to the job information configured in advance by the user, thereby realizing automatic preemption and task execution, avoiding the need for users to always pay attention to the preemption results of the instance, while improving the user experience, it also improves the efficiency of instance use.

[0052] Further, the determining whether the number of instances in the first instance resource pool is less than a second threshold, and if not, before adding the instances in the first instance resource pool to the second instance resource pool, further includes:

[0053] Determine whether the number of instances in the second instance resource pool is less than a first threshold, and if so, execute the step of determining whether the number of instances in the first instance resource pool is less than a second threshold.

[0054] From the above description, it can be seen that when there are more idle instances in the first instance resource pool, if there are sufficient instances in the second instance resource pool, the instances in the first instance resource pool will not be added to the second instance resource pool, thereby reducing system energy consumption.

[0055] Further, the user information includes a prepaid account and a postpaid account;

[0056] The obtaining of user information and determining whether the instance allocation request is a request for preempting an instance includes:

[0057] If the user information is a prepaid account, the instance allocation request is a non-preemptible instance request;

[0058] If the user information is a pay-as-you-go account, the instance allocation request is an instance preemption request.

[0059] From the above description, it can be seen that users are divided into prepaid accounts and pay-as-you-go accounts based on user information. When the account is a prepaid account, there is no need to provide a preemptive instance request, and stable instance resources are provided to the user directly from the first instance resource pool. When the user is a pay-as-you-go account, preemptive instance resources corresponding to the needs of the user are matched according to the needs of the user, and services with different needs are provided to different users to meet the actual needs of different users.

[0060] Please refer to Figure 2 Another embodiment of the present invention provides a cloud service acquisition terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the above-mentioned cloud service acquisition method are implemented:

[0061] receiving an instance allocation request;

[0062] Obtain user information, determine whether the instance allocation request is a request to preempt an instance, and if not, obtain an instance from a first instance resource pool according to current user information; if so, obtain an instance from a second instance resource pool;

[0063] It is determined whether the number of instances in the second instance resource pool is less than a first threshold, and if so, the instances in the first instance resource pool are added to the second instance resource pool.

[0064] The cloud service acquisition method and terminal of the present invention can provide cloud services for various user needs, such as computing power requirements, database requirements, etc., and can save the cost of using instances when purchasing preemptible instances for computing power requirements of stateless applications. The following is an explanation through specific implementation methods:

[0065] Embodiment 1

[0066] Please refer to Figure 1 , a cloud service acquisition method, comprising the steps of:

[0067] S1. Receive an instance allocation request;

[0068] S2. Obtain user information, determine whether the instance allocation request is a preemptive instance request, if not, obtain the instance from the first instance resource pool according to the current user information and execute S21; if yes, obtain the instance from the second instance resource pool; wherein the user information includes a prepaid account and a pay-as-you-go account; if the user information is a prepaid account, the instance allocation request is a non-preemptive instance request; if the user information is a pay-as-you-go account, the instance allocation request is a preemptive instance request; in an optional implementation, the instance in the first instance resource pool can be distinguished from the instance in the second implementation resource pool by setting an instance ID or the like; at the same time, the instance is set with an idle and busy state, and the busy state is marked when the instance is allocated;

[0069] The preemptible instance is suitable for stateless application scenarios, such as elastically scalable Web site services, image rendering, big data analysis, and large-scale parallel computing. The higher the distribution, scalability, and fault tolerance of the application, the more suitable it is to use preemptible instances to save costs and improve throughput. The application scenarios mainly include: a. real-time analysis business, b. big data business, c. geospatial survey and analysis business, d. image and media encoding business, e. scientific and technological business, f. elastically scalable business sites, g. crawler business, and h. testing business.

[0070] S21, determining whether the instance is successfully acquired, and if so, acquiring the system time to obtain the first system time;

[0071] S22, obtaining usage information of the instance; obtaining the idle state or busy state of the instance, and the type of the instance used;

[0072] S23, determining in real time whether the instance has finished the job, if so, obtaining the current system time again as the second system time; generating a timestamp according to the first system time and the second system time; obtaining the busy time period and the idle time period corresponding to the instance;

[0073] S24, obtaining user data according to the user information, the timestamp, and the usage information of the instance; analyzing the user's usage of the instance according to the user information to obtain the time period when the user uses the instance, and analyzing the periodic time when the user uses the instance, that is, the probability of the user using the instance in each time period;

[0074] S3, judging whether the number of instances in the second instance resource pool is less than the first threshold, and if so, adding the instances in the first instance resource pool to the second instance resource pool; the number of instances is the number of instances in the idle state; wherein, the first threshold can be automatically adjusted according to the current time period; by obtaining the number of instances in the idle state and the busy state in the current system, the peak period and the valley period of instance usage are obtained, and the first threshold can be adjusted in real time according to the ratio of the number of instances in the idle state to the number of instances in the busy state;

[0075] In an optional implementation, the second instance resource pool includes a main resource pool and a temporary resource pool;

[0076] Specifically: S31, aggregating the user data having the same user information to obtain a user data set;

[0077] S32, analyzing the user data set to obtain a user usage schedule corresponding to the user information;

[0078] S33: Add instances in the first instance resource pool to the second instance resource pool according to the user usage schedule.

[0079] Embodiment 2

[0080] This embodiment differs from the first embodiment in that the instance allocation method of the second instance resource pool is specifically defined;

[0081] Also includes:

[0082] A1. Determine in real time whether the number of instances in the first instance resource pool is less than a second threshold;

[0083] If yes, execute step A2 to recycle the instances in the second instance resource pool to the first instance resource pool; specifically:

[0084] A21. Recycling instances that meet recycling conditions into the first instance resource pool according to the user usage schedule and the usage of the instances in the temporary resource pool;

[0085] If not, executing step A3, adding the instances in the first instance resource pool to the second instance resource pool, that is, adding the instances in the first instance resource pool to the temporary resource pool;

[0086] In an optional implementation, before executing step A1, the method further includes: step A0, determining whether the number of instances in the second instance resource pool is less than a first threshold, and if so, executing step A1; that is, only when the number of instances in the second instance resource pool is insufficient, determining whether the instances in the first instance resource pool can be allocated to the second resource pool;

[0087] Wherein, step S2 comprises:

[0088] B21. Determine whether the instance in the second instance resource pool matches the user information. If not, continue to query and match the instance matching the user information within a preset time. If the price currently expected by the user is lower than the floating market price, and the system cannot match the corresponding instance, continue to issue matching requests within a preset time, such as 30 minutes. When the market price of the instance is lower than or equal to the price expected by the user, obtain the corresponding instance.

[0089] B22, obtaining corresponding job information according to the user information; if the task to be performed by the user is a pre-settable task, the user can set the corresponding task in the system;

[0090] B23. After the instance is preempted, the job is automatically executed according to the job information.

[0091] Embodiment 3

[0092] Please refer to Figure 2 A cloud service acquisition terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in a cloud service acquisition method as described in any one of Embodiments 1, 2, or 3 is implemented.

[0093] In summary, the present invention provides a cloud service acquisition method and terminal. By dividing instance resources into a first instance resource pool and a second instance resource pool, and then dividing the second resource pool into a main resource pool and a temporary resource pool, users with different instance requirements can be differentiated to meet different user requirements, and instances in the second instance resource pool are used to allocate preemptive instances to meet user requirements for preemptive instances. When the instance resources in the second instance resource pool continue to decrease, the use cost of the preemptive instances will increase due to the supply and demand relationship. Therefore, when the number of available instances in the second instance resource pool is too small, the instance resources in the first instance resource pool are transferred to the second instance resource pool, so that the number of instances in the second instance resource pool is increased, thereby avoiding the price of preemptive instances from increasing too quickly and causing a decrease in user experience. In addition, before allocating instances in the first instance resource pool to the second instance resource pool, it is determined whether there are enough instances in the first instance resource pool. When there are enough instances, the instances in the first instance resource pool are allocated to the second resource pool, thereby improving the user experience of using and purchasing cloud services.

[0094] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A cloud service acquisition method, characterized in that: Includes steps: receiving an instance allocation request; Obtain user information, determine whether the instance allocation request is an instance preemption request, and if not, obtain an instance from the first instance resource pool according to the current user information; if so, obtain an instance from the second instance resource pool; Determine whether the number of instances in the second instance resource pool is less than a first threshold, and if so, add the instances in the first instance resource pool to the second instance resource pool; The acquiring of user information, determining whether the instance allocation request is a request for preempting an instance, and if not, acquiring an instance from a first instance resource pool according to the current user information, comprises: Determine whether the instance is successfully acquired, and if so, acquire the system time to obtain the first system time; Obtaining usage information of the instance; Determine in real time whether the instance has finished the job, and if so, obtain the current system time again as the second system time; generate a timestamp according to the first system time and the second system time; Obtain user data according to the user information, the timestamp, and usage information of the instance; If yes, then adding the instance in the first instance resource pool to the second instance resource pool comprises: Adding instances in the first instance resource pool to the second instance resource pool according to the user data.

2. A cloud service acquisition method according to claim 1, characterized in that: The adding the instance in the first instance resource pool to the second instance resource pool according to the user data comprises: Aggregate the user data having the same user information to obtain a user data set; Analyzing the user data set to obtain a user usage schedule corresponding to the user information; The instances in the first instance resource pool are added to the second instance resource pool according to the user usage schedule.

3. A cloud service acquisition method according to claim 2, characterized in that: The second instance resource pool includes a main resource pool and a temporary resource pool; The adding the instance in the first instance resource pool to the second instance resource pool according to the user data further includes: Add instances in the first instance resource pool to the temporary resource pool.

4. A cloud service acquisition method according to claim 3, characterized in that: Also includes: Determine in real time whether the number of instances in the first instance resource pool is less than a second threshold value. If so, recycle the instances in the second instance resource pool to the first instance resource pool; if not, add the instances in the first instance resource pool to the second instance resource pool.

5. A cloud service acquisition method according to claim 4, characterized in that: The recycling of the instances in the second instance resource pool to the first instance resource pool comprises: According to the user usage schedule and the usage of the instances in the temporary resource pool, the instances meeting the recycling conditions are recycled into the first instance resource pool.

6. A cloud service acquisition method according to claim 4, characterized in that: The acquiring of user information and determining whether the instance allocation request is a request for preempting an instance, and if so, acquiring an instance from the second instance resource pool comprises: Determine whether an instance in the second instance resource pool matches the user information, and if not, continue to query and match instances matching the user information within a preset time; Acquire corresponding job information according to the user information; After the instance is preempted, the job is automatically executed according to the job information.

7. A cloud service acquisition method according to claim 4, characterized in that: The determining whether the number of instances in the first instance resource pool is less than a second threshold, and if not, before adding the instances in the first instance resource pool to the second instance resource pool further includes: Determine whether the number of instances in the second instance resource pool is less than a first threshold, and if so, execute the step of determining whether the number of instances in the first instance resource pool is less than a second threshold.

8. A cloud service acquisition method according to claim 1, characterized in that: The user information includes a prepaid account and a pay-as-you-go account; The obtaining of user information and determining whether the instance allocation request is a request for preempting an instance includes: If the user information is a prepaid account, the instance allocation request is a non-preemptible instance request; If the user information is a pay-as-you-go account, the instance allocation request is an instance preemption request.

9. A cloud service acquisition terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step in the cloud service acquisition method as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and device for obtaining cloud service and cloud management server

    CN113034166A

  • Method for resource planning method in communication system

    CN1510935A