A computing power sharing method and device based on time-sharing management and control
Through time-sharing control and computing power virtualization technology, the problem of static allocation of computing power equipment has been solved, dynamic adjustment of resources and continuous preservation of data have been achieved, and the utilization rate of computing power equipment and scientific research efficiency have been improved.
Patent Information
- Application Number
- CN202411851057.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The static allocation of computing power equipment in existing technologies leads to low resource utilization, resource shortages during peak scientific research periods and excess resources during non-peak periods, the inability to continuously save data, and unbalanced resource allocation among scientific research teams, resulting in resource waste and low scientific research efficiency.
A computing power sharing method with time-sharing control is adopted. By separately managing computing power and storage clusters, and utilizing computing power virtualization technology, a container image and virtual machine resource library is built. Resource usage is monitored in real time, and dynamic adjustments and recycling are performed based on effective utilization to ensure data continuity and resource isolation.
It improves the utilization rate of computing equipment, avoids resource waste, ensures the continuous preservation of user data, realizes transparent management and efficient sharing of resources, and improves scientific research efficiency.
Smart Images

Figure CN119781969B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computing power allocation, and more particularly to a computing power sharing method and device based on time-sharing control. BACKGROUND
[0002] Currently, with the rapid development of artificial intelligence and its wide application in scientific research, more and more colleges and research institutions have deployed or are deploying a large number of high-performance professional computing power facilities. Compared with traditional CPU computing power, special AI computing power equipment represented by GPU (hereinafter referred to as "computing power equipment") is usually expensive and resource-limited. Therefore, effective management and efficient use of these computing power equipment become the key to improving scientific research efficiency and reducing operating costs. From the perspective of scientific research application, the demand for efficient management and dynamic sharing of these computing power equipment is urgent in order to improve the utilization rate of computing power equipment and reduce the investment cost of computing power equipment. However, in actual colleges and research institutions, the computing power equipment often has the following shortcomings when used:
[0003] 1. Static allocation of computing power equipment. In most colleges and research institutions, once the computing power equipment is allocated to a specific project, it is difficult to be used by other projects even during the inactive period of the project. However, this static allocation method cannot respond flexibly when the resource demand changes, especially when the resource utilization rate fluctuates greatly between peak and non-peak periods of scientific research, resulting in low efficiency and high cost of resource allocation.
[0004] 2. Resource shortage in critical stages and resource surplus in critical stages. In the scientific research environment, the demand for computing power equipment usually increases sharply in critical stages (such as data analysis period or before the deadline for submitting papers), especially when performing computationally intensive work such as data processing and model training. This periodic demand peak causes extreme shortage of computing resources in a short period of time, which is common when multiple scientific research projects reach the critical progress stage at the same time. This not only may cause resource shortage, seriously affecting the timely completion of the project and scientific research efficiency, but also may cause significant resource surplus after the demand peak. Scientific research teams often apply for a large number of computing power equipment to cope with the demand during the peak period, but these equipment are in a state of low efficiency after the critical stage, resulting in resource surplus.
[0005] 3. In particular, some teachers or teams do not actually use the computing power resources after applying for them, or only use a part of them, but other teachers do not know about it, which leads to the situation that some teachers do not have computing power resources available, while some computing power resources are allocated to other teachers but are actually idle.
[0006] 4. When a device is shared by multiple people, there is often a problem that data is deleted by other teams, or the data cannot be continuously saved when a scientific research team uses it discontinuously. For example, Team A uses it in the morning and it is assigned to Team B in the afternoon. When Team A uses it again the next morning, yesterday's data may no longer exist or be accidentally deleted by Team B, which makes it impossible for Team A to use it continuously and intermittently. Summary of the Invention
[0007] The present invention aims to overcome at least one defect (shortcoming) of the above-mentioned prior art and provide a computing power sharing method and device based on time-sharing control, which is used to solve the problems of static resource allocation, inability to monitor allocated resources, and inability to continuously save data in existing resource usage.
[0008] The technical solution adopted by the present invention is a computing power sharing method based on time-sharing control, which includes:
[0009] S1: User data and computing resources are separated and divided into two different clusters for management: a computing cluster that combines all computing resources and a storage cluster that combines all hard disk resources. For the computing cluster, computing power virtualization technology is used to virtualize computing resources.
[0010] S2: Build container images and virtual machine resource libraries;
[0011] S3: Obtain the user's resource request information from the user's resource application form, then parse the user's resource request information according to the resource allocation and recycling rules, call the computing power cluster to allocate computing power resources based on the current resource situation, and obtain the corresponding configuration data from the container image and virtual machine resource library to allocate to the user;
[0012] In this application, by storing user data and computing resources separately, user data can be continuously preserved, ensuring the continuity of user data when users use computing resources, and effectively avoiding the loss or deletion of user data after each reallocation of computing resources; and both computing clusters and storage clusters are built directly using existing computer equipment resources, without the need to add additional hardware, which is economical and practical; at the same time, computing resources are virtualized and provided to users in the form of containers or virtual machines, so that the resource environment is isolated, and the scientific research environments of each user are independent of each other and do not interfere with each other. It can also make the user's computing power operation process transparent, which helps to monitor the usage of computing power in real time and make real-time intelligent allocation adjustments, thereby improving the effective utilization of resources.
[0013] Preferably, the method further includes real-time monitoring of the usage of the allocated computing resources, including:
[0014] S41: Collect usage information of allocated computing resources at fixed time intervals according to actual needs;
[0015] S42: Calculate the effective utilization rate of the allocated computing resources using a relevant algorithm based on the obtained usage information of the allocated computing resources;
[0016] S43: Determine the obtained effective utilization rate and decide whether to reclaim the allocated computing resources based on the determination result.
[0017] In this application, in order to further improve the effective utilization rate of computing power resources, the usage of computing power resources allocated to users is also monitored in real time, so that the usage of allocated computing power resources is open and transparent, avoiding the situation where the computing power resources applied for by users are not used or are not fully used. Adjustments can be made in time to these situations to achieve more effective sharing and use of computing power resources.
[0018] Further preferably, in step S42, the algorithm includes:
[0019] S421: For all computing power card resources requested by a user in an application form, select the data with the highest utilization rate every n minutes to represent the utilization rate for those n minutes;
[0020] S422: For all utilization rates of all hashing cards requested in a user's application form, if the utilization rate of a hashing card is greater than 0, it is recorded as 1. The final number of hashing cards with utilization rates greater than 0 is recorded as u. The total number of hashing cards requested in the application form is recorded as a. The effective utilization rate η of the hashing cards requested in the application form by the user within n minutes is calculated as η = u / a*100%;
[0021] S423: Collect statistics on all effective utilization rates of the hashing cards in each of all time periods allocated to the user's application in one day, and take the maximum effective utilization rate in each time period as the effective utilization rate of the hashing cards for the application in that time period;
[0022] S424: Collect statistics on all effective utilization rates calculated for all time periods allocated to an application form of a user within one day, and take the maximum effective utilization rate among all time periods as the effective utilization rate of all computing power cards applied for by the user for the application form on that day.
[0023] The effective utilization rate is calculated by dividing the user's computing power resource usage into several different time nodes, and the highest effective utilization rate calculated at each different time node is selected as the current effective utilization rate, thereby obtaining the most accurate effective utilization rate of the current user's computing power resource usage. The obtained effective utilization rate can be used to intuitively observe the user's usage of the allocated computing power resources, so that the allocated resources can be dynamically adjusted in a timely manner, effectively avoiding the waste of computing power resources.
[0024] Preferably, the step S43 further includes setting a threshold value of effective utilization rate.
[0025] When the final effective utilization rate η is 0, it means that the user has not used any of the computing power card resources requested in the application form on that day. The computing power card recycling action can be directly triggered according to the preset rules, and the resources can be automatically recycled.
[0026] When the final effective utilization rate η is greater than 0 but less than the set threshold, it indicates that the user has only used part of the computing power card resources for the application on that day, and some computing power card resources can be recycled. In this case, the situation will be sent to the administrator and the user. If the user confirms that the computing power resources can be released, the user's computing power resources will be automatically adjusted to release the idle part. If the user does not provide feedback, the administrator will assist in adjusting the user's idle computing power resources, thereby realizing dynamic resource adjustment during operation.
[0027] By using the preset effective utilization threshold and the calculated effective utilization rate, it can be determined whether the current user's use of the allocated computing power resources meets the automatic or semi-automatic recovery conditions. If it meets the automatic recovery conditions, the part of the user's computing power resources with a utilization rate of 0 will be directly recovered and released; if it meets the semi-automatic recovery conditions, the user will be first asked whether the part of the computing power resources with a utilization rate of low will be recovered and released. If so, it will be released automatically. Otherwise, the administrator will be asked to access and assist in adjustments, thereby achieving effective utilization of computing power resources and avoiding resource waste.
[0028] Preferably, in step S1, the storage cluster uses distributed storage, and allocates corresponding data storage space on the distributed storage according to the name of each user; and using multiple backup storage, each user's data can automatically save multiple copies to prevent loss.
[0029] By adopting a distributed approach to data storage, corresponding storage space is allocated to each user in the distributed storage with the user's name. This allows each user to use the data continuously, as if it were stored on their own hard drive. This ensures that the data will not be released after the requested computing resources expire, and the next time you apply for computing resources again, you can continue to use the previous data directly by name. This way of storing computing resources and data separately effectively improves the user experience.
[0030] Preferably, the method also includes time-sharing management of computing resources. When the computing resources are used in multiple time periods, and the user only uses a certain time period in a day, the computing resources will be recycled and released and allocated to other users. The data in the computing resources will be stored in the data storage space of the storage cluster corresponding to the user's name. When the user is allocated computing resources in the next time period, the data stored in the previous time period will be automatically mounted to the newly allocated computing resources for the user to use again.
[0031] In actual use, the computing resources allocated to users are not necessarily used around the clock. Therefore, in order to improve the effective utilization of resources, computing resources are managed through time-sharing control, which can achieve cross-use of computing resources. In addition, with the help of user data stored in the storage cluster, it can also ensure that users can re-mount the previously used data when computing resources are allocated in the next time period, thereby achieving effective utilization of resources while ensuring the user experience.
[0032] Preferably, in S2, the configuration resources allocated by the container image and virtual machine resource library are automatically run only within the validity period of the computing power resource allocation, and are closed in time outside the validity period; and during the user's subsequent use, the required image resources can be uploaded and used according to actual needs.
[0033] Controlling the opening and closing of container images and virtual machines according to their validity periods can effectively avoid resource waste. If there are no suitable image resources in the resource library, users can also upload images that meet their needs for use, thereby further improving the flexibility of computing resource use.
[0034] Preferably, the method also includes setting a timed task for the user's resource request information obtained from the user resource application form through a dedicated thread pool, and executing the opening and closing tasks according to the time nodes of the set computing power resource validity period.
[0035] By setting up a dedicated thread pool to set scheduled tasks, it is possible to effectively achieve automated, accurate and efficient management of user computing resource requests. Without the need for human intervention, resources can be automatically turned on and off according to user needs, optimizing resource scheduling, reducing resource waste, and improving system stability and performance.
[0036] On the other hand, the present application also provides a computing power sharing device based on time-sharing control, the device comprising:
[0037] A resource storage module is used to separate user data from computing resources. Two different clusters are divided in the resource storage module for management, including a computing power cluster that combines all computing resources and a storage cluster that combines all hard disk resources.
[0038] The container image and virtual machine resource library module is used to store the configuration resources required for computing resource usage, including at least container images and virtual machine resources;
[0039] The resource allocation and recycling rule configuration module is used to receive user resource application forms and obtain user resource request information from them. It then parses the user's resource request information according to the resource allocation and recycling rules, calls the computing power cluster to allocate computing power resources based on the current resource situation, and then uses the computing power card virtualization module to virtualize the computing power resources and obtain the corresponding configuration data from the container image and virtual machine resource library to allocate to the user.
[0040] The computing power usage monitoring module is used to continuously monitor the computing power resources allocated to users to achieve more efficient sharing and utilization of resources;
[0041] The redundant resource notification module is used to send the monitoring results of the computing power usage monitoring module to the user or administrator, and to process redundant computing resources in a timely manner.
[0042] In this device, computing resources and user data are managed by dividing different clusters in the resource storage module, so that user data can be continuously saved, ensuring the continuity of user data when users use computing resources, and effectively avoiding the loss or deletion of user data after each reallocation of computing resources. In addition, both the computing cluster and the storage cluster are directly built using existing computer equipment resources, without the need to add additional hardware, which is economical and practical. At the same time, the computing resources are virtualized and provided to users in the form of containers or virtual machines, so that the resource environment is isolated, and the scientific research environment of each user is independent and does not interfere with each other. It can also make the user's computing power operation process transparent, which helps to monitor the use of computing power in real time and make real-time intelligent allocation adjustments, improve the effective utilization of resources, and avoid the situation where the computing power resources applied for by users are not used or are not fully used. In response to these situations, with the help of the redundant resource notification module, users and administrators can make corresponding adjustments in a timely manner to achieve more effective sharing and use of computing resources.
[0043] Preferably, the computing power usage monitoring module mainly includes:
[0044] Utilization calculation component: used to calculate the allocated computing resources and obtain the effective utilization rate of the computing resources requested by the user;
[0045] Resource recovery judgment component: used to compare the obtained effective utilization value with the preset threshold, and judge whether the user's computing power resource usage meets the automatic recovery conditions based on the comparison result. If it meets the conditions, the computing power resource recovery action is directly triggered to automatically recycle the resources; if it does not meet the conditions, the situation is sent to the user or administrator through the redundant resource notification module for further processing.
[0046] In the computing power usage monitoring module, by setting relevant components, the effective utilization rate of the allocated computing power resources can be directly calculated, so that the usage of the resources allocated to the user can be intuitively judged, thereby avoiding resource waste.
[0047] Preferably, in the redundant resource notification module, if the resource usage status that does not meet the automatic recovery conditions is received from the resource recovery judgment component, the status is sent to the administrator and the user. If the user confirms that the computing power resources can be released, the computing power resources of the user are automatically adjusted to release the idle part. If the user does not provide feedback, the administrator will assist in adjusting the idle computing power resources of the user, thereby realizing dynamic adjustment of resources during the operation process.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] 1. Improved resource utilization: The time-sharing allocation of computing resources improves the utilization efficiency of computing equipment and avoids idle equipment.
[0050] 2. Continuous preservation of user data to ensure the continuity of user business data: Based on the mechanism of separating computing power clusters and storage clusters, user usage process data is stored in distributed storage, thereby ensuring the continuity of user business data during the dynamic adjustment and allocation of computing resources, and avoiding the loss or accidental deletion of user data after each reallocation.
[0051] 3. Transparent usage of computing power cards and intelligent dynamic adjustment: The main feature of the traditional allocation method is the static allocation method. During the use process after allocation, the usage of computing power cards is unclear and non-transparent, which may lead to some user research teams applying for computing power resources but not actually using them or not reusing them, resulting in redundancy. Therefore, the present invention monitors the effective utilization rate of computing power cards in real time during use, can promptly detect unused or underused situations, and through automated or semi-automated adjustments, realize more efficient sharing and use of computing power resources.
[0052] 4. Resource and environment isolation: The scientific research environments of each user team are independent of each other and will not interfere with each other, ensuring the stability and security of research work. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is a flow chart of the method provided in this embodiment.
[0054] Figure 2 This is a schematic diagram of the device structure provided in this embodiment. DETAILED DESCRIPTION
[0055] The accompanying drawings are for illustrative purposes only and are not to be construed as limiting the present invention. To better illustrate the following embodiments, some components in the accompanying drawings may be omitted, enlarged, or reduced in size, and do not represent actual product dimensions. Those skilled in the art will appreciate that some well-known structures and their descriptions may be omitted from the accompanying drawings.
[0056] Example 1
[0057] like Figure 1 As shown, this embodiment provides a computing power sharing method based on time-sharing control, the method comprising:
[0058] Step S1: User data and computing resources are separated and divided into two different clusters for management, including a computing power cluster that combines all computing resources and a storage cluster that combines all hard disk resources. For the computing power cluster, computing power virtualization technology is used to virtualize the computing power resources; the computing resources can be CPU, computing power card, memory resources, etc.
[0059] Preferably, in step S1, the storage cluster uses distributed storage, and allocates corresponding data storage space on the distributed storage according to the name of each user; and using multiple backup storage, each user's data can automatically save multiple copies to prevent loss.
[0060] By adopting a distributed approach to data storage, corresponding storage space is allocated to each user in the distributed storage with the user's name. This allows each user to use the data continuously, as if it were stored on their own hard drive. This ensures that the data will not be released after the requested computing resources expire, and the next time you apply for computing resources again, you can continue to use the previous data directly by name. This way of storing computing resources and data separately effectively improves the user experience.
[0061] Step S2: Build a container image and virtual machine resource library; specifically, container or virtual machine images that support various machine learning environments such as Python, PyTorch, Jupyter Notebook, MATLAB, etc. can be built through container image and virtual machine resource management and stored in the container image and virtual machine resource library.
[0062] Preferably, in step S2, the configuration resources allocated by the container image and virtual machine resource library are automatically run only within the validity period of the computing power resource allocation, and are closed in time outside the validity period; and during the user's subsequent use, the required image resources can be uploaded for use according to actual needs.
[0063] Controlling the opening and closing of container images and virtual machines according to their validity periods can effectively avoid resource waste. If there are no suitable image resources in the resource library, users can also upload images that meet their needs for use, thereby further improving the flexibility of computing resource use.
[0064] Step S3: Obtain the user's resource request information from the user resource application form, then parse the user's resource request information according to the resource allocation and recycling rules, call the computing power cluster to allocate virtualized computing power resources based on the current resource situation, and obtain the corresponding configuration data from the container image and virtual machine resource library to allocate to the user;
[0065] In this embodiment, when computing power virtualization technology is used to virtualize computing resources, the memory partitioning tool provided by the computing power card manufacturer is used to achieve fine-grained segmentation of the high-performance computing power card's memory. For example, a computing power card equipped with 48GB of memory is evenly divided into six independent 8GB memory units, each allocated to different virtual machines or containers. This fine-grained resource segmentation allows a single physical computing power card to simultaneously support the parallel computing needs of multiple virtual machines or containers.
[0066] Therefore, in this embodiment, by storing user data and computing resources separately, user data can be continuously preserved, ensuring the continuity of user data when users use computing resources, and effectively avoiding the loss or deletion of user data after each reallocation of computing resources; and both the computing power cluster and the storage cluster are directly built using existing computer equipment resources, without the need to add additional hardware, which is economical and practical; at the same time, the computing power resources are virtualized and provided to users in the form of containers or virtual machines, so that the resource environment is isolated, and the scientific research environment of each user is independent of each other and does not interfere with each other, and the user's computing power operation process can be made transparent, which helps to monitor the usage of computing power in real time and make real-time intelligent allocation adjustments, thereby improving the effective utilization of resources.
[0067] Preferably, in this embodiment, a special thread pool is also set up to set timed tasks for the user's resource request information obtained from the user resource application form, and to execute the opening and closing tasks according to the time nodes of the set computing power resource validity period.
[0068] Specifically, when a research team requests resources, administrators can configure resource allocation and recycling rules to tailor the computing resources attached to containers / virtual machines and set expiration dates based on the team's specific needs. These resources primarily include the number of CPU cores, memory size, disk size, and the amount of graphics memory on the computing card. When allocating computing resources, administrators capture the current device's real-time hardware configuration data, effectively preventing hardware over-allocation from causing device crashes. Furthermore, resource allocation allows for the allocation of computing resources to a specific time period. For example, a virtual machine or container with 24GB of graphics memory could be allocated from 8:00 AM to 12:00 PM daily from the 1st to the 5th of the following month. The backend then uses scheduled tasks in the thread pool to start and shut down containers or virtual machines at the specified time points (the start and end times of the computing resource expiration date). Furthermore, if some containers or virtual machines fail to shut down on time, the next batch of containers / virtual machines cannot be started, effectively preventing computing devices from crashing due to excessive resource usage.
[0069] Therefore, in this embodiment, by setting up a dedicated thread pool to set scheduled tasks, it is possible to effectively achieve automated, accurate and efficient management of user computing resource requests. Without the need for human intervention, resources can be automatically turned on and off according to user needs, thereby optimizing resource scheduling, reducing resource waste, and improving system stability and performance.
[0070] Preferably, in this embodiment, the method further includes real-time monitoring of the usage of the allocated computing resources when the user logs in to use the computing resources, including:
[0071] Step S41: collecting usage information of allocated computing resources at fixed time intervals according to actual needs;
[0072] Step S42: Calculate the effective utilization rate of the allocated computing resources using a relevant algorithm based on the obtained usage information of the allocated computing resources;
[0073] Further preferably, in step S42, the algorithm includes the following steps. In this embodiment, the fixed time intervals are set to 1 minute and 5 minutes, specifically:
[0074] Step S421: For all the computing power card resources requested by a user in an application form, select the data with the highest utilization rate every 1 minute to represent the utilization rate of that minute, and select the data with the highest utilization rate every 5 minutes to represent the utilization rate of the computing power card within 5 minutes;
[0075] Step S422: For all utilization rates of all hashing card resources requested in a user's application form, if the utilization rate of a hashing card is greater than 0, it is recorded as 1. The final number of hashing cards with utilization rates greater than 0 is recorded as u, and the total number of hashing cards requested in the application form is recorded as a. Then, the effective utilization rate η of the hashing cards requested in a user's application form within 5 minutes is calculated, η = u / a*100%;
[0076] Step S423: Collect statistics on all effective utilization rates of the hashing power cards in each of the time periods allocated to the user's application in one day, and take the maximum effective utilization rate in each time period as the effective utilization rate of the hashing power cards for the application in that time period;
[0077] Step S424: Collect statistics on all effective utilization rates calculated for all time periods allocated to an application form of a user within one day, and take the maximum effective utilization rate among all time periods as the effective utilization rate of all computing power cards applied for by the user for the application form on that day.
[0078] Therefore, by dividing the user's computing power resource usage into several different time nodes to calculate its effective utilization rate, and selecting the highest calculated effective utilization rate at each different time node as the current effective utilization rate, the most accurate effective utilization rate of the current user's computing power resource usage can be obtained. Through the obtained effective utilization rate, the user's usage of the allocated computing power resources can be intuitively observed, so that the allocated resources can be dynamically adjusted in time, effectively avoiding the waste of computing power resources.
[0079] Preferably, step S43: judge the effective utilization rate obtained, and decide whether the allocated computing resources need to be recovered based on the judgment result. This can effectively prevent some scientific research teams from occupying the resources for a long time without using them after obtaining them, and an automatic recovery mechanism will be set up. For example, if the resources applied for by a scientific research team are not used for 24 consecutive hours, the system will automatically perform a recovery operation, thereby avoiding the situation where the resources are idle and occupied by a team for a long time.
[0080] Specifically, in step S43, a threshold of effective utilization is first set, and then the obtained effective utilization is compared with the set threshold. If the computing power is not fully utilized, the effective utilization can be adjusted accordingly.
[0081] When the final effective utilization rate η is 0, it means that the user has not used any of the computing power card resources requested in the application form on that day. The computing power card recycling action can be directly triggered according to the preset rules, and the resources can be automatically recycled.
[0082] When the final effective utilization rate η is greater than 0 but less than the set threshold, it indicates that the user has only used part of the computing power card resources for the application on that day, and some computing power card resources can be recycled. In this case, the situation will be sent to the administrator and the user. If the user confirms that the computing power resources can be released, the user's computing power resources will be automatically adjusted to release the idle part. If the user does not provide feedback, the administrator will assist in adjusting the user's idle computing power resources, thereby realizing dynamic resource adjustment during operation.
[0083] Among them, for the case of insufficient computing power utilization, as shown in Table 1, corresponding adjustments can be made.
[0084]
[0085]
[0086] Table 1
[0087] Therefore, based on the preset effective utilization threshold and the calculated effective utilization rate, it can be determined whether the current user's use of the allocated computing power resources meets the automatic or semi-automatic recovery conditions. If it meets the automatic recovery conditions, the part of the user's computing power resources whose utilization rate has always been 0 will be directly recovered and released; if it meets the semi-automatic recovery conditions, the user will be first asked whether the part of the computing power resources whose utilization rate has always been low can be recovered and released. If so, it will be automatically released. Otherwise, the administrator will access and assist in adjustments, thereby achieving effective utilization of computing power resources and avoiding resource waste.
[0088] Preferably, the method described in this embodiment also includes time-sharing management of computing resources. When the computing resources are used in multiple time periods, and the user only uses a certain time period a day, the computing resources will be recycled and released and allocated to other users. The data in the computing resources will be stored in the data storage space of the storage cluster corresponding to the user's name. When the user is allocated computing resources in the next time period, the data stored in the previous time period will be automatically mounted to the newly allocated computing resources for the user to use again.
[0089] In actual use, when the user's scientific research team completes scientific research tasks, the computing power equipment will not be fully loaded at all times. Therefore, in order to improve the effective utilization of resources, computing power resources are managed through time-sharing control. For example, when Team A uses it in time period T1, it uses the computing resources on server S1. When using it in time period T2, if it is dynamically allocated to the computing resources of server S2, it can use the same data, which does not affect Team A's use and experience at all.
[0090] This enables cross-use of computing resources, and with the help of user data stored in the storage cluster, it can also ensure that users can re-mount previously used data when computing resources are allocated in the next time period, achieving effective resource utilization while ensuring users have a good user experience.
[0091] Example 2
[0092] like Figure 2 As shown, this embodiment provides a computing power sharing device based on time-sharing control, the device at least comprising:
[0093] The container image and virtual machine resource management module is connected to the container image and virtual machine resource library and is used to manage the container image and virtual machine resource library;
[0094] The container image and virtual machine resource library module is used to store the configuration resources required for computing resource usage, including at least container images and virtual machine resources;
[0095] The resource storage module is used to separate user data and computing resources. Two different clusters are divided in the resource storage module for management, including a computing power cluster that combines all computing resources and a storage cluster that combines all hard disk resources. The computing resources include CPU, computing power card, and memory, etc.
[0096] The resource allocation and recycling rule configuration module is used to receive user resource application forms and obtain user resource request information from them. It then parses the user's resource request information according to the resource allocation and recycling rules, calls the computing power cluster to allocate computing power resources based on the current resource situation, and then uses the computing power card virtualization module to virtualize the computing power resources and obtain the corresponding configuration data from the container image and virtual machine resource library to allocate to the user.
[0097] The computing power usage monitoring module is used to continuously monitor the computing power resources allocated to users to achieve more efficient sharing and use of resources. The computing power usage monitoring module also includes:
[0098] Utilization calculation component: used to calculate the allocated computing resources and obtain the effective utilization rate of the computing resources requested by the user;
[0099] Resource recovery judgment component: used to compare the obtained effective utilization value with the preset threshold, and judge whether the user's computing power resource usage meets the automatic recovery conditions based on the comparison result. If it meets the conditions, the computing power resource recovery action is directly triggered to automatically recycle the resources; if it does not meet the conditions, the situation is sent to the user or administrator through the redundant resource notification module for further processing.
[0100] In the computing power usage monitoring module, by setting relevant components, the effective utilization rate of the allocated computing power resources can be directly calculated, so that the usage of the resources allocated to the user can be intuitively judged, thereby avoiding resource waste.
[0101] The redundant resource notification module is used to send the monitoring results of the computing power usage monitoring module to the user or administrator and to handle redundant computing resources in a timely manner.
[0102] Specifically, in the redundant resource notification module, if the resource usage status that does not meet the automatic recovery conditions is received from the resource recovery judgment component, the status will be sent to the administrator and the user. If the user confirms that the computing power resources can be released, the computing power resources of the user will be automatically adjusted to release the idle part. If the user does not provide feedback, the administrator will assist in adjusting the idle computing power resources of the user, thereby realizing dynamic adjustment of resources during the operation process.
[0103] Among them, when allocating resources, the computing power card virtualization module is first used to virtualize the computing power resources stored in the resource storage module using computing power virtualization technology. Then, the resource allocation and recycling rule configuration module parses the user application form. According to the application form information obtained from the analysis, the resource allocation information is transmitted to the resource allocation component for allocation processing. At the same time, the container image and virtual machine information resource library are called to hang in the corresponding configuration environment. After allocation, the user logs in through the resource login management module. Then, the resource allocation component allocates resources to the user according to the user login and opens the storage space of the storage cluster corresponding to the user name to store their data.
[0104] In addition, during the user's use process, it also includes the use of the computing power usage monitoring module to continuously monitor the computing power resources allocated to the user, and calculate the effective utilization rate of the computing power resources applied for by the user through the utilization calculation component, including: first, collecting the usage information of the allocated computing power resources at fixed time intervals according to actual needs, and then using the relevant algorithm to calculate its effective utilization rate based on the obtained usage information of the allocated computing power resources, and finally using the resource recovery judgment component to judge the obtained effective utilization rate, and decide whether the allocated computing power resources need to be recovered based on the judgment result.
[0105] Specifically:
[0106] For all hashrate resources requested by a user in an application form, the highest utilization data point is selected every minute to represent the utilization rate for that minute, and the highest utilization point is selected every 5 minutes to represent the utilization rate for the hashrate within 5 minutes.
[0107] For all the utilization rates of all the hashing cards applied for in one application form by one user, if the utilization rate of a hashing card is greater than 0, it is recorded as 1. Then the final number of hashing cards with utilization rates greater than 0 is recorded as u. The total number of hashing cards applied for in the application form is recorded as a. Then, the effective utilization rate η of the hashing cards applied for in one application form by one user within 5 minutes is calculated as η = u / a*100%;
[0108] Collect statistics on all effective utilization rates of the hashing cards in each time period allocated to the user's application in one day, and take the maximum effective utilization rate in each time period as the effective utilization rate of the hashing cards for the application in that time period;
[0109] Collect statistics on all effective utilization rates calculated for all time periods allocated to a user's application within a day, and take the maximum effective utilization rate among all time periods as the effective utilization rate of all computing power cards applied for by the user for this application on that day.
[0110] Therefore, by dividing the user's computing power resource usage into several different time nodes to calculate its effective utilization rate, and selecting the highest calculated effective utilization rate at each different time node as the current effective utilization rate, the most accurate effective utilization rate of the current user's computing power resource usage can be obtained. Through the obtained effective utilization rate, the user's usage of the allocated computing power resources can be intuitively observed, so that the allocated resources can be dynamically adjusted in time, effectively avoiding the waste of computing power resources.
[0111] The resource recovery judgment component determines whether the user's computing power resource usage meets the automatic recovery conditions based on resource allocation and recovery rules, and sends the insufficient computing power usage to the user and administrator through the redundant resource notification module. The resource release adjustment component also makes timely adjustments to the insufficient computing power usage. The insufficient computing power usage mainly includes the following two situations:
[0112] ① If the effective utilization rate η of some hash cards is always 0, it means that the user has not used any hash card resources requested in the application form on that day. The hash card recycling action can be directly triggered according to the preset rules to automatically release the resources with an effective utilization rate η of 0.
[0113] ② There are situations where the utilization rate of multiple computing power cards is continuously low. For example, if the final effective utilization rate η is greater than 0 but less than the set threshold, it means that the user has only used part of the computing power card resources for the application on that day. Some computing power card resources can be recycled. In this case, the situation will be sent to the administrator and the user. If the user confirms that the computing power resources can be released, the computing power resources of the user will be automatically adjusted to release the idle part. If the user does not provide feedback, the administrator will assist in adjusting the idle computing power resources of the user. Tasks used on multiple cards can be merged into the same card to release the excess computing power card resources, thereby realizing dynamic resource adjustment during operation.
[0114] Therefore, in this device, different clusters are divided in the resource storage module to manage computing resources and user data, so that user data can be continuously saved, ensuring the continuity of user data when users use computing resources, and effectively avoiding the loss or deletion of user data after each reallocation of computing resources. In addition, both the computing power cluster and the storage cluster are directly built using existing computer equipment resources, without the need to add additional hardware, which is economical and practical. At the same time, the computing power resources are virtualized and provided to users in the form of containers or virtual machines, so that the resource environment is isolated, and the scientific research environment of each user is independent and does not interfere with each other. It can also make the user's computing power operation process transparent, which helps to monitor the use of computing power in real time and make real-time intelligent allocation adjustments, improve the effective utilization of resources, and avoid the situation where the computing power resources applied for by users are not used or are not fully used. In response to these situations, with the help of the redundant resource notification module, users and administrators can make corresponding adjustments in a timely manner to achieve more effective sharing and use of computing power resources.
[0115] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A method for sharing computing power in the field of scientific research based on time-sharing control, the method comprising: S1: User data and computing resources are separated and divided into two different clusters for management: a computing cluster that combines all computing resources and a storage cluster that combines all hard disk resources. For the computing cluster, computing power virtualization technology is used to virtualize computing resources. S2: Build container images and virtual machine resource libraries; S3: Obtain the user's resource request information from the user's resource application form, then parse the user's resource request information according to the resource allocation and recycling rules, call the computing power cluster to allocate computing power resources based on the current resource situation, and obtain the corresponding configuration data from the container image and virtual machine resource library to allocate to the user; The method further includes real-time monitoring of the usage of the allocated computing resources, including: S41: Collect usage information of allocated computing resources at fixed time intervals according to actual needs; S42: Calculate the effective utilization rate of the allocated computing resources using a relevant algorithm based on the obtained usage information of the allocated computing resources; S43: Determine the obtained effective utilization rate and decide whether to reclaim the allocated computing resources based on the determination result; In step S42, the algorithm includes: S421: For all computing power card resources requested by a user in an application form, select the data with the highest utilization rate every n minutes to represent the utilization rate for those n minutes; S422: For all utilization rates of all computing power card resources applied for by a user in an application form, when the utilization rate of a computing power card is greater than 0, it is recorded as 1, and then the final calculated number of computing power cards with utilization rates greater than 0 is recorded as u, and the total number of computing power cards applied for in the application form is recorded as a. Then calculate the effective utilization rate of the computing power cards applied for by a user in an application form within n minutes. , ; S423: Collect statistics on all effective utilization rates of the hashing cards in each of all time periods allocated to the user's application in one day, and take the maximum effective utilization rate in each time period as the effective utilization rate of the hashing cards for the application in that time period; S424: Calculate the effective utilization rates calculated for all time periods allocated to an application form of a user within a day, and take the maximum effective utilization rate among all time periods as the effective utilization rate of all computing power cards applied for by the user for the application form on that day; The step S43 also includes setting a threshold value of effective utilization rate. When the effective utilization rate is finally obtained When it is 0, it means that the user has not used any of the computing power card resources applied for in the application form on that day. The computing power card recycling action can be directly triggered according to the preset rules, and the resources can be automatically recycled. When the effective utilization rate is finally obtained When the value is greater than 0 but less than the set threshold, it indicates that the user has only used part of the computing power card resources for the application on that day. Some computing power card resources can be recycled. In this case, the situation will be sent to the administrator and the user. If the user confirms that the computing power resources can be released, the user's computing power resources will be automatically adjusted to release the idle part. If the user does not provide feedback, the administrator will assist in adjusting the user's idle computing power resources, thereby realizing dynamic resource adjustment during operation.
2. A computing power sharing method in the field of scientific research based on time-sharing control according to claim 1, characterized in that: In step S1, the storage cluster uses distributed storage, and allocates corresponding data storage space on the distributed storage based on the name of each user; and uses multi-backup storage, so that each user's data can be automatically saved in multiple copies to prevent loss.
3. A computing power sharing method in the field of scientific research based on time-sharing control according to claim 2, characterized in that: The method also includes time-sharing management and control of computing resources. When the computing resources are used in multiple time periods, if a user only uses them in a certain time period in a day, the computing resources will be recycled and released and allocated to other users. The data in the computing resources will be stored in the data storage space of the storage cluster corresponding to the user's name. When the user is allocated computing resources in the next time period, the data stored in the previous time period will be automatically mounted to the newly allocated computing resources for the user to use again.
4. A computing power sharing method in the field of scientific research based on time-sharing control according to claim 3, characterized in that: In S2, the configuration resources allocated by the container image and virtual machine resource library will only run automatically within the validity period of the computing power resource allocation and will be closed in time outside the validity period; and during the user's subsequent use, the required image resources can be uploaded and used according to actual needs.
5. A computing power sharing method in the field of scientific research based on time-sharing control according to any one of claims 1 to 4, characterized in that: The method also includes setting a timed task for the user's resource request information obtained from the user resource application form through a dedicated thread pool, and executing the opening and closing tasks according to the time node of the set computing power resource validity period.
6. A device for sharing computing power in the scientific research field based on time-sharing control according to claim 1, characterized in that: The device comprises: A resource storage module is used to separate user data from computing resources. Two different clusters are divided in the resource storage module for management, including a computing power cluster that combines all computing resources and a storage cluster that combines all hard disk resources. The container image and virtual machine resource library module is used to store the configuration resources required for computing resource usage, including at least container images and virtual machine resources; The resource allocation and recycling rule configuration module is used to receive user resource application forms and obtain user resource request information from them. It then parses the user's resource request information according to the resource allocation and recycling rules, calls the computing cluster to allocate computing resources based on the current resource situation, and obtains the corresponding configuration data from the container image and virtual machine resource library based on the allocated computing resources and allocates them to the user. The computing power usage monitoring module is used to continuously monitor the computing power resources allocated to users to achieve more efficient sharing and utilization of resources; The redundant resource notification module is used to send the monitoring results of the computing power usage monitoring module to the user or administrator, and to process redundant computing resources in a timely manner.
7. The device for a computing power sharing method in the field of scientific research based on time-sharing control according to claim 6 is characterized in that: The computing power usage monitoring module mainly includes: Utilization calculation component: used to calculate the allocated computing resources and obtain the effective utilization rate of the computing resources requested by the user; Resource recovery judgment component: used to compare the obtained effective utilization value with the preset threshold, and judge whether the user's computing power resource usage meets the automatic recovery conditions based on the comparison result. If it meets the conditions, the computing power resource recovery action is directly triggered to automatically recycle the resources; if it does not meet the conditions, the situation is sent to the user or administrator through the redundant resource notification module for further processing.
8. The device for a computing power sharing method in the field of scientific research based on time-sharing control according to claim 7 is characterized in that: In the redundant resource notification module, if the resource usage status that does not meet the automatic recovery conditions is received from the resource recovery judgment component, the status will be sent to the administrator and the user. If the user confirms that the computing power resources can be released, the computing power resources of the user will be automatically adjusted to release the idle part. If the user does not provide feedback, the administrator will assist in adjusting the idle computing power resources of the user, thereby realizing dynamic adjustment of resources during the operation process.
Citation Information
Patent Citations
Load balancing system and method of cloud computing server cluster
CN106790636A
Application method of GPU card and related equipment
CN110796591A
Virtual GPU (Graphics Processing Unit) allocation method and system under container cloud environment based on API (Application Program Interface) interception and forwarding
CN116991553A