CN107886424A - Settlement data treating method and apparatus, computer equipment and storage medium - Google Patents
Settlement data treating method and apparatus, computer equipment and storage medium Download PDFInfo
- Publication number
- CN107886424A CN107886424A CN201711218490.2A CN201711218490A CN107886424A CN 107886424 A CN107886424 A CN 107886424A CN 201711218490 A CN201711218490 A CN 201711218490A CN 107886424 A CN107886424 A CN 107886424A
- Authority
- CN
- China
- Prior art keywords
- settlement data
- project
- data
- settlement
- thread
- 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
Classifications
-
- 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
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/12—Accounting
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of settlement data processing method, including:Obtain each clearing project of user's mark to be settled accounts and user's mark;Each clearing project identified by producer thread to the user carries out disbursement and sattlement, obtains project settlement data corresponding to each clearing project and preserves to data buffer zone;Project settlement data is pulled from the data buffer zone by consumer thread, the project settlement data that same user identifies is integrated to obtain settlement data and pushed.It is independent of each other between producer thread and consumer thread, it simply have shared the data of data buffer zone, therefore producer thread production project settlement data and consumer are integrated into settlement data using project settlement data and push being capable of parallel processing, it is divided into two thread parallels processing by the way that same data will be handled originally, processing time is saved, so as to improve the treatment effeciency of settlement data.
Description
Technical field
The present invention relates to Internet technical field, more particularly to a kind of settlement data treating method and apparatus, computer
Equipment and storage medium.
Background technology
Settlement data refers to the network platform for providing paid service, the expense that the service bought according to user provides a user
Settlement data, generally include service type and expense etc..
Traditional settlement data processing method, in a billing cycle, after being settled accounts successively to the expense of each user
Bill is generated, bill is pushed in the way of user selectes.For example, the mobile phone that user reserves is pushed in the form of short message, or
It is to send to the mailbox of user etc..
And a treatment progress can just handle another after the whole disbursement and sattlement of a user and bill push is completed
The settlement data of user, the time length spent, treatment effeciency are low.
The content of the invention
Based on this, it is necessary to for traditional settlement data treatment effeciency it is low the problem of, there is provided a kind for the treatment of effeciency is high
Settlement data treating method and apparatus, computer equipment and storage medium.
To reach above-mentioned purpose, one embodiment uses following technical scheme:
A kind of settlement data processing method, including:
Obtain each clearing project of user's mark to be settled accounts and user's mark;
Each clearing project identified by producer thread to the user carries out disbursement and sattlement, obtains each clearing project pair
The project settlement data answered simultaneously is preserved to data buffer zone;
Project settlement data is pulled from the data buffer zone by consumer thread, the project knot that same user is identified
Data Integration is calculated to obtain settlement data and push.
A kind of settlement data processing unit, including:Acquisition module, production module and consumption module;
The acquisition module, for obtaining each clearing project of user's mark to be settled accounts and user's mark;
The production module, each clearing project for being identified by producer thread to the user carry out expense knot
Calculate, obtain project settlement data corresponding to each clearing project and preserve to data buffer zone;
The consumption module, will be same for pulling project settlement data from the data buffer zone by consumer thread
The project settlement data of one user mark is integrated to obtain settlement data and pushed.
A kind of computer equipment, including memory, processor and storage can be run on a memory and on a processor
Computer program, it is characterised in that the step for the settlement data processing method stated is realized during the computing device described program
Suddenly.
A kind of storage medium, is stored thereon with computer program, when the program is executed by processor, realizes above-mentioned clearing
The step of data processing method.
Above-mentioned settlement data treating method and apparatus, computer equipment and storage medium, producer thread are responsible for production
Project settlement data, and project settlement data is cached to data buffer zone, consumer thread is responsible for usage data buffer area
Project settlement data, the settlement data for obtaining same user mark and push are integrated, change the serial of traditionally settlement data
Tupe, i.e. producer thread are responsible for production project settlement data, and expense knot is carried out to the clearing project of user's mark
After calculation, you can carry out disbursement and sattlement to next clearing project, and store to data buffer zone, consumer thread is in data buffer zone
When having project settlement data, the project settlement data that same user identifies is integrated to obtain settlement data and pushed, and is being handled
After a complete settlement data, you can next settlement data is handled, therefore, at the data between producer thread and consumer thread
Reason is independent of each other, and simply have shared the data of data buffer zone, therefore producer thread production project settlement data and consumer make
With project settlement data be integrated into settlement data and push can parallel processing, be divided into two by the way that same data will be handled originally
Individual thread parallel processing, has saved processing time, so as to improve the treatment effeciency of settlement data.
Brief description of the drawings
Fig. 1 is the application environment schematic diagram of the settlement data treating method and apparatus of one embodiment;
Fig. 2 is the internal structure schematic diagram of the settlement data processing server of one embodiment;
Fig. 3 is the flow chart of the settlement data processing method of another embodiment;
Fig. 4 is the structural representation of the settlement model of one embodiment;
Fig. 5 is the flow chart of the settlement data processing method of another embodiment;
Fig. 6 is the billing cycle schematic diagram of one embodiment;
Fig. 7 is the structured flowchart of the settlement data processing unit of one embodiment;
Fig. 8 is the structured flowchart of another settlement data processing unit.
Embodiment
For the objects, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with drawings and Examples, to this
Invention is described in further detail.It should be appreciated that embodiment described herein is only to explain the present invention,
Do not limit protection scope of the present invention.
Fig. 1 is the application environment schematic diagram for the settlement data treating method and apparatus that one embodiment provides.Such as Fig. 1 institutes
Show, the application environment includes settlement data processing server 101, settlement data push server 103 and client 105.Wherein,
Settlement data processing server 101 and settlement data push server 103 communicate to connect, the He of settlement data push server 103
Client 105 communicates to connect.Settlement data processing method is performed on settlement data processing server 101, when meeting terms of settlement
When, obtain each clearing project that user to be settled accounts identifies and user identifies, each clearing item that producer thread identifies to user
Mesh carries out disbursement and sattlement, obtains project settlement data corresponding to each clearing project and preserves to data buffer zone, message person's thread
Project settlement data is pulled from data buffer zone, the project settlement data that same user identifies is integrated to obtain settlement data.Knot
Calculate data processing server 101 and settlement data is pushed into settlement data push server 103, by settlement data push server
Reckoned up the bill according to settlement data generation, and push to client 105 corresponding to user's mark.
Fig. 2 is the internal structure schematic diagram of the settlement data processing server 101 of one embodiment.As shown in Fig. 2 the reality
The settlement data processing server applied in example includes:Processor, storage medium, built-in storage and the net connected by system bus
Network interface.Wherein, the processor is used to provide calculating and control ability, supports the operation of whole server.Settlement data processing
The storage medium of server is stored with operating system and a kind of computer program of settlement data processing unit, the settlement data
When the computer program of processing unit is executed by processor, for realizing a kind of settlement data processing method.Settlement data processing
The built-in storage of server provides environment for the operation of the settlement data processing unit in storage medium.The network interface of server
For carrying out network service with settlement data push server, for example, sending settlement data etc. to propelling data server.Ability
Field technique personnel are appreciated that the structure shown in Fig. 2, only the block diagram of the part-structure related to the present invention program, and
The restriction for the server being applied thereon to the present invention program is not formed, and specific settlement data processing server can include
Than more or less parts shown in figure, either combine some parts or arranged with different parts.
A kind of settlement data processing method is operated in settlement data processing server 101 as shown in Figure 1, such as Fig. 3 institutes
Show, this method comprises the following steps:
S302:Obtain each clearing project of user's mark to be settled accounts and user's mark.
User's mark is the mark for being uniquely capable of recognition user information, usually ID.
The network platform provides the user paid service, and user produces corresponding expense after buying service, passes through service item
The service of purchase is settled accounts with service price.Service item refers to the service content provided, a service item corresponding one
Individual service content, a network platform may provide a variety of service items.The clothes that specific clearing project provides with the network platform
Business is related.Clearing project refers to that user to be settled accounts identifies bought service item.In the present embodiment, respectively obtain and wait to settle accounts
User's identification list, and the configuration information of the clearing project of each user mark and the clearing project.
By taking cloud service as an example, service item includes cloud main frame and network.Wherein, cloud main frame and network traffics are respectively arranged with
Charging regulation (including service price).Cloud main frame provides the lease service of server, the service valency of the configuration of different servers
Lattice are different.Network includes broadband and process for using, and respectively with different charging modes, such as the chronomere of charging is the second.
For it have purchased the user of cloud main frame, clearing project is cloud main frame.
Specifically, the clearing time for reaching setting is detected whether, when detection reaches the clearing time of setting, performs acquisition
The step of each clearing project that user's mark to be settled accounts and user identify.It is corresponding with billing cycle to settle accounts the time.This implementation
Example in, can flexibly set clearing the time meet the needs of heterogeneous networks platform.For example, requiring high for billing accuracy, calculate
The mode neatly network platform, a shorter billing cycle can be set, such as settle accounts per hour once.
S304:Each clearing project identified by producer thread to user carries out disbursement and sattlement, obtains each clearing project
Corresponding project settlement data is simultaneously preserved to data buffer zone.
Producer thread refers to the process for creation data, and the producer thread in the present embodiment is used to produce project knot
Count evidence.Specifically, producer thread pulls each clearing project of user's mark to be settled accounts and user's mark, to each of user
Clearing project carries out disbursement and sattlement according to configuration information, service price and charging regulation, obtains each clearing item of user mark
Project settlement data corresponding to mesh.Identified by user and carry out disbursement and sattlement, facilitate the integration of subscriber's account.
Wherein, for there is the user of multiple clearing projects mark, each clearing project is identified to the user respectively and entered respectively
Row disbursement and sattlement, obtain project settlement data corresponding to each clearing project.
Data buffer zone is used for the data for caching producer thread production, and cache item clearing number is used in the present embodiment
According to.
S306:Project settlement data is pulled from data buffer zone by consumer thread, the project that same user is identified
Settlement data is integrated to obtain settlement data and pushed.
Consumer thread refers to the process of the data produced using producer thread.In the present embodiment, consumer thread from
Data buffer zone pulls settlement data, and carries out integration processing to the project settlement data of same user mark, so that will be same
The settlement data of user combines, and conveniently forms bill.
Integral data is that the single project settlement data of belonging same user's mark is merged into a settlement data,
Support is provided for settlement data push server.Specifically, can be required to set integration amount according to the push of settlement data server,
I.e. the integration amount of message person's thread is corresponding with the maximum clearing number of entry for the bill that settlement data server generates.Consumer's line
Journey pulls user's mark, and user mark is pulled from data buffer zone successively according to user's identification list to be settled accounts
All items settlement data, when the quantity of the project settlement data of user mark is more than the integration amount of setting, therefrom pull
Integrated with the project settlement data of integration amount respective amount, obtain the user and identify settlement data, and push to clearing number
According to push server, generated and sent by settlement data push server to corresponding user.In the present embodiment, pass through consumer
Thread is integrated to the project settlement data that same user identifies, and can be integrated the settlement data of same user's mark, be reduced
Interaction between settlement data processing server and settlement data push server, save Internet resources.
Above-mentioned settlement data processing method, each clearing project that producer thread identifies to user carry out disbursement and sattlement,
Obtain project settlement data corresponding to each clearing project and preserve to data buffer zone, consumer thread directly use data
The project settlement data of buffering area, and the project settlement data that same user identifies is integrated to obtain settlement data and pushed.It is raw
Production person's thread is responsible for production project settlement data, and project settlement data is cached to data buffer zone, consumer thread and is responsible for
The project settlement data in usage data buffer area, the settlement data for obtaining same user's mark and push are integrated, changes tradition
The serial process pattern of ground settlement data, i.e. producer thread are responsible for production project settlement data, to the knot of user's mark
After calculation project carries out disbursement and sattlement, you can carry out disbursement and sattlement to next clearing project, and store to data buffer zone, consumer
When thread has project settlement data in data buffer zone, the project settlement data that same user identifies is integrated to obtain settlement data
And push, and after a settlement data has been handled, you can next settlement data is handled, therefore, producer thread and consumer
Data processing between thread is independent of each other, and simply have shared the data of data buffer zone, therefore producer thread production project knot
The evidence that counts and consumer using project settlement data be integrated into settlement data and push can parallel processing, by that will handle originally
Same data are divided into two thread parallel processing, processing time have been saved, so as to improve the treatment effeciency of settlement data.
Settlement model in one embodiment is as shown in figure 4, including producer thread, data buffer zone and producer's line
Journey.Multi-threading parallel process, i.e. n producer thread and m consumer thread's parallel processing, wherein n are used in the model
It is the positive integer more than 1 with m.
Specifically, each producer thread obtains user's mark successively from user's identification list to be settled accounts, according to user
Mark matches the configuration information of one of the clearing project and the clearing project of user mark, and the clearing project is calculated
Project settlement data.
Each consumer thread obtains user's mark successively from user's identification list to be settled accounts, and is identified according to user from number
The project settlement data that same user mark is pulled according to buffering area is integrated to obtain settlement data and pushed.
Because multiple producer threads and message person's thread parallel are handled, the processing of settlement data can be further improved
Efficiency.
In one embodiment, in settlement model, the quantity n of producer thread is more than the quantity m of consumer thread, to protect
Card produces enough project settlement datas and is stored in data buffer zone for consumer thread's use.
In another embodiment, settlement data processing method also includes:The process performance of monitoring settlement data, and according to
Process performance adjusts producer thread and the quantity of consumer thread.
The process performance of settlement data refers to the performance of settlement data processing procedure hardware and software, including clearing number
According to hardware performance in treatment effeciency and settlement data processing procedure.By monitoring the process performance of settlement data, and according to processing
Property regulation producer thread and the quantity of consumer thread.For example, in the case where settlement data treatment effeciency is low, pass through increasing
Add the number of threads of producers and consumers, improve the oncurrent processing ability of settlement data, to improve the processing of settlement data effect
Rate.In another example when hardware performance in monitoring settlement data processing procedure reduces, by reducing producers and consumers' thread
Quantity, reduce server load.By monitoring the process performance of settlement process in the present embodiment, production can be flexibly set
Person and the number of threads of consumer, optimization settlement data processing.
Specifically, monitoring the process performance of settlement data is included when the processing time of time settlement data, the place of settlement data
Rationality energy, and included according to the step of process performance regulation producer thread and quantity of consumer thread:When time clearing number
After the completion of processing, statistics is when the processing time of time settlement data;When being more than preset value when secondary processing time, increase the producer
Thread and the quantity of consumer thread.
In the present embodiment, fixed billing cycle can be set, when reaching a billing cycle, to being produced in the billing cycle
Raw expense is settled accounts.The time of billing cycle can be the moon, week, day or hour.Billing cycle is shorter, and the network platform provides
Method of service it is more flexible, user can buy short-term service on demand, save the use cost of the network platform, reduce the network platform
Use threshold.So that billing cycle is a hour as an example, the expense of the network platform is settled accounts every a hour.Working as
Preceding billing cycle, clearing be a upper hour network platform usage amount.
When after the completion of time settlement data processing, that is, after the settlement data processing for completing the current balance cycle, statistics is worked as
The processing time of secondary settlement data.Being capable of reaction treatment efficiency when the processing time of secondary settlement data.When big when time processing time
When preset value, increase producer thread and the quantity of consumer thread.
Specifically, judgement is closed the account when whether time settlement data processing is completed according to the project of data buffer zone.Consumption
The settlement data that person's thread is integrated will send and arrive settlement data push server three times, if failing three times, by settlement data
Corresponding project settlement data is cached to data buffer zone, and is marked, and for sending successful settlement data, deletes data buffering
Project settlement data corresponding to area.When data buffer zone is uncached project settlement data, or only it is cached with the item of tape label
During mesh settlement data, judge when time settlement data processing is completed.
In one embodiment, the process performance of settlement data includes the hardware performance ginseng of main frame when settlement data is handled
Number.The process performance of settlement data is monitored, and the step of producer thread and the quantity of consumer thread is adjusted according to process performance
Suddenly include:The hardware performance parameter of main frame when monitoring settlement data processing;When monitoring that hardware performance parameter meets adjusting condition
When, adjust producer thread or the quantity of consumer thread.
The main frame of the present embodiment refers to settlement data processing server main frame.The hardware performance parameter of main frame is to refer to instead
Answer the hardware performance index of load on host computers situation in settlement data processing procedure.Such as CPU occupation rates and disk utilization rate.For
Each hardware performance parameter is respectively arranged with upper and lower bound.When hardware performance parameter exceedes the upper limit, reduce producer thread and
The quantity of consumer thread, when hardware performance parameter is less than lower limit, increase producer thread and the quantity of consumer thread.Example
Such as, when CPU occupation rates exceed its corresponding upper limit, producer thread and the quantity of consumer thread are reduced, to reduce service
The load of device main frame.When CPU occupation rates are less than its corresponding lower limit, increase producer thread and the quantity of consumer thread,
The resource of server host is made full use of, further improves settlement data treatment effeciency.
In the present embodiment, by monitoring the process performance of settlement data, producer thread and consumption can be neatly adjusted
The quantity of person's thread, to reach the balance of settlement data treatment effeciency and load on host computers.
In other embodiments, the purchase volume of network platform service can also be monitored, purchase volume and the producer
The quantity of thread and consumer thread are proportionate, and producer thread and the quantity of consumer thread are adjusted according to purchase volume.
In one embodiment, when settlement data pushes successfully, project settlement data corresponding to data buffer zone is deleted.
When settlement data pushes failure, project settlement data corresponding to flag data buffering area.
Project settlement data corresponding to successful settlement data is pushed by being deleted in data buffer zone, mark push is lost
Project settlement data corresponding to the settlement data lost, it can only retain the project clearing number when push failure in time billing cycle
According to.
Before the step of obtaining each clearing project of user's mark to be settled accounts and user's mark, in addition to:
When data buffer zone is stored with the project settlement data of tape label, drawn by consumer thread from data buffer zone
The project settlement data of tape label is taken, and the project settlement data for the tape label that same user is identified is integrated to obtain and mends knot calculation
Data simultaneously push.
I.e. when a new billing cycle starts, if data buffer zone is stored with the project settlement data of tape label,
The project settlement data that consumer thread pulls tape label from data buffer zone is first passed through, i.e., a upper billing cycle does not push into
The project settlement data of work(, the project settlement data for the tape label that same user is identified, which is integrated to obtain benefit, to be pushed away settlement data and pushes away
Deliver to settlement data push server.
Above-mentioned settlement data processing method, when each clearing start, upper a cycle push failure is handled first
Data, the project settlement data for the tape label that same user is identified, which is integrated to obtain benefit, to be pushed away settlement data and pushes, so as to reality
The push of settlement data in existing same billing cycle retries, and ensures that data-pushing delay is no more than two cycles, realizes bill
The real-time of push.
In other embodiments, settlement model itself has more complete alarm function, by setting alarm side
Formula, such as information alert and the contact method that processing people is set, terminated when there is settlement process midway such as, clearing overlong time etc.
Improper phenomenon, corresponding treatment people can be alerted by modes such as short message, wechats, allow research staff's very first time to feel
Know and intervene process problem.
Below to be illustrated using above-mentioned settlement data processing method to cloud service disbursement and sattlement.As shown in figure 5, should
Method comprises the following steps:
S502:Detect whether the clearing time for reaching setting.
The clearing time of the present embodiment is corresponding with billing cycle, to reduce the spirit for using threshold, improving clearing of cloud service
Activity, the cost that user uses cloud service is reduced, the billing cycle in the present embodiment is set as per hour, i.e., cloud is taken per hour
The expense of business is settled accounts.
S504:When reaching the clearing time of setting, judge whether data buffer zone is stored with the project clearing of tape label
Data.If so, step S506 is then performed, if it is not, performing step S508.
S506:Pull the project settlement data of tape label from data buffer zone by consumer thread, and by same user
The project settlement data of the tape label of mark, which is integrated to obtain benefit, to be pushed away settlement data and pushes.
The settlement model of one embodiment is as shown in figure 4, including producer thread, data buffer zone and consumer thread.
Producer thread refers to the process for creation data, and the producer thread in the present embodiment is used to produce project settlement data.
Data buffer zone is used for the data for caching producer thread production, is used for cache item settlement data in the present embodiment.Consumer
Thread refers to the data process for being produced using producer thread.
The project settlement data of the tape label of data buffer zone, it is upper one data for settling accounts push failure of deferring, each
When clearing start, the data of upper a cycle push failure, the project clearing for the tape label that same user is identified are handled first
Data Integration obtains benefit and pushes away settlement data and push, so as to realize that the push of the settlement data in same billing cycle retries,
Ensure that data-pushing delay is no more than two cycles, realize the real-time of bill push.
After step S506 is finished, step S508 is performed.
S508:Obtain each clearing project of user's mark to be settled accounts and user's mark.
In the present embodiment, the service item that cloud service provides includes cloud main frame and network service.Cloud main frame charging bag according to quantity
Include CPU, internal memory, data disks.That is, cloud main frame price=CPU prices+DRAM price+data disks price per hour.Cloud main frame is by solid
Price lattice are deducted fees per hour, and charging includes pressing bandwidth charging and is by the chronomere using charge on traffic, charging network according to quantity
Second.In the present embodiment, user's identification list to be settled accounts, and the clearing project and the knot of each user's mark are respectively obtained
The configuration information of calculation project.
S510:Each clearing project identified by producer thread to user carries out disbursement and sattlement, obtains each clearing project
Corresponding project settlement data is simultaneously preserved to data buffer zone.
Specifically, producer thread pulls each clearing project of user's mark to be settled accounts and user's mark, to user's
Each clearing project carries out disbursement and sattlement according to configuration information, service price and charging regulation, obtains item corresponding to each clearing project
Mesh settlement data.
Using the settlement data processing method of the present embodiment, need to retain certain remaining sum in user account, user starts
After use, the main frame expense (including CPU, internal memory, data disks) of one hour of the main frame can be freezed in advance, and in each integral point
(Beijing time) carries out lump-sum settlement, is deducted fees according to the actual use duration in a upper hour main frame.By real during clearing
Valuated using number of seconds on border.The each hour timing of settlement model is settled accounts, and in this current accounts settling phase, clearing were a upper hours
The usage amount of Cloud Server, and the cloud main frame to having returned terminate the clearing of charging.If the in addition, clearing of cloud main frame
Cycle as indicated with 6, the timing since being bought cloud main frame, is returned destruction up to cloud main frame and terminates timing, when centre has one section
Between be in arrearage off-mode, at this moment not to cloud main frame carry out charging, supplement with money start after continue to settle accounts, even if centre have configuration become
More, also segmentation clearing can be carried out according to different configurations.
S512:Project settlement data is pulled from data buffer zone by consumer thread, the project that same user is identified
Settlement data is integrated to obtain settlement data and pushed.
In the present embodiment, consumer thread pulls settlement data from data buffer zone, and to the project of same user mark
Settlement data carries out integration processing.Integral data is to merge into the single project settlement data of belonging same user's mark
A settlement data, support is provided for settlement data push server.
S514:When settlement data pushes successfully, project settlement data corresponding to data buffer zone is deleted.
S516:When settlement data pushes failure, project settlement data corresponding to flag data buffering area.
The settlement data that consumer thread integrates will send and arrive settlement data push server three times, if failing three times,
Then project settlement data corresponding to settlement data is cached to data buffer zone, and marked.By being deleted in data buffer zone
Project settlement data corresponding to successful settlement data is pushed, project clearing number corresponding to the settlement data of mark push failure
According to can only retain when the project settlement data of push failure in time billing cycle.
After step S514 and step S516, judge when whether time settlement data handles completion, i.e. data buffer zone
Project settlement data is judged when whether time settlement data processing is completed.When data buffer zone is uncached project settlement data,
Or when only caching the project settlement data of tape label, judge when time settlement data processing is completed.
S518:When after the completion of time settlement data processing, statistics is when the processing time of time settlement data.
Do not completed when when time settlement data processing, return to step S510.
After step S518, by when the processing time of time settlement data is compared with preset value.
S520:When being more than preset value when secondary processing time, increase producer thread and the quantity of consumer thread.
When after the completion of time settlement data processing, that is, after the settlement data processing for completing the current balance cycle, statistics is worked as
The processing time of secondary settlement data.Being capable of reaction treatment efficiency when the processing time of secondary settlement data.When big when time processing time
When preset value, increase producer thread and the quantity of consumer thread.
The settlement data processing method of the present embodiment, producer thread production project settlement data and consumer use project
Settlement data be integrated into settlement data and push can parallel processing, be divided into two threads by the way that same data will be handled originally
Parallel processing, processing time is saved, so as to improve the treatment effeciency of settlement data, meanwhile, by the place for monitoring settlement process
Rationality energy, the number of threads of producers and consumers can be flexibly set, further improves treatment effeciency.
The structural representation of the settlement data processing unit of one embodiment as shown in fig. 7, comprises:Acquisition module 701, life
Produce module 702 and consumption module 703.
The acquisition module 701, for obtaining each clearing project of user's mark to be settled accounts and user's mark.
The production module 702, each clearing project for being identified by producer thread to the user carry out expense
Clearing, obtain project settlement data corresponding to each clearing project and preserve to data buffer zone.
The consumption module 703, will for pulling project settlement data from the data buffer zone by consumer thread
The project settlement data of same user's mark is integrated to obtain settlement data and pushed.
Above-mentioned settlement data processing unit, each clearing project that producer thread identifies to user carry out disbursement and sattlement,
Obtain project settlement data corresponding to each clearing project and preserve to data buffer zone, consumer thread directly use data
The project settlement data of buffering area, and the project settlement data that same user identifies is integrated to obtain settlement data and pushed.It is raw
Production person's thread is responsible for production project settlement data, and project settlement data is cached to data buffer zone, consumer thread and is responsible for
The project settlement data in usage data buffer area, the settlement data for obtaining same user's mark and push are integrated, changes tradition
The serial process pattern of ground settlement data, i.e. producer thread are responsible for production project settlement data, to the knot of user's mark
After calculation project carries out disbursement and sattlement, you can carry out disbursement and sattlement to next clearing project, and store to data buffer zone, consumer
When thread has project settlement data in data buffer zone, the project settlement data that same user identifies is integrated to obtain settlement data
And push, and after a settlement data has been handled, you can next settlement data is handled, therefore, producer thread and consumer
Data processing between thread is independent of each other, and simply have shared the data of data buffer zone, therefore producer thread production project knot
The evidence that counts and consumer using project settlement data be integrated into settlement data and push can parallel processing, by that will handle originally
Same data are divided into two thread parallel processing, processing time have been saved, so as to improve the treatment effeciency of settlement data.
In another embodiment, as shown in figure 8, settlement data processing unit, in addition to monitoring modular 704 and regulation mould
Block 705.
The monitoring modular 704, for monitoring the process performance of settlement data.
The adjustment module 705, for adjusting the producer thread and the consumer thread according to process performance
Quantity.
By monitoring the process performance of settlement process in the present embodiment, the line of producers and consumers can be flexibly set
Number of passes amount, optimization settlement data processing.
Specifically, the process performance of the settlement data was included when the processing time of time settlement data.
The monitoring modular 704, for after the completion of being handled when time settlement data, counting when the processing of secondary settlement data
Between.
The adjustment module 705, for when being more than preset value when secondary processing time, increasing the producer thread and institute
State the quantity of consumer thread.
Specifically, the process performance of the settlement data includes the hardware performance parameter of main frame when settlement data is handled.
The monitoring modular 704, for monitoring the hardware performance parameter of main frame when settlement data is handled.
The adjustment module 705, for when monitoring that hardware performance parameter meets adjusting condition, adjusting the producer
Thread or the quantity of consumer thread.
In a further embodiment, settlement data processing unit, in addition to, cache management module 706, for when the knot
When calculating data-pushing success, project settlement data corresponding to the data buffer zone is deleted;It is additionally operable to when the settlement data pushes away
When sending unsuccessfully, project settlement data corresponding to the data buffer zone is marked.
The consumption module 703, it is additionally operable to when the data buffer zone is stored with the project settlement data of tape label, leads to
Cross the project settlement data that consumer thread pulls tape label from the data buffer zone, and the tape label that same user is identified
Project settlement data integrate to obtain benefit and push away settlement data and push.
Above-mentioned settlement data processing unit, producer thread production project settlement data and consumer are settled accounts using project
Data Integration into settlement data and push can parallel processing, be divided into two thread parallels by the way that same data will be handled originally
Processing, has saved processing time, so as to improve the treatment effeciency of settlement data, meanwhile, by the treatability for monitoring settlement process
Can, the number of threads of producers and consumers can be flexibly set, further improves treatment effeciency.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
The hardware of correlation is instructed to complete by computer program, it is non-volatile computer-readable that described program can be stored in one
Take in storage medium, in the embodiment of the present invention, the program can be stored in the storage medium of computer system, and is calculated by this
At least one computing device in machine system, to realize the flow for including the embodiment such as above-mentioned each method.Wherein, it is described
Storage medium can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) or random access memory
(Random Access Memory, RAM) etc..
Accordingly, a kind of computer equipment is also provided in one embodiment, including memory, processor and is stored in storage
Realized on device and the computer program that can run on a processor, during the computing device described program in the various embodiments described above
Any one settlement data processing method.
A kind of storage medium is also provided in one embodiment, is stored thereon with computer program, the program is by processor
During execution, any one settlement data processing method in the various embodiments described above is realized.
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality
Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, the scope that this specification is recorded all is considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously
Can not therefore it be construed as limiting the scope of the patent.It should be pointed out that come for one of ordinary skill in the art
Say, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention
Scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.
Claims (12)
- A kind of 1. settlement data processing method, it is characterised in that including:Obtain each clearing project of user's mark to be settled accounts and user's mark;Each clearing project identified by producer thread to the user carries out disbursement and sattlement, obtains corresponding to each clearing project Project settlement data is simultaneously preserved to data buffer zone;The project settlement data is pulled from the data buffer zone by consumer thread, the item that same user is identified Mesh settlement data is integrated to obtain settlement data and pushed.
- 2. settlement data processing method according to claim 1, it is characterised in that also include:The process performance of the settlement data is monitored, and the producer thread and the consumption are adjusted according to the process performance The quantity of person's thread.
- 3. settlement data processing method according to claim 2, it is characterised in that the process performance of the settlement data includes When the processing time of secondary settlement data;The process performance of the settlement data is monitored, and the producer thread and the consumption are adjusted according to the process performance The step of quantity of person's thread, includes:When described after the completion of time settlement data processing, statistics is described when the processing time of time settlement data;When described when the processing time of secondary settlement data being more than preset value, increase the producer thread and the consumption The quantity of person's thread.
- 4. settlement data processing method according to claim 2, it is characterised in that the process performance bag of the settlement data The hardware performance parameter of main frame when including settlement data processing;The process performance of the settlement data is monitored, and according to the processing The step of producer thread described in property regulation and the quantity of the consumer thread, includes:The hardware performance parameter of main frame when monitoring the settlement data processing;When monitoring that the hardware performance parameter meets adjusting condition, the producer thread or the number of consumer thread are adjusted Amount.
- 5. settlement data processing method according to claim 1, it is characterised in that also include, when the settlement data pushes away When sending successfully, the project settlement data corresponding to the data buffer zone is deleted;When the settlement data pushes failure, the project settlement data corresponding to the data buffer zone is marked;Before the step of obtaining each clearing project that user to be settled accounts identifies and user identifies, in addition to:When the data buffer zone is stored with the project settlement data of tape label, by consumer thread from the data Buffering area pulls the project settlement data of tape label, and the project settlement data for the tape label that same user is identified Integration obtains benefit and pushes away settlement data and push.
- A kind of 6. settlement data processing unit, it is characterised in that including:Acquisition module, production module and consumption module;The acquisition module, for obtaining each clearing project of user's mark to be settled accounts and user's mark;The production module, each clearing project for being identified by producer thread to the user carry out disbursement and sattlement, obtained To project settlement data corresponding to each clearing project and preserve to data buffer zone;The consumption module, will be same for pulling the project settlement data from the data buffer zone by consumer thread The project settlement data of one user mark is integrated to obtain settlement data and pushed.
- 7. settlement data processing unit according to claim 6, it is characterised in that also including monitoring modular and regulation mould Block;The monitoring modular, for monitoring the process performance of the settlement data;The adjustment module, for adjusting the producer thread and the number of the consumer thread according to the process performance Amount.
- 8. settlement data processing unit according to claim 7, it is characterised in that the process performance of the settlement data includes When the processing time of secondary settlement data;The monitoring modular, after the completion of working as time settlement data processing described in, the described of time settlement data is worked as described in statistics Processing time;The adjustment module, for, when the processing time of secondary settlement data being more than preset value, increasing the life when described Production person's thread and the quantity of the consumer thread.
- 9. settlement data processing unit according to claim 7, it is characterised in that the process performance bag of the settlement data The hardware performance parameter of main frame when including settlement data processing;The monitoring modular, for monitoring the hardware performance parameter of main frame when the settlement data is handled;The adjustment module, for when monitoring that the hardware performance parameter meets adjusting condition, adjusting producer's line Journey or the quantity of consumer thread.
- 10. settlement data processing unit according to claim 6, it is characterised in that also include, cache management module, use In when the settlement data pushes successfully, project settlement data corresponding to the data buffer zone is deleted;It is additionally operable to when described During settlement data push failure, project settlement data corresponding to the data buffer zone is marked;The consumption module, it is additionally operable to, when the data buffer zone is stored with the project settlement data of tape label, pass through Consumer thread pulls the project settlement data of tape label, and the band mark that same user is identified from the data buffer zone The project settlement data of note, which is integrated to obtain benefit, to be pushed away settlement data and pushes.
- 11. a kind of computer equipment, including memory, processor and storage are on a memory and the meter that can run on a processor Calculation machine program, it is characterised in that the clearing described in any one of claim 1 to 5 are realized during the computing device described program The step of data processing method.
- 12. a kind of storage medium, is stored thereon with computer program, it is characterised in that when the program is executed by processor, realizes The step of settlement data processing method described in any one of claim 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711218490.2A CN107886424B (en) | 2017-11-28 | 2017-11-28 | Settlement data processing method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711218490.2A CN107886424B (en) | 2017-11-28 | 2017-11-28 | Settlement data processing method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107886424A true CN107886424A (en) | 2018-04-06 |
CN107886424B CN107886424B (en) | 2022-12-16 |
Family
ID=61775923
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711218490.2A Active CN107886424B (en) | 2017-11-28 | 2017-11-28 | Settlement data processing method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107886424B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108897613A (en) * | 2018-05-07 | 2018-11-27 | 广西英腾教育科技股份有限公司 | Data processing method, system and computer equipment |
CN109034910A (en) * | 2018-08-16 | 2018-12-18 | 中国建设银行股份有限公司 | A kind of fee calculation procedure and device |
CN109472584A (en) * | 2018-09-27 | 2019-03-15 | 中国建设银行股份有限公司 | Arrearage processing system, method and storage medium |
CN111161019A (en) * | 2019-12-18 | 2020-05-15 | 口碑(上海)信息技术有限公司 | Data processing system and method |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101620702A (en) * | 2008-06-30 | 2010-01-06 | 中国移动通信集团黑龙江有限公司 | Expenditure presentation processing method, device and system |
CN102026138A (en) * | 2009-09-16 | 2011-04-20 | 广州从兴电子开发有限公司 | Communication fee bill output method and system |
CN102760126A (en) * | 2011-04-26 | 2012-10-31 | 阿里巴巴集团控股有限公司 | Data synchronization method in distributive system, and distributive system |
CN104717625A (en) * | 2013-12-12 | 2015-06-17 | 中国移动通信集团河南有限公司 | Credit control processing method and device |
CN106157187A (en) * | 2016-07-04 | 2016-11-23 | 北京佳阳科技有限公司 | A kind of guest room account due management method and device |
CN106293674A (en) * | 2015-06-08 | 2017-01-04 | 宏碁股份有限公司 | Automatically increase or decrease the method for data consumer and use the device of the method |
CN106651443A (en) * | 2016-12-19 | 2017-05-10 | 中国联合网络通信集团有限公司 | User portrait information processing method and device |
CN106790549A (en) * | 2016-12-23 | 2017-05-31 | 北京奇虎科技有限公司 | A kind of data-updating method and device |
CN107239343A (en) * | 2017-06-02 | 2017-10-10 | 浪潮金融信息技术有限公司 | Data processing method and device |
-
2017
- 2017-11-28 CN CN201711218490.2A patent/CN107886424B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101620702A (en) * | 2008-06-30 | 2010-01-06 | 中国移动通信集团黑龙江有限公司 | Expenditure presentation processing method, device and system |
CN102026138A (en) * | 2009-09-16 | 2011-04-20 | 广州从兴电子开发有限公司 | Communication fee bill output method and system |
CN102760126A (en) * | 2011-04-26 | 2012-10-31 | 阿里巴巴集团控股有限公司 | Data synchronization method in distributive system, and distributive system |
CN104717625A (en) * | 2013-12-12 | 2015-06-17 | 中国移动通信集团河南有限公司 | Credit control processing method and device |
CN106293674A (en) * | 2015-06-08 | 2017-01-04 | 宏碁股份有限公司 | Automatically increase or decrease the method for data consumer and use the device of the method |
CN106157187A (en) * | 2016-07-04 | 2016-11-23 | 北京佳阳科技有限公司 | A kind of guest room account due management method and device |
CN106651443A (en) * | 2016-12-19 | 2017-05-10 | 中国联合网络通信集团有限公司 | User portrait information processing method and device |
CN106790549A (en) * | 2016-12-23 | 2017-05-31 | 北京奇虎科技有限公司 | A kind of data-updating method and device |
CN107239343A (en) * | 2017-06-02 | 2017-10-10 | 浪潮金融信息技术有限公司 | Data processing method and device |
Non-Patent Citations (2)
Title |
---|
D. JAYAPRAKASH: "Using python inbuild modules for effective pharmacy billing application", 《2017 INTERNATIONAL CONFERENCE ON IOT AND APPLICATION (ICIOT)》 * |
陈勇: "大数据量多进程环境下生产者消费者模式实现研究", 《电脑编程技巧与维护》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108897613A (en) * | 2018-05-07 | 2018-11-27 | 广西英腾教育科技股份有限公司 | Data processing method, system and computer equipment |
CN109034910A (en) * | 2018-08-16 | 2018-12-18 | 中国建设银行股份有限公司 | A kind of fee calculation procedure and device |
CN109472584A (en) * | 2018-09-27 | 2019-03-15 | 中国建设银行股份有限公司 | Arrearage processing system, method and storage medium |
CN111161019A (en) * | 2019-12-18 | 2020-05-15 | 口碑(上海)信息技术有限公司 | Data processing system and method |
CN111161019B (en) * | 2019-12-18 | 2021-03-26 | 口碑(上海)信息技术有限公司 | Data processing system and method |
Also Published As
Publication number | Publication date |
---|---|
CN107886424B (en) | 2022-12-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104966214B (en) | A kind of exchange method and device of electronic ticket | |
CN107886424A (en) | Settlement data treating method and apparatus, computer equipment and storage medium | |
CN105281981B (en) | The data traffic monitoring method and device of network service | |
CN104301404B (en) | A kind of method and device of the adjustment operation system resource based on virtual machine | |
Zhang et al. | Toward Green Metaverse Networking: Technologies, Advancements, and Future Directions | |
CN107515663A (en) | The method and apparatus for adjusting central processor core running frequency | |
CN110490392A (en) | Site bank note distribution method and device | |
CN102404126A (en) | Charging method of cloud computing during application process | |
CN107566133A (en) | A kind of resource billing method, device and platform | |
CN109684078A (en) | Resource dynamic distributing method and system for spark streaming | |
CN111383093A (en) | Intelligent overdue bill collection method and system | |
CN109669789A (en) | Transaction queuing strategy, trading pit storage method, equipment and storage medium | |
CN107273182A (en) | A kind of resources of virtual machine dynamic expanding method and system | |
CN107425989A (en) | A kind of virtual management platform charging method and apparatus | |
CN111582850A (en) | Electricity charge recharging method and device based on mobile phone bank | |
CN112332404A (en) | Intelligent management system and method for heating service | |
CN110473113A (en) | Operation system handling capacity method, apparatus and medium, server are improved based on disruptor | |
CN105930245B (en) | A kind of transaction terminal service condition monitoring method and system | |
CN107451868A (en) | A kind of method and device of article appraisal | |
CN110246014A (en) | Bill checks and writes off dispatching method, device and server | |
CN108765134A (en) | Order data processing method and processing device, electronic equipment, storage medium | |
CN110471769A (en) | A kind of method for managing resource and device of virtual machine | |
CN112803427A (en) | Regional power grid dispatching method, system, terminal and storage medium based on demand | |
CN108052657A (en) | A kind of service label computational methods, system, equipment and computer storage media | |
CN108428009A (en) | A kind of channel distribution method and device |
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 |