Resource sharing method, electronic equipment and storage medium

Through the resource sharing method between online services and offline computing services, the problem of low utilization rate of online service resources during low peak periods is solved, and efficient reuse and utilization rate of resources are achieved.

CN120295744APending Publication Date: 2025-07-11HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410038638.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

在线服务在资源使用低峰期时资源利用率低,导致资源浪费,现有技术难以有效提升资源利用率。

Method used

By receiving the sharing conditions specified by the user, the idle resources of the online service are allocated to the offline computing service for use, and the resources are released when the sharing end condition is met to achieve shared reuse of resources.

Benefits of technology

It improves resource utilization, reduces resource waste, and ensures the normal operation of online services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295744A_ABST
    Figure CN120295744A_ABST
Patent Text Reader

Abstract

The invention discloses a resource sharing method, electronic equipment and a storage medium. The method comprises the following steps: receiving a sharing condition specified by a user for a first service use resource; allocating idle resources of the first service to the second service for use according to the sharing condition; and controlling the second service to release the occupied resources of the first service under the condition that a sharing ending condition specified by a sharing condition is detected. According to the embodiment of the invention, the cloud platform receives the sharing condition specified by the user for the use resource of the first service, and then allocates the idle resource of the first service to the second service according to the sharing condition, so that the resource locked by the first service is reused, and the resource utilization rate is improved; therefore, normal operation of the first service is not affected, and when the system time reaches the sharing end time specified by the sharing condition, the resources, occupied by the second service, of the first service are released, so that the operation requirement of the first service is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a resource sharing method, an electronic device, and a storage medium. Background Art

[0002] With the development of cloud technology, more and more user tasks are running on the cloud. For online services of users, since they are always running, resource determinacy needs to be ensured. Users purchase corresponding capacity of ECS (Elastic Compute Service) resources on the cloud and lock them through certain means to meet the needs of continuously running online services.

[0003] However, there are low peak periods of resource usage in some time periods for online services. For example, the night belongs to the low peak period of resource usage, and the resource utilization rate is relatively low at this time, resulting in resource waste problems. Summary of the Invention

[0004] The purpose of this application is to propose a resource sharing method, an electronic device, and a storage medium in view of the above-mentioned deficiencies of the prior art, and this purpose is achieved through the following technical solutions.

[0005] A first aspect of this application proposes a resource sharing method, which is applied to a cloud platform. The method includes:

[0006] Receiving the sharing conditions specified by the user for using resources for the first service;

[0007] According to the sharing conditions, allocating the idle resources of the first service to the second service for use;

[0008] When it is detected that the sharing end condition specified by the sharing conditions is met, controlling the second service to release the resources of the first service occupied by it.

[0009] Based on the resource sharing method described in the above first aspect, it has at least the following beneficial effects or advantages:

[0010] The cloud platform receives the sharing conditions specified by the user for using resources for the first service, and thus, according to these sharing conditions, allocates the idle resources of the first service to the second service to reuse the resources locked by the first service, improving resource utilization. Since the idle resources of the first service are allocated to the second service for use, the normal operation of the first service will not be affected. And when the sharing end condition specified by the sharing conditions is met, the resources of the first service occupied by the second service are released to ensure the operation requirements of the first service.

[0011] The first service can be an online service that always runs. The second service can be other cloud services except the first service, such as a service for offline computing. By allocating the idle resources of the online service during the off-peak period to the service for offline computing, the sharing and reuse of the resources of the online service are realized, and the goal of improving resource utilization is achieved. When the specified sharing end condition set by the user is reached, the resources of the online service occupied by the service for offline computing are released to ensure the operation requirements of the online service.

[0012] The second aspect of this application proposes a resource sharing method, which is applied to a user device. The method includes:

[0013] Obtain the resource utilization rates of the first service at different times from the cloud platform, and display the resource utilization rates of the first service at different times and the total amount of resources used to process the first service;

[0014] Receive the sharing conditions input by the user for the first service according to the resource utilization rates at different times and the total amount of resources;

[0015] Send the sharing conditions to the cloud platform so that the cloud platform can allocate the idle resources of the first service to the second service for use according to the sharing conditions.

[0016] Based on the resource sharing method described in the above second aspect, it has at least the following beneficial effects or advantages:

[0017] By displaying the resource utilization rates of the first service at different times and the total amount of resources used to process the first service for the user, it is convenient for the user to specify the sharing conditions of the resources of the first service according to the resource usage situation of the first service. By sending the sharing conditions specified by the user to the cloud platform, the cloud platform can allocate the idle resources of the first service to the second service for use according to the sharing conditions, share the resources locked by the first service, and improve resource utilization.

[0018] The third aspect of this application proposes a resource sharing method. The method includes:

[0019] The user device obtains the resource utilization rates of the first service at different times from the cloud platform, and displays the resource utilization rates of the first service at different times and the total amount of resources used to process the first service;

[0020] The user device receives the sharing conditions input by the user for the first service according to the resource utilization rates at different times and the total amount of resources, and sends the sharing conditions to the cloud platform;

[0021] The cloud platform allocates the idle resources of the first service to the second service for use according to the sharing conditions;

[0022] When the cloud platform detects that the sharing end condition specified by the sharing condition is met, it controls the second service to release the resources of the first service occupied by it.

[0023] A fourth aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor executes the program to implement the method described in the first aspect or the second aspect above.

[0024] A fifth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. The program is executed by a processor to implement the method described in the first aspect or the second aspect above.

[0025] The above description is only an overview of the technical solution of the present application. In order to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the specific embodiments of the present application are specifically given below. Description of the Drawings

[0026] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0027] Figure 1 It is a schematic diagram of resource usage of an online service shown according to an exemplary embodiment;

[0028] Figure 2 It is a flowchart of an embodiment of a resource sharing method shown according to an exemplary embodiment;

[0029] Figure 3 It is a schematic diagram of time-sharing resource usage shown according to an exemplary embodiment;

[0030] Figure 4 It is a schematic diagram of resource view management and scheduling shown according to an exemplary embodiment;

[0031] Figure 5 It is a flowchart of an embodiment of another resource sharing method shown according to an exemplary embodiment;

[0032] Figure 6 It is an interaction flowchart of implementing resource sharing shown according to an exemplary embodiment;

[0033] Figure 7 It is a schematic diagram of the hardware structure of an electronic device shown according to an exemplary embodiment;

[0034] Figure 8Schematic structural diagram of a storage medium shown according to an exemplary embodiment. Detailed implementation manners

[0035] Here, the exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0036] The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The singular forms "a", "the", and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0037] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0038] Currently, for users' online services, it is necessary to ensure the resource certainty of the online services. Therefore, the resources applied by users for online services on the cloud will be locked, that is, these resources are only for the use of users' online services. However, due to the low peak period of resource usage in online services, the resource utilization rate is relatively low at this time. As Figure 1 shown, it is the daily resource usage situation of the online service. The period from 00:00 to 08:00 at night belongs to the low peak period of resource usage, and the resource utilization rate is relatively low. The daytime period is the peak period of resource usage, and the resource utilization rate is relatively high.

[0039] Due to the existence of the low peak period and the peak period of resource usage, the average resource utilization rate of the online service is relatively low, usually only 10%-30%, resulting in the problem of resource waste.

[0040] Based on the above technical problems, the inventors found that at night is exactly the peak period of resource usage for offline computing services. If the offline computing services can utilize the idle resources of the online services during the low peak period, the overall resource utilization rate can be improved.

[0041] For example, when Company A is planning the future use of cloud-based service products within the company, different department teams within the company will use different cloud-based service products. In terms of product coverage, IaaS (Infrastructure as a Server) products such as cloud servers and elastic containers on the cloud, as well as PaaS (Platform as a Service) products such as big data and databases, will be used. Currently, a certain task of the company has been running on the cloud all the time, which can be regarded as an online service. And through the resource reservation method, the corresponding capacity of resources has been purchased on the cloud as private resources to ensure the continuous operation of the task. It is found from daily observations that there are low peaks in resource usage during some time periods. The company is also using the big data service on the cloud for offline computing, hoping to reuse the idle resources freed up by the big data service during the low peak period of resource usage to improve the overall resource utilization rate and reduce costs.

[0042] Therefore, this application proposes a resource sharing method. The user specifies the sharing conditions for the resources of the first service according to the resource usage situation of the first service. The cloud platform receives the sharing conditions specified by the user, and then according to these sharing conditions, allocates the idle resources of the first service to the second service to reuse the resources locked by the first service and improve the resource utilization rate. Since the idle resources of the first service are allocated for the second service to use, it will not affect the normal operation of the first service. And when the sharing end condition specified by the sharing conditions is met, the resources of the first service occupied by the second service are released to ensure the operation requirements of the first service.

[0043] The first service can be an online service that always keeps running. The second service can be other cloud services except the first service, such as a service for offline computing. By allocating the idle resources of the online service during the low peak period of use to the service for offline computing, the sharing and reuse of the resources of the online service are realized, and the goal of improving the resource utilization rate is achieved. When the sharing end condition specified by the user is met, the resources of the online service occupied by the service for offline computing are released to ensure the operation requirements of the online service.

[0044] The above-given is an application example where the first service and the second service belong to different types of services. Of course, it can also be different services where the second service and the first service belong to the same type of service, as long as the first service and the second service are two different cloud services.

[0045] The following will use specific embodiments to elaborate in detail on the technical solution of this application and how the technical solution of this application solves the aforementioned technical problems. The several specific embodiments listed can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of this application in detail with reference to the accompanying drawings.

[0046] Example 1:

[0047] Figure 2 FIG. is a flowchart of an embodiment of a resource sharing method shown according to an exemplary embodiment. The execution subject of this embodiment may be a cloud platform. The resource sharing method includes the following steps:

[0048] Step 201: Receive the sharing conditions specified by the user for the resources used for the first service.

[0049] In this step, the first service is a service product of a cloud platform used by the user. The user locks a certain amount of resources on the cloud platform for the continuous operation of the first service to ensure resource certainty. That is to say, the first service can be regarded as an online service that needs to keep running all the time, and the resource usage of the online service does not remain unchanged. In some time periods, the resource usage is very high, which can be called the peak period at this time. In some time periods, the resource usage is relatively low, which can be called the off-peak period at this time. During the off-peak period, the resources used for the first service will be idle. In order to share this part of the resources for other services to use, the user can specify the sharing conditions for the resources used for the first service.

[0050] The sharing conditions are used to characterize the conditions that need to be met when the resources used by the first service are shared with other services.

[0051] Optionally, the sharing conditions may include the sharing time period of the resources used by the first service, the shareable resource quota, and the information of the resource pool corresponding to the first service. Among them, the resources usually locked for the first service are correspondingly placed in a private resource pool. Therefore, it is necessary to specify the information of the resource pool corresponding to the first service in the sharing conditions. The sharing start time and sharing end time of the sharing time period respectively represent the sharing start condition and sharing end condition. The resource quota is the resource specification size that the user specifies for the second service to use the resources of the first service.

[0052] Further, the sharing conditions may also include the information of the shared user, the information of the shared service, etc.

[0053] For example, assume that the resource pool A locked by the first service of user A is 1000 vCPUs (virtual Central Processing Unit) and 100G of memory to ensure the use of the first service. The sharing time period is specified as 0:00 - 8:00 every day in the sharing conditions, that is, the sharing start time is 0:00 every morning, and the sharing end time is 8:00 every morning; the resource quota is 600 vCPUs and 60G of memory; the information of the resource pool is A.

[0054] Step 202: Allocate the idle resources of the first service to the second service for use according to the sharing conditions.

[0055] In this step, the idle resources of the first service refer to the total resources of the first service minus the resources currently in use. The second service is also a service product of the cloud platform used by users for offline computing and does not need to run continuously. Therefore, the second service can be regarded as an offline service and does not need to run continuously. It only needs to be started and run during a certain time period, such as the big data computing service provided by the cloud platform.

[0056] Before executing step 202, it is necessary to control the first service to release the occupied resources so as to free up these resources for sharing with other services. The implementation process includes: when the current system time reaches the sharing start time specified by the sharing condition, controlling the first service to release the resources of the resource quota specified by the sharing condition.

[0057] Among them, since all the resources in the resource pool are usually used to process the first service during the non-sharing period to ensure the resource usage of the first service during the peak period, when the sharing start time of the sharing period is reached, the first service also enters the low peak period and can release some resources to reduce the resources occupied by the first service. Further, the amount of resources reduced by the first service is at least the resource quota specified by the sharing condition to ensure normal sharing.

[0058] Suppose the first service creates 100 instances with a specification of 10 vCPU and 1G memory using 1000 vCPU and 100G memory. During the peak period, these 100 instances all execute tasks at full load, while during the low peak period, some instances execute tasks at low load, and even some instances have no tasks to execute. The sharing condition specifies that the resource quota is 600 vCPU and 60G memory. Therefore, by releasing 60 instances with a specification of 10 vCPU and 1G memory among these 100 instances, the sharing requirement can be met.

[0059] It should be noted that this application does not limit the method of controlling the first service to release resources. It can be that the user device side authorizes the cloud platform, and the cloud platform actively releases the instances of the first service according to the sharing period and resource quota specified by the sharing condition. Of course, it can also be that the user device side sends a resource release notice to the cloud platform, and the cloud platform releases the instances of the first service passively according to this notice.

[0060] It can be seen that when the sharing start time of the sharing period is reached, it indicates that the resource usage of the first service enters the low peak period. By releasing a part of the resources occupied by the first service for the second service to use, since this part of the resources is the idle resources of the first service, if it is allocated to the second service for use, it can play the role of time-sharing use of resources. For example, Figure 3As shown, since the first service running the online service enters the low peak period from 00:00 to 8:00 every day and the resource utilization rate is relatively low, the user has given a sharing authorization for the first service. The specified sharing condition is that during the period from 00:00 to 8:00 every day, a resource quota of 600 vCPUs and 60G of memory can be shared with the second service. Thus, the first service releases the resources of the 600 vCPUs and 60G of memory resource quota at 00:00 every day. Starting from 00:00 every day, the second service adds the resources of these 600 vCPUs and 60G of memory to its own resource pool and uses this part of the resources to run its own computing service. When it reaches 8:00, the second service releases this part of the resources again.

[0061] As a possible implementation, by detecting the instance creation request of the second service, when the detected instance creation request meets the sharing condition, then use the idle resources of the first service to generate an instance for processing the second service according to the instance creation request.

[0062] In this implementation, the second service can be a cloud service that does not need to always run, that is, it can be called an offline service, such as a big data service for offline computing. The instance creation request of the second service is used to create an instance for processing the second service.

[0063] Based on the sharing condition described in step 201 above, the process for the detected instance creation request to meet the sharing condition includes:

[0064] The detection time of the instance creation request should be within the sharing period specified by the sharing condition, and the resource pool information carried by the instance creation request indicates the resource pool specified by the sharing condition.

[0065] For example, assume that the specified sharing period of the sharing condition is from 00:00 to 08:00 every day, the specified resource pool is s01, and the detection time of the detected instance creation request is 03:30. Since the detection time is within the sharing period and the resource pool information carried by the instance creation request is also s01, it is considered that the instance creation request meets the sharing condition.

[0066] If the instance creation request meets the above condition requirements, it means that the instance creation request is a request for creating an instance to start the second service by sharing resources. By judging that the instance creation request meets the sharing condition, the sharing accuracy can be ensured.

[0067] Furthermore, if the sharing condition also includes the information of the shared user and the information of the shared service, it can further judge whether the user information carried by the instance creation request is the information of the shared user specified by the sharing condition, and judge whether the second service is the information of the shared service specified by the sharing condition.

[0068] Continuing with the above example, assume that the sharing condition specifies that the shared user is User A and the shared service is Service A. If it is detected that the user information carried in the instance creation request is User A and the second service to which the instance creation request belongs is also Service A, then it is considered that the instance creation request meets the two conditions of the shared user and the shared service specified in the sharing condition.

[0069] In an optional implementation, for the process of generating an instance for processing the second service using the idle resources of the first service according to the instance creation request, obtain the resource quota specified by the sharing condition, and then use the idle resources of this resource quota of the first service according to the instance creation requirements in the instance creation request to generate an instance for processing the second service.

[0070] Among them, the resource quota is the size of the shareable resource specification specified by the user in the sharing condition. The idle resources of the first service are the resources released by the aforementioned control of the first service. Specifically, this part of the released resources can be marked in the resource pool to indicate that they are available idle resources.

[0071] In a specific implementation, for the process of generating an instance of the second service using the idle resources of this resource quota of the first service, a virtual physical machine can be created using the idle resources of this resource quota in the resource pool specified by the sharing condition, and then in this virtual physical machine, an instance for processing the second service is generated according to the instance creation requirements in the instance creation request.

[0072] Among them, for the idle resources reserved in the resource pool of the first service, in the resource view management of the physical machine, only the idle resources of this resource quota can be scheduled for the second service as a whole. To achieve resource slicing, a virtual physical machine is created using the idle resources of the resource quota in the resource pool, so that in the virtual physical machine, a resource view management similar to that of the real physical machine can be adopted, and resources can be scheduled for the second service with fine granularity.

[0073] The instance creation requirements may include information such as instance specifications and instance quantities. As Figure 3 shown, in the resource view management of the real physical machine, the idle resources reserved in the resource pool of the first service are of the resource specification of 8vCPU 8G memory. By using this part of the resources to create a virtual physical machine, then in the resource view management of the virtual physical machine, resources with a specification less than or equal to 8vCPU 8G memory can be scheduled, that is, it is allowed to create instances with a specification less than or equal to 8vCPU 8G memory for the second service. Assume that the instance creation requirements are to create an instance with a specification of 2vCPU 1G memory and an instance with a specification of 4vCPU 1G memory. Thus, in the virtual physical machine, it is allowed to create these two specifications of instances respectively.

[0074] It should be noted here that a virtual physical machine is a hardware entity virtualized using certain resources on a real physical machine, that is, a virtual physical machine is a hardware system virtualized by means of a real physical machine.

[0075] Step 203: When it is detected that the sharing end condition specified by the sharing condition is satisfied, control the second service to release the resources of the first service that it occupies.

[0076] In this step, the sharing end condition specified by the sharing condition is specifically that the current system time reaches the sharing end time of the sharing time period specified by the sharing condition. At this time, it indicates that the resource usage of the first service is gradually restored. In order to ensure the normal operation of the first service, it is necessary to release the resources occupied by the second service for the first service to use.

[0077] It should be noted here that the released resources are the resources of the first service occupied by the second service, and the resources specifically applied by the user for the second service and dedicated to the second service are not processed.

[0078] In specific implementation, it is possible to mark the instances generated by using the shared resources. When releasing the resources, release the instances with marks to achieve the release of the resources of the first service occupied by the second service.

[0079] Thus far, the above Figure 2 shown resource sharing process is completed. The cloud platform receives the sharing conditions specified by the user for using the resources of the first service, and thus, according to this sharing condition, allocates the idle resources of the first service to the second service to reuse the resources locked by the first service and improve the resource utilization rate. Since the idle resources of the first service are allocated to the second service for use, the normal operation of the first service will not be affected. And when the sharing end condition specified by the sharing condition is satisfied, the resources of the first service occupied by the second service are released to ensure the operation requirements of the first service.

[0080] Embodiment 2:

[0081] Based on the above Figure 2 shown embodiment, Figure 4 is a flowchart of an embodiment of another resource sharing method shown according to an exemplary embodiment. The execution subject of this embodiment may be a user device, and the resource sharing method includes the following steps:

[0082] Step 401: Obtain the resource utilization rates of the first service at different times from the cloud platform, and display the resource utilization rates of the first service at different times and the total amount of resources used to process the first service.

[0083] In specific implementation, the resource usage of different cloud services is statistically calculated in real time on the cloud platform, that is, at regular intervals, the ratio of the current resource usage of the cloud service to the total amount of resources occupied by the cloud service is calculated to obtain the current resource utilization rate. Therefore, the resource utilization rates of the first service at different times can be obtained from the cloud platform.

[0084] In step 401, when a request for the resource usage of the first service is sent to the cloud platform and the resource utilization rates of the first service at different times returned by the cloud platform are received, the resource utilization rates of the first service at different times can be displayed in the form of a time axis. As Figure 1 shown in the schematic diagram of the change of resource utilization rate over time, it is convenient for users to understand the low-peak time of the resource usage of the first service, so that the resource quota can be determined according to the resource utilization rate and the total amount of resources during the low-peak time.

[0085] Step 402: Detect the sharing conditions input by the user for the first service according to the resource utilization rates at different times and the total amount of this resource.

[0086] In this step, the user obtains the low-peak time period of the resource usage of the first service and the average resource usage amount during the low-peak time period according to the resource utilization rates at different times and the total amount of resources of the first service. Thus, the low-peak time period is used as the sharing time period, and the total amount of resources minus the average resource usage amount is used as the resource quota. The sharing conditions of the first service are composed of the sharing time period, the resource quota, and the resource pool information corresponding to the first service.

[0087] Furthermore, information about the shared user, information about the shared service, etc. can also be added to the sharing conditions.

[0088] Step 403: Send the sharing conditions to the cloud platform so that the cloud platform can allocate the idle resources of the first service to the second service for use according to the sharing conditions.

[0089] In this step, by sending the sharing conditions to the cloud platform, the resource sharing authorization of the first service is realized.

[0090] Based on the above-mentioned second embodiment, by displaying the resource utilization rates of the first service at different times and the total amount of resources used to process the first service for the user, it is convenient for the user to specify the sharing conditions of the first service resources according to the resource usage of the first service. By sending the sharing conditions specified by the user to the cloud platform, the cloud platform can allocate the idle resources of the first service to the second service for use according to the sharing conditions, share the resources locked by the first service, and improve the resource utilization rate.

[0091] Based on the above-mentioned first and second embodiments, the implementation process of resource sharing is described in detail in the form of interaction between each product module (i.e., the ECS module, the big data service module, and the resource sharing management module) in the cloud platform.Figure 5 An interaction flowchart for implementing resource sharing shown according to an exemplary embodiment, wherein the ECS module is used to provide ECS resources of cloud servers; the resource sharing management module provides an entry for users to share resources; and the big data service module is used to perform big data computing services using ECS resources.

[0092] In the sharing establishment phase:

[0093] The user device locks a certain capacity of resource pool through the ECS module for use in continuously running online services to ensure resource certainty. Then the user device sends the sharing conditions input by the user for the online service to the resource sharing management module. The sharing conditions may include sharing time period, resource quota, information about the resource pool corresponding to the online service, information about the shared user, information about the shared service, etc. Among them, the sharing time period, resource quota, and information about the resource pool corresponding to the online service are three mandatory input items, and the information about the shared user and the information about the shared service are two optional input items. Assume that the input item for the shared service is big data service, and the sharing time period is from 0:00 to 8:00 every day, that is, the low peak period of resource usage for the online service.

[0094] The resource sharing management module sends the sharing conditions to the ECS module and the big data service module respectively. The ECS module records the sharing conditions, and the big data service module records the sharing conditions.

[0095] In the resource sharing phase:

[0096] The user device creates an instance for processing the online service through the resource pool. When the online service enters the low peak period of resource usage, that is, when the system time reaches the start time of the sharing period specified in the sharing conditions, the user device sends a resource release notice to the ECS module according to the resource quota specified in the sharing conditions; the ECS module stops some instances of the online service according to the resource release notice of the user device to release a part of the resources.

[0097] And when the big data service module detects that the system time reaches the start time of the sharing period specified in the sharing conditions, it can send a request for creating an instance for processing the big data service to the ECS module according to the resource quota specified in the sharing conditions.

[0098] The ECS module determines whether the instance creation request meets the sharing conditions of the online service to ensure the accuracy of resource sharing. In the case of determination that it meets, it creates a virtual physical machine using the idle resources of the resource quota in the corresponding resource pool, and then creates an instance for processing the big data service in the virtual physical machine according to the instance creation requirements of the instance creation request, so as to realize the reuse of the idle resources of the online service by the big data service.

[0099] When the big data service module detects that the system time reaches the sharing end time of the sharing time period specified by the sharing condition, it can send a resource release notification to the ECS module according to the instances created by using the resources of the online service; the ECS module stops the instances created by using the resources of the online service according to the resource release notification of the big data service module, so as to release the resources of the online service occupied by the big data service.

[0100] Meanwhile, when the user device detects that the system time reaches the sharing end time of the sharing time period specified by the sharing condition, it can send an instance creation request for processing the online service to the ECS module according to the resource quota specified by the sharing condition, so as to continue to use the previously released resources for processing the online service.

[0101] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.

[0102] Corresponding to the embodiment of the foregoing resource sharing method, the present application further provides a resource sharing system, which includes a user device and a cloud platform. Among them, the user device is used to execute the method described in the foregoing Embodiment 1, and the cloud platform is used to execute the method described in the foregoing Embodiment 2.

[0103] The embodiment of the present application also provides an electronic device corresponding to the resource sharing method provided by the foregoing embodiment to execute the foregoing resource sharing method.

[0104] Figure 6 Shown is a hardware structure diagram of an electronic device according to an exemplary embodiment. The electronic device includes: a communication interface 601, a processor 602, a memory 603, and a bus 604; among them, the communication interface 601, the processor 602, and the memory 603 complete mutual communication through the bus 604. The processor 602 can execute the resource sharing method described above by reading and executing the machine-executable instructions corresponding to the control logic of the resource sharing method in the memory 603. For the specific content of this method, please refer to the foregoing embodiments and will not be repeated here.

[0105] The memory 603 mentioned in this application can be any electronic, magnetic, optical or other physical storage device, which can contain stored information such as executable instructions, data, etc. Specifically, the memory 603 can be a RAM (Random Access Memory), flash memory, storage drive (such as a hard disk drive), any type of storage disk (such as an optical disk, DVD, etc.), or a similar storage medium, or a combination thereof. The communication connection between this system network element and at least one other network element is realized through at least one communication interface 601 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.

[0106] The bus 604 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 603 is used to store a program, and after receiving an execution instruction, the processor 602 executes the program.

[0107] The processor 602 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 602 or the instructions in software form. The above-mentioned processor 602 can be a general-purpose processor, including a network processor (abbreviated as NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of this application can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor.

[0108] The electronic device provided by the embodiments of this application and the resource sharing method provided by the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by it.

[0109] The embodiments of this application also provide a computer-readable storage medium corresponding to the resource sharing method provided in the foregoing embodiments. Please refer to Figure 7 As shown, the computer-readable storage medium shown is an optical disc 30, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the resource sharing method provided in any of the foregoing embodiments.

[0110] It should be noted that examples of the computer-readable storage medium may further include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical and magnetic storage media, which will not be elaborated here one by one.

[0111] The computer-readable storage medium provided by the above embodiments of the present application and the resource sharing method provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored therein.

[0112] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only illustrative, and the true scope and spirit of the present application are pointed out by the following claims.

[0113] It should also be noted that the term "comprising", "including", or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity, or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, commodity, or device comprising the element.

[0114] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of protection of the present application.

Claims

1. A resource sharing method, characterized in that, Applied to a cloud platform, the method includes: Receiving sharing conditions specified by a user for using resources of a first service; Allocating idle resources of the first service to a second service for use according to the sharing conditions; When it is detected that a sharing end condition specified by the sharing conditions is met, controlling the second service to release the resources of the first service that it occupies.

2. The method according to claim 1, wherein The allocating, according to the sharing conditions, the idle resources of the first service to the second service for use includes: Detecting an instance creation request of the second service; When the detected instance creation request meets the sharing conditions, using the idle resources of the first service according to the instance creation request to generate an instance for processing the second service.

3. The method according to claim 2, wherein The detected instance creation request meeting the sharing conditions includes: the detection time of the instance creation request being within the sharing time period specified by the sharing conditions and the resource pool information carried by the instance creation request indicating the resource pool specified by the sharing conditions; The detecting that a sharing end condition specified by the sharing conditions is met includes: the current system time reaching the sharing end time of the sharing time period specified by the sharing conditions.

4. The method according to claim 2, wherein The using, according to the instance creation request, the idle resources of the first service to generate an instance for processing the second service includes: Obtaining the resource quota specified by the sharing conditions; Using the idle resources of the resource quota of the first service according to the instance creation requirements in the instance creation request to generate an instance for processing the second service.

5. The method according to claim 4, characterized in that, The using, according to the instance creation requirements in the instance creation request, the idle resources of the resource quota of the first service to generate an instance for processing the second service includes: Using the idle resources of the resource quota in the resource pool specified by the sharing conditions to create a virtual physical machine; Generating an instance for processing the second service in the virtual physical machine according to the instance creation requirements in the instance creation request.

6. The method according to claim 1, characterized in that, Before allocating, according to the sharing conditions, the idle resources of the first service to the second service for use, the method further includes: When the current system time reaches the sharing start time of the sharing time period specified by the sharing conditions, controlling the first service to release the resources of the resource quota specified by the sharing conditions.

7. A resource sharing method, characterized in that, Applied to a user device, the method includes: Obtaining the resource utilization rate of a first service at different times from a cloud platform, and displaying the resource utilization rate of the first service at different times and the total amount of resources used for processing the first service; Receiving sharing conditions input by the user for the first service according to the resource utilization rate at different times and the total amount of resources; Sending the sharing conditions to the cloud platform so that the cloud platform allocates the idle resources of the first service to the second service for use according to the sharing conditions.

8. The method according to claim 7, wherein The sharing conditions include a sharing time period, resource pool information used by the first service, and a sharable resource quota.

9. A resource sharing method, characterized in that The method includes: The user device obtains the resource utilization rates of the first service at different times from the cloud platform, and displays the resource utilization rates of the first service at different times and the total amount of resources used to process the first service; The user device receives the sharing conditions input by the user for the first service according to the resource utilization rates at different times and the total amount of resources, and sends the sharing conditions to the cloud platform; The cloud platform allocates the idle resources of the first service to the second service for use according to the sharing conditions; When the cloud platform detects that the sharing end condition specified by the sharing conditions is met, it controls the second service to release the resources of the first service that it occupies.

10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the method according to any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method according to any one of claims 1-8.