A method, system, device and medium for pre-issuing traffic charges

By generating multi-period ledger data at the moment of user behavior and utilizing compression technology and reinforcement learning models, the problem of resource exhaustion caused by concentrated pressure on ledger generation in the communications operation system is solved, achieving high efficiency and stability in resource optimization and bill processing.

CN120378238BActive Publication Date: 2025-09-12GUANGDONG LEGEND COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing communications operation system lacks optimization solutions for problems such as sudden surges in TPS, I/O and bandwidth resource exhaustion, user billing delays, and system horizontal expansion costs at the beginning of the bill period due to complex ledger generation logic and resource exhaustion.

Method used

By obtaining the user package selection action instructions, the ledger data of the preset period is generated and compressed, and the number of pre-release cycles is dynamically adjusted using the reinforcement learning model. Combined with the compression template and incremental encoding technology, the time-sharing activation and resource optimization of the ledger data are achieved.

Benefits of technology

It significantly reduces the system's dependence on peak resources, reduces redundant expansion, improves system stability and cost efficiency, and ensures the accuracy of billing periods and consistency of user perception.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378238B_ABST
    Figure CN120378238B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device, and medium for pre-issuing traffic charges, relating to the field of communications. The method comprises: 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 account book data for a preset period based on the package selection action instruction, wherein the preset period is determined based on a pre-issuance rate of return; compressing the account book data for the preset period to generate compressed account book data; and after reaching a billing period, decompressing the compressed account book data to activate the account book data. The present invention achieves optimized scheduling of large-scale account book issuance without affecting the accuracy of the bill period and user perception. The present invention is applicable to high-concurrency bill period systems such as operators, virtual operator platforms, and Internet of Things platforms, and has strong engineering practicality and promotion value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and more specifically, to a method, system, device, and medium for pre-issuing traffic charges. Background Art

[0002] In the existing communications operations system, ledger issuance, as one of the core business support processes, primarily handles the distribution of detailed accounting information, including package usage records, cost information, and billing rules, to users. In mobile communications platforms, in particular, with the widespread deployment of virtual operators, IoT number segments, and diversified data plans, platforms often need to simultaneously support ledger generation and issuance for tens of millions, or even hundreds of millions, of SIM cards.

[0003] Traditional ledger systems typically use a periodic centralized generation mechanism. At the beginning of each calendar month or billing cycle, ledger data is generated in batches for all active users and simultaneously pushed through distribution channels (such as SMS push, app notifications, and billing interfaces). Due to the complex ledger generation logic, diverse field structures, and reliance on storage I / O and network transmission resources during the distribution process, the system is prone to experiencing issues such as sudden surges in TPS (transactions per second), I / O and bandwidth exhaustion, user billing delays, and high system scale-out costs during this concentrated window at the start of the billing period.

[0004] To address these issues, there is currently a lack of an optimized ledger distribution solution that balances billing accuracy, resource flexibility, and system stability. Therefore, a method, system, device, and medium for pre-issuing traffic charges are urgently needed to address at least some of these issues. Summary of the Invention

[0005] The Summary of the Invention introduces a series of simplified concepts that will be further described in the Detailed Description of the Invention. The Summary of the Invention is not intended to limit the key features and essential features of the claimed technical solution, nor is it intended to determine the scope of protection of the claimed technical solution.

[0006] In a first aspect, the present invention provides a method for pre-issuing traffic charges, the method comprising:

[0007] Obtaining the user's package selection action instruction, wherein the package selection action instruction includes a package ordering action instruction and a package changing action instruction;

[0008] Generate account book data for a preset period based on the above package selection action instruction, wherein the above preset period is determined based on the pre-issuance rate of return;

[0009] Compressing the account book data of the preset period to generate compressed account book data;

[0010] After the billing cycle arrives, the compressed account book data is decompressed to activate the account book data.

[0011] In a feasible implementation manner, the above method further includes:

[0012] Gain the benefits of resource release brought about by the reduction of transactions per second and the increased storage costs of pre-issued ledgers;

[0013] Calculate the margin yield of ledger pre-issuance based on the above resource release income and the above storage cost;

[0014] Adjust the above preset period according to the above pre-issuance boundary yield.

[0015] In a feasible implementation manner, adjusting the preset period according to the pre-issuance boundary yield rate includes:

[0016] Construct an input feature vector including pre-issuance yield, resource pressure status, package subscription behavior, and user change probability;

[0017] The above input feature vector is input into the pre-trained reinforcement learning model, with the maximum pre-launch boundary yield as the goal to obtain the above preset period.

[0018] In one feasible implementation, the process of constructing the above reinforcement learning model includes:

[0019] Define the state space and construct the state vector St used to represent the operating state of the ledger system;

[0020] Define the action space and discretize the number of ledger pre-issuance cycles N into an action set;

[0021] Construct a reward function based on revenue incentives and cost penalties;

[0022] Construct a policy network and a value network. The policy network is used to output the probability of selecting each ledger pre-release period, and the value network is used to estimate the long-term expected return of the current state.

[0023] The advantage value of each state is calculated using generalized advantage estimation, and the above policy network and the above value network are simultaneously optimized using the cut policy optimization algorithm to obtain the above reinforcement learning model.

[0024] In a feasible implementation manner, compressing the account book data of the preset period to generate compressed account book data includes:

[0025] Build a general ledger field set based on the ledger structure as a compression template;

[0026] For each ledger period, record the difference in content and period offset relative to the template field value;

[0027] The compression template, the difference content, and the periodic offset are combined and encoded using an incremental coding compression algorithm to generate the compressed ledger data.

[0028] In a feasible implementation manner, after a billing period is reached, decompressing the compressed ledger data to activate the ledger data includes:

[0029] Obtain the compression template and the period offset in the compressed ledger data;

[0030] Restore the general structure of the ledger based on the field template;

[0031] Replace and complete the fields according to the above differences to generate the ledger instance data for the target period;

[0032] The above account instance data is activated to execute billing services and user bill push processes.

[0033] In a feasible implementation, the above-mentioned construction of a universal ledger field set based on the ledger structure as a compression template includes:

[0034] Obtaining a sample set of ledgers, wherein the sample set of ledgers includes ledger data for multiple preset periods, the ledger data having a unified structure, and the ledger data recording package names, package rates, billing periods, and data quotas;

[0035] Performing a field extraction operation on the ledger data in the sample set of ledgers to obtain an initial field set, wherein the initial field set includes the field name, field value type, and frequency of occurrence in each ledger in the sample set of ledgers;

[0036] Perform field consistency analysis based on the initial field set to determine the field set that exists simultaneously in all ledger data as the first candidate field set.

[0037] Perform a value stability assessment on each field in the first candidate field set, counting the frequency of value changes of the field across periods in the sample set of ledgers. If the value of a field remains consistent in most ledgers, mark the field as a static field.

[0038] Generate a ledger field template based on the above static fields to generate the reusable compressed template mentioned above.

[0039] In a second aspect, the present invention provides a traffic rate pre-issuance system, comprising:

[0040] An acquiring unit, configured to acquire a user's package selection action instruction, wherein the package selection action instruction includes a package subscription action instruction and a package change action instruction;

[0041] A generating unit, configured to generate account book data of a preset period based on the package selection action instruction, wherein the preset period is determined based on a pre-issuance rate of return;

[0042] A compression unit, configured to compress the ledger data of the preset period to generate compressed ledger data;

[0043] The decompression unit is used to decompress the compressed account book data to activate the account book data after the billing cycle arrives.

[0044] In a third aspect, the present invention proposes an electronic device comprising: a memory and a processor, characterized in that the processor is used to implement the steps of the traffic tariff pre-issuance method as described in any one of the first aspects when executing the computer program stored in the memory.

[0045] 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 traffic tariff pre-issuance method as described in any one of the first aspects are implemented.

[0046] In summary, this embodiment proactively generates multiple periods of ledger data when users subscribe to or change packages, shifting the burden of ledger generation, previously concentrated at the beginning of the month, to the moment of user activity, achieving temporal decoupling of business loads. The proposed solution utilizes structured compression rather than direct ledger data distribution, significantly reducing storage space and transmission costs. The ledger is automatically decompressed and activated upon the arrival of the target period, ensuring account consistency while avoiding redundant recalculations and improving the accuracy and timeliness of ledger generation. This invention dynamically adjusts the number of ledger periods pre-distributed each time by constructing a reinforcement learning model targeted at resource yield, achieving an optimal balance between resource yield and storage costs. Through the "pre-computation + compression caching + time-sharing activation" strategy, this invention significantly reduces the system's reliance on peak resources, thereby reducing redundant capacity expansion and improving system stability and cost efficiency. In summary, this invention optimizes the scheduling of large-scale ledger issuance without compromising account accuracy or user perception. It is suitable for high-concurrency account systems such as carriers, virtual operator platforms, and IoT platforms, demonstrating strong engineering practicality and widespread adoption.

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

[0048] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present description. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0049] Figure 1 A schematic diagram of a flow chart of a method for pre-issuing traffic charges provided in an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of the structure of a traffic rate pre-issuance system provided in an embodiment of the present invention;

[0051] Figure 3 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are 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 drawings in the embodiments of the present invention. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments.

[0053] See also Figure 1 , which is a flow diagram of a method for pre-issuing traffic charges provided by an embodiment of the present invention, which may specifically include:

[0054] S110: Obtaining a package selection action instruction from the user, wherein the package selection action instruction includes a package subscription action instruction and a package change action instruction;

[0055] For example, the system monitors the user's package operation behavior at the terminal, business hall, or online platform in real time. When the user initiates a package subscription action instruction or a package change action instruction, the system records the instruction and uses it as the starting condition for triggering the ledger pre-issuance process.

[0056] Among them, package subscription action instructions may include new package activation requests, traffic package subscription requests, etc.; package change action instructions include current package switching, upgrading, downgrading and other change operations.

[0057] S120: Generate account book data for a preset period based on the package selection action instruction, wherein the preset period is determined based on a pre-issuance rate of return;

[0058] For example, after receiving a user package selection action command, the system determines that N periods of ledger data should be generated for the user in advance, based on the current package's billing period structure and system policy configuration, where N is the preset number of periods. The system uses the ledger generation engine to invoke parameters such as package pricing information, user ID, and billing period index to generate structured ledger data for the corresponding billing period, including the package name, pricing level, billing period range, credit information, and ledger number. This multi-period ledger data is then used for subsequent compression processing.

[0059] S130: compressing the account book data of the preset period to generate compressed account book data;

[0060] Exemplarily, the system performs templated compression on the data from the aforementioned multiple ledger periods. Specifically, this includes: constructing a general field template based on the ledger structure, extracting fields that rarely change in the ledger (such as package name and unit price) as template fields; for each ledger period, recording only the fields that differ from the template fields (such as the account period number and bill number) and the account period offset; using an incremental encoding compression algorithm to combine and encode the template identifier, the difference content, and the period offset to form the final compressed ledger data structure; and storing the compressed ledger data in an object storage system, where it will be decompressed and activated when the target account period arrives.

[0061] S140: After the billing period arrives, decompress the compressed account book data to activate the account book data.

[0062] Exemplarily, at the billing period trigger point, the system determines whether pre-issued ledger data exists. If so, the corresponding compressed ledger data is immediately loaded. The decompression process includes: obtaining the compressed template identifier, difference field content, and billing period offset from the ledger data; loading the template content to restore the ledger field structure; merging the difference field values ​​into the template fields to construct a complete ledger instance; calculating the bill's effective time, expiration time, and other periodic attributes based on the billing period offset; and sending the activated ledger instance data to the billing system and bill distribution system for executing the fee settlement and user notification push process.

[0063] In summary, this embodiment proactively generates multiple periods of ledger data when users subscribe to or change packages, shifting the burden of ledger generation, previously concentrated at the beginning of the month, to the moment of user activity, achieving temporal decoupling of business loads. The proposed solution utilizes structured compression rather than direct ledger data distribution, significantly reducing storage space and transmission costs. The ledger is automatically decompressed and activated upon the arrival of the target period, ensuring account consistency while avoiding redundant recalculations and improving the accuracy and timeliness of ledger generation. This invention dynamically adjusts the number of ledger periods pre-distributed each time by constructing a reinforcement learning model targeted at resource yield, achieving an optimal balance between resource yield and storage costs. Through the "pre-computation + compression caching + time-sharing activation" strategy, this invention significantly reduces the system's reliance on peak resources, thereby reducing redundant capacity expansion and improving system stability and cost efficiency. In summary, this invention optimizes the scheduling of large-scale ledger issuance without compromising account accuracy or user perception. It is suitable for high-concurrency account systems such as carriers, virtual operator platforms, and IoT platforms, demonstrating strong engineering practicality and widespread adoption.

[0064] In a feasible implementation manner, the above method further includes:

[0065] Gain the benefits of resource release brought about by the reduction of transactions per second and the increased storage costs of pre-issued ledgers;

[0066] Calculate the margin yield of ledger pre-issuance based on the above resource release income and the above storage cost;

[0067] Adjust the above preset period according to the above pre-issuance boundary yield.

[0068] For example, in a feasible implementation, the method for pre-issuing traffic charges further includes the following steps:

[0069] First, the system obtains the resource release benefits brought by the decrease in the number of transactions per second (TPS). Specifically, the system records the TPS peak when the ledger pre-release mechanism is not enabled. And the TPS peak after enabling the ledger pre-issuance , and based on the difference The released system processing capacity is calculated. The benefits of this resource release can be further converted into system resource value, such as reducing network bandwidth usage, computing node load, or the probability of message channel blocking. It is usually quantified by the cost savings corresponding to a unit TPS decrease (such as yuan / time / second).

[0070] Then, the system obtains the additional storage cost of the pre-released ledger. This storage cost depends on the average size S of the compressed ledger data, the number of pre-release cycles N, and the total number of pre-release users U, according to the formula:

[0071]

[0072] Calculate the required storage resource investment , unit: yuan; U is the total number of users (no unit);

[0073] N is the number of cycles (unitless), S is the average size of data stored each time (unit: GB), Indicates the unit cost of the object storage service (yuan / GB).

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

[0075]

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

[0077] Furthermore, the system adjusts the preset number of cycles N for the ledger based on the marginal rate of return η. If η is greater than a set threshold (e.g., 1.5), indicating a high rate of return on resources from the pre-issued ledger, N is appropriately increased, for example, from 2 to 3 or 4. If η is in the middle range (e.g., 1.0-1.5), the existing N value is maintained. If η is lower than a set threshold (e.g., 1.0), the system reduces the number of pre-issued cycles N to reduce resource waste caused by ledger redundancy.

[0078] This adjustment strategy can adopt a static interval method (preset rule mapping) or be combined with an intelligent learning model for dynamic updates (such as reinforcement learning method) to achieve optimal control of the friendliness of ledger pre-issuance behavior to system resources.

[0079] Through the yield-driven preset period adjustment mechanism described in this embodiment, the system dynamically balances storage costs with peak ledger release revenue, achieving intelligent load shaving and optimal resource utilization. Compared to fixed-period pre-release mechanisms, this method effectively reduces system TPS peaks while ensuring ledger period accuracy, minimizing the risk of message loss and resource congestion, and exhibiting significant economic efficiency and engineering adaptability.

[0080] In a feasible implementation manner, adjusting the preset period according to the pre-issuance boundary yield rate includes:

[0081] Construct an input feature vector including pre-issuance yield, resource pressure status, package subscription behavior, and user change probability;

[0082] The above input feature vector is input into the pre-trained reinforcement learning model, with the maximum pre-launch boundary yield as the goal to obtain the above preset period.

[0083] For example, first, the system constructs an input feature vector that represents the ledger operating environment and user behavior characteristics. The input feature vector includes the following four core feature dimensions:

[0084] 1. Pre-issuance yield, i.e., the marginal yield η brought by ledger pre-issuance, which reflects the benefit of the system's current ledger pre-issuance in reducing TPS peak;

[0085] 2. Resource pressure status, including indicators such as current CPU usage, network bandwidth utilization, and I / O write latency, which comprehensively reflect the resource load level of the ledger system;

[0086] 3. Package subscription behavior, including the user package subscription density and subscription time distribution in the recent period, which is used to evaluate the frequency of ledger triggering;

[0087] 4. User change probability, predicted based on a historical user package change behavior model, indicates the likelihood that a user or user group will change their package within the next billing period.

[0088] The system normalizes the above features to form a standardized input feature vector Then, the system converts the input feature vector The input is fed into a pre-trained reinforcement learning model. The reinforcement learning model is a policy network built based on the PPO (Proximal Policy Optimization) algorithm. Its training objective is to maximize the marginal yield of ledger pre-issuance and output the optimal ledger preset period N under cost constraints.

[0089] Specifically, the model outputs a set of actions through a policy network The selection probability corresponding to each action in action The corresponding value is the recommended preset account cycle number N. The system determines the final preset cycle output based on the maximum probability strategy or sampling decision mechanism.

[0090] Finally, the model automatically outputs the optimal number of ledger pre-issuance cycles based on the current system status, achieving dynamic adaptation between ledger pre-issuance in terms of system resource utilization and user behavior characteristics.

[0091] Through the method described in this embodiment, the system can automatically determine the number of ledger pre-issuance cycles (N) based on a comprehensive understanding of multiple factors, such as ledger yield, theft pressure, and user behavior, thus personalizing, dynamizing, and intelligentizing the pre-issuance strategy. Compared with static configuration or interval mapping rules, this method offers significant advantages in improving the accuracy of ledger period control, reducing storage redundancy, and avoiding wasteful high-frequency changes. It can significantly enhance the resource flexibility and operational efficiency of large-scale ledger distribution systems.

[0092] In one feasible implementation, the process of constructing the above reinforcement learning model includes:

[0093] Define the state space and construct the state vector St used to represent the operating state of the ledger system;

[0094] Define the action space and discretize the number of ledger pre-issuance cycles N into an action set;

[0095] Construct a reward function based on revenue incentives and cost penalties;

[0096] Construct a policy network and a value network. The policy network is used to output the probability of selecting each ledger pre-release period, and the value network is used to estimate the long-term expected return of the current state.

[0097] The advantage value of each state is calculated using generalized advantage estimation, and the above policy network and the above value network are simultaneously optimized using the cut policy optimization algorithm to obtain the above reinforcement learning model.

[0098] For example, first, define the state space. The system constructs a state vector that represents the operating state of the ledger system. The state vector is used to fully describe the 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 current system's CPU load rate, disk IO write delay, and TPS drop value , the current package subscription density and the probability of user package changes, and the current ledger budget usage and remaining balance. The state vector undergoes feature standardization and normalization and is then input into the subsequent model module.

[0099] Next, define the action space. Discretize the number of ledger pre-issue cycles N into an action set , indicating the available ledger pre-release cycle plans for the system in the current state. Each action represents pre-generating N cycles of ledger data when a package is ordered.

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

[0101] The final reward function can be expressed as:

[0102]

[0103] in, is the storage cost, and ρ is the budget penalty coefficient.

[0104] Construct a policy network and a value network. The policy network is used to receive the state vector , output the selection probability of each cycle number in the ledger pre-release cycle set A; the value network is used to evaluate the current state The long-term expected return V( ), providing advantage function estimation for policy updates. Both structures use a two-layer fully connected neural network with ReLU activation function, and output Softmax probability distribution and single value regression results respectively.

[0105] Train the model and use Generalized Advantage Estimation (GAE) to calculate the advantage value of each state , and the policy network and the value network are jointly trained using the PPO algorithm. The optimization objective function is:

[0106]

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

[0108]

[0109] This ratio reflects the magnitude of change in action selection by the current strategy. Advantage Function, which indicates how much better an action is than the average action in the current state, 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 amplitude of the policy update and prevent the policy from deviating too much. clip (•) is the clipping function used to adjust the policy ratio Limited to the range min(·) takes the smaller value of the two to ensure that the policy update will not cause a drastic policy deviation due to a high advantage value, thus protecting the policy stability. It represents the expected value at all time steps t, usually calculated by sampling. represents the action chosen by the agent at time step t.

[0110] The training process can be performed in a simulation environment or a production log playback environment, and iterative optimization is performed until the strategy is stable and has good generalization capabilities.

[0111] Through the reinforcement learning model construction method described in this embodiment, the system achieves intelligent, adaptive, and generalizable control over ledger pre-issuance cycle decisions. Compared to static pre-issuance strategies, this method can perceive the dynamic changes in system operating status, user behavior, and resource pressure in real time, and output the optimal ledger generation cycle based on the goal of maximizing revenue. This significantly improves the operational flexibility, resource utilization, and stability of the ledger management system, demonstrating broad engineering adaptability and promotional value.

[0112] In a feasible implementation manner, compressing the account book data of the preset period to generate compressed account book data includes:

[0113] Build a general ledger field set based on the ledger structure as a compression template;

[0114] For each ledger period, record the difference in content and period offset relative to the template field value;

[0115] The compression template, the difference content, and the periodic offset are combined and encoded using an incremental coding compression algorithm to generate the compressed ledger data.

[0116] For example, the system first performs field structure analysis on historical ledger data samples to extract a set of common fields across multiple ledger periods. This set of fields includes, but is not limited to, package name, package price, account period, data quota, effective date, expiration date, ledger number, and other fields.

[0117] The system performs consistency checks on the aforementioned fields and, based on frequency of occurrence and field type stability, identifies a subset of fields that appear repeatedly across most ledgers and maintain a constant structure. These fields are then used as static fields for the compression template. The system then generates the compression template structure and assigns a unique identifier (e.g., a template ID) to the template.

[0118] The compressed template records metadata information such as field name, field type, field order, and default value, which is used as the basis for restoration when the ledger is subsequently rebuilt.

[0119] For each ledger period's corresponding ledger data, the system performs a difference identification operation based on the aforementioned compression template. Specifically, it compares the current ledger data with the values ​​of the compressed template fields; identifies fields that differ from the template's default values ​​and records them as differences; extracts the period index information corresponding to the current ledger, and calculates the offset from the template's starting period, recording this as the period offset. The difference can be represented using a key-value pair structure (field→delta value), and the period offset can be encoded as an integer.

[0120] The system takes the compression template ID, difference field content, and period offset information as input, and uses the incremental coding compression algorithm for encoding processing to generate the final compressed ledger data.

[0121] The incremental encoding compression algorithm is based on the following strategies: static fields do not need to be stored repeatedly and are only referenced through templates; difference fields are stored using field position index + value pairs; periodic offsets are compressed using variable-length integer encoding (such as VLQ encoding); the result output can be binary data or Base64 string, suitable for network transmission and object storage systems.

[0122] Ultimately, the compressed ledger data output by the system is significantly smaller than the original ledger data, while retaining the necessary structure and decoding capabilities.

[0123] The method described in this embodiment achieves efficient compression of pre-set period ledger data without compromising the integrity and readability of the ledger structure. Compared to traditional full-data storage using JSON structures, this method significantly reduces redundant fields and achieves compression ratios of 10:1 or even higher. It also offers the engineering advantages of strong field reproducibility, high template reuse, and adaptability to batch processing. This solution is particularly suitable for operators' large-scale period ledger distribution scenarios, helping to reduce storage costs, alleviate network pressure on ledger distribution, and improve system resource utilization and scalability.

[0124] In a feasible implementation manner, after a billing period is reached, decompressing the compressed ledger data to activate the ledger data includes:

[0125] Obtain the compression template and the period offset in the compressed ledger data;

[0126] Restore the general structure of the ledger based on the field template;

[0127] Replace and complete the fields according to the above differences to generate the ledger instance data for the target period;

[0128] The above account instance data is activated to execute billing services and user bill push processes.

[0129] Exemplarily, before each ledger cycle begins, the system first checks whether the current period is the target activation date for the pre-issued ledger. If so, it extracts the corresponding compressed ledger data from the ledger storage system. The system then parses the compressed ledger data, extracting the compressed template identifier (template ID), field differences, and period offset value.

[0130] The compressed template identifier is used to associate the field structure definition, the period offset is used to locate the specific account period position of the current account book in the template sequence, and the difference content is used to restore the personalized value of the account book field.

[0131] Based on the template ID, the system loads a pre-built field template from the template repository. This field template contains information such as the ledger field name, field type, field order, and default field value. Once loaded, the system restores the ledger's universal field framework based on the template structure, forming the basic ledger structure. This universal structure contains only the static portion of the template fields and serves as a framework for completing personalized data.

[0132] The system compares the field template with the differences and replaces the field values ​​in the target ledger structure. For fields with differences, the default values ​​in the template are overwritten with the values ​​in the differences. For fields without differences, the default values ​​in the template are retained.

[0133] At the same time, the system automatically calculates the time-related dynamic field content such as the effective account period, expiration account period, account number, etc. of the bill based on the said period offset value, and supplements these fields in the account book instance.

[0134] Finally, the system generates complete account book instance data for the current account period. The structure is consistent with the account book generated in the conventional way and can be directly used for subsequent business processing.

[0135] The system marks the restored ledger data as "activated" and sends it to the billing engine and notification module: in the billing service, the ledger data is used to calculate the user's package, usage, fees, etc.; in the user notification process, the ledger data generates bill display information and distributes it to the user terminal through SMS, APP push, email, etc.

[0136] The status of the ledger after activation will be synchronized with the system's billing period control module to ensure accounting consistency.

[0137] Through the method described in this embodiment, the system can quickly restore the ledger instance structure based on the compressed template and differential data, and decompress and activate it on demand at the beginning of the billing period, avoiding the computational burden and storage overhead associated with traditional full ledger reconstruction for each period. This method not only achieves decompression and restoration of ledger data and ensures structural integrity, but also seamlessly integrates with billing and notification systems, enabling timely ledger activation and distribution, significantly improving ledger processing efficiency and system resource utilization.

[0138] In a feasible implementation, the above-mentioned construction of a universal ledger field set based on the ledger structure as a compression template includes:

[0139] Obtaining a sample set of ledgers, wherein the sample set of ledgers includes ledger data for multiple preset periods, the ledger data having a unified structure, and the ledger data recording package names, package rates, billing periods, and data quotas;

[0140] Performing a field extraction operation on the ledger data in the sample set of ledgers to obtain an initial field set, wherein the initial field set includes the field name, field value type, and frequency of occurrence in each ledger in the sample set of ledgers;

[0141] Perform field consistency analysis based on the initial field set to determine the field set that exists simultaneously in all ledger data as the first candidate field set.

[0142] Perform a value stability assessment on each field in the first candidate field set, counting the frequency of value changes of the field across periods in the sample set of ledgers. If the value of a field remains consistent in most ledgers, mark the field as a static field.

[0143] Generate a ledger field template based on the above static fields to generate the reusable compressed template mentioned above.

[0144] Exemplarily, the system first obtains sample ledger data generated by multiple users or the same user during different billing periods to form a sample ledger set. This sample ledger set contains ledger data from multiple preset periods, and the structure of this ledger data remains consistent, typically including the following typical fields: package name, package price, billing period, effective date, data limit, bill number, etc. The ledger data is stored in a structured form with unified field naming and data formatting to facilitate subsequent analysis.

[0145] The system traverses each ledger data in the ledger sample set, extracts the field name, field value type (such as string, number, date), and field value sample contained in each ledger, and counts the frequency of each field in the entire sample.

[0146] Finally, an initial field set is constructed, which includes a ternary information structure of field name → type → frequency of occurrence, in preparation for subsequent field consistency and stability analysis.

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

[0148] If a field appears in all or most of the ledgers in the sample set, it is considered to have a stable structure and is included in the first set of candidate fields. If a field is missing in some ledgers or its structure changes frequently, it is removed from the candidate set. This process can automatically determine field consistency by setting a field co-occurrence threshold (e.g., appearing in ≥90% of the ledgers).

[0149] For each field in the first candidate field set, the system further performs a field value stability assessment. Specifically, the system counts the frequency of value changes for each field across different account periods. If a field's value remains consistent or changes minimally across most account periods, it is marked as a static field.

[0150] For example, if the value of the "Package Name" field is "10G per month" in 5 out of 6 billing periods and "20G per month" in only 1 period, it is judged to be a stable field and can be used as a fixed item in the template field.

[0151] The system assembles the above-mentioned static fields, along with their field names, field types, and field order information, into a standardized ledger field template. This field template represents the common parts of the ledger structure and can be reused across multiple ledger periods.

[0152] The final output field template serves as the basis for the definition of the compressed ledger data structure, is assigned a unique template identifier (template ID), and is stored in the template warehouse for reference by the compression processing module.

[0153] Through the field template construction method described in this embodiment, the system can automatically extract and abstract a stable field structure from historical ledger data, enabling structural reuse during the ledger compression process and avoiding duplicate field transmission. This method not only significantly improves the ledger compression ratio (typically exceeding 10:1), but also effectively enhances the controllability and consistency of the ledger structure. The templated design also supports standardized execution of subsequent decompression and structure restoration operations, offering significant engineering application value for high-concurrency bill generation and distribution services.

[0154] like Figure 2 As shown, the present invention also provides a traffic rate pre-issuance system, comprising:

[0155] The acquisition unit 101 is configured to acquire a user's package selection action instruction, wherein the package selection action instruction includes a package subscription action instruction and a package change action instruction;

[0156] A generating unit 102 is configured to generate account book data of a preset period based on the package selection action instruction, wherein the preset period is determined based on a pre-issuance rate of return;

[0157] The compression unit 103 is used to compress the account book data of the preset period to generate compressed account book data;

[0158] The decompression unit 104 is configured to decompress the compressed account book data to activate the account book data after a billing period is reached.

[0159] The above system can also perform the following steps:

[0160] Obtaining the user's package selection action instruction, wherein the package selection action instruction includes a package ordering action instruction and a package changing action instruction;

[0161] Generate account data for a preset period based on the action instructions selected in the above package;

[0162] Compressing the account book data of the preset period to generate compressed account book data;

[0163] After the billing cycle arrives, the compressed account book data is decompressed to activate the account book data.

[0164] In a feasible implementation manner, the above method further includes:

[0165] Gain the benefits of resource release brought about by the reduction of transactions per second and the increased storage costs of pre-issued ledgers;

[0166] Calculate the margin yield of ledger pre-issuance based on the above resource release income and the above storage cost;

[0167] Adjust the above preset period according to the above pre-issuance boundary yield.

[0168] In a feasible implementation manner, adjusting the preset period according to the pre-issuance boundary yield rate includes:

[0169] Construct an input feature vector including pre-issuance yield, resource pressure status, package subscription behavior, and user change probability;

[0170] The above input feature vector is input into the pre-trained reinforcement learning model, with the maximum pre-launch boundary yield as the goal to obtain the above preset period.

[0171] In one feasible implementation, the process of constructing the above reinforcement learning model includes:

[0172] Define the state space and construct the state vector St used to represent the operating state of the ledger system;

[0173] Define the action space and discretize the number of ledger pre-issuance cycles N into an action set;

[0174] Construct a reward function based on revenue incentives and cost penalties;

[0175] Construct a policy network and a value network. The policy network is used to output the probability of selecting each ledger pre-release period, and the value network is used to estimate the long-term expected return of the current state.

[0176] The advantage value of each state is calculated using generalized advantage estimation, and the above policy network and the above value network are simultaneously optimized using the cut policy optimization algorithm to obtain the above reinforcement learning model.

[0177] In a feasible implementation manner, compressing the account book data of the preset period to generate compressed account book data includes:

[0178] Build a general ledger field set based on the ledger structure as a compression template;

[0179] For each ledger period, record the difference in content and period offset relative to the template field value;

[0180] The compression template, the difference content, and the periodic offset are combined and encoded using an incremental coding compression algorithm to generate the compressed ledger data.

[0181] In a feasible implementation manner, after a billing period is reached, decompressing the compressed ledger data to activate the ledger data includes:

[0182] Obtain the compression template and the period offset in the compressed ledger data;

[0183] Restore the general structure of the ledger based on the field template;

[0184] Replace and complete the fields according to the above differences to generate the ledger instance data for the target period;

[0185] The above account instance data is activated to execute billing services and user bill push processes.

[0186] In a feasible implementation, the above-mentioned construction of a universal ledger field set based on the ledger structure as a compression template includes:

[0187] Obtaining a sample set of ledgers, wherein the sample set of ledgers includes ledger data for multiple preset periods, the ledger data having a unified structure, and the ledger data recording package names, package rates, billing periods, and data quotas;

[0188] Performing a field extraction operation on the ledger data in the sample set of ledgers to obtain an initial field set, wherein the initial field set includes the field name, field value type, and frequency of occurrence in each ledger in the sample set of ledgers;

[0189] Perform field consistency analysis based on the initial field set to determine the field set that exists simultaneously in all ledger data as the first candidate field set.

[0190] Perform a value stability assessment on each field in the first candidate field set, counting the frequency of value changes of the field across periods in the sample set of ledgers. If the value of a field remains consistent in most ledgers, mark the field as a static field.

[0191] Generate a ledger field template based on the above static fields to generate the reusable compressed template mentioned above.

[0192] like Figure 3 As shown, the present invention also provides an electronic device 30, including a memory 310, a processor 320 and a computer program 311 stored in the memory 310 and executable on the processor. When the processor 320 executes the computer program 311, any step of the above-mentioned traffic charge pre-issuance method is implemented.

[0193] The present invention also provides a computer program product, comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium and executes the computer program or computer-executable instructions, causing the electronic device to perform any step of the traffic rate prepayment method described above.

[0194] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for pre-issuing traffic charges, characterized in that: include: Obtaining a user's package selection action instruction, wherein the package selection action instruction includes a package ordering action instruction and a package changing action instruction; Generate account book data for a preset period based on the package selection action instruction, wherein the preset period is determined based on a pre-issuance rate of return; Compressing the account book data of the preset period to generate compressed account book data; After a billing cycle is reached, decompressing the compressed account book data to activate the account book data; The method further comprises: Gain the benefits of resource release brought about by the reduction of transactions per second and the increased storage costs of pre-issued ledgers; Calculate the book pre-issuance boundary yield rate based on the resource release income and the storage cost; Adjusting the preset period according to the pre-issuance boundary yield; The compressing the account book data of the preset period to generate compressed account book data includes: Build a general ledger field set based on the ledger structure as a compression template; For each ledger period, record the difference in content and period offset relative to the template field value; Combining and encoding the compression template, the difference content, and the periodic offset using an incremental coding compression algorithm to generate the compressed ledger data; The process of constructing a universal ledger field set based on the ledger structure as a compression template includes: Obtaining a sample account book set, wherein the sample account book set includes account book data for multiple preset periods, the account book data has a unified structure, and the account book data records a package name, package price, billing period, and data quota; Performing a field extraction operation on the ledger data in the sample set of ledgers to obtain an initial field set, wherein the initial field set includes a field name, a field value type, and an occurrence frequency of the field in each ledger; Performing a field consistency analysis operation based on the initial field set to determine a field set that exists simultaneously in all ledger data as a first candidate field set; Perform a value stability assessment on each field in the first candidate field set, counting the frequency of value changes of the field across periods in the sample set of ledgers. If the value of a field remains consistent in most ledgers, mark the field as a static field. Generate a ledger field template based on the static field to generate the reusable compressed template.

2. The method for pre-issuing traffic charges according to claim 1, characterized in that: The adjusting the preset period according to the pre-issuance boundary yield rate includes: Construct an input feature vector including pre-issuance yield, resource pressure status, package subscription behavior, and user change probability; The input feature vector is input into a pre-trained reinforcement learning model, with the maximum pre-launch boundary yield as the goal, to obtain the preset period.

3. The method for pre-issuing traffic charges according to claim 2, characterized in that: The construction process of the reinforcement learning model includes: Define the state space and construct the 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 cycles N into an action set; Construct a reward function based on revenue incentives and cost penalties; Construct a policy network and a value network, where the policy network is used to output the selection probability of each ledger pre-release cycle number, and the value network is used to estimate the long-term expected return of the current state; The advantage value of each state is calculated using generalized advantage estimation, and the policy network and the value network are simultaneously optimized using a cut policy optimization algorithm to obtain the reinforcement learning model.

4. The method for pre-issuing traffic charges according to claim 3, characterized in that: After the billing period arrives, decompressing the compressed account data to activate the account data includes: Obtaining the compression template and the period offset in the compressed account book data; Restore the general structure of the ledger based on the field template; Replace and complete fields according to the differences to generate the ledger instance data for the target period; The account instance data is activated to execute the billing service and user bill push process.

5. A traffic rate pre-issuance system, characterized in that: include: An acquiring unit, configured to acquire a user's package selection action instruction, wherein the package selection action instruction includes a package subscription action instruction and a package change action instruction; A generating unit, configured to generate account book data of a preset period based on the package selection action instruction, wherein the preset period is determined based on a pre-issuance rate of return; A compression unit, configured to compress the account book data of the preset period to generate compressed account book data; a decompression unit, configured to decompress the compressed account book data to activate the account book data after a billing cycle is reached; The compressing the account book data of the preset period to generate compressed account book data includes: Build a general ledger field set based on the ledger structure as a compression template; For each ledger period, record the difference in content and period offset relative to the template field value; Combining and encoding the compression template, the difference content, and the periodic offset using an incremental coding compression algorithm to generate the compressed ledger data; The process of constructing a universal ledger field set based on the ledger structure as a compression template includes: Obtaining a sample account book set, wherein the sample account book set includes account book data for multiple preset periods, the account book data has a unified structure, and the account book data records a package name, package price, billing period, and data quota; Performing a field extraction operation on the ledger data in the sample set of ledgers to obtain an initial field set, wherein the initial field set includes a field name, a field value type, and an occurrence frequency of the field in each ledger; Performing a field consistency analysis operation based on the initial field set to determine a field set that exists simultaneously in all ledger data as a first candidate field set; Perform a value stability assessment on each field in the first candidate field set, counting the frequency of value changes of the field across periods in the sample set of ledgers. If the value of a field remains consistent in most ledgers, mark the field as a static field. Generate a ledger field template based on the static field to generate the reusable compressed template.

6. An electronic device comprising: A memory and a processor, characterized in that the processor is used to implement the steps of the traffic tariff pre-issuance method as described in any one of claims 1 to 4 when executing the computer program stored in the memory.

7. 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 traffic tariff pre-issuance method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Communication consumption monthly bill prediction method and system

    CN116796266A

  • Bill generation method, system and device, medium and computer program product

    CN118365447A