Flow rate pre-sending method, system, device and medium

By generating multi-cycle ledger data at the moment of user behavior and using compression technology and reinforcement learning model, the resource exhaustion problem caused by concentrated ledger generation pressure is solved, and the optimization of optimized scheduling and resource utilization of ledger is achieved, which is suitable for large-scale bill distribution systems.

CN120378238AActive Publication Date: 2025-07-25GUANGDONG LEGEND COMM CO LTD

Patent Information

Application Number
CN202510839985.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-07-25
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

At the beginning of the accounting period, the existing communications operation system lacks optimization solutions due to the complex logic of the ledger generation and diverse field structure, resulting in sudden TPS, exhaustion of IO and bandwidth resources, user bill delay and high system horizontal scaling costs.

Method used

By obtaining user package selection action instructions, generating preset period ledger data and compressing it, using reinforcement learning model to dynamically adjust the number of pre-issuance cycles, combining compression templates and differential coding technology, time-sharing activation and resource optimization of ledger data are achieved.

Benefits of technology

Without affecting the accuracy of the bookkeeping period, it significantly reduces the system's dependence on peak resources, reduces redundant expansion, and improves system stability and cost efficiency. It is suitable for high-concurrent bookkeeping systems for operators, virtual business platforms and Internet of Things platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378238A_ABST
    Figure CN120378238A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic charge pre-sending method, system, device and medium, and relates to the communication field, the method comprises the following steps: obtaining a package selection action instruction of a user, the package selection action instruction comprising a package ordering action instruction and a package replacement action instruction; account book data of a preset period is generated based on the package selection action instruction, and the preset period is determined based on a pre-sending return rate; compressing the account book data of the preset period to generate compressed account book data; and after reaching a charging period, decompressing the compressed account book data to activate the account book data. On the premise that the account period accuracy and the user perception are not affected, optimization scheduling of large-scale account book issuing behaviors is achieved, the method is suitable for high-concurrency account period systems such as an operator, a virtual business platform and an Internet of Things platform, and the method has high engineering practicability and popularization value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of communications. More specifically, the present invention relates to a method, system, device, and medium for pre-distributing traffic charges and fees. Background Art

[0002] In the existing communication operation system, ledger distribution, as one of the core business support processes, mainly undertakes the task of distributing account details such as package usage records, fee information, and billing rules to users. Especially in the mobile communication platform, with the wide deployment of virtual operators, Internet of Things number segments, and diverse traffic packages, the platform often needs to support the generation and distribution operations of ledgers for tens of millions or even hundreds of millions of SIM cards simultaneously.

[0003] Traditional ledger systems usually adopt a periodic centralized generation mechanism, that is, at the beginning of each natural month or the start of the billing cycle, ledger data is batch-generated for all active users uniformly, and is synchronously pushed through distribution channels (such as SMS push, APP notification, bill interface). Due to the complex ledger generation logic, diverse field structures, and the dependence of the distribution process on storage I / O and network transmission resources, within this centralized time window of "the start of the billing period", the system is prone to problems such as sudden increase in TPS (Transactions Per Second), exhaustion of I / O and bandwidth resources, delay in user bills, or high cost of system horizontal expansion.

[0004] In view of the above problems, there is currently a lack of an optimized ledger distribution solution that can balance the accuracy of the billing period, elastic utilization of resources, and system operation stability. Therefore, there is an urgent need for a method, system, device, and medium for pre-distributing traffic charges and fees to at least solve some of the above problems. Summary of the Invention

[0005] A series of simplified concepts are introduced in the Summary of the Invention section, which will be further elaborated in the Detailed Description section. The Summary of the Invention section of the present invention does not mean to attempt to define the key features and essential technical features of the claimed technical solution, nor does it mean to attempt to determine the protection scope of the claimed technical solution.

[0006] In a first aspect, the present invention proposes a method for pre-distributing traffic charges and fees, the method comprising: Obtaining a user's package selection action instruction, wherein the package selection action instruction includes a package subscription action instruction and a package replacement action instruction; Generating ledger data for a preset period based on the package selection action instruction, wherein the preset period is determined based on the pre-distribution rate of return; Performing compression processing on the ledger data for the preset period to generate compressed ledger data; After the billing cycle arrives, decompressing the compressed ledger data to activate the ledger data.

[0007] In a feasible implementation, the above method further includes: Obtain the resource release benefits brought by the decrease in the number of transactions per second and the storage costs increased by the pre-issued ledger; Calculate the pre-issued boundary rate of return of the ledger according to the above resource release benefits and the above storage costs; Adjust the above preset period according to the above pre-issued boundary rate of return.

[0008] In a feasible implementation, the above adjusting the above preset period according to the above pre-issued boundary rate of return includes: Construct an input feature vector including the pre-issued rate of return, the resource pressure state, the package subscription behavior, and the user change probability; Input the above input feature vector into a pre-trained reinforcement learning model, with the maximum pre-issued boundary rate of return as the goal, to obtain the above preset period.

[0009] In a feasible implementation, the construction process of the above reinforcement learning model includes: Define the state space and construct a state vector St for characterizing the operating state of the ledger system; Define the action space and discretize the number of pre-issued ledger periods N into an action set; Construct a reward function according to the revenue incentive and cost penalty; Construct a policy network and a value network, where the above policy network is used to output the selection probability of each number of pre-issued ledger periods, and the above value network is used to estimate the long-term expected revenue of the current state; Use generalized advantage estimation to calculate the advantage value of each state, and adopt the clipped policy optimization algorithm to synchronously optimize the above policy network and the above value network to obtain the above reinforcement learning model.

[0010] In a feasible implementation, the above compressing the ledger data of the above preset period to generate compressed ledger data includes: Construct a general ledger field set based on the ledger structure as a compression template; For each ledger period, record the difference content and period offset relative to the template field value; Combine and encode the above compression template, the above difference content, and the above period offset through an incremental coding compression algorithm to generate the above compressed ledger data.

[0011] In a feasible implementation, the above decompressing the above compressed ledger data to activate the above ledger data after reaching the billing period includes: Obtain the above compression template and the above period offset in the above compressed ledger data; Restore the general ledger structure based on the field template; Perform field replacement and completion according to the above differences to generate ledger instance data for the target period; Activate the above ledger instance data for performing the billing service and the user bill push process.

[0012] In a feasible implementation manner, constructing the above general ledger field set as a compression template based on the ledger structure includes: Obtain a ledger sample set, where the above ledger sample set includes ledger data for multiple preset periods, the above ledger data has a unified structure, and the above ledger data records the package name, package tariff, billing period, and data quota; Perform a field extraction operation on the above ledger data in the above ledger sample set to obtain an initial field set, where the above initial field set includes the field name, field value type, and its occurrence frequency in the ledger sample set for each ledger; Perform a field consistency analysis operation based on the above initial field set to determine the field set that exists simultaneously in all ledger data as the first candidate field set; Perform a value stability evaluation operation on each field in the above first candidate field set, and count the value change frequency of the above field across periods in the ledger sample set. If the value of a certain field remains consistent in most ledgers, mark the field as a static field; Generate a ledger field template based on the above static fields to generate the above reusable compression template.

[0013] In a second aspect, the present invention proposes a traffic tariff pre-issuance system, including: An acquisition unit for acquiring an instruction of a user's package selection action, where the above package selection action instruction includes a package subscription action instruction and a package replacement action instruction; A generation unit for generating ledger data for a preset period based on the above package selection action instruction, where the above preset period is determined based on the pre-issuance rate of return; A compression unit for performing compression processing on the above ledger data for the preset period to generate compressed ledger data; A decompression unit for decompressing the above compressed ledger data to activate the above ledger data after the billing period arrives.

[0014] In a third aspect, the present invention proposes an electronic device, including: a memory and a processor, characterized in that when the processor executes the computer program stored in the memory, it implements the steps of the traffic tariff pre-issuance method described in any item of the first aspect.

[0015] In a fourth aspect, the present invention proposes a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method for pre-issuing traffic charges as described in any one of the first aspects are implemented.

[0016] In summary, this embodiment actively generates account book data of multiple periods when users subscribe to or change packages, and distributes the account book generation pressure originally concentrated at the beginning of the month to the time when user behavior occurs, thereby realizing time decoupling of business load. The account book data of the solution proposed by the present invention is not directly issued, but structured compression is used to greatly reduce storage space and transmission costs. The account book is automatically decompressed and activated when the target period arrives, ensuring the consistency of the account period while avoiding redundant recalculation, and improving the accuracy and timeliness of account book generation. The present invention dynamically adjusts the number of account book cycles pre-issued each time by constructing a reinforcement learning model with resource yield as the target, so as to achieve the optimal balance between resource yield and storage cost. The present invention significantly reduces the system's dependence on peak resources through the strategy of "pre-calculation + compression cache + time-sharing activation", thereby reducing redundant expansion and improving system stability and cost efficiency. In summary, the present invention realizes the optimized scheduling of large-scale account book issuance behavior without affecting the accuracy of the account period and user perception, and is suitable for high-concurrency account period systems such as operators, virtual business platforms, and Internet of Things platforms, and has strong engineering practicality and promotion value.

[0017] The traffic charge prepayment method proposed in the present invention, and other advantages, objectives and features of the present invention will be partially reflected through the following description, and will also be partially understood by those skilled in the art through research and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present specification. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings: Figure 1 A flow chart of a method for pre-issuing traffic charges provided by an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a traffic rate pre-issuance system provided by an embodiment of the present invention; Figure 3 A structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In the description and claims of the present invention and the above-mentioned drawings, terms such as "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices. The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.

[0020] Please refer to Figure 1 , which is a schematic flowchart of a method for pre-issuing traffic charges provided by an embodiment of the present invention, and specifically may include: S110. Obtain a user's package selection action instruction, where the package selection action instruction includes a package subscription action instruction and a package replacement action instruction; Exemplarily, the system monitors the user's package operation behavior on the terminal, business hall, or online platform in real time. When the user initiates a package subscription action instruction or a package replacement action instruction, the system records the instruction and uses it as the starting condition for triggering the ledger pre-issuing process.

[0021] Among them, the package subscription action instruction may include a new package activation request, a traffic package subscription request, etc.; the package replacement action instruction includes change operations such as switching, upgrading, and downgrading the current package.

[0022] S120. Generate ledger data for a preset period based on the package selection action instruction, where the preset period is determined based on the pre-issuing rate of return; Exemplarily, after receiving the user's package selection action instruction, the system determines, according to the account period structure of the current package and the system policy configuration, that N periods of ledger data should be generated in advance for the user, where N is the number of preset periods. The system calls parameters such as package tariff information, user identification, and account period index through the ledger generation engine to generate structured ledger data for the corresponding account period, including content such as package name, tariff standard, account period range, quota information, and ledger number. The generated multi-period ledger data will be used for subsequent compression processing.

[0023] S130. Compress the ledger data for the preset period to generate compressed ledger data; Exemplarily, the system performs template compression operations on the data of the above multiple account book cycles. Specifically, it includes: building a general field template based on the account book structure, extracting fields that do not change much in the account book (such as package name, unit tariff, etc.) as template fields; for each account book, only recording the difference fields (such as account period number, bill number) and account period offset relative to the template fields; using the incremental coding compression algorithm to merge and encode the template identifier, difference content and period offset to form the final compressed account book data structure; the compressed account book data will be stored in the object storage system and will be decompressed and activated when the target account period arrives.

[0024] S140: After the billing cycle is reached, decompress the compressed account book data to activate the account book data.

[0025] Exemplarily, the system determines whether there is pre-issued account data at the account period trigger point. If so, the corresponding compressed account data is loaded immediately. The decompression process includes: obtaining the compressed template identifier, difference field content and account period offset in the account data; loading the template content to restore the account field structure; merging the difference field value into the template field to build a complete account instance; calculating the effective time, expiration time and other periodic attributes of the bill according to the account period offset; sending the activated account instance data to the billing system and bill distribution system for executing the fee settlement and user notification push process.

[0026] In summary, this embodiment actively generates account book data of multiple periods when users subscribe to or change packages, and distributes the account book generation pressure originally concentrated at the beginning of the month to the time when user behavior occurs, thereby realizing time decoupling of business load. The account book data of the solution proposed by the present invention is not directly issued, but structured compression is used to greatly reduce storage space and transmission costs. The account book is automatically decompressed and activated when the target period arrives, ensuring the consistency of the account period while avoiding redundant recalculation, and improving the accuracy and timeliness of account book generation. The present invention dynamically adjusts the number of account book cycles pre-issued each time by constructing a reinforcement learning model with resource yield as the target, so as to achieve the optimal balance between resource yield and storage cost. The present invention significantly reduces the system's dependence on peak resources through the strategy of "pre-calculation + compression cache + time-sharing activation", thereby reducing redundant expansion and improving system stability and cost efficiency. In summary, the present invention realizes the optimized scheduling of large-scale account book issuance behavior without affecting the accuracy of the account period and user perception, and is suitable for high-concurrency account period systems such as operators, virtual business platforms, and Internet of Things platforms, and has strong engineering practicality and promotion value.

[0027] In a feasible implementation manner, the above method further includes: Obtain the resource release benefits brought by the decrease in the number of transactions per second and the increased storage costs of pre-issued ledgers; Calculate the ledger pre-issuance marginal rate of return based on the above resource release benefits and the above storage costs; Adjust the above preset period according to the above pre-issuance marginal rate of return.

[0028] Exemplarily, in a feasible implementation manner, the traffic tariff pre-issuance method further includes the following steps: First, the system obtains the resource release benefits brought by the decrease in Transactions Per Second (TPS). Specifically, the system records the TPS peak value when the ledger pre-issuance mechanism is not enabled and the TPS peak value after the ledger pre-issuance is enabled , and calculates the released system processing capacity according to the difference . This resource release benefit can be further converted into the value of system resources, such as reducing network bandwidth occupancy, computing node load, or message channel blocking probability. Usually, it is quantified by the cost saved per unit of TPS decrease (such as yuan / transaction / second).

[0029] Then, the system obtains the increased storage costs of the pre-issued ledger. This storage cost depends on the average size S of the compressed ledger data, the number of pre-issuance periods N, and the total number of pre-issuance users U. According to the formula:

[0030] Calculate the required storage resource input , with the unit: yuan; U is the total number of users (unitless); N is the number of periods (unitless), S: the average size of each stored data (unit: GB), represents the unit cost of the object storage service (yuan / GB).

[0031] Next, the system calculates the marginal rate of return of ledger pre-issuance based on the above two items of data. The formula is:

[0032] Among them, η represents the ledger pre-issuance marginal rate of return, ΔT is the TPS decrease value, is the resource release value brought by the unit TPS decrease (unit: yuan / TPS).

[0033] Furthermore, the system adjusts the preset number of periods N of the ledger according to the marginal rate of return η. If η is greater than the set threshold (for example, 1.5), it means that the resource return rate of the pre-issued ledger is high, then appropriately increase N, for example, from 2 to 3 or 4; if η is in the intermediate range (for example, 1.0 - 1.5), keep the existing N value unchanged; if η is lower than the set threshold (such as 1.0), then the system reduces the number of pre-issuance periods N to reduce the resource waste caused by ledger redundancy.

[0034] The adjustment strategy can adopt the static interval method (preset rule mapping) or be dynamically updated in combination with an intelligent learning model (such as the reinforcement learning method) to achieve optimal control of the friendliness of the ledger pre-issuance behavior to system resources.

[0035] Through the yield-driven preset cycle adjustment mechanism described in this embodiment, the system can dynamically balance the storage cost and the revenue released at the ledger peak, realizing intelligent peak shaving of the ledger distribution load and optimal allocation of resource utilization. Compared with the fixed-cycle pre-issuance mechanism, this method effectively reduces the TPS peak value of the system while ensuring the accuracy of the accounting period, reduces the risk of message loss and resource congestion, and has significant economic and engineering adaptability.

[0036] In a feasible implementation manner, adjusting the preset cycle according to the pre-issuance boundary yield rate includes: Construct an input feature vector including pre-issuance yield rate, resource pressure status, package subscription behavior, and user change probability; Input the above input feature vector into a pre-trained reinforcement learning model, with the maximum pre-issuance boundary yield rate as the goal, to obtain the above preset cycle.

[0037] Exemplarily, first, the system constructs an input feature vector representing the ledger running environment and user behavior characteristics. The input feature vector includes the following four core feature dimensions: 1. Pre-issuance yield rate, that is, the boundary yield rate η brought by ledger pre-issuance, reflecting the benefit of the current ledger pre-issuance of the system in reducing the TPS peak value; 2. Resource pressure status, including indicators such as the current CPU occupancy rate, network bandwidth utilization rate, and IO write delay, comprehensively reflecting the resource load level where the ledger system is located; 3. Package subscription behavior, including information such as the user package subscription density and subscription time distribution in the recent period, used to evaluate the ledger trigger frequency; 4. User change probability, predicted based on the historical user package replacement behavior model, indicating the possibility of a user or user group changing the package in the future accounting period.

[0038] The system normalizes the above features to form a standardized input feature vector . Then, the system inputs the input feature vector into a pre-trained reinforcement learning model. The reinforcement learning model is a policy network constructed based on the PPO (Proximal Policy Optimization) algorithm, and its training goal is to maximize the boundary yield rate of ledger pre-issuance and output the optimal ledger preset cycle N under cost constraints.

[0039] Specifically, the model outputs an action set through the policy network and the selection probability corresponding to each action in the action set. The value corresponding to the action is the proposed preset ledger period number N. The system determines the final preset period output according to the maximum probability policy or the sampling decision mechanism.

[0040] Finally, the model automatically outputs the optimal ledger pre-issuance period number according to the current system state, realizing the dynamic adaptation of ledger pre-issuance between system resource utilization and user behavior characteristics.

[0041] Through the method described in this embodiment, the system can automatically decide the ledger pre-issuance period number N based on the comprehensive perception of multiple factors such as ledger yield rate, source theft pressure, and user behavior, realizing the personalization, dynamicization, and intelligence of the pre-issuance strategy. Compared with static configuration or interval mapping rules, this method has significant advantages in improving the accuracy of account period control, reducing storage redundancy, and avoiding waste caused by high-frequency changes, and can significantly enhance the resource elasticity and operation efficiency of the large-scale ledger distribution system.

[0042] In a feasible implementation manner, the construction process of the above reinforcement learning model includes: Define the state space and construct a state vector St for characterizing the operating state of the ledger system; Define the action space and discretize the ledger pre-issuance period number N into an action set; Construct a reward function according to revenue incentives and cost penalties; Construct a policy network and a value network. Among them, the above policy network is used to output the selection probability of each ledger pre-issuance period number, and the above value network is used to estimate the long-term expected revenue of the current state; Use generalized advantage estimation to calculate the advantage value of each state, and adopt the clipped policy optimization algorithm to synchronously optimize the above policy network and the above value network to obtain the above reinforcement learning model.

[0043] Exemplarily, first, define the state space. The system constructs a state vector for characterizing the operating state of the ledger system. The state vector is used to comprehensively describe the environmental state of the system when the ledger pre-issuance strategy is executed. The state vector includes, but is not limited to, the following dimensions: the current ledger pre-issuance boundary yield rate , the CPU load rate and disk IO write latency of the current system, the TPS drop value , the current package subscription density and user package change probability, and the current ledger budget usage and remaining amount. The state vector is input into the subsequent model module after feature standardization and normalization processing.

[0044] Next, define the action space. Discretize the ledger pre-issuance period number N into an action set , representing the ledger pre-issuance cycle options available to the system in the current state. Each action represents pre-generating ledger data for N cycles at the time of package subscription.

[0045] Then, construct the reward function. The reward function comprehensively considers both revenue incentives and cost penalties and is designed as follows: When the marginal rate of return is higher than the set threshold (e.g., > 1.5), a positive incentive is given; when the marginal rate of return is in the intermediate range (e.g., 1.0 ≤ ≤ 1.5), a neutral incentive is given; when the marginal rate of return is low (e.g., < 1.0), a negative penalty is imposed; at the same time, a ledger budget overrun penalty term is introduced, and the overrun cost is calculated based on the difference between the current ledger budget usage and the budget quota.

[0046] Finally, the form of the reward function can be expressed as:

[0047] where, is the storage cost, and ρ is the budget penalty coefficient.

[0048] Construct the policy network and the value network. The policy network is used to receive the state vector , and output the selection probability of each cycle number in the ledger pre-issuance cycle set A; the value network is used to evaluate the long-term expected return V( ) of the current state ), providing an advantage function estimate for policy update. Both are structured with two-layer fully connected neural networks, using the ReLU activation function, and respectively outputting the Softmax probability distribution and the single-value regression result.

[0049] Train the model, use Generalized Advantage Estimation (GAE) to calculate the advantage value of each state, and use the Proximal Policy Optimization (PPO) algorithm to jointly train the policy network and the value network. The optimization objective function is:

[0050] θ (theta) is the parameter vector of the current policy network, used to represent the set of learnable parameters of the policy function. is the policy ratio, used to measure the ratio of the action probabilities of the current policy and the old policy, defined as:

[0051] This ratio reflects the change amplitude of the current policy for action selection. is the Advantage Function, which represents how much better it is to take a certain action in the current state than the average behavior, and is used to guide the optimization direction. is the clipping range parameter, usually set to 0.1 or 0.2, which is used to limit the magnitude of the policy update and prevent the policy from deviating too much. clip(•) is the clipping function, which is used to clip the policy ratio to be within the interval to avoid excessive updates. min(·) is to take the smaller value of the two, which ensures that the policy update will not cause the policy to deviate violently due to high advantage values, and plays a role in protecting the stability of the policy. represents the expected value at all time steps t, and is usually calculated by sampling. represents the action selected by the agent at time step t.

[0052] This training process can be carried out in a simulation environment or a production log replay environment, and iteratively optimized until the policy is stable and has good generalization ability.

[0053] Through the reinforcement learning model construction method described in this embodiment, the system can realize the intelligent, adaptive and generalizable control of the ledger pre-issuance cycle decision. Compared with the static pre-issuance policy, this method can perceive the dynamic changes of the system operation state, user behavior and resource pressure in real time, and output the optimal ledger generation cycle based on the goal of maximizing revenue, significantly improving the operation elasticity, resource utilization rate of the account period management system and the stability of the ledger service, and having broad engineering adaptability and promotion value.

[0054] In a feasible implementation manner, the above-mentioned compression processing of the ledger data of the above-mentioned preset cycle to generate compressed ledger data includes: Construct a general ledger field set based on the ledger structure as a compression template; For each ledger cycle, record the difference content and cycle offset relative to the template field value; Combine and encode the above-mentioned compression template, the above-mentioned difference content and the above-mentioned cycle offset through an incremental coding compression algorithm to generate the above-mentioned compressed ledger data.

[0055] Exemplarily, first, the system analyzes the field structure of the historical ledger data sample and extracts the common field set in multiple ledger cycles. The field set includes, but is not limited to, fields such as package name, package tariff, account period, data quota, effective time, expiration time, ledger number, etc.

[0056] The system performs a consistency check on the above fields and determines a subset of fields that repeatedly appear and have an unchanged structure in most ledgers, based on the occurrence frequency and field type stability, as the static fields of the compression template. Subsequently, the system generates the compression template structure and assigns a unique identifier (such as template ID) to the template.

[0057] The compression template records metadata information such as field names, field types, field order, and default values, which is used as the restoration basis during subsequent ledger reconstruction.

[0058] For the ledger data corresponding to each ledger period, the system performs a difference identification operation based on the aforementioned compression template. That is: compare the values of the current ledger data with the fields of the compression template; identify the field items that are different from the template default values and record them as difference content; extract the period index information corresponding to the current ledger and calculate the offset value relative to the starting period of the template, denoted as the period offset. The difference content can be represented in the structure of key-value pairs (field → delta value), and the period offset can be encoded in integer form.

[0059] The system takes the compression template ID, the difference field content, and the period offset information as inputs and performs encoding processing using an incremental coding compression algorithm to generate the final compressed ledger data.

[0060] The incremental coding compression algorithm is based on the following strategy: static fields do not need to be stored repeatedly and are only referenced through the template; difference fields are stored in the form of field position index + value pairs; the period offset is compressed using variable-length integer encoding (such as VLQ encoding); the result output can be binary data or a Base64 string, which is suitable for network transmission and object storage systems.

[0061] Finally, the compressed ledger data output by the system is significantly smaller than the original ledger data and retains the necessary structure and decoding ability.

[0062] Through the method described in this embodiment, efficient compression of ledger data for a preset period is achieved without affecting the integrity and readability of the ledger structure. Compared with the traditional full-scale storage method of JSON structure, the method can significantly reduce the redundancy of repeated fields, and the compression ratio can reach 10:1 or even higher. At the same time, it has the engineering advantages of strong field reducibility, high template reuse rate, and adaptability to batch processing. This solution is especially suitable for the scenario of large-scale ledger distribution by operators, which helps to reduce storage costs, relieve the network pressure of ledger distribution, and improve the system resource utilization rate and scalability.

[0063] In a feasible implementation manner, after reaching the billing period, decompressing the above compressed ledger data to activate the above ledger data includes: Obtaining the above compression template and the above period offset in the above compressed ledger data; Restore the general ledger structure based on the field template; Perform field replacement and completion according to the above differences to generate the ledger instance data for the target period; Activate the above ledger instance data for executing the billing service and the user bill push process.

[0064] Exemplarily, before the start of each ledger period, the system first detects whether the current accounting period is the target activation time of the pre-issued ledger. If so, extract the corresponding compressed ledger data from the ledger storage system. The system parses the compressed ledger data and extracts the compressed template identifier (template ID), field difference content, and period offset value contained therein.

[0065] The compressed template identifier is used to associate the field structure definition, the period offset is used to locate the specific accounting period position of the current ledger in the template sequence, and the difference content is used to restore the personalized values of the ledger fields.

[0066] The system loads the pre-constructed field template from the template repository according to the template ID. The field template records information such as the ledger field name, field type, field order, and default field value. After loading, the system restores the general ledger field framework according to the template structure to form the basic ledger structure. This general structure only contains the static part of the template fields and is used as the skeleton for personalized data completion.

[0067] The system compares the field template with the difference content and performs field value replacement operations on the target ledger structure in sequence. For the field items with differences, use the values in the difference content to overwrite the default values in the template; for the fields without provided difference items, keep the template default values unchanged.

[0068] At the same time, the system automatically calculates the dynamic field content related to time such as the effective accounting period, expiration accounting period, and ledger number of the bill according to the period offset value, and supplements these fields in the ledger instance.

[0069] Finally, the system generates the complete ledger instance data for the current accounting period, and the structure is the same as that of the ledger generated in the conventional way, which can be directly used for subsequent business processing.

[0070] The system marks the restored ledger data as "activated status" and sends it to the billing engine and the notification module: in the billing service, the ledger data is used for billing calculations of user packages, usage, fees, etc.; in the user notification process, the ledger data generates bill display information and distributes it to the user terminal through text messages, APP push, e-mails, etc.

[0071] The status after the ledger is activated will be synchronized with the accounting period control module of the system to ensure accounting consistency.

[0072] Through the method described in this embodiment, the system can quickly restore the ledger instance structure based on the compression template and the differential data, and decompress and activate it on demand at the beginning of the accounting period, avoiding the computational burden and storage overhead brought by the full-scale reconstruction of traditional ledgers in each period. The method not only realizes the decompression and restoration of ledger data and the guarantee of structural integrity, but also can be seamlessly docked with the billing system and the notification system to realize the timely activation and distribution push of the ledger, greatly improving the ledger processing efficiency and system resource utilization rate.

[0073] In a feasible implementation manner, constructing the above general ledger field set as a compression template based on the ledger structure includes: Obtain a ledger sample set, where the ledger sample set includes ledger data for multiple preset periods, the ledger data has a unified structure, and the ledger data records the package name, package tariff, accounting period, and data quota; Perform a field extraction operation on the ledger data in the ledger sample set to obtain an initial field set, where the initial field set includes the field name, field value type, and its occurrence frequency in the ledger sample set for each ledger; Perform a field consistency analysis operation based on the initial field set to determine the field set that exists simultaneously in all ledger data as the first candidate field set; Perform a value stability evaluation operation on each field in the first candidate field set, and count the value change frequency of the field across periods in the ledger sample set. If the value of a certain field remains consistent in most ledgers, mark the field as a static field; Generate a ledger field template based on the static fields to generate the reusable compression template.

[0074] Exemplarily, the system first obtains ledger sample data generated by multiple users or the same user in different accounting periods to form a ledger sample set. The ledger sample set contains ledger data for multiple preset periods, and the structures of these ledger data are consistent, usually including the following typical fields: package name, package tariff, accounting period, effective date, data quota, bill number, etc. The ledger data is stored in a structured form with unified field naming and data format, facilitating subsequent analysis.

[0075] The system traverses each piece of ledger data in the ledger sample set, extracts the field name, field value type (such as string, numerical value, date), and field value example included in each ledger, and counts the frequency of each field appearing in the overall sample.

[0076] Finally, an initial field set is constructed, including a three-element information structure of field name → type → occurrence frequency, preparing for subsequent field consistency and stability analysis.

[0077] The system performs field consistency analysis based on the above initial field set, and counts the co-occurrence of each field in all ledger samples.

[0078] If a field appears in all or most of the ledger samples in the ledger sample set, it is determined that the field is a structurally stable field and is included in the first candidate field set; if a field is missing in some ledgers or its structure changes frequently, it is excluded from the candidate set. This process can automatically judge field consistency by setting a field co-occurrence threshold (such as appearing in ≥90% of the ledgers).

[0079] For each field in the above first candidate field set, the system further performs an operation to evaluate the stability of the field value. Specifically, it counts the change frequency of the value of each field in the ledgers of different accounting periods. If the value of a field remains consistent or changes very little in most accounting periods, it is marked as a static field.

[0080] For example, if the "package name" field has a value of "10G per month" in 5 out of 6 accounting periods and only "20G per month" in 1 period, it is determined to be a stable field and can be used as a fixed item in the template field.

[0081] The system assembles the field set marked as static fields above, along with their field names, field types, and field order information, to generate a standardized ledger field template. The field template is used to represent the common part of the ledger structure and can be reused by the ledger data of multiple accounting periods.

[0082] The finally output field template serves as the basis for defining the compressed ledger data structure, is assigned a unique template identifier (template ID), and is stored in the template repository for reference by the compression processing module.

[0083] Through the field template construction method described in this embodiment, the system can automatically extract and abstract the stable field structure from historical ledger data, thereby realizing structure reuse in the ledger compression process and avoiding the transmission of duplicate fields. This method can not only greatly improve the ledger compression ratio (usually reaching more than 10:1), but also effectively enhance the controllability and consistency of the ledger structure. The templated design also supports the standardized execution of subsequent decompression and structure restoration operations, and has significant engineering application value for high-concurrency bill generation and distribution services.

[0084] As Figure 2 shown, the present invention also provides a traffic tariff pre-issuance system, including: An acquisition unit 101, configured to acquire an instruction for the user's package selection action, where the above package selection action instruction includes a package subscription action instruction and a package replacement action instruction; A generation unit 102 for generating ledger data for a preset period based on the above package selection action instruction, where the above preset period is determined based on the pre-issue yield rate; A compression unit 103 for compressing the ledger data for the above preset period to generate compressed ledger data; A decompression unit 104 for decompressing the above compressed ledger data to activate the above ledger data after the billing period arrives.

[0085] The above system can also perform the following steps: Obtain the user's package selection action instruction, where the above package selection action instruction includes a package subscription action instruction and a package replacement action instruction; Generate ledger data for a preset period based on the above package selection action instruction; Compress the ledger data for the above preset period to generate compressed ledger data; After the billing period arrives, decompress the above compressed ledger data to activate the above ledger data.

[0086] In a feasible implementation manner, the above method further includes: Obtain the resource release benefit brought by the decrease in the number of transactions per second and the storage cost increased by the pre-issued ledger; Calculate the ledger pre-issue boundary yield rate according to the above resource release benefit and the above storage cost; Adjust the above preset period according to the above pre-issue boundary yield rate.

[0087] In a feasible implementation manner, the above adjusting the above preset period according to the above pre-issue boundary yield rate includes: Construct an input feature vector including the pre-issue yield rate, resource pressure state, package subscription behavior, and user change probability; Input the above input feature vector into a pre-trained reinforcement learning model, with the maximum pre-issue boundary yield rate as the goal, to obtain the above preset period.

[0088] In a feasible implementation manner, the construction process of the above reinforcement learning model includes: Define the state space and construct a state vector St for characterizing the running state of the ledger system; Define the action space and discretize the number of ledger pre-issue periods N into an action set; Construct a reward function according to the benefit incentive and cost penalty; Construct a policy network and a value network, where the above policy network is used to output the selection probability of each number of ledger pre-issue periods, and the above value network is used to estimate the long-term expected benefit of the current state; Calculate the advantage value of each state using generalized advantage estimation, and adopt the clipped policy optimization algorithm to synchronously optimize the above-mentioned policy network and the above-mentioned value network to obtain the above-mentioned reinforcement learning model.

[0089] In a feasible implementation manner, the above-mentioned compression processing of the ledger data of the above-mentioned preset period to generate compressed ledger data includes: Construct a general ledger field set based on the ledger structure as a compression template; For each ledger period, record the difference content and period offset relative to the template field value; Combine and encode the above-mentioned compression template, the above-mentioned difference content, and the above-mentioned period offset through an incremental coding compression algorithm to generate the above-mentioned compressed ledger data.

[0090] In a feasible implementation manner, the above-mentioned decompression of the above-mentioned compressed ledger data to activate the above-mentioned ledger data after reaching the billing period includes: Obtain the above-mentioned compression template and the above-mentioned period offset in the above-mentioned compressed ledger data; Restore the general ledger structure based on the field template; Perform field replacement and completion according to the above-mentioned difference content to generate ledger instance data for the target period; Activate the above-mentioned ledger instance data for executing the billing service and the user bill push process.

[0091] In a feasible implementation manner, the above-mentioned construction of a general ledger field set based on the ledger structure as a compression template includes: Obtain a ledger sample set, where the above-mentioned ledger sample set includes ledger data of multiple preset periods, the above-mentioned ledger data has a unified structure, and the above-mentioned ledger data records the package name, package tariff, accounting period, and data quota; Perform a field extraction operation on the above-mentioned ledger data in the above-mentioned ledger sample set to obtain an initial field set, where the above-mentioned initial field set includes the field name, field value type, and its occurrence frequency in the ledger sample set in each ledger; Perform a field consistency analysis operation based on the above-mentioned initial field set to determine the field set that exists simultaneously in all ledger data as the first candidate field set; Perform a value stability evaluation operation on each field in the above-mentioned first candidate field set, and count the value change frequency of the above-mentioned field across periods in the ledger sample set. If the value of a certain field remains consistent in most ledgers, mark this field as a static field; Generate a ledger field template based on the above-mentioned static fields to generate the reusable above-mentioned compression template.

[0092] Such as Figure 3As shown, the present invention further provides an electronic device 30, which includes a memory 310, a processor 320, and a computer program 311 stored on the memory 310 and executable on the processor. When the processor 320 executes the computer program 311, any step of the above-mentioned traffic tariff pre-issuance method is implemented.

[0093] The present invention further provides a computer program product, which includes a computer program or computer-executable instructions, and the computer program or computer-executable instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium, and the processor executes the computer program or computer-executable instructions, so that the electronic device executes any step of the above-mentioned traffic tariff pre-issuance method of the present invention.

[0094] The above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims

1. A method for pre-issuing traffic charges, characterized in that, Including: Obtain the package selection action instruction of the user, where the package selection action instruction includes a package subscription action instruction and a package replacement action instruction; Generate ledger data for a preset period based on the package selection action instruction, where the preset period is determined based on the pre-issuance rate of return; Perform compression processing on the ledger data for the preset period to generate compressed ledger data; After the billing period arrives, decompress the compressed ledger data to activate the ledger data.

2. The traffic charge pre-issuance method according to claim 1, wherein The method further includes: Obtain the resource release benefits brought by the decrease in the number of transactions per second and the storage costs increased by the pre-issued ledger; Calculate the pre-issuance boundary rate of return of the ledger based on the resource release benefits and the storage costs; Adjust the preset period according to the pre-issuance boundary rate of return.

3. The flow rate tariff pre-issuance method according to claim 2, wherein The adjusting the preset period according to the pre-issuance boundary rate of return includes: Construct an input feature vector including the pre-issuance rate of return, the resource pressure state, the package subscription behavior, and the user change probability; Input the input feature vector into a pre-trained reinforcement learning model, with the maximum pre-issuance boundary rate of return as the goal, to obtain the preset period.

4. The flow rate tariff pre-issuance method according to claim 3, characterized in that, The construction process of the reinforcement learning model includes: Define the state space and construct a state vector S used to represent the operating state of the ledger system t ; Define the action space, and discretize the number of ledger pre-issuance periods N into an action set; Construct a reward function according to the revenue incentive and cost penalty; Construct a policy network and a value network, where the policy network is used to output the selection probability of each ledger pre-issuance period number, and the value network is used to estimate the long-term expected revenue of the current state; Use generalized advantage estimation to calculate the advantage value of each state, and adopt the clipped policy optimization algorithm to synchronously optimize the policy network and the value network to obtain the reinforcement learning model.

5. The flow rate tariff pre-issuance method according to claim 1, characterized in that The performing compression processing on the ledger data for the preset period to generate compressed ledger data includes: Construct a general ledger field set based on the ledger structure as a compression template; For each ledger period, record the difference content and period offset relative to the template field value; Combine and encode the compression template, the difference content, and the period offset through an incremental coding compression algorithm to generate the compressed ledger data.

6. The traffic charge pre-issuance method according to claim 5, wherein The decompressing the compressed ledger data to activate the ledger data after the billing period arrives includes: Obtain the compression template and the period offset in the compressed ledger data; Restore the general ledger structure based on the field template; Perform field replacement and completion according to the difference content to generate ledger instance data for the target period; Activate the ledger instance data for executing the billing service and the user bill push process.

7. The flow rate tariff pre - issuance method according to claim 5, characterized in that, The constructing a general ledger field set based on the ledger structure as a compression template includes: Obtain a ledger sample set, where the ledger sample set includes ledger data for multiple preset periods, the ledger data has a unified structure, and the ledger data records the package name, package tariff, accounting period, and data quota; Perform a field extraction operation on the ledger data in the ledger sample set to obtain an initial field set, where the initial field set includes the field name, field value type, and its occurrence frequency in the ledger sample set for each ledger; Perform a field consistency analysis operation based on the initial field set, and determine the field set that exists simultaneously in all ledger data as the first candidate field set; Perform a value stability evaluation operation on each field in the first candidate field set, and count the value change frequency of the field across cycles in the ledger sample set. If the value of a certain field remains consistent in most ledgers, mark this field as a static field; Generate a ledger field template based on the static fields to generate the reusable compression template.

8. A traffic fee pre-issuance system, characterized in that, Include: An acquisition unit, configured to acquire a user's package selection action instruction, where the package selection action instruction includes a package subscription action instruction and a package replacement action instruction; A generation unit, configured to generate ledger data for a preset period based on the package selection action instruction, where the preset period is determined based on the pre-issue yield; A compression unit, configured to perform compression processing on the ledger data for the preset period to generate compressed ledger data; A decompression unit, configured to decompress the compressed ledger data to activate the ledger data after the billing period arrives.

9. An electronic device, comprising: A memory and a processor, characterized in that the processor is configured to implement the steps of the traffic tariff pre-issue method according to any one of claims 1-7 when executing the computer program stored in the memory.

10. A computer-readable storage medium, having a computer program stored thereon, characterized in that, The computer program, when executed by the processor, implements the steps of the traffic tariff pre-issue method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Business package selection method, apparatus and system

    CN107666407A

  • Charging method, charging device and charging system

    CN108900989A

  • Communication flow charging method and system

    CN109981373A

  • Charge rehearsal method and related equipment

    CN110351098A

  • Communication consumption monthly bill prediction method and system

    CN116796266A

Cited By

  • Service provider account period data quality evaluation and automatic switching method and system

    CN121210475A