CN112631768A - Resource sharing method and system based on asynchronous mechanism - Google Patents

Resource sharing method and system based on asynchronous mechanism Download PDF

Info

Publication number
CN112631768A
CN112631768A CN202011321569.XA CN202011321569A CN112631768A CN 112631768 A CN112631768 A CN 112631768A CN 202011321569 A CN202011321569 A CN 202011321569A CN 112631768 A CN112631768 A CN 112631768A
Authority
CN
China
Prior art keywords
consumption information
residual value
threshold value
service
information data
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.)
Pending
Application number
CN202011321569.XA
Other languages
Chinese (zh)
Inventor
胡鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Si Tech Information Technology Co Ltd
Original Assignee
Beijing Si Tech Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Si Tech Information Technology Co Ltd filed Critical Beijing Si Tech Information Technology Co Ltd
Priority to CN202011321569.XA priority Critical patent/CN112631768A/en
Publication of CN112631768A publication Critical patent/CN112631768A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5017Task decomposition

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Checking Fares Or Tickets At Control Points (AREA)

Abstract

The invention discloses a resource sharing method and a system based on an asynchronous mechanism, wherein members sharing the same consumption information are dispersed to different processes, and the method comprises the following steps: setting a threshold value; after acquiring the service of the corresponding member, any process reads the residual value of the shared consumption information data; judging whether the residual value is larger than a threshold value; when the residual value is larger than the threshold value, the process carries out rating according to the personal mode, and rating information of the current service is output; and accumulating the rating information, and updating the residual value of the shared consumption information data after locking once. Splitting the family service into individual services under a certain triggering condition to realize a mode of asynchronously updating the shared consumption information record; the method and the system improve the pricing processing capability of the family service, adapt to the expansion of the number of family members and adapt to the long-term popularization of the cluster service.

Description

Resource sharing method and system based on asynchronous mechanism
Technical Field
The invention relates to the technical field of resource sharing, in particular to a resource sharing method based on an asynchronous mechanism, which aims to solve the problem of lock waiting caused by using shared consumption information in home business.
Background
In the traditional family business pricing, all family members use one shared consumption information, and the family members are dispersed to different processing processes; when all processes are processing the pricing of different members in the same family, the first obtained process locks the shared consumption information data, and the later process can process the shared consumption information data after the former process releases the lock.
The serial locking waiting mechanism has the advantages that under the condition that the number of family members is increased and the processing process is more discrete, the locking waiting is more serious and the processing capacity is lower.
Although the processing flow of the serial locking mechanism is simple to control, the accuracy of pricing can be well controlled; however, the development of the family service is more and more lagged, the price-rating capability is greatly reduced, and the method cannot adapt to the long-term popularization of the cluster service.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a resource sharing method based on an asynchronous mechanism, which divides a family service into individual services under a certain trigger condition and realizes a mode of asynchronously updating and sharing consumption information records; the method and the system improve the pricing processing capability of the family service, adapt to the expansion of the number of family members and adapt to the long-term popularization of the cluster service.
The invention discloses a resource sharing method based on an asynchronous mechanism, wherein members sharing the same consumption information are dispersed to different processes, and the method comprises the following steps:
setting a threshold value;
after acquiring the service of the corresponding member, any process reads the residual value of the shared consumption information data;
judging whether the residual value is larger than a threshold value;
when the residual value is larger than the threshold value, the process carries out rating according to the personal mode, and rating information of the current service is output;
and accumulating the rating information, and updating the residual value of the shared consumption information data after locking once.
As a further improvement of the invention, the method also comprises the following steps:
and when the residual value is not larger than the threshold value, performing serial locking processing on the shared consumption information data.
As a further improvement of the present invention,
when the service is a call ticket, the rating information comprises a number, a family number, a call ticket usage amount, a call ticket free amount, a product usage code and a validity period.
The invention also discloses a resource sharing system based on the asynchronous mechanism, the members sharing the same consumption information are dispersed to different processes, comprising:
the memory database is used for storing the shared consumption information;
the process is used for reading the residual value of the shared consumption information data in the memory database after the business of the corresponding member is obtained; and, according to the judged result, when the residual value is greater than the threshold value, the process is priced according to the personal mode, and the pricing information of the current service is output;
the judging module is used for judging whether the residual value is larger than a threshold value or not;
and the accumulation module is used for accumulating the pricing information and updating the residual value of the shared consumption information data in the memory database after locking once.
As a further improvement of the invention, the process is further for:
and according to the judgment result, when the residual value is not greater than the threshold value, performing serial locking processing on the shared consumption information data.
As a further improvement of the present invention,
when the service is a call ticket, the rating information comprises a number, a family number, a call ticket usage amount, a call ticket free amount, a product usage code and a validity period.
Compared with the prior art, the invention has the beneficial effects that:
the invention cancels the sharing mutual exclusion lock when the residual value is larger than the threshold value, and takes the member as the individual asynchronous processing;
the invention adds the accumulation module of the shared resource, locks once, gathers and accumulates once according to the family code and the product name;
the invention solves the problem of frequent exclusive lock waiting of the family charging memory database by the mode, greatly improves the rating processing capability of family services, and improves the expansion capability of family member number.
Drawings
FIG. 1 is a flowchart illustrating a resource sharing method based on an asynchronous mechanism according to an embodiment of the present invention;
fig. 2 is a block diagram of a resource sharing system based on an asynchronous mechanism according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
The invention is described in further detail below with reference to the attached drawing figures:
the invention provides a resource sharing method and a resource sharing system based on an asynchronous mechanism, wherein by additionally arranging a threshold value of a shared resource residual value, when the actual residual value of the shared resource is greater than the threshold value, in order to improve the processing efficiency, the invention divides the processing of family members into different individual processes for independent processing, and does not lock the data of public consumption information; parallel processing can be realized; after parallel processing, the pricing information can be accumulated according to the family number, locking is carried out for one time, and the shared resource is updated for one time according to the accumulated result. When the actual residual value of the shared resource is not greater than the threshold value, the existing serial locking mechanism can be adopted for processing in order to guarantee the accuracy of charging deduction.
Specifically, the method comprises the following steps:
as shown in fig. 1, the present invention provides a resource sharing method based on an asynchronous mechanism, including:
step 1, setting a threshold value;
the threshold value designed by the invention is related to the maximum quantity of a single call ticket and the member quantity of a family number; the threshold value is not lower than the product of the maximum amount of the call tickets and the number of the members;
for example, when the maximum amount of a single call ticket is 10M and the number of family members is 10, the threshold value is not lower than 100M;
step 2, after acquiring the service of the corresponding member, any process reads the residual value of the shared consumption information data;
step 3, judging whether the residual value is larger than a threshold value;
step 4, when the residual value is larger than the threshold value, rating the process according to the personal mode, and outputting rating information of the current service; wherein the pricing information comprises: the number, the family number, the call ticket usage amount, the call ticket free amount, the product code usage and the validity period;
and 5, accumulating the rating information in a preset time (which is related to the processing time of the process), and updating the residual value of the shared consumption information data after locking once.
And 6, when the residual value is not greater than the threshold value, performing serial locking processing on the shared consumption information data.
As shown in fig. 2, the present invention provides a resource sharing system based on asynchronous mechanism, in which members sharing the same consumption information are discretized into different processes, including:
the memory database is used for storing the shared consumption information;
the process is used for reading the residual value of the shared consumption information data in the memory database after the business of the corresponding member is obtained; and, according to the judged result, when the residual value is greater than the threshold value, the process is priced according to the personal mode, and the pricing information of the current service is output; according to the judgment result, when the residual value is not greater than the threshold value, serial locking processing is carried out on the shared consumption information data
The judging module is used for judging whether the residual value is larger than a threshold value or not;
and the accumulation module is used for accumulating the pricing information and updating the residual value of the shared consumption information data in the memory database after locking once.
Example 1:
one family number is JT 00001; from members jt00001, jt0002, jt 0003; the shared consumption information data is GX 01; the processing process comprises A, B and C; the sharing accumulation processing module is GR as an example, and the sharing method is explained as follows:
step 1, presetting a threshold VT which is 500M;
step 2, when the process A acquires the call bill of the jt00001 user in a period, reading the shared consumption information data GX01 from the memory database, and acquiring the remaining value F of the shared consumption information data GX01 as 600M;
f > VT, the A process rates according to the personal mode; outputting the rating information (number, family number, call ticket usage amount, call ticket free amount, product code usage and validity period) of the current call ticket;
step 3, in a period, when the process B acquires the ticket of the jt00002 user, reading GX01 information from a memory database, and acquiring a residual value F of 600M;
f > VT, then the B process rates according to the personal mode; outputting the rating information (number, family number, call ticket usage amount, call ticket free amount, product code usage and validity period) of the current call ticket;
step 4, in the same way, circularly judging when all processes are reprocessed to the members in the family in the same period, and outputting an increment;
step 5, sharing an accumulation module GR, periodically reading an increment table, accumulating and summarizing free ticket amount according to the same family number and product codes, locking once and updating once;
step 6, in another period, when the process C obtains the ticket of the jt00003 user, reading the shared consumption information data GX01 from the memory database, and obtaining the remaining value F of the shared consumption information data GX01 as 4500M;
f < VT, GX01 starts to be locked and serially processed, and the accuracy of charging deduction is guaranteed;
step 7, in the same way, circularly judging when all processes are reprocessed to the members in the family in the same period, and outputting an increment;
compared with the prior art, the invention has the beneficial effects that:
the invention cancels the sharing mutual exclusion lock when the residual value is larger than the threshold value, and takes the member as the individual asynchronous processing;
the invention adds the accumulation module of the shared resource, locks once, gathers and accumulates once according to the family code and the product name;
the invention solves the problem of frequent exclusive lock waiting of the family charging memory database by the mode, greatly improves the rating processing capability of family services, and improves the expansion capability of family member number.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A resource sharing method based on asynchronous mechanism, the members sharing the same consumption information are dispersed to different processes, characterized in that, the method comprises:
setting a threshold value;
after acquiring the service of the corresponding member, any process reads the residual value of the shared consumption information data;
judging whether the residual value is larger than a threshold value;
when the residual value is larger than the threshold value, the process carries out rating according to the personal mode, and rating information of the current service is output;
and accumulating the rating information, and updating the residual value of the shared consumption information data after locking once.
2. The resource sharing method of claim 1, further comprising:
and when the residual value is not larger than the threshold value, performing serial locking processing on the shared consumption information data.
3. The resource sharing method of claim 1,
when the service is a call ticket, the rating information comprises a number, a family number, a call ticket usage amount, a call ticket free amount, a product usage code and a validity period.
4. A resource sharing system based on asynchronous mechanism, wherein members sharing the same consumption information are dispersed to different processes, comprising:
the memory database is used for storing the shared consumption information;
the process is used for reading the residual value of the shared consumption information data in the memory database after the business of the corresponding member is obtained; and, according to the judged result, when the residual value is greater than the threshold value, the process is priced according to the personal mode, and the pricing information of the current service is output;
the judging module is used for judging whether the residual value is larger than a threshold value or not;
and the accumulation module is used for accumulating the pricing information and updating the residual value of the shared consumption information data in the memory database after locking once.
5. The resource sharing system of claim 4 wherein the process is further to:
and according to the judgment result, when the residual value is not greater than the threshold value, performing serial locking processing on the shared consumption information data.
6. The resource sharing system of claim 4,
when the service is a call ticket, the rating information comprises a number, a family number, a call ticket usage amount, a call ticket free amount, a product usage code and a validity period.
CN202011321569.XA 2020-11-23 2020-11-23 Resource sharing method and system based on asynchronous mechanism Pending CN112631768A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011321569.XA CN112631768A (en) 2020-11-23 2020-11-23 Resource sharing method and system based on asynchronous mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011321569.XA CN112631768A (en) 2020-11-23 2020-11-23 Resource sharing method and system based on asynchronous mechanism

Publications (1)

Publication Number Publication Date
CN112631768A true CN112631768A (en) 2021-04-09

Family

ID=75303691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011321569.XA Pending CN112631768A (en) 2020-11-23 2020-11-23 Resource sharing method and system based on asynchronous mechanism

Country Status (1)

Country Link
CN (1) CN112631768A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787588A (en) * 2005-12-01 2006-06-14 大唐软件技术有限责任公司 Method for processing multiprogress message and method for processing multiprogress talk ticket
CN101841421A (en) * 2009-03-19 2010-09-22 华为技术有限公司 Online charging method, device and system
CN101998344A (en) * 2009-08-20 2011-03-30 中国移动通信集团辽宁有限公司 Method and device for multi-user charging
CN104636260A (en) * 2013-11-06 2015-05-20 深圳市风景智联科技有限公司 Data management method and system for charging services
CN105721174A (en) * 2016-04-25 2016-06-29 中国联合网络通信集团有限公司 Charging method, charging system and charging terminal
CN106982126A (en) * 2016-01-18 2017-07-25 中国移动通信集团重庆有限公司 A kind of resource-sharing charging method and message accounting, memory bank
CN107992368A (en) * 2017-11-15 2018-05-04 国家计算机网络与信息安全管理中心 Method for interchanging data and system between a kind of multi-process
CN109428735A (en) * 2017-08-31 2019-03-05 中国电信股份有限公司 Charging method and charge system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787588A (en) * 2005-12-01 2006-06-14 大唐软件技术有限责任公司 Method for processing multiprogress message and method for processing multiprogress talk ticket
CN101841421A (en) * 2009-03-19 2010-09-22 华为技术有限公司 Online charging method, device and system
CN101998344A (en) * 2009-08-20 2011-03-30 中国移动通信集团辽宁有限公司 Method and device for multi-user charging
CN104636260A (en) * 2013-11-06 2015-05-20 深圳市风景智联科技有限公司 Data management method and system for charging services
CN106982126A (en) * 2016-01-18 2017-07-25 中国移动通信集团重庆有限公司 A kind of resource-sharing charging method and message accounting, memory bank
CN105721174A (en) * 2016-04-25 2016-06-29 中国联合网络通信集团有限公司 Charging method, charging system and charging terminal
CN109428735A (en) * 2017-08-31 2019-03-05 中国电信股份有限公司 Charging method and charge system
CN107992368A (en) * 2017-11-15 2018-05-04 国家计算机网络与信息安全管理中心 Method for interchanging data and system between a kind of multi-process

Similar Documents

Publication Publication Date Title
CA2895893C (en) Searchable data archive
CN101166159B (en) A method and system for identifying rubbish information
CN101350869B (en) Method and apparatus for removing repeat of telecom charging based on index and hash
CN113141410B (en) Dynamically adjusted QPS control method, system, device and storage medium
CN112437198B (en) Intelligent outbound data processing method, device and storage medium
CN113095769A (en) Service inventory management method, device, equipment and readable storage medium
CN111182485A (en) Single ticket total traffic control system and method
CN112631768A (en) Resource sharing method and system based on asynchronous mechanism
CN1231747A (en) Monitoring of load situation in a service database system
CN101799803B (en) Method, module and system for processing information
CN114722045A (en) Time series data storage method and device
CN111010676B (en) Short message caching method, device and system
CN112468980B (en) Short message reminding fusing processing method and system based on distributed memory database
CN110880101A (en) Data processing method, device, server and storage medium thereof
CN116915664A (en) Traffic threshold reminding method and device, electronic equipment and storage medium
CN111131393A (en) User activity data statistical method, electronic device and storage medium
CN111680111B (en) Billing method and device, computer equipment and computer readable storage medium
CN114255120A (en) Updating method of collection-promoting data and related device
CN114598559B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN107958011B (en) Rapid statistical method based on Discuz community
CN118170806B (en) Method for improving mass data processing performance of account of communication carrier
CN109446215B (en) Real-time ID pull-through engine method based on priority
CN118134623A (en) Method for automatically producing credit card fraud cases based on cluster accumulation
CN114338931A (en) Batch short message reminding method and device and computer readable storage medium
CN117057903A (en) Data processing method, device, equipment and medium

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