Resource bundle consumption processing method, system, equipment, medium and product
By pre-aggregating the original usage data and putting it into the message queue, the problem of data processing delay in the prior art is solved, real-time reflection of resource package usage and rapid response to business processing is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411796652.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-05-13
AI Technical Summary
In the prior art, the batch interval of data processing is long and the performance is poor, and it cannot reflect the use of resource packages in real time, resulting in delays in business processing and customers cannot obtain deduction information in time.
By obtaining the original usage data for pre-aggregation and putting it into the message queue, the user usage data is obtained in real time, resource package deductions are performed based on the real-time data, and resource package usage is reflected in real time.
This improves the data processing speed, enables the message receiver to obtain the user's usage data in real time, quickly reflects the use of resource packages, further speeds up the business processing speed, and improves the user experience.
Smart Images

Figure CN119991201A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of billing, and in particular to a resource package usage processing method, system, equipment, medium and product. Background Art
[0002] In the related technology, the underlying interface or offline file is used to obtain the customer's usage, and the customer's usage is used to deduct the resource package. If the resource package is exhausted, the function shutdown and pay-as-you-go billing are triggered. However, the data processing batch interval of the above method is long, the performance is poor, and it cannot reflect the resource package usage in real time, resulting in business processing delays and customers cannot obtain deduction information in time. Summary of the invention
[0003] In view of this, the present invention provides a resource package usage processing method, system, device, medium and product to solve technical problems in related technologies such as long data processing batch intervals, poor performance, inability to reflect resource package usage in real time, resulting in business processing delays, and customers being unable to obtain deduction information in a timely manner.
[0004] In a first aspect, the present invention provides a method for processing resource package usage, the method comprising:
[0005] Obtain the original usage data of target users;
[0006] Pre-aggregating the original usage data to obtain usage data of target users;
[0007] Put the usage data of the target user into the message queue, and obtain the usage data of the target user in the message queue;
[0008] Obtain resource package subscription information of a target user, and query whether a resource package is available for the target user based on the resource package subscription information;
[0009] When the target user has an available resource package, obtain the remaining usage of the available resource package and calculate the deductible usage based on the usage data of the target user;
[0010] According to the deductible usage, the remaining usage is updated to obtain the updated remaining usage; and according to the deductible usage and the usage data of the target user, the deducted usage and the used usage in the usage record table of the current day are updated respectively;
[0011] Update the resource package deduction details table based on the deductible usage, deduction time, and updated remaining usage.
[0012] In an optional implementation, before putting the usage data of the target user into the message queue, the method further includes:
[0013] Obtain abnormal usage data of target users;
[0014] Resets abnormal usage data to negative numbers.
[0015] In an optional implementation, the usage record table is associated with the resource package deduction detail table through a primary key;
[0016] After obtaining the usage data of the target user in the message queue, the method further includes:
[0017] When the usage data of the target user is negative, obtain the usage record table of the corresponding day according to the time period corresponding to the usage data;
[0018] Obtain the resource package deduction details table based on the usage record table of the corresponding day, and add the deducted usage corresponding to the corresponding time period in the resource package deduction details table to the remaining usage of the target user.
[0019] In an optional implementation, the updating of the deducted usage and the used usage in the usage record table of the current day according to the deductible usage and the usage data of the target user respectively includes:
[0020] When there is no deducted usage and used usage in the usage record table for the current day, the deductible usage is added to the deducted usage, and the usage data of the target user is added to the used usage;
[0021] When the usage record table for the current day contains deducted usage and used usage, the deductible usage is added to the deducted usage, and the usage data of the target user is added to the used usage.
[0022] In an optional implementation, after updating the resource package deduction details table according to the deductible usage, the deduction time, and the updated remaining usage, the method further includes:
[0023] When the updated remaining usage reaches the set threshold, a message reminder is sent to the target user, and / or the service function of the target user is shut down, and / or the target user is charged on a usage-based basis.
[0024] In a second aspect, the present invention provides a resource package usage processing system, the system comprising:
[0025] The original usage data acquisition module is used to obtain the original usage data of the target user;
[0026] A data preprocessing module, used to perform pre-aggregation processing on the original usage data to obtain usage data of target users;
[0027] The usage data sending and receiving module is used to put the usage data of the target user into the message queue and obtain the usage data of the target user in the message queue;
[0028] An available resource package query module is used to obtain the resource package subscription information of the target user, and query whether the target user has an available resource package according to the resource package subscription information;
[0029] A deductible usage calculation module is used to obtain the remaining usage of the available resource package when the target user has an available resource package, and calculate the deductible usage based on the usage data of the target user;
[0030] The first updating module is used to update the remaining usage according to the deductible usage to obtain the updated remaining usage; and to update the deducted usage and the used usage in the usage record table of the current day according to the deductible usage and the usage data of the target user;
[0031] The second updating module is used to update the resource package deduction details table according to the deductible usage, deduction time and the updated remaining usage.
[0032] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0033] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0034] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0035] The embodiment of the present invention pre-aggregates the acquired original usage data and puts it into a message queue, which not only improves the data processing speed, but also enables the message recipient to obtain the user's usage data in real time, and deduct resource packages based on the usage data obtained in real time, thereby reflecting the resource package usage in real time, further accelerating the business processing speed and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 is a flow chart of a method for processing resource package usage according to an embodiment of the present invention;
[0038] Figure 2 is a structural block diagram of a resource package usage processing system according to an embodiment of the present invention;
[0039] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0041] An embodiment of the present invention provides a method for processing resource package usage. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0042] Figure 1 FIG. 1 is a flow chart of a method for processing resource package usage according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0043] Step S101, obtaining the original usage data of the target user.
[0044] In step S101, the original usage data of the target user is obtained using the underlying interface or offline file. The original usage data may be the usage data of the target user recorded in units of every second or every minute, or may be the usage data of the target user recorded once every time interval of 5 seconds, 10 seconds, 3 minutes, or 5 minutes. The time interval may be set according to specific actual business needs and is not specifically limited here.
[0045] As an example, the original usage data of the target user is shown in Table 1.
[0046] Table 1
[0047] Data time Usage(KB) 2023-04-01 00:00:00 100 2023-04-01 00:00:10 200 2023-04-01 00:00:20 300 …… 0 2023-04-01 00:05:00 0
[0048] The usage data records the data time and the original usage data corresponding to each data time. The data time is accurate to seconds.
[0049] Step S102: pre-aggregate the original usage data to obtain usage data of the target user.
[0050] In step S102, the original usage data may be pre-aggregated to improve data processing speed. When the usage data of the target user exceeds the remaining usage of the available resource package and needs to be charged on a per-capacity basis, the amount of data for charging may be greatly reduced.
[0051] In an optional implementation, the pre-aggregation processing is implemented based on spark streaming.
[0052] Among them, Spark Streaming is a real-time computing framework based on big data streams. It is used to process large-scale streaming data, supports real-time data processing, and is easy to use and integrate.
[0053] Continuing with the example, spark streaming is used to pre-aggregate the original usage data of the target users in Table 1 at a 5-minute granularity. The results are shown in Table 2.
[0054] Table 2
[0055] Data time Usage(KB) 2023-04-01 00:05:00 600
[0056] Among them, by integrating the traffic data within a 5-minute time period, 600KB of usage data of the current integrated target user can be obtained.
[0057] Step S103: putting the usage data of the target user into the message queue, and obtaining the usage data of the target user in the message queue.
[0058] In step S103, the message queue allows different processes to transfer and share data by sending and receiving messages (inter-process communication mechanism), which makes data exchange faster and more efficient. When the usage data of the target user is put into the message queue, the usage data in the message queue can be obtained in real time, shortening the interval between data processing batches. In addition, when the usage data processed by pre-aggregation is sent to the message queue, it can be returned immediately without waiting for the response of the recipient (asynchronous communication mechanism), which greatly improves the efficiency of communication.
[0059] In some optional implementations, the message queue functionality is implemented based on Apache Kafka (distributed stream processing platform).
[0060] Apache Kafka is an open source stream processing platform, a high-throughput distributed publish-subscribe messaging system that is mainly used to process all action stream data on websites, such as web browsing, search, and other user behaviors. These data are usually solved by processing logs and log aggregation due to throughput requirements. The purpose of Apache Kafka is to unify online and offline message processing through a parallel loading mechanism and provide real-time message processing through clusters.
[0061] Step S104, obtaining resource package subscription information of the target user, and querying whether the target user has an available resource package according to the resource package subscription information;
[0062] In step S104, the resource package subscription information of the target user is obtained, and the available resource packages of the target user can be known according to the resource package subscription information. The resource package subscription information includes: the ID corresponding to the resource package, the effective time and the expiration time, and the remaining usage.
[0063] Among them, resource packages whose remaining usage is not 0 are available resource packages.
[0064] As an example, the resource package ordering information is shown in Table 3.
[0065] Table 3
[0066] Resource ID Effective time Expiration time Remaining capacity (KB) res1 2023-03-01 00:00:00 2023-05-01 00:00:00 1000
[0067] Step S105, when the target user has an available resource package, obtain the remaining usage of the available resource package, and calculate the deductible usage according to the usage data of the target user.
[0068] In step S105, when it is found that the target user has an available resource package, the remaining usage corresponding to the available resource package is obtained from the resource package ordering information, and then the deductible usage is calculated based on the obtained usage data of the target user.
[0069] As an example, if the usage data of the target user obtained is 300KB and the current remaining usage is 1000KB, then all 300KB can be deducted, and the deductible usage is 300KB.
[0070] As an example, if the usage data of the target user obtained is 600KB and the current remaining usage is 500KB, then only 500KB of the 600KB can be deducted, and the deductible usage is 500KB.
[0071] It should be noted that when there are multiple available resource packages, priority will be given to the available resource package that expires first and has the least remaining usage.
[0072] Step S106, updating the remaining usage according to the deductible usage to obtain the updated remaining usage; and updating the deducted usage and used usage in the usage record table of the current day according to the deductible usage and the usage data of the target user.
[0073] In step S106, the usage record table is recorded in units of days, including the recorded time (date), deducted usage and used usage.
[0074] In some optional implementations, based on the deductible usage and the usage data of the target user, respectively updating the deducted usage and the used usage in the usage record table of the current day includes:
[0075] When there is no deducted usage and used usage in the usage record table for the current day, the deductible usage is added to the deducted usage, and the usage data of the target user is added to the used usage.
[0076] When the usage record table for the current day contains deducted usage and used usage, the deductible usage is added to the deducted usage, and the usage data of the target user is added to the used usage.
[0077] As an example, if the usage data of the target user is 300KB and the current remaining usage is 1000KB, then all 300KB can be deducted, and the deductible usage is 300KB. At this time, according to the deductible usage of 300KB, the remaining capacity is updated to 1000KB, and the updated remaining capacity is 700KB.
[0078] Continuing with the example, assuming that there is no deducted usage and used usage in the usage record table for the current day, then add the deductible usage of 300KB to the deducted usage, and add the usage data of the target user of 300KB to the used usage. At this time, the deducted usage and used usage are both 300KB. Assuming that the deducted usage in the usage record table for the current day is 500KB and the used usage is 500KB, then add the deductible usage of 300KB to the deducted usage, and add the usage data of the target user of 300KB to the used usage. At this time, the deducted usage and used usage are both 800KB.
[0079] Step S107, updating the resource package deduction details table according to the deductible usage, deduction time and updated remaining usage.
[0080] In step S107, the resource package deduction details table includes the id of the resource package, the deduction time, the deductible usage and the remaining usage, wherein the deduction time is accurate to seconds.
[0081] In some optional implementations, since the resource package deduction details table has a large amount of data, it can be stored in a MySql database or a CK database according to the business volume to meet the business performance requirements.
[0082] The embodiment of the present invention pre-aggregates the acquired original usage data and puts it into a message queue, which not only improves the data processing speed, but also enables the message recipient to obtain the user's usage data in real time, and deduct resource packages based on the usage data obtained in real time, thereby reflecting the resource package usage in real time, further accelerating the business processing speed and improving the user experience.
[0083] In some optional implementations, after updating the resource package deduction details table according to the deductible usage, deduction time, and the updated remaining usage, the resource package usage processing method further includes:
[0084] When the updated remaining usage reaches the set threshold, a message reminder is sent to the target user, and / or the service function of the target user is shut down, and / or the target user is charged on a usage-based basis.
[0085] The threshold value may be set to 0, or to 10%-20% of the total capacity of the corresponding resource package, or may be set according to actual needs.
[0086] As an example, when the remaining usage after update is 0, that is, the resource package is exhausted, the signal control action is triggered, that is, a message reminder is sent to the target user that the resource package has been exhausted, the business function has been shut down, and the usage has been converted to pay-as-you-go billing. At the same time, the business function of the target user is shut down and the usage is converted to pay-as-you-go billing.
[0087] As an example, when the remaining usage after update is 10% of the total capacity of the resource package, that is, the resource package is about to be exhausted, the signal control action is triggered, that is, a message reminder is sent to the target user that the resource package is about to be exhausted, the business function is about to be shut down, and the usage is about to be converted to pay-as-you-go billing.
[0088] In some optional implementations, before putting the usage data of the target user into the message queue, the resource package usage processing method further includes:
[0089] Obtain abnormal usage data of target users;
[0090] Resets abnormal usage data to negative numbers.
[0091] In some optional implementations, the usage record table is associated with the resource package deduction details table through a primary key.
[0092] After obtaining the usage data of the target user in the message queue, the resource package usage processing method further includes:
[0093] When the usage data of the target user is negative, obtain the usage record table of the corresponding day according to the time period corresponding to the usage data;
[0094] Obtain the resource package deduction details table based on the usage record table of the corresponding day, and add the deductible usage corresponding to the corresponding time period in the resource package deduction details table to the remaining usage of the target user;
[0095] Specifically, the usage record table is associated with the resource package deduction detail table through a primary key, wherein both the usage record table and the resource package deduction detail table include the same primary key value.
[0096] As an example, the usage record table is shown in Table 4.
[0097] Table 4
[0098] Primary Key time Used Amount(KB) Deducted Usage(KB) 1 2023-04-01 600 600
[0099] As an example, the resource package deduction details table is shown in Table 5.
[0100] Table 5
[0101] Usage record table primary key Resource bundle id Data time Deductible usage (KB) Remaining amount (KB) 1 res1 2023-04-01 00:05:00 600 400
[0102] In the related art, when the original log data corresponding to a certain time period is abnormal, directly reducing the abnormal usage may cause customers to be charged twice or even cause user complaints.
[0103] The embodiment of the present invention uses a correction method to correct the user's abnormal usage data to 0, and reprocesses the customer's correct usage, which can avoid repeated billing of the customer.
[0104] As an example, suppose that due to a problem with the original data, the user's usage data for this time period is 600KB (abnormal usage data), and the actual accurate usage data is 300KB. The reversal and repair process is as follows:
[0105] Step a: Get the abnormal usage data of the target user, which is 600KB.
[0106] Step b: reset the abnormal usage data to a negative number. At this time, the abnormal usage data is -600KB, as shown in Table 6.
[0107] Table 6
[0108] Data time Usage(KB) 2023-04-01 00:05:00 -600
[0109] Step c: When the usage data of the target user is determined to be negative, the usage record table of the corresponding day 2023-04-01 is searched according to the time period 2023-04-01 00:05:00 corresponding to the abnormal usage data, as shown in Table 7.
[0110] Table 7
[0111] Primary Key time Used Amount(KB) Deducted amount (KB) 1 2023-04-01 600 600
[0112] Step d: Obtain the resource package deduction details table through the primary key according to the usage record table of the corresponding day 2023-04-01, as shown in Table 8.
[0113] Table 8
[0114] Usage record primary key Resource bundle id Data time Deductible usage (KB) Remaining capacity (KB) 1 res1 2023-04-01 00:05:00 600 400
[0115] Step e: add the deductible usage of 600KB corresponding to the corresponding time period 2023-04-01 00:05:00 in the resource package deduction details table to the remaining usage of the target user.
[0116] Among them, replenishing the remaining usage of the target user means adding 600KB to the remaining usage in the resource package ordering information, and updating the usage record table of 2023-04-01 and the resource package deduction details table of 2023-04-01 00:05:00 accordingly.
[0117] Assume that the remaining usage in the resource package ordering information before the replenishment is 400KB, and the remaining usage is updated to 1000KB after the replenishment, as shown in Table 9.
[0118] Table 9
[0119] Resource ID Effective time Expiration time Remaining capacity (KB) res1 2023-03-01 00:00:00 2023-05-01 00:00:00 1000
[0120] Step f: Finally, transmit 300KB of the correct user's usage data, and follow the aforementioned resource package usage processing flow to complete the final repair of the user's usage.
[0121] In this embodiment, a resource package usage processing system is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0122] The embodiment of the present invention provides a resource package usage processing system, such as Figure 2 As shown, including:
[0123] The original usage data acquisition module 201 is used to acquire the original usage data of the target user.
[0124] The data pre-processing module 202 is used to perform pre-aggregation processing on the original usage data to obtain the usage data of the target user.
[0125] The usage data sending and receiving module 203 is used to put the usage data of the target user into the message queue, and obtain the usage data of the target user in the message queue.
[0126] The available resource package query module 204 is used to obtain the resource package subscription information of the target user, and query whether the target user has an available resource package according to the resource package subscription information.
[0127] The deductible usage calculation module 205 is used to obtain the remaining usage of the available resource package when the target user has an available resource package, and calculate the deductible usage according to the usage data of the target user.
[0128] The first updating module 206 is used to update the remaining usage according to the deductible usage to obtain the updated remaining usage; and to update the deducted usage and used usage in the usage record table of the current day according to the deductible usage and the usage data of the target user.
[0129] The second updating module 207 is used to update the resource package deduction details table according to the deductible usage, deduction time and the updated remaining usage.
[0130] In some optional implementations, the resource package usage processing system further includes:
[0131] The abnormal usage data processing module 208 is used to obtain the abnormal usage data of the target user and reset the abnormal usage data to a negative number.
[0132] In some optional implementations, the usage record table is associated with the resource package deduction details table through a primary key.
[0133] The resource package usage processing system also includes a correct usage search module 209 .
[0134] The correct dosage search module 209 further includes:
[0135] The usage record checking unit 2091 is used to obtain a usage record table of a corresponding day according to a time period corresponding to the usage data when the usage data of the target user is a negative number.
[0136] The usage reversal unit 2092 is used to obtain the resource package deduction details table according to the usage record table of the corresponding day, and return the deducted usage corresponding to the corresponding time period in the resource package deduction details table to the remaining usage of the target user.
[0137] In some optional implementations, the deductible usage calculation module 205 further includes:
[0138] The adding unit 2051 is used to add the deductible usage to the deducted usage and to add the usage data of the target user to the used usage when there is no deducted usage and used usage in the usage record table of the current day.
[0139] The accumulation unit 2052 is used to accumulate the deductible usage to the deducted usage and accumulate the usage data of the target user to the used usage when there is deducted usage and used usage in the usage record table of the current day.
[0140] In some optional implementations, the resource package usage processing system further includes:
[0141] The signal control module 210 is used to send a message reminder to the target user, and / or shut down the service function of the target user, and / or charge the target user on a usage-based basis when the updated remaining usage reaches a set threshold.
[0142] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0143] A resource package usage processing system in an embodiment of the present invention is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0144] The embodiment of the present invention also provides a computer device having the above Figure 2 The resource package usage processing system shown.
[0145] See also Figure 3 , the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.
[0146] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0147] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0148] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0149] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0150] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0151] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0152] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0153] A portion of the embodiments of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in a computer-readable medium includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which the computer program instructions are executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0154] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A resource package usage processing method, characterized in that: The method comprises: Obtain the original usage data of target users; Pre-aggregating the original usage data to obtain usage data of target users; Put the usage data of the target user into the message queue, and obtain the usage data of the target user in the message queue; Obtain resource package subscription information of a target user, and query whether a resource package is available for the target user based on the resource package subscription information; When the target user has an available resource package, obtain the remaining usage of the available resource package and calculate the deductible usage based on the usage data of the target user; According to the deductible usage, the remaining usage is updated to obtain the updated remaining usage; and according to the deductible usage and the usage data of the target user, the deducted usage and the used usage in the usage record table of the current day are updated respectively; Update the resource package deduction details table based on the deductible usage, deduction time, and updated remaining usage.
2. The method according to claim 1, characterized in that Before putting the usage data of the target user into the message queue, the method further includes: Obtain abnormal usage data of target users; Resets abnormal usage data to negative numbers.
3. The method according to claim 2, characterized in that The usage record table is associated with the resource package deduction detail table through a primary key; After obtaining the usage data of the target user in the message queue, the method further includes: When the usage data of the target user is negative, obtain the usage record table of the corresponding day according to the time period corresponding to the usage data; Obtain the resource package deduction details table based on the usage record table of the corresponding day, and add the deducted usage corresponding to the corresponding time period in the resource package deduction details table to the remaining usage of the target user.
4. The method according to claim 1, characterized in that The method of updating the deductible usage and the used usage in the usage record table of the current day according to the deductible usage and the usage data of the target user includes: When there is no deducted usage and used usage in the usage record table for the current day, the deductible usage is added to the deducted usage, and the usage data of the target user is added to the used usage; When the usage record table for the current day contains deducted usage and used usage, the deductible usage is added to the deducted usage, and the usage data of the target user is added to the used usage.
5. The method according to claim 4, characterized in that After updating the resource package deduction details table according to the deductible usage, the deduction time, and the updated remaining usage, the method further includes: When the updated remaining usage reaches the set threshold, a message reminder is sent to the target user, and / or the service function of the target user is shut down, and / or the target user is charged on a usage-based basis.
6. A resource package usage processing system, characterized in that: The system comprises: The original usage data acquisition module is used to obtain the original usage data of the target user; A data preprocessing module, used to perform pre-aggregation processing on the original usage data to obtain usage data of target users; The usage data sending and receiving module is used to put the usage data of the target user into the message queue and obtain the usage data of the target user in the message queue; An available resource package query module is used to obtain the resource package subscription information of the target user, and query whether the target user has an available resource package according to the resource package subscription information; A deductible usage calculation module is used to obtain the remaining usage of the available resource package when the target user has an available resource package, and calculate the deductible usage based on the usage data of the target user; The first updating module is used to update the remaining usage according to the deductible usage to obtain the updated remaining usage; and to update the deducted usage and the used usage in the usage record table of the current day according to the deductible usage and the usage data of the target user; The second updating module is used to update the resource package deduction details table according to the deductible usage, deduction time and the updated remaining usage.
7. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 5 by executing the computer instructions.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.
9. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 5.