A method, device and related equipment for counting usage

By adding target identifiers in the object storage system and recording the data volume and timestamp of access requests, target statistics are formed, which solves the problem of a single form of usage statistics in the object storage field, enables differentiated statistics for different scenarios and account categories, and supports More refined billing and service models.

CN118170826BActive Publication Date: 2024-09-03CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410578940.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-09-03
Estimated Expiration
2044-05-11

AI Technical Summary

Technical Problem

The usage statistics of existing object storage service providers are based on user granularity, which cannot be classified according to specific usage scenarios, and panels and reports cannot be output regularly, resulting in a relatively single form of usage statistics.

Method used

By adding the target identifier in the access request, the data volume and timestamp of the data to be operated are recorded, target statistics are formed, and visually displayed to achieve differentiated statistics for different scenarios and account categories.

Benefits of technology

It realizes differentiated statistics on different operating behaviors or account categories of a single user, enriches the usage statistics form in the field of object storage, and supports more refined billing models and service requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170826B
    Figure CN118170826B
Patent Text Reader

Abstract

The present disclosure provides a usage statistics method, device and related equipment, which relate to the technical field of cloud computing, wherein the method comprises: when an access request satisfies a target condition, adding a target identifier associated with the target condition to the access request, wherein the target condition is any one of at least one preset condition; according to the target identifier, recording the data volume of the data to be operated of the access request and the timestamp of the access request to form target statistical data, and visually displaying the target statistical data, wherein the target statistical data is used to count the total amount of data of the user's cumulative operation data within a set period of time. By adding conditional judgment to the access request, and adding an identifier associated with the corresponding condition to the access request, the data volume of the data to be operated of the access request and the timestamp of the access request are recorded based on the added identifier, and combined with the visual display method, the usage statistics form in the object storage field is enriched.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a usage statistics method, apparatus, and related equipment. Background Art

[0002] Currently, object storage service providers mainly conduct usage statistics based on the user granularity. They lack a more fine-grained usage statistics method, are unable to classify usage according to the user's specific usage scenarios, and are unable to regularly output various usage statistics into dashboards and reports.

[0003] That is to say, in the field of object storage, the usage statistics provided by related technologies are relatively simple. Summary of the invention

[0004] The purpose of the present disclosure is to provide a usage statistics method, apparatus and related equipment to solve the technical problem that the usage statistics provided by the related technology in the field of object storage are in a single form.

[0005] In a first aspect, the present disclosure provides a usage statistics method, the method comprising:

[0006] In the case where the access request satisfies a target condition, adding a target identifier associated with the target condition to the access request, wherein the target condition is any one of at least one preset condition;

[0007] According to the target identifier, the amount of data to be operated of the access request and the timestamp of the access request are recorded to form target statistical data, which is used to count the total amount of accumulated operation data of users in the scenario corresponding to the target condition within a set period of time;

[0008] The target statistical data is visually displayed.

[0009] In a second aspect, the present disclosure provides a usage statistics device, the device comprising:

[0010] an identifier adding module, configured to add a target identifier associated with the target condition to the access request when the access request satisfies the target condition, wherein the target condition is any one of at least one preset condition;

[0011] A recording module, configured to record the amount of data to be operated of the access request and the timestamp of the access request according to the target identifier, so as to form target statistical data, wherein the target statistical data is used to count the total amount of accumulated operation data of users in the scenario corresponding to the target condition within a set period of time;

[0012] A display module is used to visually display the target statistical data.

[0013] In a third aspect, the present disclosure provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.

[0014] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0015] In a fifth aspect, the present disclosure provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0016] In the present disclosure, conditional judgments are added to user access requests, and when the judgment is passed, an identifier of the associated corresponding condition is added to the access request, so that when responding to the access request, the amount of data to be operated in the access request and the timestamp of the access request are recorded based on the added identifier, so that the operator can know the total amount of accumulated operation data of the corresponding scenario within the set time period, and then realize the differentiated statistics of different operation behaviors or different account categories involving a single user, and combine with the visual display method to enrich the usage statistics form in the object storage field. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flowchart of a usage statistics method provided by an embodiment of the present disclosure;

[0018] Figure 2 is a schematic diagram of the architecture of an object storage system provided by an embodiment of the present disclosure;

[0019] Figure 3 It is a schematic diagram of the structure of Http request header data provided by an embodiment of the present disclosure;

[0020] Figure 4 is a flow chart of another usage statistics method provided by an embodiment of the present disclosure;

[0021] Figure 5 It is a structural schematic diagram of a usage statistics device provided by an embodiment of the present disclosure;

[0022] Figure 6 It is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0024] The present disclosure provides a method for calculating the usage statistics. Figure 1 As shown, the usage statistics method includes:

[0025] Step 101: When an access request satisfies a target condition, a target identifier associated with the target condition is added to the access request.

[0026] Wherein, the target condition is any one of at least one preset condition.

[0027] Step 102: According to the target identifier, the data volume of the to-be-operated data of the access request and the timestamp of the access request are recorded to form target statistical data.

[0028] The target statistical data is used to count the total amount of operation data accumulated by users in the scenario corresponding to the target condition within a set time period.

[0029] The method disclosed herein is applied to an object storage system, wherein the object storage system includes a seven-layer load balancing gateway and a system access layer, and the access request is an operation request initiated by an account of a user in the object storage system, and the operation request is used to upload data and / or download data from the object storage system.

[0030] Exemplarily, the access request may be issued by a client or an SDK tool, which is not limited in the present disclosure.

[0031] The data volume of the data to be operated in the access request is specifically: the data volume of the data requested to be downloaded by the access request, or the data volume of the data requested to be uploaded by the access request.

[0032] The timestamp of the access request is used to indicate the time when the access request is generated, or to indicate the time when the access request reaches the object storage system.

[0033] The seven-layer load balancing gateway is the entrance to the object storage system. All requests sent by clients and SDK tools pass through the seven-layer load balancing gateway and are forwarded to the access layer after load balancing processing.

[0034] The seven-layer load balancing gateway is used to execute the action of step 101, and the system access layer is used to execute the action of step 102.

[0035] Step 103: Visually display the target statistical data.

[0036] For example, the total amount of accumulated operation data of different accounts belonging to a user may be pulled periodically (e.g., every 24 hours) and compared with the total amount of accumulated operation data of each account in a historical period, so as to draw a line graph reflecting the changes in the total amount of accumulated operation data of each account in different time periods.

[0037] In the present disclosure, conditional judgments are added to user access requests, and when the judgment is passed, an identifier of the associated corresponding condition is added to the access request, so that when responding to the access request, the amount of data to be operated in the access request and the timestamp of the access request are recorded based on the added identifier, so that the operator can know the total amount of accumulated operation data of the corresponding scenario within the set time period, and then realize the differentiated statistics of different operation behaviors or different account categories involving a single user, and combine with the visual display method to enrich the usage statistics form in the object storage field.

[0038] In an example, if user A includes two storage accounts, namely storage account a1 and storage account a2, if it is determined that the access request is issued by storage account a1, then identifier a1 is added to the access request; if it is determined that the access request is issued by storage account a2, then identifier a2 is added to the access request; if identifier a1 is used as the query condition, the usage statistics of storage account a1 in user A within the set time period can be obtained; similarly, if identifier a2 is used as the query condition, the usage statistics of storage account a2 in user A within the set time period can be obtained.

[0039] In some implementations, the determination of whether an access request satisfies a preset condition may be performed based on a direct match, a fuzzy match, or a combined match.

[0040] Among them, the preset conditions formed in a direct matching manner may be:

[0041] {"remote_addr"="A address segment"}, where remote_addr is the client address carried in the access request. The preset condition is used to determine whether the client address is equal to the preset A address segment. If so, the access request is determined to meet the preset condition, otherwise it is determined not to meet the preset condition.

[0042] The preset conditions formed based on fuzzy matching (based on regular expressions) can be:

[0043] {"remote_addr" = "(?:(?:1[0-9][0-9]\.)|(?:2[0-4][0-9]\.)|(?:25[0-5]\.)| (?:[1-9][0-9]\.)|(?:[0-9]\.)){3}(?:(?:1[0-9][0-9])|(?:2[0-4][0-9])|(?:25[0-5])|(?:[1-9][0-9])|(?:[0-9]))"};

[0044] The regular expression in the preset condition indicates any address segment, that is, if the client address meets the format requirement of the address segment, it is determined that the access request meets the preset condition, otherwise it is determined that it does not meet the preset condition.

[0045] The preset condition formed based on the combined matching method can be understood as a composite rule formed by combining at least two judgment rules formed by direct matching / fuzzy matching methods through a logical operator.

[0046] For example, the preset condition may be: {"remote_addr"=["OR / AND / NOT", "A address segment / regular expression match", "B address segment / regular expression match"]}.

[0047] It should be pointed out that, since the access request is an Http request, the execution of step 101 does not involve changing the data format of the access request, that is, the application of the method disclosed in the present invention will neither cause changes to the access request initiation logic of the client, nor destroy the original request processing logic of the system access layer and the seven-layer load balancing gateway, and therefore it can be applied to any object storage system.

[0048] It should be noted that, if the access request fails to meet any one of the at least one preset condition, no identification is added to the access request, that is, the access request transmitted to the system access layer may not include an identification.

[0049] In one embodiment, the at least one preset condition includes at least one of the following:

[0050] The request initiation address of the access request is a first preset address;

[0051] The data storage address of the data to be operated in the access request is a second preset address;

[0052] The data storage type of the data to be operated in the access request is a preset type.

[0053] In this embodiment, a variety of optional preset conditions are provided to enrich the means of adding identifiers, making the application of the method described in the present disclosure more flexible.

[0054] Among them, by judging whether the request initiation address of the access request is the first preset address, the source of the access request can be determined, that is, the specific account or account group to which the access request belongs can be determined. For example, if the first preset address is the address of a set region, then the access requests originating from the set region and the access requests originating from a region other than the set region can be distinguished.

[0055] By determining whether the data storage address of the data to be operated in the access request is the second preset address, the target determination of the access request can be achieved. For example, if the second preset address is the set storage address, access requests pointing to the set storage address and the non-set storage address can be distinguished accordingly.

[0056] The preset types include a standard frequency storage type, a low frequency access storage type, and an archive storage type.

[0057] In one embodiment, when the number of the at least one preset condition is at least two, each of the preset conditions corresponds to a condition priority, and different preset conditions correspond to different condition priorities;

[0058] The step of determining whether the access request satisfies the target condition comprises:

[0059] Determine a condition determination sequence according to the condition priority corresponding to each of the preset conditions, wherein the higher the condition priority, the higher the order of the corresponding preset condition in the condition determination sequence;

[0060] Traversing the condition determination sequence in order, and determining whether the access request satisfies the preset condition corresponding to sequence number n, and if so, determining the preset condition corresponding to sequence number n as the target condition, and ending the traversal;

[0061] If not, continue to determine whether the access request satisfies the preset condition corresponding to sequence number n+1, where n is a positive integer less than or equal to the total number of conditions of the at least one preset condition.

[0062] It should be understood that there may be multiple first preset addresses / the second preset addresses / the preset types. In this case, different condition priorities are set for multiple preset conditions, and the multiple preset conditions are conditionally sorted and traversed based on the condition priorities of each preset condition, so as to avoid the situation where an access request carries two or more identifiers, thereby avoiding the problem of chaotic identifier management due to an access request carrying multiple identifiers.

[0063] It is further explained that for operators of object storage systems, as the number of customers continues to grow, the number of preset conditions generated for traffic statistics needs will increase. Since the above setting limits the maximum number of identifiers carried by an access request to one, when faced with complex identifier setting requirements, the above-mentioned combination matching condition setting method can be combined to meet the growing or complex identifier setting requirements while avoiding the problem of chaotic identifier management.

[0064] In one embodiment, after recording the amount of the data to be operated of the access request and the timestamp of the access request according to the target identifier to form target statistical data, the method further includes:

[0065] Receive external query requests;

[0066] Determining, according to a query period of the external query request, at least one target statistical data within the query period;

[0067] At least one target statistical data within the query period is returned to the receiving address of the external query request.

[0068] In this embodiment, an external query request of an external SDK may be received through a preset interface to support users or operators to conveniently obtain usage statistics of corresponding identifiers based on the aforementioned interface.

[0069] Specifically, the external query result returned in response to the external query request includes at least a request timestamp and a usage value, wherein the request timestamp can be understood as the aforementioned query period, and the usage value indicates the total usage value of at least one target statistical data within the query period;

[0070] Among them, the external query results can also include at least one of user name, user group, rule, and request type, wherein the user name indicates the user name corresponding to each target statistical data obtained by the query, the user group indicates the user group name corresponding to each target statistical data obtained by the query, the rule indicates the identifier corresponding to each target statistical data obtained by the query, and the request type indicates the operation type (upload / download) corresponding to each target statistical data obtained by the query.

[0071] In one embodiment, after recording the amount of the data to be operated of the access request and the timestamp of the access request according to the target identifier to form target statistical data, the method further includes:

[0072] Determine the sum of the data amounts of at least one of the target statistical data formed within a preset monitoring period as a parameter value of a target parameter, wherein the target parameter is a parameter associated with the target identifier;

[0073] When the parameter value of the target parameter is greater than or equal to a preset threshold value of the target parameter, alarm information indicating the target parameter is generated.

[0074] In this embodiment, the usage data and values ​​are periodically counted based on the above-mentioned identification, and when the usage data and values ​​counted within a preset detection period exceed a preset threshold, an alarm message is generated to remind the supervisor to take corresponding warning measures or usage restriction measures for the corresponding user.

[0075] In the application, a corresponding parameter can be set for each identifier to count the usage and value corresponding to each identifier respectively; a parameter can also be set based on multiple identifiers to comprehensively count the usage and values ​​of multiple identifiers corresponding to each parameter; the user dimension can also be introduced to uniquely determine a parameter in the form of user + identifier, the above parameters include the target parameters, and the above multiple identifiers include the target identifier.

[0076] It should be understood that the calculation of the parameter value of the target parameter can be implemented based on the aforementioned preset interface.

[0077] The aforementioned object storage system also includes a visualization layer / observation panel for aggregating multiple target statistical data into observable content, thereby enabling monitoring of usage information.

[0078] In one embodiment, the visual display of the target statistical data includes:

[0079] Acquire at least one of the target statistical data within a target period;

[0080] At least one of the target statistical data within the target time period is visually displayed.

[0081] In this embodiment, by visually displaying at least one of the target statistical data of the target time period, it is convenient for the user to observe the target statistical data.

[0082] Exemplarily, at least one of the target statistical data within the target time period can be displayed in the form of a line graph to illustrate the changing trend of at least one of the target statistical data within the target time period; or, at least one of the target statistical data within the target time period can be displayed in the form of a pie chart to illustrate the usage differences between different identifiers / the usage differences of the same identifier in different time periods.

[0083] It should be understood that the data used in the above-mentioned visualization display, in addition to target statistical data, may also include data obtained from statistics of access requests that do not carry identifiers.

[0084] In some implementations, the aforementioned multiple preset conditions may be stored in a persistent database, so that relevant personnel can complete hot updates of the multiple preset conditions.

[0085] For ease of understanding, the following examples are provided:

[0086] like Figure 2 As shown, the object storage system includes: a client, a seven-layer load balancing gateway, a system intervention layer, and a visualization layer (also called an observation panel).

[0087] Among them, the seven-layer load balancing gateway is used to capture the Http request header of the client's access request and obtain the client address (TCP Option Address) contained in the request header. If the client address hits a preset rule (i.e., the aforementioned preset condition), a new field X-Request-Rule (i.e., the aforementioned target identifier) ​​is added to the access request. It should be noted that when there are multiple preset rules, the new fields added by hitting different preset rules are different. Multiple preset rules are stored in a persistent database as key-value pairs, and multiple preset rules support hot update operations to avoid service or component restarts caused by updates to preset rules or corresponding fields.

[0088] For example, if a client address (66.249.xx.xx) hits the maintained matching address segment, the seven-layer load balancing gateway adds the rule field X-Request-Rule:rule1 to the request and forwards it to the system access layer.

[0089] Figure 3 The data structure of an Http request header is shown, which specifically includes a request line, a request header, and request data. When an access request hits a rule, a corresponding new field is added to the request header of the access request.

[0090] The system access layer is used to process actual business requests. After the Http request with the newly added fields is forwarded to this layer, the request is parsed to extract the bucket name and object name of the request operation, the request type (such as upload, download, delete, etc.) and the newly added "rule field" (that is, the aforementioned "new field"; the query usage allows users to filter using the "rule field" as one of the query conditions).

[0091] In addition, the system access layer also counts the size of the request body (by reading the content-length of the HTTP request header), that is, counts the specific usage of the access request operation.

[0092] At the same time, the system access layer also provides an interface for external SDKs to call to query usage information. The usage information must return timestamp-request (required), user name, user group, rule (that is, the aforementioned rule field), request type, and usage value (required).

[0093] The functions of the visualization layer / observation panel are described above and will not be repeated here.

[0094] It should be understood that the above method can provide data support for customized, differentiated, and scenario-based charging of object storage systems. It can not only distinguish between traffic billing and storage type billing (standard frequency, low frequency, archive, etc.), but also perform usage statistics for the same user in different business environments, and then implement a more refined billing model for users. For example, in object storage products in cloud service scenarios, if 90% of the access requests of the same user come from a set province, and 10% come from non-set provinces, differentiated pricing can be provided for the user, that is, a lower access fee will be charged for the user's access requests from the set province, and a relatively higher access fee will be charged for the user's access requests from non-set provinces.

[0095] For another example, for a large group or company with multiple business units or branches, there will be multiple accounts or account groups corresponding to the users of the large group or company, and each account or account group corresponds to a business unit or branch. At this time, based on the application of the aforementioned method, the account or account group to which the access request initiated by the user belongs is judged by preset conditions, and different identifiers are added to the access requests initiated by different accounts or account groups under the user. This allows the system intervention layer to distinguish and count the usage of different accounts or account groups under the user based on the added identifiers while responding to the access request, so that the operator of the object storage system can conduct a more in-depth analysis of the user's usage, and then promote or provide a more refined billing model or service model to meet the changing service needs of users and enhance the competitiveness of object storage products.

[0096] like Figure 4 As shown in the figure, in an example, if the client address is used for rule matching, then during the access request processing, the seven-layer load balancing gateway will collect the client address (TCP Option Address) of each access request, match the client address through the hot-updatable and easy-to-maintain rule list configured by the operation and maintenance personnel / user, and if the match is successful, a new field X-Request-Rule corresponding to the rule will be added to the corresponding access request, and the access request carrying the new field will continue to be transparently transmitted to the system access layer.

[0097] The system access layer adds the judgment of "matching conditions" when counting usage. In addition to the original usage statistics based on users, a new field X-Request-Rule is added for statistics. The usage statistics of a user or user group in a specified time period (optional) can be obtained by specifying this field, and an interface is provided for visualization tools to obtain data streams.

[0098] The observation panel adds a usage statistics module, which pulls data regularly (such as every 24 hours) through the interface exposed by the access layer, compares it with the last pull time point, and draws a line chart;

[0099] A pie chart is output for visual display of all users and user groups in the cluster. At the same time, an alarm threshold is designed. When the usage reaches 80% of the design value (the specific ratio can be adaptively adjusted), an alarm prompt is actively issued on the monitoring panel, and automatic monitoring is performed on the usage values ​​that require warning.

[0100] The above request processing settings based on preset rules and the addition of new fields can further meet the user's detailed needs for usage statistics in different scenarios, different operation modes, and different operation buckets on the basis of the usage statistics method based on the user dimension.

[0101] Among them, at the seven-layer load balancing gateway layer, fields in the request header are added according to the rules, which is easy to maintain and provides a hot update option to facilitate dynamic adjustments by operation and maintenance personnel, which can take effect in time. Since this layer does not directly perform request parsing, it will not affect the actual business processing performance, and there is no need to modify the client access logic. It is compatible with most data transmission protocols, such as the S3 protocol.

[0102] See also Figure 5 , Figure 5 is a usage statistics device provided by an embodiment of the present disclosure, such as Figure 5 As shown, the usage statistics device 500 includes:

[0103] An identifier adding module 501, configured to add a target identifier associated with the target condition to the access request when the access request satisfies a target condition, wherein the target condition is any one of at least one preset condition;

[0104] The recording module 502 is used to record the amount of data to be operated of the access request and the timestamp of the access request according to the target identifier to form target statistical data, and the target statistical data is used to count the total amount of data accumulated by the user in the scenario corresponding to the target condition within a set period of time;

[0105] The display module 503 is used to visually display the target statistical data.

[0106] In one embodiment, the at least one preset condition includes at least one of the following:

[0107] The request initiation address of the access request is a first preset address;

[0108] The data storage address of the data to be operated in the access request is a second preset address;

[0109] The data storage type of the data to be operated in the access request is a preset type.

[0110] In one embodiment, when the number of the at least one preset condition is at least two, each of the preset conditions corresponds to a condition priority, and different preset conditions correspond to different condition priorities;

[0111] The identification adding module 501 includes:

[0112] A sequence determination unit, configured to determine a condition determination sequence according to a condition priority corresponding to each of the preset conditions, wherein the higher the condition priority, the higher the order of the corresponding preset condition in the condition determination sequence;

[0113] A sequence traversal unit is used to traverse the condition determination sequence in order and determine whether the access request satisfies the preset condition corresponding to sequence number n. If so, the preset condition corresponding to sequence number n is determined as the target condition and the traversal is terminated; if not, the access request continues to be determined whether it satisfies the preset condition corresponding to sequence number n+1, where n is a positive integer less than or equal to the total number of conditions of at least one preset condition.

[0114] In one embodiment, the apparatus 500 further includes an external query module, and the external query module is used to:

[0115] Receive external query requests;

[0116] Determining, according to a query period of the external query request, at least one target statistical data within the query period;

[0117] At least one target statistical data within the query period is returned to the receiving address of the external query request.

[0118] In one embodiment, the apparatus 500 further includes an alarm module, and the alarm module is used to:

[0119] Determine the sum of the data amounts of at least one of the target statistical data formed within a preset monitoring period as a parameter value of a target parameter, wherein the target parameter is a parameter associated with the target identifier;

[0120] When the parameter value of the target parameter is greater than or equal to a preset threshold value of the target parameter, alarm information indicating the target parameter is generated.

[0121] In one embodiment, the display module 503 is specifically used to:

[0122] Acquire at least one of the target statistical data within a target period;

[0123] At least one of the target statistical data within the target time period is visually displayed.

[0124] The usage statistics device 500 provided in the embodiment of the present disclosure can implement each process in the above-mentioned usage statistics method embodiment, and will not be described again here to avoid repetition.

[0125] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0126] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0127] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0128] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0129] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the usage statistics method. For example, in some embodiments, the usage statistics method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the usage statistics method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the usage statistics method in any other appropriate manner (eg, by means of firmware).

[0130] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0131] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0132] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0133] As used herein, the term "machine-readable medium" refers to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0134] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0135] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0136] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0137] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 or Figure 4The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0138] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0139] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for statistical usage. It is characterized in that The method comprises: In the case where the access request satisfies a target condition, adding a target identifier associated with the target condition to the access request, wherein the target condition is any one of at least one preset condition; According to the target identifier, the data volume of the data to be operated of the access request and the timestamp of the access request are recorded to form target statistical data, wherein the target statistical data is used to count the total data volume of the accumulated operation data of the user in the scenario corresponding to the target condition within a set time period, wherein the data volume of the data to be operated of the access request is specifically: the data volume of the download data requested by the access request, or the data volume of the upload data requested by the access request; Visually display the target statistical data; The at least one preset condition includes at least one of the following: The request initiation address of the access request is a first preset address; The data storage address of the data to be operated in the access request is a second preset address; The data storage type of the data to be operated in the access request is a preset type; When the number of the at least one preset condition is at least two, each of the preset conditions corresponds to a condition priority, and different preset conditions correspond to different condition priorities; The step of determining whether the access request satisfies the target condition comprises: Determine a condition determination sequence according to the condition priority corresponding to each of the preset conditions, wherein the higher the condition priority, the higher the order of the corresponding preset condition in the condition determination sequence; Traversing the condition determination sequence in order, and determining whether the access request satisfies the preset condition corresponding to sequence number n, and if so, determining the preset condition corresponding to sequence number n as the target condition, and ending the traversal; If not, continue to determine whether the access request satisfies the preset condition corresponding to sequence number n+1, where n is a positive integer less than or equal to the total number of conditions of the at least one preset condition.

2. The method according to claim 1, It is characterized in that After recording the amount of the data to be operated of the access request and the timestamp of the access request according to the target identifier to form target statistical data, the method further includes: Receive external query requests; Determining, according to a query period of the external query request, at least one target statistical data within the query period; At least one target statistical data within the query period is returned to the receiving address of the external query request.

3. The method according to claim 1, It is characterized in that After recording the amount of the data to be operated of the access request and the timestamp of the access request according to the target identifier to form target statistical data, the method further includes: Determine the sum of the data amounts of at least one of the target statistical data formed within a preset monitoring period as a parameter value of a target parameter, wherein the target parameter is a parameter associated with the target identifier; When the parameter value of the target parameter is greater than or equal to a preset threshold value of the target parameter, alarm information indicating the target parameter is generated.

4. The method according to claim 1, It is characterized in that The visual display of the target statistical data includes: Acquire at least one of the target statistical data within a target period; At least one of the target statistical data within the target time period is visually displayed.

5. A usage statistics device, It is characterized in that The device comprises: an identifier adding module, configured to add a target identifier associated with the target condition to the access request when the access request satisfies the target condition, wherein the target condition is any one of at least one preset condition; a recording module, configured to record, according to the target identifier, the amount of data to be operated of the access request and the timestamp of the access request to form target statistical data, wherein the target statistical data is used to count the total amount of data accumulated by the user in the scenario corresponding to the target condition within a set period of time, wherein the amount of data to be operated of the access request is specifically: the amount of data requested to be downloaded by the access request, or the amount of data requested to be uploaded by the access request; A display module, used for visually displaying the target statistical data; The at least one preset condition includes at least one of the following: The request initiation address of the access request is a first preset address; The data storage address of the data to be operated in the access request is a second preset address; The data storage type of the data to be operated in the access request is a preset type; When the number of the at least one preset condition is at least two, each of the preset conditions corresponds to a condition priority, and different preset conditions correspond to different condition priorities; The identification adding module includes: A sequence determination unit, configured to determine a condition determination sequence according to a condition priority corresponding to each of the preset conditions, wherein the higher the condition priority, the higher the order of the corresponding preset condition in the condition determination sequence; A sequence traversal unit is used to traverse the condition determination sequence in order and determine whether the access request satisfies the preset condition corresponding to sequence number n. If so, the preset condition corresponding to sequence number n is determined as the target condition and the traversal is terminated; if not, the access request continues to be determined whether it satisfies the preset condition corresponding to sequence number n+1, where n is a positive integer less than or equal to the total number of conditions of at least one preset condition.

6. An electronic device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 4 when executed by the processor.

7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

8. A computer program product, It is characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 4.