Method, system and medium for calculating server resource inventory for computing power scheduling

Through the computing method of server resource inventory calculation for computing power scheduling, the joint dimension splitting sub-order and transaction rollback mechanism is used to solve the problem of slow resource occupation query and inventory query speed in the existing technology, and achieve fast and effective server resources manage.

CN118820022BActive Publication Date: 2024-12-06YIFANG JIANSHU (BEIJING) INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411306024.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-06
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

In the prior art, the query response based on the machine dimension resource occupation situation is slow, and the batch query response speed based on the SKU inventory dimension is too slow, making it difficult to effectively manage and optimize server resource inventory.

Method used

Using the server resource inventory calculation method for computing power scheduling, the sub-orders are split by obtaining order data and storing and updating based on the preset data structure, using the joint dimension (server-order-time interval) to split the sub-orders, combined with the transaction rollback mechanism, Backoff algorithm and timing compensation tasks ensure data consistency, and label database query based on query frequency to improve query efficiency.

Benefits of technology

It realizes rapid calculation of inventory, improves the response speed of resource usage and inventory query efficiency, helps users optimize server resource management, and is suitable for scheduling and management systems in enterprises and cloud computing centers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820022B_ABST
    Figure CN118820022B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system and medium for calculating server resource inventory for computing power scheduling, wherein the method includes: obtaining order data, and storing the order data in the inventory based on a set data structure; updating data based on the order data, including updating the inventory based on order changes and updating the inventory based on machine changes; when querying data, querying the data in the inventory based on a preset query mechanism, and the query mechanism includes performing sub-library queries based on preset tags. The present invention can quickly calculate inventory status, can be applied to the enterprise's intelligent computing center scheduling and management system, as well as cloud computing center scheduling and management, to help users optimize the management of server resource inventory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more specifically, to a method, system and medium for calculating server resource inventory for computing power scheduling. Background Art

[0002] With the continuous development of big models and AI, these technologies are profoundly changing the way we live, work, and operate our society. However, obtaining this "machine intelligence" requires a large amount of computing resources, mainly GPU resources. In order to avoid wasting server resources, it is particularly important to maximize the use of server computing resources.

[0003] Usually, a task only occupies part of the computing power resources of a single server, so containers are used to execute tasks to ensure that different tasks can run on the same server at the same time and are isolated from each other, so as to fully utilize server resources. Therefore, for a computing power scheduling system, it is very important to keep abreast of the usage and inventory of resources in the system.

[0004] In the prior art, real-time resource occupancy and stock keeping unit (SKU) inventory query have the following defects:

[0005] The query response of machine-based resource usage is slow;

[0006] The response speed of batch query based on SKU inventory dimension is too slow Summary of the invention

[0007] The purpose of the present invention is to provide a method, system and medium for calculating server resource inventory for computing power scheduling, which can quickly calculate inventory status and can be applied to the enterprise's intelligent computing center scheduling and management system, as well as cloud computing center scheduling and management, to help users optimize the management of server resource inventory.

[0008] A first aspect of the present invention provides a method for calculating server resource inventory for computing power scheduling, comprising the following steps:

[0009] Obtaining order data, and storing the order data in inventory based on a set data structure;

[0010] Performing data updates based on the order data, including updating inventory based on order changes and updating inventory based on machine changes;

[0011] When performing data query, the data in the inventory is queried based on a preset query mechanism, and the query mechanism includes performing sub-database query based on preset tags.

[0012] In this solution, the data structure is set, specifically including:

[0013] The order data is flattened according to a preset joint dimension to record resource usage, wherein the joint dimension specifically includes a joint dimension of server-order-time interval;

[0014] Based on the start time and end time in the order data, overlap identification is performed to split out sub-orders, and the order data is segmented and stored according to the sub-orders.

[0015] In this solution, the data update based on the order data specifically includes:

[0016] Update inventory based on the order changes, wherein inventory statistics are collected based on preset business scenarios, wherein the business scenarios include creating a ticket, renewing a ticket, changing a ticket end time, canceling a ticket, creating a maintenance order, changing a maintenance order end time, and canceling a maintenance order, wherein Ticket is an identifier corresponding to the order data;

[0017] updating inventory based on the machine changes, wherein the machine changes include machine downtime and machine recycling;

[0018] When updating data, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation tasks are used to ensure the eventual consistency of machine occupancy information.

[0019] In this solution, creating a ticket specifically includes:

[0020] Based on the order data, the start time, end time, bound machine ID, machine slot ID, number of occupied GPU cards, number of occupied CPU cores, and occupied memory size of the order are obtained;

[0021] When storing the order data, the order data is segmented based on the start time of the order, wherein the data is segmented based on the overlapping time periods of different orders.

[0022] In this solution, when renewing a ticket, the start time and end time of the renewal ticket are obtained, and the renewal ticket is divided and stored according to the logic of creating an order; when changing the end time of the ticket, the start time and new end time of the order are obtained, and all sub-orders of the old order need to be deleted, and then divided and stored according to the new start and end times; when canceling the ticket, all sub-orders in the corresponding order data are directly deleted.

[0023] In this solution, when querying inventory, inventory units are labeled according to the query time and query frequency, wherein inventory units that meet preset conditions are labeled, wherein the labeled inventory units are stored in the first database, and the unlabeled inventory units are stored in the second database, and the preset conditions include inventory units that have been queried within 3 days or inventory units that are queried more than 5 times a day.

[0024] A second aspect of the present invention further provides a computing system for server resource inventory for computing power scheduling, comprising a memory and a processor, wherein the memory comprises a computing method program for server resource inventory for computing power scheduling, and when the computing method program for server resource inventory for computing power scheduling is executed by the processor, the following steps are implemented:

[0025] Obtaining order data, and storing the order data in inventory based on a set data structure;

[0026] Performing data updates based on the order data, including updating inventory based on order changes and updating inventory based on machine changes;

[0027] When performing data query, the data in the inventory is queried based on a preset query mechanism, and the query mechanism includes performing sub-database query based on preset tags.

[0028] In this solution, the data structure is set, specifically including:

[0029] The order data is flattened according to a preset joint dimension to record resource usage, wherein the joint dimension specifically includes a joint dimension of server-order-time interval;

[0030] Based on the start time and end time in the order data, overlap identification is performed to split out sub-orders, and the order data is segmented and stored according to the sub-orders.

[0031] In this solution, the data update based on the order data specifically includes:

[0032] Update inventory based on the order changes, wherein inventory statistics are collected based on preset business scenarios, wherein the business scenarios include creating a ticket, renewing a ticket, changing a ticket end time, canceling a ticket, creating a maintenance order, changing a maintenance order end time, and canceling a maintenance order, wherein Ticket is an identifier corresponding to the order data;

[0033] updating inventory based on the machine changes, wherein the machine changes include machine downtime and machine recycling;

[0034] When updating data, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation tasks are used to ensure the eventual consistency of machine occupancy information.

[0035] In this solution, creating a ticket specifically includes:

[0036] Based on the order data, the start time, end time, bound machine ID, machine slot ID, number of occupied GPU cards, number of occupied CPU cores, and occupied memory size of the order are obtained;

[0037] When storing the order data, the order data is segmented based on the start time of the order, wherein the data is segmented based on the overlapping time periods of different orders.

[0038] In this solution, when renewing a ticket, the start time and end time of the renewal ticket are obtained, and the renewal ticket is divided and stored according to the logic of creating an order; when changing the end time of the ticket, the start time and new end time of the order are obtained, and all sub-orders of the old order need to be deleted, and then divided and stored according to the new start and end times; when canceling the ticket, all sub-orders in the corresponding order data are directly deleted.

[0039] In this solution, when querying inventory, inventory units are labeled according to the query time and query frequency, wherein inventory units that meet preset conditions are labeled, wherein the labeled inventory units are stored in the first database, and the unlabeled inventory units are stored in the second database, and the preset conditions include inventory units that have been queried within 3 days or inventory units that are queried more than 5 times a day.

[0040] A third aspect of the present invention provides a computer-readable storage medium, which includes a machine's method program for calculating a server resource inventory for computing power scheduling. When the method program for calculating a server resource inventory for computing power scheduling is executed by a processor, the steps of a method for calculating a server resource inventory for computing power scheduling as described in any one of the above items are implemented.

[0041] The present invention discloses a method, system and medium for calculating server resource inventory for computing power scheduling, which can quickly calculate inventory status and can be applied to the enterprise's intelligent computing center scheduling and management system, as well as cloud computing center scheduling and management, to help users optimize the management of server resource inventory. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A flow chart showing a method for calculating server resource inventory for computing power scheduling according to the present invention is shown;

[0043] Figure 2 A schematic diagram of machine scheduling management of a method for calculating server resource inventory for computing power scheduling according to the present invention is shown;

[0044] Figure 3 A machine management schematic diagram showing a method for calculating server resource inventory for computing power scheduling according to the present invention;

[0045] Figure 4 A schematic diagram of the data structure of a method for calculating server resource inventory for computing power scheduling according to the present invention is shown;

[0046] Figure 5 A partitioning and storage diagram of a method for calculating server resource inventory for computing power scheduling according to the present invention is shown;

[0047] Figure 6 A block diagram of a computing system for server resource inventory for computing power scheduling according to the present invention is shown. DETAILED DESCRIPTION

[0048] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0050] Figure 1 A flow chart of a method for calculating server resource inventory for computing power scheduling according to the present application is shown.

[0051] like Figure 1 As shown, the present application discloses a method for calculating server resource inventory for computing power scheduling, comprising the following steps:

[0052] S102, acquiring order data, and storing the order data in inventory based on a set data structure;

[0053] S104, updating data based on the order data, including updating inventory based on order changes and updating inventory based on machine changes;

[0054] S106, when performing data query, query the data in the inventory based on a preset query mechanism, the query mechanism including performing sub-database query based on preset tags.

[0055] It should be noted that in this embodiment, when calculating the server resource inventory, the acquired order data can be sliced ​​and stored using the set data structure. Since it is necessary to query the resource usage of the machine in batches and ensure a certain response speed, if the start time and end time of each order are simply stored in the database, it is difficult to find out the resource usage of the machine at one time when encountering orders with overlapping times on the same machine. Therefore, the orders will be sliced ​​and stored.

[0056] Furthermore, when updating data, the inventory can be updated based on order changes and machine changes. The updating of inventory based on order changes will be described in detail in the subsequent instructions. When updating inventory based on machine changes, the update is specifically based on machine downtime and machine recycling, etc., wherein, for example Figure 2 as well as Figure 3 shown, specifically, Figure 2 The display is a schematic diagram of the machine's scheduling management. Figure 3 It is shown as a machine management diagram, where Figure 2 , users can view the schedule of target type machines in a certain period of time, and visualize the order occupancy. When users click on a machine to query, they can obtain the details of the number of GPU cards used in the current time; Figure 3 , you can view the machine list, where the occupancy status indicates the usage of the machine GPU at the moment. The numerator is the number of GPU cards in use, and the denominator is the total number of GPU cards.

[0057] Furthermore, when querying data, the present invention designs a three-level data query scheme to query the data in the inventory based on a preset query mechanism, and the query mechanism includes sub-database query based on preset tags, including storing recently accessed SKU related inventory information in the cache, storing commonly used SKU related inventory information in the cache, and storing original machine resource occupancy information in medium and low-speed databases.

[0058] According to an embodiment of the present invention, setting the data structure specifically includes:

[0059] The order data is flattened according to a preset joint dimension to record resource usage, wherein the joint dimension specifically includes a joint dimension of server-order-time interval;

[0060] Based on the start time and end time in the order data, overlap identification is performed to split out sub-orders, and the order data is segmented and stored according to the sub-orders.

[0061] It should be noted that, in this embodiment, Figure 4As shown, it is displayed as a data structure diagram, in which the data is flattened according to the joint dimension of server-order-time interval to record the usage of resources. If the start time and end time of different orders on the same server do not completely overlap, they will be split into "independent" sub-orders in the time period to ensure that the sub-orders either do not overlap or completely overlap in time, and the orders are divided and stored according to the sub-orders, thereby avoiding multiple resource matches and time matches in the query to reduce the computational complexity.

[0062] According to an embodiment of the present invention, updating data based on the order data specifically includes:

[0063] Update inventory based on the order changes, wherein inventory statistics are collected based on preset business scenarios, wherein the business scenarios include creating a ticket, renewing a ticket, changing a ticket end time, canceling a ticket, creating a maintenance order, changing a maintenance order end time, and canceling a maintenance order, wherein Ticket is an identifier corresponding to the order data;

[0064] updating inventory based on the machine changes, wherein the machine changes include machine downtime and machine recycling;

[0065] When updating data, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation tasks are used to ensure the eventual consistency of machine occupancy information.

[0066] It should be noted that in this embodiment, when updating data, the inventory status is updated based on the changes in orders (creation, renewal, cancellation), and the inventory status is updated based on the changes in the machines (downtime, recycling, etc.). At the same time, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation task are used to ensure the final consistency of the machine occupancy information. Among them, in order to ensure the final consistency of the data, the present invention has two compensation mechanisms. The first is that if an error occurs when the data is entered into the warehouse and the rollback is carried out, the backoff algorithm is used to retry three times after 2 seconds, 4 seconds and 8 seconds respectively. If it still fails after three attempts, the context information will be saved to the database, and then the timed task will be re-executed. This is the second compensation mechanism.

[0067] According to an embodiment of the present invention, creating a Ticket specifically includes:

[0068] Based on the order data, the start time, end time, bound machine ID, machine slot ID, number of occupied GPU cards, number of occupied CPU cores, and occupied memory size of the order are obtained;

[0069] When storing the order data, the order data is segmented based on the start time of the order, wherein the data is segmented based on the overlapping time periods of different orders.

[0070] It should be noted that in this embodiment, when creating an order (Ticket), the start time, end time, bound machine ID, machine slot ID, number of GPU cards occupied, number of CPU cores occupied, and memory size of the order will be obtained. When inserting the order into the database, there will be an order splitting operation. For example, Figure 5 As shown, assume that for the same machine (8 cards, 16 cores, 16GB), there is already an order 1 (2 cards, 4 cores, 4GB). Its start time is t1 and its end time is t3. At this time, if order 2 (2 cards, 4 cores, 4GB) is created, its corresponding start time is t2 and end time is t4. Obviously, there is an overlap between the start and end times of these two orders. At this time, the two orders need to be split according to the overlapping time points. That is: Order 1 is split into t1-t2, t2-t3; Order 2 is split into t2-t3, t3-t4. The four split sub-orders are stored in the database.

[0071] According to an embodiment of the present invention, when renewing a ticket, the start time and end time of the renewal ticket are obtained, and the renewal ticket is divided and stored in the warehouse according to the logic of creating the order; when changing the end time of the ticket, the start time of the order and the new end time are obtained, and all sub-orders of the old order need to be deleted, and then they are divided and stored in the warehouse according to the new start and end times; when canceling the ticket, all sub-orders in the corresponding order data are directly deleted.

[0072] It should be noted that in this embodiment, for the renewal order (Ticket), the start time and end time of the renewal order will be obtained at this time. The start time of renewal here is actually equal to the end time of the order before renewal. The renewal order can be divided and stored according to the logic of creating the order; and when the end time of the order (Ticket) is changed, the start time and the new end time of the order will also be retrieved. At this time, all sub-orders of the old order need to be deleted, and then divided and stored according to the new start and end time; and when canceling the order (Ticket), all sub-orders of the order can be directly deleted.

[0073] According to an embodiment of the present invention, when querying inventory, inventory units are labeled according to the query time and query frequency, wherein inventory units that meet preset conditions are labeled, wherein the labeled inventory units are stored in a first database, and unlabeled inventory units are stored in a second database, wherein the preset conditions include inventory units that have been queried within 3 days or inventory units that have been queried more than 5 times a day.

[0074] It should be noted that in this embodiment, when querying the SKU, the SKU is tagged according to the query time and query frequency, and the SKU that meets certain conditions (for example, the SKU that has been queried within 3 days or the number of queries per day exceeds 5 times) is tagged. The inventory of the tagged SKU is cached in the high-speed database, so that when querying, it is first determined whether it exists in the cache library, and if it exists, the result is directly returned; otherwise, the query is made in the medium and low-speed database.

[0075] Figure 6 A block diagram of a computing system for server resource inventory for computing power scheduling according to the present invention is shown.

[0076] like Figure 6 As shown, the present invention discloses a computing system for server resource inventory for computing power scheduling, including a memory and a processor, wherein the memory includes a computing method program for server resource inventory for computing power scheduling, and when the computing method program for server resource inventory for computing power scheduling is executed by the processor, the following steps are implemented:

[0077] Obtaining order data, and storing the order data in inventory based on a set data structure;

[0078] Performing data updates based on the order data, including updating inventory based on order changes and updating inventory based on machine changes;

[0079] When performing data query, the data in the inventory is queried based on a preset query mechanism, and the query mechanism includes performing sub-database query based on preset tags.

[0080] It should be noted that in this embodiment, when calculating the server resource inventory, the acquired order data can be sliced ​​and stored using the set data structure. Since it is necessary to query the resource usage of the machine in batches and ensure a certain response speed, if the start time and end time of each order are simply stored in the database, it is difficult to find out the resource usage of the machine at one time when encountering orders with overlapping times on the same machine. Therefore, the orders will be sliced ​​and stored.

[0081] Furthermore, when updating data, the inventory can be updated based on order changes and machine changes. The updating of inventory based on order changes will be described in detail in the subsequent instructions. When updating inventory based on machine changes, the update is specifically based on machine downtime and machine recycling, etc., wherein, for example Figure 2 as well as Figure 3 shown, specifically, Figure 2 The display is a schematic diagram of the machine's scheduling management. Figure 3 It is shown as a machine management diagram, where Figure 2 , users can view the schedule of target type machines in a certain period of time, and visualize the order occupancy. When users click on a machine to query, they can obtain the details of the number of GPU cards used in the current time; Figure 3 , you can view the machine list, where the occupancy status indicates the usage of the machine GPU at the moment. The numerator is the number of GPU cards in use, and the denominator is the total number of GPU cards.

[0082] Furthermore, when querying data, the present invention designs a three-level data query scheme to query the data in the inventory based on a preset query mechanism, and the query mechanism includes sub-database query based on preset tags, including storing recently accessed SKU related inventory information in the cache, storing commonly used SKU related inventory information in the cache, and storing original machine resource occupancy information in medium and low-speed databases.

[0083] According to an embodiment of the present invention, setting the data structure specifically includes:

[0084] The order data is flattened according to a preset joint dimension to record resource usage, wherein the joint dimension specifically includes a joint dimension of server-order-time interval;

[0085] Based on the start time and end time in the order data, overlap identification is performed to split out sub-orders, and the order data is segmented and stored according to the sub-orders.

[0086] It should be noted that, in this embodiment, Figure 4 As shown, it is displayed as a data structure diagram, in which the data is flattened according to the joint dimension of server-order-time interval to record the usage of resources. If the start time and end time of different orders on the same server do not completely overlap, they will be split into "independent" sub-orders in the time period to ensure that the sub-orders either do not overlap or completely overlap in time, and the orders are divided and stored according to the sub-orders, thereby avoiding multiple resource matches and time matches in the query to reduce the computational complexity.

[0087] According to an embodiment of the present invention, updating data based on the order data specifically includes:

[0088] Update inventory based on the order changes, wherein inventory statistics are collected based on preset business scenarios, wherein the business scenarios include creating a ticket, renewing a ticket, changing a ticket end time, canceling a ticket, creating a maintenance order, changing a maintenance order end time, and canceling a maintenance order, wherein Ticket is an identifier corresponding to the order data;

[0089] updating inventory based on the machine changes, wherein the machine changes include machine downtime and machine recycling;

[0090] When updating data, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation tasks are used to ensure the eventual consistency of machine occupancy information.

[0091] It should be noted that in this embodiment, when updating data, the inventory status is updated based on the changes in orders (creation, renewal, cancellation), and the inventory status is updated based on the changes in the machines (downtime, recycling, etc.). At the same time, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation task are used to ensure the final consistency of the machine occupancy information. Among them, in order to ensure the final consistency of the data, the present invention has two compensation mechanisms. The first is that if an error occurs when the data is entered into the warehouse and the rollback is carried out, the backoff algorithm is used to retry three times after 2 seconds, 4 seconds and 8 seconds respectively. If it still fails after three attempts, the context information will be saved to the database, and then the timed task will be re-executed. This is the second compensation mechanism.

[0092] According to an embodiment of the present invention, creating a Ticket specifically includes:

[0093] Based on the order data, the start time, end time, bound machine ID, machine slot ID, number of occupied GPU cards, number of occupied CPU cores, and occupied memory size of the order are obtained;

[0094] When storing the order data, the order data is segmented based on the start time of the order, wherein the data is segmented based on the overlapping time periods of different orders.

[0095] It should be noted that in this embodiment, when creating an order (Ticket), the start time, end time, bound machine ID, machine slot ID, number of GPU cards occupied, number of CPU cores occupied, and memory size of the order will be obtained. When inserting the order into the database, there will be an order splitting operation. For example, Figure 5As shown, assume that for the same machine (8 cards, 16 cores, 16GB), there is already an order 1 (2 cards, 4 cores, 4GB). Its start time is t1 and its end time is t3. At this time, if order 2 (2 cards, 4 cores, 4GB) is created, its corresponding start time is t2 and end time is t4. Obviously, there is an overlap between the start and end times of these two orders. At this time, the two orders need to be split according to the overlapping time points. That is: Order 1 is split into t1-t2, t2-t3; Order 2 is split into t2-t3, t3-t4. The four split sub-orders are stored in the database.

[0096] According to an embodiment of the present invention, when renewing a ticket, the start time and end time of the renewal ticket are obtained, and the renewal ticket is divided and stored in the warehouse according to the logic of creating the order; when changing the end time of the ticket, the start time of the order and the new end time are obtained, and all sub-orders of the old order need to be deleted, and then they are divided and stored in the warehouse according to the new start and end times; when canceling the ticket, all sub-orders in the corresponding order data are directly deleted.

[0097] It should be noted that in this embodiment, for the renewal order (Ticket), the start time and end time of the renewal order will be obtained at this time. The start time of renewal here is actually equal to the end time of the order before renewal. The renewal order can be divided and stored according to the logic of creating the order; and when the end time of the order (Ticket) is changed, the start time and the new end time of the order will also be retrieved. At this time, all sub-orders of the old order need to be deleted, and then divided and stored according to the new start and end time; and when canceling the order (Ticket), all sub-orders of the order can be directly deleted.

[0098] According to an embodiment of the present invention, when querying inventory, inventory units are labeled according to the query time and query frequency, wherein inventory units that meet preset conditions are labeled, wherein the labeled inventory units are stored in a first database, and unlabeled inventory units are stored in a second database, wherein the preset conditions include inventory units that have been queried within 3 days or inventory units that have been queried more than 5 times a day.

[0099] It should be noted that in this embodiment, when querying the SKU, the SKU is tagged according to the query time and query frequency, and the SKU that meets certain conditions (for example, the SKU that has been queried within 3 days or the number of queries per day exceeds 5 times) is tagged. The inventory of the tagged SKU is cached in the high-speed database, so that when querying, it is first determined whether it exists in the cache library, and if it exists, the result is directly returned; otherwise, the query is made in the medium and low-speed database.

[0100] A third aspect of the present invention provides a computer-readable storage medium, which includes a method program for calculating a server resource inventory for computing power scheduling. When the method program for calculating a server resource inventory for computing power scheduling is executed by a processor, the steps of a method for calculating a server resource inventory for computing power scheduling as described in any one of the above items are implemented.

[0101] The present invention discloses a method, system and medium for calculating server resource inventory for computing power scheduling, which can quickly calculate inventory status and can be applied to the enterprise's intelligent computing center scheduling and management system, as well as cloud computing center scheduling and management, to help users optimize the management of server resource inventory.

[0102] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0103] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0104] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0105] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0106] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A method for calculating server resource inventory for computing power scheduling. It is characterized in that The following steps are involved: Obtaining order data, and storing the order data in inventory based on a set data structure; Performing data updates based on the order data, including updating inventory based on order changes and updating inventory based on machine changes; When performing data query, the data in the inventory is queried based on a preset query mechanism, and the query mechanism includes performing sub-database query based on preset tags; Setting the data structure specifically includes: The order data is flattened according to a preset joint dimension to record resource usage, wherein the joint dimension specifically includes a joint dimension of server-order-time interval; Based on the start time and end time in the order data, overlap identification is performed to split out sub-orders, and the order data is segmented and stored according to the sub-orders; The updating of data based on the order data specifically includes: Update inventory based on the order changes, wherein inventory statistics are collected based on preset business scenarios, wherein the business scenarios include creating a ticket, renewing a ticket, changing a ticket end time, canceling a ticket, creating a maintenance order, changing a maintenance order end time, and canceling a maintenance order, wherein Ticket is an identifier corresponding to the order data; updating inventory based on the machine changes, wherein the machine changes include machine downtime and machine recycling; When updating data, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation tasks are used to ensure the final consistency of machine occupancy information; The creation of a Ticket specifically includes: Based on the order data, the start time, end time, bound machine ID, machine slot ID, number of occupied GPU cards, number of occupied CPU cores, and occupied memory size of the order are obtained; When storing the order data, the order data is segmented based on the start time of the order, wherein the data is segmented based on the overlapping time periods of different orders.

2. A method for calculating server resource inventory for computing power scheduling according to claim 1, It is characterized in that When renewing a ticket, obtain the start and end time of the renewal ticket, and divide the renewal ticket into the warehouse according to the logic of creating the order; when changing the end time of the ticket, obtain the start time of the order and the new end time, delete all sub-orders of the old order, and then divide and store them according to the new start and end time; when canceling the ticket, directly delete all sub-orders in the corresponding order data.

3. A method for calculating server resource inventory for computing power scheduling according to claim 2, It is characterized in that When querying inventory, the inventory units are labeled according to the query time and query frequency, wherein the inventory units that meet the preset conditions are labeled, wherein the labeled inventory units are stored in the first database, and the unlabeled inventory units are stored in the second database, wherein the preset conditions include inventory units that have been queried within 3 days or inventory units that have been queried more than 5 times a day.

4. A computing system for server resource inventory for computing power scheduling, It is characterized in that The system comprises a memory and a processor, wherein the memory comprises a calculation method program for server resource inventory for computing power scheduling, and the calculation method program for server resource inventory for computing power scheduling is executed by the processor to implement the following steps: Obtaining order data, and storing the order data in inventory based on a set data structure; Performing data updates based on the order data, including updating inventory based on order changes and updating inventory based on machine changes; When performing data query, the data in the inventory is queried based on a preset query mechanism, and the query mechanism includes performing sub-database query based on preset tags; Setting the data structure specifically includes: The order data is flattened according to a preset joint dimension to record resource usage, wherein the joint dimension specifically includes a joint dimension of server-order-time interval; Based on the start time and end time in the order data, overlap identification is performed to split out sub-orders, and the order data is segmented and stored according to the sub-orders; The data updating based on the order data specifically includes: Update inventory based on the order changes, wherein inventory statistics are collected based on preset business scenarios, wherein the business scenarios include creating a ticket, renewing a ticket, changing a ticket end time, canceling a ticket, creating a maintenance order, changing a maintenance order end time, and canceling a maintenance order, wherein Ticket is an identifier corresponding to the order data; updating inventory based on the machine changes, wherein the machine changes include machine downtime and machine recycling; When updating data, the transaction rollback mechanism is used to ensure the correctness of the data, and the backoff algorithm, retry mechanism and timed compensation tasks are used to ensure the final consistency of the machine occupancy information; The creation of a Ticket specifically includes: Based on the order data, the start time, end time, bound machine ID, machine slot ID, number of occupied GPU cards, number of occupied CPU cores, and occupied memory size of the order are obtained; When storing the order data, the order data is segmented based on the start time of the order, wherein the data is segmented based on the overlapping time periods of different orders.

5. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a method program for calculating server resource inventory for computing power scheduling. When the method program for calculating server resource inventory for computing power scheduling is executed by a processor, the steps of a method for calculating server resource inventory for computing power scheduling as described in any one of claims 1 to 3 are implemented.