Statistical request processing method and device, computer equipment, readable storage medium and program product
By providing a statistical request processing method in the object storage service, the statistical mapping table is used to read the usage of bucket containers in the upper container, the problem of unbalanced resource use is solved and more refined resource management and allocation is achieved.
Patent Information
- Application Number
- CN202411670512.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-18
AI Technical Summary
In the current object storage service, it is impossible to refine the amount of storage in the bucket in the superior container to which the bucket belongs, resulting in unbalanced resource usage, overload or waste.
Provide a statistical request processing method, by receiving a statistical request, obtaining a statistical mapping table, which is determined based on a first data table that records the information of the superior container to which the bucket container belongs and a second data table that stores user object data in the bucket container, thereby Read the target data in response to statistics requests.
It realizes fine management and allocation of the usage of bucket containers in the upper container, reducing overload or waste of resource use, and balancing resource use.
Smart Images

Figure CN119474102A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a statistical request processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of data statistics technology, storing data in containers at different levels makes it easier to expand and improve processing efficiency.
[0003] In the current object storage service, in order to better understand and manage the resource usage and performance status of the cluster, there are many statistics, such as cluster health status, object storage device statistics (Object-based StorageDevice, OSD), pool statistics, placement group statistics (Placement Group, PG), user and bucket statistics, etc. Among them, in terms of user and bucket statistics, only the status of all objects in the bucket can be known, and it is impossible to further refine the usage of the storage in the bucket in the parent container to which the bucket belongs. Therefore, different parent containers are prone to uneven resource usage, overload or waste. Summary of the invention
[0004] Based on this, it is necessary to provide a statistical request processing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can balance resource usage in response to the above technical problems.
[0005] In a first aspect, the present application provides a statistical request processing method, the method comprising:
[0006] receiving a statistical request, wherein the statistical request represents a usage request of the bucket container in the upper-level container to which it belongs;
[0007] Acquire a statistical mapping table according to the statistical request, wherein the statistical mapping table is determined based on a first data table and a second data table, wherein the first data table is used to record information of an upper-level container to which the bucket container belongs; and the second data table is used to record user object data stored in the bucket container;
[0008] The target data is read from the statistics mapping table in response to the statistics request.
[0009] In one embodiment, obtaining a statistical mapping table according to a statistical request includes:
[0010] querying from the cache whether the statistical mapping table exists according to the statistical request;
[0011] If the statistics mapping table exists in the cache, reading the statistics mapping table from the cache;
[0012] If the statistical mapping table does not exist in the cache, reading the statistical mapping table from the database;
[0013] The reading target data from the statistical mapping table includes:
[0014] Reading initial data from the statistical mapping table;
[0015] Perform statistical analysis on the initial data to determine target data.
[0016] In one embodiment, the initial data includes information of a parent container to which the bucket container belongs and user object data information stored in the bucket container; and reading the initial data from the statistical mapping table includes:
[0017] Reading the upper-level container information to which the bucket container belongs and the user object data information stored in the bucket container from the statistical mapping table;
[0018] The target data includes the usage of the barrel container in the upper-level container to which it belongs; performing statistical analysis on the initial data to determine the target data includes:
[0019] Based on the information of the upper-level container to which the bucket container belongs and the user object data information stored in the bucket container, the usage of the bucket container in the upper-level container to which it belongs is determined.
[0020] In one embodiment, the information of the upper-level container to which the bucket container belongs includes the upper-level container identifier to which the bucket container identifier belongs, wherein the upper-level container identifier includes at least one of a pool identifier and a cluster identifier; the first data table is also used to record the bucket container identifier, each of the cluster identifiers corresponds to a plurality of pool identifiers; each of the pool identifiers corresponds to a plurality of bucket identifiers; the second data table is also used to record the bucket container identifier; the generation method of the statistical mapping table includes:
[0021] Obtaining the bucket container identifier of the first data table and the bucket container identifier of the second data table;
[0022] The bucket container identifier is used as a primary key, and at least one of the pool identifier and the cluster identifier and the user object data stored in the bucket container are associated to obtain the statistical mapping table.
[0023] In one embodiment, after obtaining the statistical mapping table, the method further includes:
[0024] Storing the statistical mapping table in a cache;
[0025] Based on the scheduled task, the statistical mapping table is obtained from the cache and stored in the database.
[0026] In one of the embodiments, before storing the statistical mapping table in the cache, the method further includes:
[0027] Receive a first verification instruction, wherein the first verification instruction includes verification of at least one bucket container information of a user object;
[0028] According to the first verification instruction, scan the actual information of at least one bucket container where the user object is located, the actual information including the actual bucket container identifier and the actual upper-level container identifier to which the actual bucket container identifier belongs, wherein the actual upper-level container identifier includes at least one of an actual pool identifier and an actual cluster identifier;
[0029] If the actual information is inconsistent with the information in the mapping data table, at least one of replacing the bucket container identifier in the statistical mapping table with an actual bucket container identifier, replacing the pool identifier with an actual pool identifier, and replacing the cluster identifier with an actual cluster identifier.
[0030] In a second aspect, the present application further provides a statistical request processing device, the device comprising:
[0031] A receiving module, configured to receive a statistical request, wherein the statistical request represents a usage request of a bucket container in a corresponding upper-level container;
[0032] an acquisition module, configured to acquire a statistical mapping table according to the statistical request, wherein the statistical mapping table is determined based on a first data table and a second data table, wherein the first data table is used to record information of an upper-level container to which the bucket container belongs; and the second data table is used to record user object data stored in the bucket container;
[0033] The response module is used to read the target data from the statistical mapping table to respond to the statistical request.
[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0036] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0037] The statistical request processing method, device, computer equipment, computer-readable storage medium and computer program product described above first receive a statistical request, the statistical request represents the usage request of the bucket container in the upper-level container to which it belongs; secondly, obtain a statistical mapping table according to the statistical request, the statistical mapping table is determined based on the first data table and the second data table, wherein the first data table is used to record the information of the upper-level container to which the bucket container belongs; the second data table is used to record the user object data stored in the bucket container; finally, read the target data from the statistical mapping table to respond to the statistical request. The statistical mapping table is determined based on the first data table that records the information of the upper-level container to which the bucket container belongs, and the second data table that records the user object data stored in the bucket container, and a mapping relationship between the upper-level container to which the bucket container belongs and the user object data stored in the bucket container is constructed. When obtaining the statistical mapping table according to the statistical request, the corresponding target data can be read from the statistical mapping table to obtain the usage of the bucket container in the upper-level container to which it belongs. Compared with the case where only all object storage in the bucket container is obtained, more refined resource management and allocation can be achieved based on the usage of different bucket containers in their respective parent containers, thereby reducing resource overload or waste in the parent container and balancing resource usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0039] FIG1 is a diagram of an application environment of a statistical request processing method in one embodiment;
[0040] FIG2 is a schematic diagram of a flow chart of a statistical request processing method in one embodiment;
[0041] FIG3 is a schematic diagram of a storage system architecture in one embodiment;
[0042] FIG4 is a schematic diagram of a process of reading target data from a statistical mapping table in one embodiment;
[0043] FIG5 is a schematic diagram of a process of reading target data from a statistical mapping table in another embodiment;
[0044] FIG6 is a schematic diagram of a flow chart of a method for generating a statistical mapping table in one embodiment;
[0045] FIG7 is a schematic diagram of a process for storing a statistical mapping table in one embodiment;
[0046] FIG8 is a schematic diagram of a flow chart of checking a statistical mapping table in one embodiment;
[0047] FIG9 is a structural block diagram of a statistical request processing device in one embodiment;
[0048] FIG. 10 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] The statistical request processing method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. The storage server 102 communicates with the statistical server 104 through the network. The data storage system can store the data that the storage server 104 needs to process. The data storage system can be integrated on the storage server 104, or placed on the cloud or other network servers. The statistical server 102 obtains the data information stored in the data storage system and constructs a statistical mapping table. The statistical server 102 receives a statistical request, which represents the usage request of the bucket container in the upper-level container to which it belongs; obtains a statistical mapping table according to the statistical request, and the statistical mapping table is determined based on the first data table and the second data table, wherein the first data table is used to record the information of the upper-level container to which the bucket container belongs; the second data table is used to record the user object data stored in the bucket container; and reads the target data from the statistical mapping table to respond to the statistical request. The statistical server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The storage server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0051] In an exemplary embodiment, as shown in FIG2 , a statistical request processing method is provided, which is described by taking the method applied to the statistical server 104 in FIG1 as an example, and includes the following steps S202 to S206 . Among them:
[0052] Step S202: receiving a statistical request, where the statistical request represents a usage request of the bucket container in its upper-level container.
[0053] A bucket is a storage space for storing specific types of data, such as user object data. The upper-level container includes a pool or a cluster. As shown in FIG3 , a cluster includes multiple pools, a pool includes multiple bucket containers, and a cluster may also include multiple bucket containers.
[0054] The statistical request represents the usage request of the bucket container in the upper-level container to which it belongs, for example, the usage request of the bucket container in the pool, or the usage request of the bucket container in the cluster.
[0055] Optionally, the statistics server receives a statistics request, such as a usage request for a bucket container in a pool, or a usage request for a bucket container in a cluster.
[0056] Step S204, obtaining a statistical mapping table according to the statistical request, the statistical mapping table is determined based on the first data table and the second data table, wherein the first data table is used to record the information of the parent container to which the bucket container belongs; the second data table is used to record the user object data stored in the bucket container.
[0057] Optionally, before the statistics server obtains the statistics mapping table according to the statistics request, the statistics mapping table is generated first. The statistics mapping table is determined according to the first data table recording the information of the upper container to which the bucket container belongs and the second data table recording the user object data stored in the bucket container, so that the statistics server obtains the statistics mapping table according to the statistics request.
[0058] Step S206, reading target data from the statistics mapping table to respond to the statistics request.
[0059] Optionally, the statistics server reads target data from the statistics mapping table, such as resource usage of bucket containers in the corresponding pool, and responds to the statistics request through the target data. According to the target data, the object storage status of all bucket containers in the pool or the object storage status of all bucket containers in the cluster can be obtained, so as to achieve more refined resource management and allocation.
[0060] In the above statistical request processing method, first, a statistical request is received, and the statistical request represents the usage request of the bucket container in the upper-level container to which it belongs; secondly, a statistical mapping table is obtained according to the statistical request, and the statistical mapping table is determined based on the first data table and the second data table, wherein the first data table is used to record the information of the upper-level container to which the bucket container belongs; the second data table is used to record the user object data stored in the bucket container; finally, the target data is read from the statistical mapping table to respond to the statistical request. The statistical mapping table is determined based on the first data table that records the information of the upper-level container to which the bucket container belongs, and the second data table that records the user object data stored in the bucket container, and a mapping relationship between the upper-level container to which the bucket container belongs and the user object data stored in the bucket container is constructed. When the statistical mapping table is obtained according to the statistical request, the corresponding target data can be read from the statistical mapping table, so as to obtain the usage of the bucket container in the upper-level container to which it belongs. According to the usage of different bucket containers in the upper-level container to which they belong, compared with the situation of only obtaining all object storage in the bucket container, more refined resource management and allocation can be achieved, reducing the situation of resource overload or waste in the upper-level container, and balancing resource usage.
[0061] In an exemplary embodiment, target data is read from a statistical mapping table, as shown in FIG4 , and obtaining the statistical mapping table according to a statistical request includes steps S402 to S404 . Among them:
[0062] Step S402: query whether a statistics mapping table exists in the cache according to the statistics request; if the statistics mapping table exists in the cache, read the statistics mapping table from the cache.
[0063] Optionally, before querying whether the statistical mapping table exists from the cache according to the statistical request, the statistical mapping table is first stored in the cache, and then read from the cache and stored in the database through a scheduled task. The statistical server queries whether the statistical mapping table exists from the cache according to the statistical request, and if it exists in the cache, the statistical mapping table is read from the cache. The cache can handle data storage requirements at an extremely fast speed, significantly reducing the pressure of direct access to the database.
[0064] Step S404: if the data does not exist in the cache, the statistical mapping table is read from the database.
[0065] Optionally, if the statistics mapping table does not exist in the cache, the statistics mapping table is obtained from the database.
[0066] Reading target data from the statistical mapping table includes steps S406 to S408.
[0067] Step S406, reading initial data from the statistical mapping table.
[0068] Optionally, the statistical mapping table includes a mapping relationship between the first data table and the second data table, and the parent container information to which the bucket container belongs is obtained from the first data table according to the statistical mapping table, and the user object data stored in the bucket container is obtained from the first data table according to the statistical mapping table.
[0069] Step S408, performing statistical analysis on the initial data to determine target data.
[0070] Optionally, according to the information of the upper-level container to which the bucket container belongs and the user object data stored in the bucket container, the object storage status of all the bucket containers in the upper-level container may be obtained by statistics.
[0071] In this embodiment, by first obtaining the statistical mapping table from the cache and then obtaining the statistical mapping table from the database, on the one hand, the response speed of the cache to the request can be improved, and on the other hand, through the cache, the system resources can be better managed and scheduled, providing greater flexibility and possibility for future expansion and optimization. By reading the initial data from the statistical mapping table and analyzing the initial data, the target data that can respond to the statistical request is determined.
[0072] Continuing with the above embodiment, the target data is obtained from the statistical mapping table, as shown in Figure 5, the initial data includes the parent container information to which the bucket container belongs and the user object data information stored in the bucket container; the initial data is read from the statistical mapping table, including step S502: reading the parent container information to which the bucket container belongs and the user object data information stored in the bucket container from the statistical mapping table.
[0073] The initial data includes the upper-level container information to which the bucket container belongs and the user object data information stored in the bucket container.
[0074] Optionally, information of a parent container to which the bucket container belongs is obtained from the first data table according to the statistical mapping table, and user object data stored in the bucket container is obtained from the first data table according to the statistical mapping table.
[0075] The target data includes the usage of the bucket container in its parent container; performing statistical analysis on the initial data to determine the target data includes step S504: determining the usage of the bucket container in its parent container based on the parent container information to which the bucket container belongs and the user object data information stored in the bucket container.
[0076] The target data includes the usage of the barrel container in its parent container.
[0077] Optionally, according to the information of the upper-level container to which the bucket container belongs and the user object data stored in the bucket container, the object storage status of all the bucket containers in the upper-level container may be obtained by statistics.
[0078] Optionally, the logical relationship of buckets in different pools is shown in Figure 3. By executing the command: admin bucket_pool_stats --uid=aaa --bucket=001, the usage of the bucket container in the parent container to which it belongs is obtained from the statistical mapping table, such as the usage of bucket container 001 in the pool. The pool statistics of bucket 001 to which user object aaa belongs can be displayed, where uid represents the identifier of the user object and bucket represents the bucket container to which the user object belongs.
[0079] Optionally, the usage of the bucket container in the corresponding upper-level container may be obtained from the statistical mapping table according to the logical relationship between the buckets in different clusters, such as the usage of the bucket container 001 in the cluster.
[0080] In this embodiment, the first data table and the second data table are associated through a statistical mapping table, and the usage of the bucket container in its parent container can be obtained through the statistical mapping table, which facilitates more refined resource management and allocation, reduces resource overload or waste in the parent container, and balances resource usage.
[0081] In an exemplary embodiment, as shown in FIG6 , the information of the upper-level container to which the bucket container belongs includes the upper-level container identifier to which the bucket container identifier belongs, wherein the upper-level container identifier includes at least one of a pool identifier and a cluster identifier; the first data table is also used to record the bucket container identifier, each cluster identifier corresponds to multiple pool identifiers; each pool identifier corresponds to multiple bucket identifiers; the second data table is also used to record the bucket container identifier; the method for generating the statistical mapping table includes steps S602 to S604. Among them:
[0082] Step S602: Obtain the bucket container identifier of the first data table and the bucket container identifier of the second data table.
[0083] Among them, the information of the parent container to which the bucket container belongs includes the parent container identifier to which the bucket container identifier belongs, wherein the parent container identifier includes at least one of a pool identifier and a cluster identifier; the first data table is also used to record the bucket container identifier, each cluster identifier corresponds to multiple pool identifiers; each pool identifier corresponds to multiple bucket identifiers; wherein each cluster identifier also corresponds to multiple bucket identifiers.
[0084] The second data table is also used to record the bucket container identifier, that is, the first data table records the bucket container identifier, the pool identifier, and the cluster identifier, and the second data table records the bucket container identifier and the user object data stored in the bucket container.
[0085] The first data table may also record a storage type identifier, which includes multiple bucket container identifiers, a pool identifier may include multiple storage type identifiers, and a cluster identifier may include multiple pool identifiers.
[0086] Optionally, the statistics server obtains the bucket container identifier of the first data table and the bucket container identifier of the second data table.
[0087] Step S604 , using the bucket container identifier as a primary key, at least one of the pool identifier and the cluster identifier and the user object data stored in the bucket container are associated to obtain a statistical mapping table.
[0088] Optionally, the statistics server uses the bucket container identifier as the primary key, for example, associates the pool identifier with the cluster identifier and the user object data stored in the bucket container to obtain a statistics mapping table. In this case, the field information recorded in the statistics mapping table includes fields such as bucket container id, storage type, cluster id, pool id, bucket size, and object quantity.
[0089] In this embodiment, the statistical mapping table is constructed by associating the first data table with the second data table using the bucket container identifier as the primary key.
[0090] In an exemplary embodiment, as shown in FIG7 , after obtaining the statistical mapping table, steps S702 to S704 are further included. Among them:
[0091] Step S702: store the statistical mapping table in a cache.
[0092] Optionally, after obtaining the statistical mapping table, the statistical server stores the statistical mapping table in a cache.
[0093] Step S704: based on the scheduled task, obtain the statistical mapping table from the cache and store it in the database.
[0094] Optionally, the statistics server is refreshed regularly, such as a 20-second scheduled task, to write the cached data to the database in batches.
[0095] In this embodiment, by first storing in the cache and then storing in the database, not only the efficiency of data writing is improved, but also the frequency of database write operations is greatly reduced, and the database load is reduced. At the same time, the statistical request is responded to from the cache first, which improves the response speed of the statistical request.
[0096] In an exemplary embodiment, as shown in FIG8 , before storing the statistical mapping table in the cache, steps S802 to S806 are further included.
[0097] Step S802: Receive a first verification instruction, where the first verification instruction includes verification of at least one bucket container information of a user object.
[0098] If the first verification instruction includes verification of one bucket container information of the user object, it is a single bucket verification. If the first verification instruction includes verification of two or more bucket container information of the user object, it is a multi-bucket verification.
[0099] Optionally, before storing the statistical mapping table in the cache, the statistical server verifies the information recorded in the statistical mapping table. The statistical server receives the first verification instruction, and if the first verification instruction includes verification of a bucket container information of the user object, that is, single bucket verification.
[0100] Step S804, according to the first verification instruction, scan the actual information of at least one bucket container where the user object is located, the actual information includes the actual bucket container identifier and the actual superior container identifier to which the actual bucket container identifier belongs, wherein the actual superior container identifier includes at least one of an actual pool identifier and an actual cluster identifier.
[0101] Optionally, taking the existence of pools and clusters in the architecture, single bucket verification is used as an example. The statistics server scans the actual bucket container identifier of a bucket container where the user object is located, the actual pool identifier and the actual cluster identifier to which the actual bucket container identifier belongs according to the first verification instruction. By executing admin bucket_pool_stats --uid=aaa --bucket=001 --cluster-id=aaa001 --pool-id=aaabbb --sync-bucket-pool-stats=SINGLE, the bucket 001 to which user aaa belongs can be calibrated. uid represents the user's id, bucket represents the user's bucket, cluster-id represents the cluster to be viewed, pool-id represents the pool to be viewed, and sync-bucket-pool-stats can select "SINGLE" or "ALL", that is, single calibration of the user object or multi-bucket verification of the user object.
[0102] Optionally, the statistics server may also receive a second verification instruction, the second verification instruction including verification of at least one bucket container information. The first verification instruction includes the second verification instruction. The first verification instruction includes a single bucket or multiple bucket verification of the user object, and the second verification instruction only includes a single bucket or multiple bucket verification. When executing the first verification instruction, the execution of the second verification instruction may also be completed.
[0103] Step S806: if the actual information is inconsistent with the information in the mapping data table, at least one of replacing the bucket container identifier in the statistical mapping table with the actual bucket container identifier, replacing the pool identifier with the actual pool identifier, and replacing the cluster identifier with the actual cluster identifier.
[0104] Optionally, if the actual information is inconsistent with the information in the mapping data table, the bucket container identifier in the statistical mapping table is replaced with the actual bucket container identifier, the pool identifier is replaced with the actual pool identifier, and the cluster identifier is replaced with the actual cluster identifier. If the actual information is consistent with the information in the mapping data table, there is no need to adjust the statistical mapping table.
[0105] Optionally, when a bucket container is deleted, the data of the corresponding deleted bucket container also needs to be deleted in the statistical mapping table.
[0106] In this embodiment, the accuracy of the data in the statistical mapping table can be ensured by calibrating the data in the statistical mapping table.
[0107] In an exemplary embodiment, there are two stages: one is the stage of generating and storing the statistical mapping table, and the other is the stage of using the statistical mapping table.
[0108] The generation and storage phase of the statistical mapping table: obtain the first data table and the second data table, the first data table records the bucket identifier, pool identifier, and cluster identifier; the second data table records the bucket identifier and the user object data stored in the bucket container. The statistical server uses the bucket container identifier as the primary key to associate the first data table and the second data table, for example, associates the pool identifier and the cluster identifier with the user object data stored in the bucket container to obtain the statistical mapping table. At this time, the field information recorded in the statistical mapping table includes fields such as the bucket container id, storage type, cluster id, pool id, bucket size, and number of objects. The statistical server receives the first verification instruction. If the first verification instruction includes a verification of a bucket container information of the user object, it is a single bucket verification. Taking the existence of pools and clusters in the architecture and the single bucket verification as an example, the statistical server scans the actual bucket container identifier of a bucket container where the user object is located, the actual pool identifier to which the actual bucket container identifier belongs, and the actual cluster identifier according to the first verification instruction. By executing admin bucket_pool_stats --uid=aaa --bucket=001 --cluster-id=aaa001 --pool-id=aaabbb --sync-bucket-pool-stats=SINGLE, you can calibrate bucket 001 to which user aaa belongs. uid indicates the user's id, bucket indicates the bucket to which the user belongs, cluster-id indicates the cluster to be viewed, and pool-id indicates the pool to be viewed. sync-bucket-pool-stats can select "SINGLE" or "ALL", that is, single calibration of the user object or multi-bucket calibration of the user object. If the actual information is inconsistent with the information in the mapping data table, replace the bucket container identifier in the statistics mapping table with the actual bucket container identifier, the pool identifier with the actual pool identifier, and the cluster identifier with the actual cluster identifier. If the actual information is consistent with the information in the mapping data table, there is no need to adjust the statistics mapping table. The statistics server first stores the statistics mapping table in the cache and refreshes it regularly, such as a 20-second scheduled task, to write the data in the cache into the database in batches.
[0109] The usage phase of the statistical mapping table: The statistical server receives a statistical request, such as a usage request for a bucket container in a pool, or a usage request for a bucket container in a cluster. The statistical server queries the cache based on the statistical request whether there is a statistical mapping table. If it exists in the cache, the statistical mapping table is read from the cache. If the statistical mapping table does not exist in the cache, the statistical mapping table is obtained from the database. According to the statistical mapping table, the parent container information to which the bucket container belongs is obtained from the first data table, and the user object data stored in the bucket container is obtained from the first data table based on the statistical mapping table. Based on the parent container information to which the bucket container belongs and the user object data stored in the bucket container, the object storage status of all bucket containers in the parent container can be statistically obtained to respond to the statistical request.
[0110] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0111] Based on the same inventive concept, the embodiment of the present application also provides a statistical request processing device for implementing the statistical request processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more statistical request processing device embodiments provided below can refer to the limitations of the statistical request processing method above, and will not be repeated here.
[0112] In an exemplary embodiment, as shown in FIG9 , a statistical request processing device is provided, including: a receiving module 901, an acquisition module 902 and a response module 903, wherein:
[0113] The receiving module 901 is used to receive a statistical request, where the statistical request represents a usage request of a bucket container in its upper-level container.
[0114] Acquisition module 902 is used to obtain a statistical mapping table according to a statistical request. The statistical mapping table is determined based on a first data table and a second data table, wherein the first data table is used to record information of an upper-level container to which the bucket container belongs; and the second data table is used to record user object data stored in the bucket container.
[0115] The response module 903 is used to read the target data from the statistics mapping table to respond to the statistics request.
[0116] In an exemplary embodiment, the acquisition module 902 includes:
[0117] The first reading unit is used to query whether the statistical mapping table exists in the cache according to the statistical request; if the statistical mapping table exists in the cache, read the statistical mapping table from the cache.
[0118] The second reading unit is used to read the statistical mapping table from the database if the statistical mapping table does not exist in the cache.
[0119] The response module 903 includes:
[0120] The third reading unit is used to read initial data from the statistical mapping table.
[0121] The analysis and determination unit is used to perform statistical analysis on the initial data and determine the target data.
[0122] In an exemplary embodiment, the initial data includes information about the upper-level container to which the bucket container belongs and user object data information stored in the bucket container; the third reading unit is further used to read information about the upper-level container to which the bucket container belongs and user object data information stored in the bucket container from the statistical mapping table. The analysis and determination unit is further used to determine the usage of the bucket container in the upper-level container to which it belongs based on the information about the upper-level container to which the bucket container belongs and the user object data information stored in the bucket container.
[0123] In an exemplary embodiment, the information of the parent container to which the bucket container belongs includes the parent container identifier to which the bucket container identifier belongs, wherein the parent container identifier includes at least one of a pool identifier and a cluster identifier; the first data table is also used to record the bucket container identifier, each cluster identifier corresponds to multiple pool identifiers; each pool identifier corresponds to multiple bucket identifiers; the second data table is also used to record the bucket container identifier; the statistical request processing device also includes a generation module for obtaining the bucket container identifier of the first data table and the bucket container identifier of the second data table; using the bucket container identifier as the primary key, at least one of the pool identifier and the cluster identifier, and the user object data stored in the bucket container are associated to obtain a statistical mapping table.
[0124] In an exemplary embodiment, the statistical request processing device further includes a storage module for storing the statistical mapping table in a cache; based on a scheduled task, the statistical mapping table is obtained from the cache and stored in a database.
[0125] In an exemplary embodiment, the statistical request processing device further includes a verification module, which is used to receive a first verification instruction, wherein the first verification instruction includes verification of at least one bucket container information of the user object;
[0126] According to the first verification instruction, scan the actual information of at least one bucket container where the user object is located, the actual information includes the actual bucket container identifier and the actual superior container identifier to which the actual bucket container identifier belongs, wherein the actual superior container identifier includes at least one of an actual pool identifier and an actual cluster identifier; if the actual information is inconsistent with the information in the mapping data table, replace the bucket container identifier in the statistical mapping table with the actual bucket container identifier, replace the pool identifier with the actual pool identifier, and replace the cluster identifier with at least one of the actual cluster identifiers.
[0127] Each module in the above statistical request processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0128] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG10. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store user object data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a statistical request processing method is implemented.
[0129] Those skilled in the art will understand that the structure shown in FIG. 10 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0132] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0133] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0134] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0135] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A statistical request processing method, characterized in that: The method comprises: receiving a statistical request, wherein the statistical request represents a usage request of the bucket container in the upper-level container to which it belongs; Acquire a statistical mapping table according to the statistical request, wherein the statistical mapping table is determined based on a first data table and a second data table, wherein the first data table is used to record information of an upper-level container to which the bucket container belongs; and the second data table is used to record user object data stored in the bucket container; The target data is read from the statistics mapping table in response to the statistics request.
2. The method according to claim 1, characterized in that The obtaining of the statistical mapping table according to the statistical request includes: querying from the cache whether the statistical mapping table exists according to the statistical request; If the statistics mapping table exists in the cache, reading the statistics mapping table from the cache; If the statistical mapping table does not exist in the cache, reading the statistical mapping table from the database; The reading target data from the statistical mapping table includes: Reading initial data from the statistical mapping table; Perform statistical analysis on the initial data to determine target data.
3. The method according to claim 2, characterized in that The initial data includes information of the upper container to which the bucket container belongs and user object data information stored in the bucket container; the reading of the initial data from the statistical mapping table includes: Reading the upper-level container information to which the bucket container belongs and the user object data information stored in the bucket container from the statistical mapping table; The target data includes the usage of the barrel container in the upper-level container to which it belongs; performing statistical analysis on the initial data to determine the target data includes: Based on the information of the upper-level container to which the bucket container belongs and the user object data information stored in the bucket container, the usage of the bucket container in the upper-level container to which it belongs is determined.
4. The method according to claim 1, characterized in that: The information of the upper-level container to which the bucket container belongs includes the upper-level container identifier to which the bucket container identifier belongs, wherein the upper-level container identifier includes at least one of a pool identifier and a cluster identifier; the first data table is also used to record the bucket container identifier, each of the cluster identifiers corresponds to a plurality of pool identifiers; each of the pool identifiers corresponds to a plurality of bucket identifiers; the second data table is also used to record the bucket container identifier; the generation method of the statistical mapping table includes: Obtaining the bucket container identifier of the first data table and the bucket container identifier of the second data table; The bucket container identifier is used as a primary key, and at least one of the pool identifier and the cluster identifier and the user object data stored in the bucket container are associated to obtain the statistical mapping table.
5. The method according to claim 4, characterized in that After obtaining the statistical mapping table, the method further includes: Storing the statistical mapping table in a cache; Based on the scheduled task, the statistical mapping table is obtained from the cache and stored in the database.
6. The method according to claim 5, characterized in that Before storing the statistical mapping table in the cache, the method further includes: receiving a first verification instruction, wherein the first verification instruction includes verification of at least one bucket container information of a user object; According to the first verification instruction, scan the actual information of at least one bucket container where the user object is located, the actual information including the actual bucket container identifier and the actual upper-level container identifier to which the actual bucket container identifier belongs, wherein the actual upper-level container identifier includes at least one of an actual pool identifier and an actual cluster identifier; If the actual information is inconsistent with the information in the mapping data table, at least one of replacing the bucket container identifier in the statistical mapping table with an actual bucket container identifier, replacing the pool identifier with an actual pool identifier, and replacing the cluster identifier with an actual cluster identifier.
7. A statistical request processing device, characterized in that: The device comprises: A receiving module, configured to receive a statistical request, wherein the statistical request represents a usage request of a bucket container in a corresponding upper-level container; an acquisition module, configured to acquire a statistical mapping table according to the statistical request, wherein the statistical mapping table is determined based on a first data table and a second data table, wherein the first data table is used to record information of an upper-level container to which the bucket container belongs; and the second data table is used to record user object data stored in the bucket container; The response module is used to read the target data from the statistical mapping table to respond to the statistical request.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.