CN113806379A - Pricing method, device and equipment based on threshold optimistic lock and computer medium - Google Patents
Pricing method, device and equipment based on threshold optimistic lock and computer medium Download PDFInfo
- Publication number
- CN113806379A CN113806379A CN202010544869.8A CN202010544869A CN113806379A CN 113806379 A CN113806379 A CN 113806379A CN 202010544869 A CN202010544869 A CN 202010544869A CN 113806379 A CN113806379 A CN 113806379A
- Authority
- CN
- China
- Prior art keywords
- version number
- ticket
- user
- threshold interval
- current
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 70
- 238000012545 processing Methods 0.000 claims abstract description 51
- 238000004891 communication Methods 0.000 claims abstract description 17
- 230000007246 mechanism Effects 0.000 claims description 17
- 230000009286 beneficial effect Effects 0.000 abstract 1
- 230000008569 process Effects 0.000 description 27
- 238000004590 computer program Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2308—Concurrency control
- G06F16/2336—Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
- G06F16/2343—Locking methods, e.g. distributed locking or locking implementation details
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0283—Price estimation or determination
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/60—Business processes related to postal services
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Development Economics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Game Theory and Decision Science (AREA)
- Entrepreneurship & Innovation (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Human Resources & Organizations (AREA)
- Primary Health Care (AREA)
- Tourism & Hospitality (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention relates to the technical field of network communication charging processing, and discloses a method for optimistic locking pricing based on a threshold value, which comprises the following steps: obtaining a bill to be batched of a user; acquiring the current usage amount of user resources, a rating threshold interval and an initial version number according to the bill to be rated; determining whether the current usage exceeds a batch price threshold interval; if not, performing rating processing on the ticket to be rated, completing charging and resource updating of the ticket to be rated, and generating a new version number; if so, comparing whether the initial version number is the same as the first current version number; if the initial version number is the same as the first current version number in the database table, the standard ticket is priced, the charging and the resource updating of the ticket to be priced are completed, and a new version number is generated. By the mode, the method and the device have the beneficial effect of improving the batch price processing performance and efficiency.
Description
Technical Field
The embodiment of the invention relates to the technical field of network communication, in particular to a pricing method, a pricing device, pricing equipment and a computer-readable storage medium based on a threshold optimistic lock.
Background
In the charging system of the telecommunication industry, the traffic service can be charged according to the ticket issued by the network element side, and for the high efficiency of charging, the free resources/accumulated amount in the traffic service can be stored in a database (charging MDB). The main modules involved in the billing process include: a call ticket decoding module, a service analysis module, a charging MDB module and a rating module.
A ticket decoding module: after the original telephone bills generated by the network elements of different manufacturers are collected, the original telephone bills are converted according to the established rules to form the internal telephone bills in the standard format so as to be convenient for the subsequent unified charging.
A service analysis module: and inquiring user subscription information in the MDB, analyzing a service consumption scene of the user, and delivering the analyzed ticket to pricing processing.
And a charging MDB module: and the database of the charging system stores the free resource/accumulated amount use condition of the full amount of users. Supporting the object control capability, providing free resource/accumulated amount inquiry for the periphery, and updating the interface.
A rating module: and (4) combining the subscription information of the user and the used free resource/accumulated amount information, and rating the ticket according to an agreed rate to complete the charging of the original ticket of the user and the updating of the resource.
The mode can well support the charging of the flow service of the common user, but with the development of the flow sharing service of the Internet of things/group, a scene that millions of users share a resource pool appears, and the wholesale price processing performance is seriously reduced in the mode, so that the requirement of the flow charging efficiency of the Internet of things cannot be met.
At present, a long lock updating mode is adopted when rating and MDB are interacted, namely, a user is locked when MDB data is inquired out, the user is unlocked after updating is completed, and the consistency of the data under the condition of concurrent updating is ensured.
This approach has no problem for a single user, but for group free resource sharing service, MDB locking and unlocking are performed on group owner users, and when there are a large number of users under the traffic sharing service/large account of the internet of things, the generation of batch tickets by the users will cause the lock conflict of the group users to be very serious, resulting in:
under a large group/large account, the long-locking mechanism causes the call tickets under the group/account to be processed only according to the sequence (namely when one process processes the call tickets of the same type, other processes processing the call tickets of the same type can only wait), and the efficiency of processing the call tickets of the same type is low, thereby causing the untimely pricing.
Under the above conditions, when a large number of group/large account call tickets are waiting and occupy all rating processes, the call ticket rating of the ordinary user is waited, and the rating efficiency of the ordinary user is affected.
If the long lock mode is improved to the optimistic lock mode, namely, the optimistic lock mode is inquired and used, the consistency of objects is guaranteed through version number comparison, and the concurrency problem can be relieved to a certain extent. However, when a large number of call tickets come under a large account, and an optimistic lock updating mode is used, a large number of version numbers are inconsistent, so that data consistency verification fails, updating is unsuccessful, and finally a long lock mode needs to be taken again. In such extreme cases, the amount of concurrency cannot be significantly increased.
Therefore, the improvement of the pricing efficiency of the traffic service under the group/large account is an urgent technical problem to be solved.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present invention provide a pricing method, apparatus, device and computer readable storage medium based on a threshold optimistic lock, so as to solve the technical problem in the prior art that the efficiency of business pricing is low.
According to an aspect of an embodiment of the present invention, there is provided a pricing method based on a threshold optimistic lock, the method including:
obtaining a bill to be batched of a user;
acquiring the current usage amount of user resources, a rating threshold interval and an initial version number according to the ticket to be rated, wherein the rating threshold interval and the initial version number are stored in a database table;
determining whether the current usage exceeds the rating threshold interval;
if the current usage does not exceed the rating threshold interval, performing rating processing on the ticket to be rated, completing charging and resource updating of the ticket to be rated, and generating a new version number;
if the current usage amount exceeds the rating threshold interval, acquiring a first current version number from the database table, and comparing whether the initial version number is the same as the first current version number;
and if the initial version number is the same as the first current version number, pricing the ticket to be priced, completing charging and resource updating of the ticket to be priced, and generating a new version number.
In an optional manner, obtaining a ticket to be priced for a user further includes:
collecting a bill to be priced of a user through a network element;
decoding and converting the bill to be priced to form a standard bill to be priced;
and performing service analysis on the standard ticket to be priced to obtain the ticket to be priced, wherein the ticket to be priced comprises user account identification information, user consumption categories and corresponding resource use increment.
In an optional manner, obtaining the current usage amount of the user resource, the rating threshold interval, and the initial version number according to the ticket to be rated, further includes:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
In an optional manner, before the step of obtaining a first current version number from the database table and comparing whether the initial version number is the same as the first current version number if the current usage exceeds the rating threshold interval, the method further includes the following steps:
if the current usage amount exceeds a batch price threshold interval, analyzing whether a new user product tariff exists;
if the new user product tariff exists, acquiring a second current version number from a database table, and comparing whether the initial version number is the same as the second current version number;
and if the user product price is the same as the user product price, determining a new wholesale price threshold interval according to the new user product price, and updating the new threshold interval into the database table.
In an optional manner, if the current usage amount exceeds the rating threshold interval, comparing whether the initial version number is the same as the first current version number, further includes:
if the initial version number is different from the first current version number in the database table, the rating processing fails, and the rating processing is performed on the ticket to be rated again by adopting a long locking mechanism.
According to another aspect of the embodiments of the present invention, there is also provided a pricing apparatus based on a threshold optimistic lock, including:
the ticket acquiring module is used for acquiring a to-be-batched ticket of the user;
the data query module is used for acquiring the current usage amount of the user resource, a rating threshold interval and an initial version number according to the to-be-batched bill, wherein the rating threshold interval and the initial version number are stored in a database table;
a threshold interval checking module, configured to determine whether the current usage amount exceeds the pricing threshold interval;
the first data updating module is used for carrying out rating processing on the ticket to be rated if the current usage does not exceed the rating threshold interval, completing charging and resource updating of the ticket to be rated and generating a new version number;
the version comparison module is used for comparing whether the initial version number is the same as the first current version number in the database or not if the current usage amount exceeds the rating threshold interval;
and the second data updating module is used for pricing the ticket to be priced if the initial version number is the same as the first current version number in the database, completing charging and resource updating of the ticket to be priced and generating a new version number.
In an optional manner, the ticket obtaining module obtains a to-be-approved ticket of the user, and further includes:
collecting a bill to be priced of a user through a network element;
decoding and converting the bill to be priced to form a standard bill to be priced;
and performing service analysis on the standard ticket to be priced to obtain the ticket to be priced, wherein the ticket to be priced comprises user account identification information, user consumption categories and corresponding resource use increment.
In an optional manner, the information obtaining module obtains the current usage amount of the user resource, the rating threshold interval, and the initial version number according to the ticket to be rated, and further includes:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
According to another aspect of the embodiments of the present invention, there is provided a pricing device based on a threshold optimistic lock, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation of the pricing method based on the threshold optimistic lock.
According to another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, wherein at least one executable instruction is stored in the storage medium, and when the executable instruction is executed on a pricing device/apparatus based on a threshold optimistic lock, the pricing device/apparatus based on the threshold optimistic lock performs the operation of the pricing method based on the threshold optimistic lock.
According to the pricing method based on the threshold optimistic lock, the consistent pricing of the optimistic lock is judged based on the threshold, the improved pricing of the optimistic lock mode is achieved for specific services on the basis of the pricing based on the long lock mode, the mode of conducting consistency judgment on a single judgment version number when the optimistic lock is updated is improved, judgment of a threshold interval is increased, the problem of concurrence under large-account batch ticket processing is solved, the use limitation of the optimistic lock is expanded, and the pricing processing performance and efficiency of group/large-account flow service are improved.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
Drawings
The drawings are only for purposes of illustrating embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart diagram illustrating a pricing method based on a threshold optimistic lock according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a pricing apparatus for providing optimistic lock based on threshold according to an embodiment of the present invention;
fig. 3 shows a schematic structural diagram of a pricing device based on a threshold optimistic lock according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein.
The pricing method based on the threshold optimistic lock changes the pricing mode from a pessimistic lock mode of a long lock to an optimistic lock mode by changing an MDB inquiry locking/updating unlocking mechanism. The database table comprising the version number and the threshold interval is arranged in the database, locking is not performed during query, an optimistic locking mode is used during updating, the threshold interval is added in the optimistic locking model and is determined according to the free resource amount of a product ordered by a user, and the updating is directly successful without comparing the version number in the threshold interval. When the version number is not in the threshold interval or the threshold interval is updated, the version number needs to be compared, so that the consistency of the objects is ensured. Therefore, when a large number of call bills are generated under the group/large account in batch, the concurrent processing of call bill pricing is realized.
Fig. 1 is a flowchart illustrating a pricing method based on a threshold optimistic lock according to an embodiment of the present invention, where the method is executed by a pricing device based on a threshold optimistic lock. As shown in fig. 1, the method comprises the steps of:
s110: and obtaining a bill to be batched of the user.
The method comprises the steps that network elements of different manufacturers collect price waiting tickets of users, the price waiting tickets of the users are obtained, a ticket decoding unit carries out conversion decoding on the price waiting tickets according to a preset rule to form price waiting standard tickets, the price waiting standard tickets are analyzed by a service analysis unit, the service analysis unit inquires memory data corresponding to user account identification information in a database according to the user account identification information in the price waiting standard tickets, the memory data are user ordering information, free resource information or accumulated resource information, and a service consumption scene of the users is analyzed to obtain the price waiting tickets. The price waiting list comprises user consumption categories and corresponding resource use increment. And the service analysis unit sends the pricing call ticket information to the current pricing thread.
S120: and acquiring the current usage amount of the user resource, a rating threshold interval and an initial version number according to the bill to be rated, wherein the rating threshold interval and the initial version number are stored in a database table.
After receiving the ticket to be priced, the current pricing thread sends an asset query request to a database (MDB) so as to acquire the current usage amount of the user resource, the pricing threshold interval and the initial version number corresponding to the user account representation information from the database.
In this embodiment, the database is a Memory Database (MDB) of the charging system, in which information such as free resource information and accumulated resource usage amount of a full user account is stored. And obtaining the current usage amount of the user resource according to the current resource usage increment in the standard ticket of the to-be-batched prices of the user analyzed by the service analysis unit and the accumulated resource usage amount recorded in the database, namely calculating the current usage amount by adding the current resource usage increment and the accumulated resource usage amount. The user resources can be free internet traffic, free call duration, free short message number and other resources of the user.
The database (MDB) also stores a database table including a version number and a threshold interval, and is used for storing user account identification information, an attribution type, a version number, a threshold interval start value, a threshold interval end value, a threshold interval type, and the like of a user in a form of a table field, as shown in table 1. The database tables are initialized when the user is first priced. And comparing the change of the version number through the value corresponding to the version number. The version number is initialized to 0, when data is read, values of fields such as a threshold interval, a version number (version _ seq) and the like in a database table are read together according to user account identification information, and the value of the version number is added with 1 when the rating is completed once, namely, when the bill charging and resource updating are completed once.
Name of field | Field description | Description of field |
owner_id | User account identification information | Group/account number, etc |
owner_type | Attribution type | Groups/accounts, etc |
version_seq | Version number | 0 |
beg_val | Threshold interval starting value | 0 |
end_val | Threshold interval end value | 10G |
val_type | Threshold interval type | Free resource type |
TABLE 1
The threshold interval type comprises a free resource type and an accumulative resource type, wherein the free resource type means that the resource is free in the threshold interval; the accumulative resource type means that charging is performed according to the accumulative usage of the resource. The threshold interval refers to the total free resource amount or the tariff gear interval owned by the product ordered by the user account. For a free resource type, for example, if a user orders a 100-yuan 10G product, 10G is a threshold interval, and the 10G threshold interval type is a free resource type. At this time, beg _ val is 0, end _ val is 10485760K (10G), and val _ type is 10 (free resource type). For the accumulated resource type, the tariff shift interval is a threshold interval, for example, [0G,1G ] is 10 yuan/G, where beg _ val is 0, end _ val is 1048576K (1G), and val _ type is 11 (accumulated resource type); [1G,10G ] is 5-membered/G, where beg _ val is 1048576K, end _ val is 10485760K (1G), and val _ type is 11 (threshold interval type).
Therefore, the specific steps of obtaining the current usage amount, the batch price threshold interval and the initial version number include:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
User information (such as a group/account number and the like) is obtained from the bill to be priced through the steps, and a pricing threshold interval corresponding to the user and an initial version number in the database are determined according to the user information. The initial version number indicates the latest version number stored in a database read in advance before the current pricing is performed.
Step 130: and determining whether the current usage exceeds a lot price threshold interval.
The unit prices of the resources in the wholesale price threshold interval are the same, so whether the charging standard of the current usage amount of the user account changes is judged based on the wholesale price threshold interval inquired from the database table, and if yes, the charging standard exceeds the free resource interval.
Step 140: and if the current usage does not exceed the rating threshold interval, performing rating processing on the ticket to be rated, completing charging and resource updating of the ticket to be rated, and generating a new version number.
The step is to check the batch price threshold interval stored in the database table, and the unit price of the resource represented by the batch price threshold interval is the same in the batch price threshold interval, so that when the current usage (the current resource usage increment plus the accumulated resource usage) is less than or equal to the threshold interval stored in the database table, the accumulated resource usage can be randomly updated without comparing the version number. If a free resource or an accumulated amount satisfies (beg _ val + used amount + present increment + end _ val), processing a bill to be priced, specifically, adding the present resource use increment to the accumulated resource use amount, updating the accumulated resource use amount, and generating a new version number. In this embodiment, generating a new version number is to add 1 to the initial version number in the database table and store the new version number in the database.
Step 150: and if the current usage exceeds the pricing threshold interval, acquiring a first current version number from the database table, and comparing whether the initial version number is the same as the first current version number based on an optimistic lock mechanism.
If the check of the threshold interval fails, the current usage amount exceeds the threshold interval, at this time, the cumulative resource usage amount is updated through the optimistic lock, and whether the initial version number is the same as the first current version number in the database is compared. And the first current version number is the latest version number acquired from the database table after judging that the current usage amount exceeds the rating threshold interval and before carrying out rating bill charging and resource updating in the rating processing. That is, because the database is not locked during rating processing, there may be other rating threads that update data during the execution of the current rating thread, and update the version number in the database table. Therefore, when the current usage exceeds the threshold interval, it needs to be determined whether there are other rating threads updating the database in the rating process, read the first current version number from the database table, and compare whether the initial version number is consistent with the first current version number in the database. If the data are consistent with the data, the data are not updated in the pricing process, and the pricing can be updated at the time. If the two are not consistent, the data updating is performed in the process of executing the rating thread, namely, the charging and the resource of the rating bill are updated, and the data updating fails.
If the current usage exceeds the rating threshold interval stored in the database table, comparing whether the initial version number is the same as the first current version number in the database, and before, further comprising: if the current usage exceeds the rating threshold interval, returning to the service analysis unit to analyze whether a new user product tariff exists, determining whether a new rating threshold interval exists, if so, updating the rating threshold interval according to the new user product tariff, reading a second current version number from a database table of the database before updating the rating threshold interval, comparing whether the initial version number is the same as the second current version number, and if so, updating the rating threshold interval to obtain the new rating threshold interval. For example, after the 2G free resources of the user are used up, the user subscribes to the 1G free resources, and the 1G becomes a new threshold. And after a new rating threshold interval is obtained, checking the rating threshold interval, judging whether the current usage exceeds the new threshold interval, if not, directly updating, and updating the version number. If the version number is consistent, the pricing is processed, and charging and resource updating of the bill to be priced are carried out. If the new threshold interval is not exceeded, the pricing is failed, and the charging and resource updating of the bill to be priced are failed. And comparing the version numbers after the rating threshold interval is not updated any more and the usage amount of the user exceeds the rating threshold interval, and if the version numbers are the same, successfully updating, otherwise, failing to update.
Step 160: and if the initial version number is the same as the first current version number in the database, rating the ticket to be priced, completing the charging and resource updating of the ticket to be priced, and generating a new version number.
And comparing whether the initial version number is consistent with the first current version number in the database. If the resource usage increment is consistent with the resource usage increment, the resource usage increment is added into the accumulated resource usage amount, and a new version number is generated at the same time. In this embodiment, generating a new version number is to add 1 to the initial version number in the database table and store the version number in the database.
The present embodiment further includes step 170: if the initial version number is different from the first current version number, namely the initial version number is different from the latest version number in the database, the data corresponding to the user account in the database is changed, and the pricing processing is performed on the ticket to be priced again by adopting a long locking mechanism.
If the user resources are inconsistent with the user resources in the user account, it is indicated that other rating threads update the user resources in the user account in the database in the rating process, and the rating process fails at this time, that is, the charging and resource updating of the to-be-batched ticket fails.
In this embodiment, if the current pricing and pricing process fails, the ticket to be priced is reset and sent to the service analysis unit for service analysis again, and a long-locking mechanism is used for pricing process, that is, the user account in the database is locked when the data in the database is queried, and the user account is unlocked after the charging and resource updating of the ticket to be priced are completed, so that the consistency of the data under the condition of concurrent updating is ensured. The long lock mechanism is a pessimistic lock, which means that data is in a locked state in the data processing process and can be realized by using a lock mechanism of a database.
The pricing method based on the threshold optimistic lock of the embodiment judges the consistent pricing of the optimistic lock based on the threshold, realizes the improved pricing of the optimistic lock mode for specific services on the basis of the pricing based on the long lock mode, improves the mode of judging the consistency of a single judgment version number when the optimistic lock is updated, and increases the judgment of the threshold interval. The database table comprising the version number and the threshold interval is arranged in the database, locking is not performed during query, an optimistic locking mode is used during updating, the threshold interval is added in the optimistic locking model and is determined according to the free resource amount of a product ordered by a user, and the updating is directly successful without comparing the version number in the threshold interval. When the version number is not in the threshold interval or the threshold interval is updated, the version number needs to be compared, so that the consistency of the objects is ensured. The problem of concurrency under the large-account batch ticket processing is solved, the use limitation of the optimistic lock is expanded, and the group/large-account flow business pricing processing performance and efficiency are improved.
Fig. 2 is a schematic structural diagram illustrating an embodiment of a pricing apparatus based on a threshold optimistic lock according to the present invention. As shown in fig. 2, the apparatus 200 includes: the system comprises a ticket acquiring module 210, a data query module 220, a threshold interval checking module 230, a first data updating module 240, a version comparing module 250, a second data updating module 260 and a long lock pricing processing module 270.
The ticket acquiring module 210 is configured to acquire a to-be-batched ticket of the user.
And the data query module 220 is configured to obtain the current usage amount of the user resource, a rating threshold interval and an initial version number according to the to-be-batched bill, where the rating threshold interval and the initial version number are stored in a database table.
A threshold interval checking module 230, configured to determine whether the current usage amount exceeds the rating threshold interval.
And the first data updating module 240 is configured to perform rating processing on the ticket to be rated if the current usage amount does not exceed the rating threshold interval, complete charging and resource updating on the ticket to be rated, and generate a new version number.
And a version comparison module 250, configured to obtain a first current version number from the database table if the current usage exceeds the rating threshold interval, and compare whether the initial version number is the same as the first current version number in the database.
And the second data updating module 260 is configured to, if the initial version number is the same as the first current version number in the database, perform rating on the ticket to be priced, complete charging and resource updating on the ticket to be priced, and generate a new version number.
The pricing device based on the threshold optimistic lock further comprises a long lock pricing processing module 270, which is used for performing pricing processing by using a long lock mechanism if the initial version number is different from the latest version number in the database.
The specific working process of each module is as follows:
the ticket acquiring module 210 acquires a to-be-batched ticket of the user.
The method comprises the steps that network elements of different manufacturers collect price waiting tickets of users, the price waiting tickets of the users are obtained, a ticket decoding unit carries out conversion decoding on the price waiting tickets according to a preset rule to form price waiting standard tickets, the price waiting standard tickets are analyzed by a service analysis unit, the service analysis unit inquires memory data corresponding to user account identification information in a database according to the user account identification information in the price waiting standard tickets, the memory data are user ordering information, free resource information or accumulated resource information, and a service consumption scene of the users is analyzed to obtain the price waiting tickets. The price waiting list comprises user consumption categories and corresponding resource use increment. And the service analysis unit sends the pricing call ticket information to the current pricing thread.
The data query module 220 obtains the current usage amount of the user resource, the rating threshold interval and the initial version number according to the to-be-rated bill, wherein the rating threshold interval and the initial version number are stored in a database table.
After receiving the price waiting list, the current pricing thread sends an asset query request to a database (MDB) by the data query module 220, so as to obtain the current usage amount of the user resource, the pricing threshold interval and the initial version number corresponding to the user account identification information from the database.
In this embodiment, the database is a Memory Database (MDB) of the charging system, in which information such as free resource information and accumulated resource usage amount of a full user account is stored. And obtaining the current usage amount of the user resource according to the current resource usage increment in the standard ticket of the to-be-batched prices of the user analyzed by the service analysis unit and the accumulated resource usage amount recorded in the database, namely calculating the current usage amount by adding the current resource usage increment and the accumulated resource usage amount. The user resources can be free internet traffic, free call duration, free short message number and other resources of the user.
The database (MDB) also stores a database table including a version number and a threshold interval, and is used for storing user account identification information, an attribution type, a version number, a threshold interval start value, a threshold interval end value, a threshold interval type, and the like of a user in a form of a table field, as shown in table 1. The database tables are initialized when the user is first priced. And comparing the change of the version number through the value corresponding to the version number. The version number is initialized to 0, when data is read, values of fields such as a threshold interval, a version number (version _ seq) and the like in a database table are read together according to user account identification information, and the value of the version number is added with 1 when the rating is completed once, namely, when the bill charging and resource updating are completed once.
TABLE 1
The threshold interval type comprises a free resource type and an accumulative resource type, wherein the free resource type means that the resource is free in the threshold interval; the accumulative resource type means that charging is performed according to the accumulative usage of the resource. The threshold interval refers to the total free resource amount or the tariff gear interval owned by the product ordered by the user account. For a free resource type, for example, if a user orders a 100-yuan 10G product, 10G is a threshold interval, and the 10G threshold interval type is a free resource type. At this time, beg _ val is 0, end _ val is 10485760K (10G), and val _ type is 10 (free resource type). For the accumulated resource type, the tariff shift interval is a threshold interval, for example, [0G,1G ] is 10 yuan/G, where beg _ val is 0, end _ val is 1048576K (1G), and val _ type is 11 (accumulated resource type); [1G,10G ] is 5-membered/G, where beg _ val is 1048576K, end _ val is 10485760K (1G), and val _ type is 11 (threshold interval type).
Therefore, the specific working process of the data query module 220 for obtaining the current usage amount, the batch price threshold interval and the initial version number includes:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
By the method, user information (such as numbers of groups/accounts and the like) is obtained from the bill to be batched, and a batching threshold interval corresponding to the user and an initial version number in the database are determined according to the user information. The initial version number indicates the latest version number stored in a database acquired in advance before the current pricing is performed.
The threshold interval check module 230 determines whether the current usage exceeds the lot threshold interval.
The unit prices of the resources in the wholesale price threshold interval are the same, so whether the charging standard of the current usage amount of the user account changes is judged based on the wholesale price threshold interval inquired from the database table, and if yes, the charging standard exceeds the free resource interval.
If the current usage amount does not exceed the rating threshold interval, the first data updating module 240 performs rating processing on the ticket to be rated, completes charging and resource updating of the ticket to be rated, and generates a new version number.
The step is to check the batch price threshold interval stored in the database table, and the unit price of the resource represented by the batch price threshold interval is the same in the batch price threshold interval, so that when the current usage (the current resource usage increment plus the accumulated resource usage) is less than or equal to the threshold interval stored in the database table, the accumulated resource usage can be randomly updated without comparing the version number. If a free resource or an accumulated amount satisfies (beg _ val + used amount + present increment + end _ val), processing a bill to be priced, specifically, adding the present resource use increment to the accumulated resource use amount, updating the accumulated resource use amount, and generating a new version number. In this embodiment, generating a new version number is to add 1 to the initial version number in the database table and store the new version number in the database.
If the current usage exceeds the rating threshold interval, the version comparison module 250 obtains a first current version number from the database table, and compares whether the initial version number is the same as the first current version number based on an optimistic lock mechanism.
If the check of the threshold interval fails, the current usage amount exceeds the threshold interval, at this time, the cumulative resource usage amount is updated through the optimistic lock, and whether the initial version number is the same as the first current version number in the database is compared. And the first current version number is the latest version number acquired from the database table after judging that the current usage amount exceeds the rating threshold interval and before carrying out rating bill charging and resource updating in the rating processing. That is, because the database is not locked during rating processing, there may be other rating threads that update data during the execution of the current rating thread, and update the version number in the database table. Therefore, when the current usage exceeds the threshold interval, it needs to be determined whether there are other rating threads updating the database in the rating process, read the first current version number from the database table, and compare whether the initial version number is consistent with the first current version number in the database. If the data are consistent with the data, the data are not updated in the pricing process, and the pricing can be updated at the time. If the two are not consistent, the data updating is performed in the process of executing the rating thread, namely, the charging and the resource of the rating bill are updated, and the data updating fails.
If the current usage exceeds the rating threshold interval stored in the database table, comparing whether the initial version number is the same as the first current version number in the database, and before, further comprising: if the current usage exceeds the rating threshold interval, returning to the service analysis unit to analyze whether a new user product tariff exists, determining whether a new rating threshold interval exists, if so, updating the rating threshold interval according to the new user product tariff, reading a second current version number from a database table of the database before updating the rating threshold interval, comparing whether the initial version number is the same as the second current version number, and if so, updating the rating threshold interval to obtain the new rating threshold interval. For example, after the 2G free resources of the user are used up, the user subscribes to the 1G free resources, and the 1G becomes a new threshold. And after a new rating threshold interval is obtained, checking the rating threshold interval, judging whether the current usage exceeds the new threshold interval, if not, directly updating, and updating the version number. If the version number is consistent, the pricing is processed, and charging and resource updating of the bill to be priced are carried out. If the new threshold interval is not exceeded, the pricing is failed, and the charging and resource updating of the bill to be priced are failed. And comparing the version numbers after the rating threshold interval is not updated any more and the usage amount of the user exceeds the rating threshold interval, and if the version numbers are the same, successfully updating, otherwise, failing to update.
If the initial version number is the same as the first current version number in the database, the second data updating module 260 performs rating on the ticket to be priced, completes charging and resource updating on the ticket to be priced, and generates a new version number.
And comparing whether the initial version number is consistent with the first current version number in the database. If the data is consistent with the data, the data is stored in the database after the data is updated, which means that no other rating thread updates the resource of the user in the database in the rating process, that is, the rating process can charge the rating bill and update the resource.
The embodiment further includes a long-lock pricing processing module 270, and if the initial version number is different from the latest version number in the database, it indicates that the data in the database has changed, and the long-lock pricing processing module 270 performs pricing processing on the ticket to be priced again by using a long-lock mechanism.
If the two are not consistent, it is indicated that other rating threads update the data of the user resource in the database in the rating process, and the rating process fails at this time, that is, the charging and resource updating of the to-be-batched bill are failed.
In this embodiment, if the current pricing and pricing process fails, the ticket to be priced is reset and sent to the service analysis unit for service analysis again, and a long-locking mechanism is used for pricing process, that is, the user account in the database is locked when the data in the database is queried, and the user account is unlocked after the charging and resource updating of the ticket to be priced are completed, so that the consistency of the data under the condition of concurrent updating is ensured. The long lock mechanism is a pessimistic lock, which means that data is in a locked state in the data processing process and can be realized by using a lock mechanism of a database.
The pricing device based on the threshold optimistic lock of the embodiment judges the pricing of the optimistic lock in consistency based on the threshold, realizes the improved pricing of the optimistic lock mode for specific services on the basis of the pricing based on the long lock mode, improves the mode of judging the consistency of a single judgment version number when the optimistic lock is updated, and increases the judgment of a threshold interval. The database table comprising the version number and the threshold interval is arranged in the database, locking is not performed during query, an optimistic locking mode is used during updating, the threshold interval is added in the optimistic locking model and is determined according to the free resource amount of a product ordered by a user, and the updating is directly successful without comparing the version number in the threshold interval. When the version number is not in the threshold interval or the threshold interval is updated, the version number needs to be compared, so that the consistency of the objects is ensured. The problem of concurrency under the large-account batch ticket processing is solved, the use limitation of the optimistic lock is expanded, and the group/large-account flow business pricing processing performance and efficiency are improved.
Fig. 3 is a schematic structural diagram illustrating an embodiment of a pricing device based on a threshold optimistic lock according to the present invention, and the specific implementation of the pricing device based on the threshold optimistic lock is not limited by the specific embodiment of the present invention.
As shown in fig. 3, the pricing device based on the threshold optimistic lock may include: a processor (processor)302, a Communications Interface 304, a memory 506, and a communication bus 308.
Wherein: the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 508. A communication interface 304 for communicating with network elements of other devices, such as clients or other application servers. The processor 302 is configured to execute the program 310, and may specifically execute the relevant steps in the above embodiment of the rating method for optimistic lock based on the threshold.
In particular, program 310 may include program code comprising computer-executable instructions.
The processor 302 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The identity authentication device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Specifically, the program 310 may be invoked by the processor 302 to cause the electronic device to perform the following operations:
obtaining a bill to be batched of a user;
acquiring the current usage amount of user resources, a rating threshold interval and an initial version number according to the ticket to be rated, wherein the rating threshold interval and the initial version number are stored in a database table;
determining whether the current usage exceeds the rating threshold interval;
if the current usage does not exceed the rating threshold interval, performing rating processing on the ticket to be rated, completing charging and resource updating of the ticket to be rated, and generating a new version number;
if the current usage amount exceeds the rating threshold interval, acquiring a first current version number from the database table, and comparing whether the initial version number is the same as the first current version number;
and if the initial version number is the same as the first current version number, pricing the ticket to be priced, completing charging and resource updating of the ticket to be priced, and generating a new version number.
In an optional manner, obtaining a ticket to be priced for a user further includes:
collecting a bill to be priced of a user through a network element;
decoding and converting the bill to be priced to form a standard bill to be priced;
and performing service analysis on the standard ticket to be priced to obtain the ticket to be priced, wherein the ticket to be priced comprises user account identification information, user consumption categories and corresponding resource use increment.
In an optional manner, obtaining the current usage amount of the user resource, the rating threshold interval, and the initial version number according to the ticket to be rated, further includes:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
In an optional manner, before the step of obtaining a first current version number from the database table and comparing whether the initial version number is the same as the first current version number if the current usage exceeds the rating threshold interval, the method further includes the following steps:
if the current usage amount exceeds a batch price threshold interval, analyzing whether a new user product tariff exists;
if the new user product tariff exists, acquiring a second current version number from a database table, and comparing whether the initial version number is the same as the second current version number;
and if the user product price is the same as the user product price, determining a new wholesale price threshold interval according to the new user product price, and updating the new threshold interval into the database table.
In an optional manner, if the current usage amount exceeds the rating threshold interval, comparing whether the initial version number is the same as the first current version number, further includes:
if the initial version number is different from the first current version number in the database table, the rating processing fails, and the rating processing is performed on the ticket to be rated again by adopting a long locking mechanism.
The pricing equipment based on the threshold optimistic lock of the embodiment judges the consistent pricing of the optimistic lock based on the threshold, realizes the improved pricing of the optimistic lock mode for specific services on the basis of the pricing based on the long lock mode, improves the mode of judging the consistency of a single judgment version number when the optimistic lock is updated, and increases the judgment of the threshold interval. The database table comprising the version number and the threshold interval is arranged in the database, locking is not performed during query, an optimistic locking mode is used during updating, the threshold interval is added in the optimistic locking model and is determined according to the free resource amount of a product ordered by a user, and the updating is directly successful without comparing the version number in the threshold interval. When the version number is not in the threshold interval or the threshold interval is updated, the version number needs to be compared, so that the consistency of the objects is ensured. The problem of concurrency under the large-account batch ticket processing is solved, the use limitation of the optimistic lock is expanded, and the group/large-account flow business pricing processing performance and efficiency are improved.
An embodiment of the present invention provides a computer-readable storage medium, where the storage medium stores at least one executable instruction, and when the executable instruction runs on a pricing device/apparatus based on a threshold optimistic lock, the pricing device/apparatus based on the threshold optimistic lock executes a pricing method based on the threshold optimistic lock in any method embodiment described above.
The executable instructions may be specifically configured to cause a pricing device/apparatus based on a threshold optimistic lock to perform the following operations:
obtaining a bill to be batched of a user;
acquiring the current usage amount of user resources, a rating threshold interval and an initial version number according to the ticket to be rated, wherein the rating threshold interval and the initial version number are stored in a database table;
determining whether the current usage exceeds the rating threshold interval;
if the current usage does not exceed the rating threshold interval, performing rating processing on the ticket to be rated, completing charging and resource updating of the ticket to be rated, and generating a new version number;
if the current usage amount exceeds the rating threshold interval, acquiring a first current version number from the database table, and comparing whether the initial version number is the same as the first current version number;
and if the initial version number is the same as the first current version number, pricing the ticket to be priced, completing charging and resource updating of the ticket to be priced, and generating a new version number.
In an optional manner, obtaining a ticket to be priced for a user further includes:
collecting a bill to be priced of a user through a network element;
decoding and converting the bill to be priced to form a standard bill to be priced;
and performing service analysis on the standard ticket to be priced to obtain the ticket to be priced, wherein the ticket to be priced comprises user account identification information, user consumption categories and corresponding resource use increment.
In an optional manner, obtaining the current usage amount of the user resource, the rating threshold interval, and the initial version number according to the ticket to be rated, further includes:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
In an optional manner, before the step of obtaining a first current version number from the database table and comparing whether the initial version number is the same as the first current version number if the current usage exceeds the rating threshold interval, the method further includes the following steps:
if the current usage amount exceeds a batch price threshold interval, analyzing whether a new user product tariff exists;
if the new user product tariff exists, acquiring a second current version number from a database table, and comparing whether the initial version number is the same as the second current version number;
and if the user product price is the same as the user product price, determining a new wholesale price threshold interval according to the new user product price, and updating the new threshold interval into the database table.
In an optional manner, if the current usage amount exceeds the rating threshold interval, comparing whether the initial version number is the same as the first current version number, further includes:
if the initial version number is different from the first current version number in the database table, the rating processing fails, and the rating processing is performed on the ticket to be rated again by adopting a long locking mechanism.
According to the embodiment, on the basis of pricing based on a long lock mode, improved pricing of an optimistic lock mode is achieved for specific services, a mode that consistency judgment is conducted on a single judgment version number when the optimistic lock is updated is improved, judgment of a threshold interval is increased, the problem of concurrence under large-account batch ticket processing is solved, the use limitation of the optimistic lock is expanded, and the pricing processing performance and efficiency of group/large-account flow services are improved.
The embodiment of the invention provides a pricing device based on a threshold optimistic lock, which is used for executing the pricing method based on the threshold optimistic lock.
Embodiments of the present invention provide a computer program, where the computer program can be called by a processor to enable the electronic device to execute a pricing method based on a threshold optimistic lock in any of the above method embodiments.
Embodiments of the present invention provide a computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions that, when run on a computer, cause the computer to perform a method for rating based on a threshold optimistic lock as in any of the above-mentioned method embodiments.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.
Claims (10)
1. A method for optimistic lock pricing based on a threshold, the method comprising:
obtaining a bill to be batched of a user;
acquiring the current usage amount of user resources, a rating threshold interval and an initial version number according to the ticket to be rated, wherein the rating threshold interval and the initial version number are stored in a database table;
determining whether the current usage exceeds the rating threshold interval;
if the current usage does not exceed the rating threshold interval, performing rating processing on the ticket to be rated, completing charging and resource updating of the ticket to be rated, and generating a new version number;
if the current usage amount exceeds the rating threshold interval, acquiring a first current version number from the database table, and comparing whether the initial version number is the same as the first current version number;
and if the initial version number is the same as the first current version number, pricing the ticket to be priced, completing charging and resource updating of the ticket to be priced, and generating a new version number.
2. The method of claim 1, wherein obtaining a ticket for a pending price of a user further comprises:
collecting a bill to be priced of a user through a network element;
decoding and converting the bill to be priced to form a standard bill to be priced;
and performing service analysis on the standard ticket to be priced to obtain the ticket to be priced, wherein the ticket to be priced comprises user account identification information, user consumption categories and corresponding resource use increment.
3. The method of claim 2, wherein the obtaining of the current usage amount of the user resource, the rating threshold interval and the initial version number according to the ticket to be rated further comprises:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
4. The method of claim 1, wherein the step of obtaining a first current version number from the database table if the current usage exceeds a rating threshold interval, and comparing whether the initial version number is the same as the first current version number further comprises the steps of:
if the current usage amount exceeds a batch price threshold interval, analyzing whether a new user product tariff exists;
if the new user product tariff exists, acquiring a second current version number from a database table, and comparing whether the initial version number is the same as the second current version number;
and if the user product price is the same as the user product price, determining a new wholesale price threshold interval according to the new user product price, and updating the new threshold interval into the database table.
5. The method of claim 1, wherein if the current usage exceeds the rating threshold interval, comparing whether the initial version number is the same as the first current version number further comprises:
if the initial version number is different from the first current version number in the database table, the rating processing fails, and the rating processing is performed on the ticket to be rated again by adopting a long locking mechanism.
6. The pricing device based on the threshold optimistic lock is characterized by comprising the following modules:
the ticket acquiring module is used for acquiring a to-be-batched ticket of the user;
the data query module is used for acquiring the current usage amount of the user resource, a rating threshold interval and an initial version number according to the to-be-batched bill, wherein the rating threshold interval and the initial version number are stored in a database table;
a threshold interval checking module, configured to determine whether the current usage amount exceeds the pricing threshold interval;
the first data updating module is used for carrying out rating processing on the ticket to be rated if the current usage does not exceed the rating threshold interval, completing charging and resource updating of the ticket to be rated and generating a new version number;
the version comparison module is used for acquiring a first current version number from the database table if the current usage exceeds the rating threshold interval, and comparing whether the initial version number is the same as the first current version number in the database;
and the second data updating module is used for pricing the ticket to be priced if the initial version number is the same as the first current version number in the database, completing charging and resource updating of the ticket to be priced and generating a new version number.
7. The apparatus of claim 6, wherein the ticket obtaining module obtains a pending price ticket of the user, further comprising:
collecting a bill to be priced of a user through a network element;
decoding and converting the bill to be priced to form a standard bill to be priced;
and performing service analysis on the standard ticket to be priced to obtain the ticket to be priced, wherein the ticket to be priced comprises user account identification information, user consumption categories and corresponding resource use increment.
8. The apparatus of claim 7, wherein the information obtaining module obtains a current usage amount of the user resource, a rating threshold interval, and an initial version number according to the ticket to be rated, further comprising:
inquiring the accumulated resource usage amount of the user account from a database according to the user account identification information;
obtaining the current usage amount of the user resource corresponding to the user account according to the accumulated resource usage amount and the current resource usage increment;
and inquiring a rating threshold interval and an initial version number of the user account in a database table of the database.
9. A pricing device based on a threshold optimistic lock, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform the operations of the threshold optimistic lock based rating method according to any of claims 1 to 5.
10. A computer-readable storage medium having stored thereon at least one executable instruction that, when executed on a pricing device based on a threshold optimistic lock, causes the pricing device based on the threshold optimistic lock to perform the operations of the pricing method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010544869.8A CN113806379B (en) | 2020-06-15 | 2020-06-15 | Rating method, device, equipment and computer medium based on threshold optimistic lock |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010544869.8A CN113806379B (en) | 2020-06-15 | 2020-06-15 | Rating method, device, equipment and computer medium based on threshold optimistic lock |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113806379A true CN113806379A (en) | 2021-12-17 |
CN113806379B CN113806379B (en) | 2024-04-09 |
Family
ID=78944217
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010544869.8A Active CN113806379B (en) | 2020-06-15 | 2020-06-15 | Rating method, device, equipment and computer medium based on threshold optimistic lock |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113806379B (en) |
Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101730043A (en) * | 2008-10-29 | 2010-06-09 | 中国移动通信集团吉林有限公司 | Pricing test method and system |
CN102075641A (en) * | 2009-11-25 | 2011-05-25 | 中国移动通信集团甘肃有限公司 | Method and device for processing service ticket |
CN102075897A (en) * | 2009-11-20 | 2011-05-25 | 中国移动通信集团江苏有限公司 | Method and system for charging mobile data service |
CN102098650A (en) * | 2011-01-21 | 2011-06-15 | 中国联合网络通信集团有限公司 | Content charging-based flow adaptive method and system |
US20140180915A1 (en) * | 2012-12-21 | 2014-06-26 | Zetta, Inc. | Systems and methods for real-time billing and metrics reporting |
EP2911103A1 (en) * | 2014-02-24 | 2015-08-26 | Amadeus S.A.S. | Auditing system with increased accuracy |
CN107292640A (en) * | 2016-03-30 | 2017-10-24 | 阿里巴巴集团控股有限公司 | Resource information processing method and device in many businessman's joint promotion activities |
CN107846288A (en) * | 2016-09-19 | 2018-03-27 | 中国电信股份有限公司 | For realizing the methods, devices and systems of charging |
CN108964932A (en) * | 2017-05-17 | 2018-12-07 | 中兴通讯股份有限公司 | A kind of charging method, device and computer readable storage medium |
CN109618070A (en) * | 2018-12-03 | 2019-04-12 | 中国移动通信集团江苏有限公司 | Bill charging method, device, equipment and medium |
CN109978619A (en) * | 2019-03-25 | 2019-07-05 | 携程旅游网络技术(上海)有限公司 | Method, system, equipment and the medium of air ticket pricing Policy Filtering |
CN109981911A (en) * | 2017-12-27 | 2019-07-05 | 中国移动通信集团山东有限公司 | A kind of calculation method and device optimizing talk business ticketing expense |
CN110189158A (en) * | 2019-04-16 | 2019-08-30 | 德邦物流股份有限公司 | A kind of logistics billing method and system based on charging regulation engine |
CN110366122A (en) * | 2018-03-26 | 2019-10-22 | 华为技术有限公司 | A kind of wholesale price method and apparatus |
CN110493016A (en) * | 2018-05-15 | 2019-11-22 | 中国移动通信集团浙江有限公司 | Flow charging method and device |
CN111082947A (en) * | 2018-10-18 | 2020-04-28 | 华为技术有限公司 | Method and device for charging consumption of resources |
-
2020
- 2020-06-15 CN CN202010544869.8A patent/CN113806379B/en active Active
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101730043A (en) * | 2008-10-29 | 2010-06-09 | 中国移动通信集团吉林有限公司 | Pricing test method and system |
CN102075897A (en) * | 2009-11-20 | 2011-05-25 | 中国移动通信集团江苏有限公司 | Method and system for charging mobile data service |
CN102075641A (en) * | 2009-11-25 | 2011-05-25 | 中国移动通信集团甘肃有限公司 | Method and device for processing service ticket |
CN102098650A (en) * | 2011-01-21 | 2011-06-15 | 中国联合网络通信集团有限公司 | Content charging-based flow adaptive method and system |
US20140180915A1 (en) * | 2012-12-21 | 2014-06-26 | Zetta, Inc. | Systems and methods for real-time billing and metrics reporting |
EP2911103A1 (en) * | 2014-02-24 | 2015-08-26 | Amadeus S.A.S. | Auditing system with increased accuracy |
CN107292640A (en) * | 2016-03-30 | 2017-10-24 | 阿里巴巴集团控股有限公司 | Resource information processing method and device in many businessman's joint promotion activities |
CN107846288A (en) * | 2016-09-19 | 2018-03-27 | 中国电信股份有限公司 | For realizing the methods, devices and systems of charging |
CN108964932A (en) * | 2017-05-17 | 2018-12-07 | 中兴通讯股份有限公司 | A kind of charging method, device and computer readable storage medium |
CN109981911A (en) * | 2017-12-27 | 2019-07-05 | 中国移动通信集团山东有限公司 | A kind of calculation method and device optimizing talk business ticketing expense |
CN110366122A (en) * | 2018-03-26 | 2019-10-22 | 华为技术有限公司 | A kind of wholesale price method and apparatus |
CN110493016A (en) * | 2018-05-15 | 2019-11-22 | 中国移动通信集团浙江有限公司 | Flow charging method and device |
CN111082947A (en) * | 2018-10-18 | 2020-04-28 | 华为技术有限公司 | Method and device for charging consumption of resources |
CN109618070A (en) * | 2018-12-03 | 2019-04-12 | 中国移动通信集团江苏有限公司 | Bill charging method, device, equipment and medium |
CN109978619A (en) * | 2019-03-25 | 2019-07-05 | 携程旅游网络技术(上海)有限公司 | Method, system, equipment and the medium of air ticket pricing Policy Filtering |
CN110189158A (en) * | 2019-04-16 | 2019-08-30 | 德邦物流股份有限公司 | A kind of logistics billing method and system based on charging regulation engine |
Also Published As
Publication number | Publication date |
---|---|
CN113806379B (en) | 2024-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2011011146A1 (en) | System and method for real-time batch account processing | |
CN111737300A (en) | Service processing method, device, equipment and computer readable storage medium | |
CN110659971A (en) | Transaction data processing method and device | |
CN113704307A (en) | Data query method, device, server and computer readable storage medium | |
CN115145587A (en) | Product parameter checking method and device, electronic equipment and storage medium | |
CN109542922B (en) | Processing method for real-time service data and related system | |
CN109583980A (en) | Method, system, electronic equipment and the storage medium of order processing | |
WO2019019596A1 (en) | Breakpoint list processing method, device, server and medium | |
CN113806379A (en) | Pricing method, device and equipment based on threshold optimistic lock and computer medium | |
CN112099934A (en) | Batch processing method, system, computer equipment and storage medium | |
CN111367694A (en) | Event processing method, server and computer storage medium | |
CN111008078A (en) | Batch processing method, device and equipment of data and computer storage medium | |
CN113450067B (en) | Risk control method, device and system based on decision engine and electronic device | |
CN114971753A (en) | Billing method and system based on distributed lock | |
CN110321461B (en) | Bill processing method, system, computer device and storage medium | |
CN112838932A (en) | Re-rating method and device based on volume accumulated rating and computing equipment | |
CN111898004A (en) | Data mining method and device, electronic equipment and readable storage medium thereof | |
CN111367634A (en) | Information processing method, information processing device and terminal equipment | |
CN114598559A (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CN113766442B (en) | Telephone traffic resource sharing method and device, computing equipment and storage medium | |
CN113965900B (en) | Method, device, computing equipment and storage medium for dynamically expanding flow resources | |
CN115756768B (en) | Distributed transaction processing method, device, equipment and medium based on saga | |
CN113824847B (en) | Method and device for determining charging abnormality, computing equipment and computer storage medium | |
CN114205764B (en) | Traffic resource sharing method, device, equipment and computer readable storage medium | |
CN108256989B (en) | Data display method and system of fund preparation system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |