CN107220897A - Treating method and apparatus and processing system that a kind of income keeps accounts - Google Patents
Treating method and apparatus and processing system that a kind of income keeps accounts Download PDFInfo
- Publication number
- CN107220897A CN107220897A CN201710374823.4A CN201710374823A CN107220897A CN 107220897 A CN107220897 A CN 107220897A CN 201710374823 A CN201710374823 A CN 201710374823A CN 107220897 A CN107220897 A CN 107220897A
- Authority
- CN
- China
- Prior art keywords
- server
- income
- accounts
- processing
- task
- 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/06—Asset management; Financial planning or analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/62—Establishing a time schedule for servicing the requests
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Business, Economics & Management (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Finance (AREA)
- Databases & Information Systems (AREA)
- Human Resources & Organizations (AREA)
- Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Data Mining & Analysis (AREA)
- Game Theory and Decision Science (AREA)
- Computer Hardware Design (AREA)
- Operations Research (AREA)
- Computational Linguistics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Computing Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention discloses the treating method and apparatus and processing system that a kind of income keeps accounts, for being kept accounts to the income performed on server, task carries out precise management, improves the treatment effeciency that income keeps accounts.The embodiment of the present invention provides the processing method that a kind of income keeps accounts, including:First server, which receives delivery system and is distributed to the timing task management device and income of N number of server, to keep accounts configuration file used in processing routine, and first server belongs to N number of server;According to configuration file, the start by set date income in the machine keeps accounts processing routine first server;First server, which receives delivery system and is distributed to the first income of N number of server, to keep accounts task, and first server robs lock operation according to the first income tasks carrying that keeps accounts, the first income keep accounts task be used for indicate the progress of the first avail data is kept accounts processing;When first server, which is robbed, locks successfully, first server carries out the processing that keeps accounts to the first avail data.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind for the treatment of method and apparatus that keeps accounts of income and processing
System.
Background technology
At present, internet financing platform disposes many and performs timing times first when the income for handling a large number of users keeps accounts
The server of business, is the fund product list to be processed of every server-assignment, and on the server in fund product list
The corresponding income of each fund products configuration keep accounts task, such multiple servers can be with the multiple fund products of parallel processing
Income keeps accounts file.And income to be processed keeps accounts, file can be synchronized to from front end processor full dose on every server, and front end processor is
Internet is managed money matters and a transfer machine of data and file interaction is carried out between platform and Fund Company, such as Fund Company is to reason
Wealth platform provides income and kept accounts file, and Fund Company's file that income can be kept accounts is uploaded on the front end processor made an appointment,
Then server can download to file from this front end processor and be handled.
The keep accounts processing procedure of file of income may include:Every server keeps accounts task regularly by the income being locally configured
Start income to keep accounts processing routine, the fund product income that book server is distributed in processing keeps accounts.Income keeps accounts processing routine
Main processing logic may include:The income of parsing Fund Company first is kept accounts file, and user's avail data in load document is arrived
Server memory carries out data preview and looked into.If preliminary examination passes through, the income batch program that keeps accounts then calls other systems service
The avail data of each user in file is handled one by one.
At present, increasing Fund Company has selected access internet financing platform, and due to simple operation, interconnection
Net financing platform has attracted the user of magnanimity, therefore internet financing platform user's avail data to be processed also ten daily
Divide huge.At least there is problems with the existing income processing scheme that keeps accounts:Deployment income keeps accounts the server count of processing task
Amount is numerous, and each server is that processing fund list is separately configured in the machine, causes the tasks carrying between multiple servers
Progress is uncontrollable, it is impossible to which the processing task that kept accounts to the income regularly performed on each server is effectively managed, one
Denier part server, which breaks down, can not quickly realize system disaster tolerance, and configuration can not be effectively managed, and can so be dropped
The treatment effeciency that low fund product income keeps accounts.
The content of the invention
The embodiments of the invention provide the treating method and apparatus and processing system that a kind of income keeps accounts, for service
The income performed on device the task that keeps accounts carries out precise management, improves the treatment effeciency that keeps accounts of income.
In order to solve the above technical problems, the embodiment of the present invention provides following technical scheme:
In a first aspect, the embodiment of the present invention provides the processing method that a kind of income keeps accounts, including:
First server, which receives delivery system and is distributed to the timing task management device and income of N number of server, to keep accounts processing journey
Configuration file used in sequence, the first server belongs to N number of server, and N is positive integer;
First server income according to configuration file start by set date in the machine keeps accounts processing routine;
The first server receives the first income that the delivery system is distributed to N number of server and kept accounts task,
And the first server according to first income keep accounts tasks carrying rob lock operation, first income keep accounts task use
The processing that keeps accounts is carried out to the first avail data in instruction;
When the first server, which is robbed, locks successfully, the first server carries out the place that keeps accounts to first avail data
Reason.
With reference in a first aspect, in the first possible implementation of first aspect, the first server is according to institute
Configuration file income described in start by set date in the machine is stated to keep accounts processing routine, including:
The first server loads in the machine according to the timing task management device and parses the configuration file;
The first server checks the task legitimacy in the configuration file;
When task is legal in the configuration file, the first server is according to being configured in the configuration file for task
The execution time determines whether need to perform at current time;
If needing execution task at current time, the first server is according to starting the timing task management device
Income keeps accounts processing routine.
With reference to the first possible implementation of first aspect, in second of possible implementation of first aspect
In, first server income according to configuration file start by set date in the machine keeps accounts processing routine, in addition to:
If needing execution task at current time, the first server first carries out random time delay, terminated in delay
When, then trigger execution following steps:The first server starts the income according to the timing task management device and kept accounts place
Reason program.
With reference to the first possible or second of possible implementation of first aspect or first aspect, in first aspect
In the third possible implementation, the first server according to first income keep accounts tasks carrying rob lock operation, bag
Include:
The first server creates a Zookeeper transient node in Zookeeper service ends, if first clothes
Business device, which successfully creates the Zookeeper transient nodes and then represents that the first server is robbed, to be locked successfully, if the first service
Device can not create the Zookeeper transient nodes and then represent that the first server robs lock failure.
With reference to the third possible implementation of first aspect, in the 4th kind of possible implementation of first aspect
In, the first server carries out the processing that keeps accounts to first avail data, including:
The first server by the income keep accounts processing routine by first avail data storage arrive income number
According in storehouse;
The income that the first server updates the first avail data described in the avail data storehouse keeps accounts state for
Complete;
The first server deletes the Zookeeper transient nodes created in Zookeeper service ends.
The first possible or second of possible or the third possible implementation with reference to first aspect or first aspect,
In the 5th kind of possible implementation of first aspect, methods described also includes:
When the first server, which is robbed, locks successfully, the first server starts lock expired time;
When the lock expired time is reached, if the first server does not complete to enter first avail data
Account processing, the first server abandons the lock got, other in addition to the first server in N number of server
Server proceeds to rob lock operation.
The first possible or second of possible or the third possible implementation with reference to first aspect or first aspect,
In the 6th kind of possible implementation of first aspect, the first server carries out the place that keeps accounts to first avail data
Reason, including:
The first server carries out deconsolidation process to first avail data, obtains M income subfile, the M's
Value is the natural number more than or equal to 2;
The first server creates M subprocess in the income keeps accounts processing routine;
The first server carries out the parallel processing that keeps accounts by the M subprocess to the M income subfile.
With reference to the 6th kind of possible implementation of first aspect, in the 7th kind of possible implementation of first aspect
In, the first server carries out the processing that keeps accounts to first avail data, in addition to:
The first server is carried out to first avail data after deconsolidation process, and the first server generates institute
State the corresponding encryption string of M income subfile difference;
The first server carries out the parallel processing that keeps accounts by the M subprocess to the M income subfile,
Specifically include:
The first server separately verifies the legitimacy of the M income subfile according to the encryption string;
The first server is to the legal subfile that bears interest respectively by a subprocess while carrying out the place that keeps accounts
Reason.
Second aspect, the embodiment of the present invention also provides the processing method that another income keeps accounts, including:
Delivery system issues timing task management device to N number of server and income keeps accounts and text is configured used in processing routine
Part, as N number of server, the income according to configuration file start by set date in the machine keeps accounts processing routine, institute respectively
N is stated for positive integer;
The delivery system is issued the first income to the N number of server and kept accounts task, and first income keeps accounts task
For indicating that the first avail data is carried out to keep accounts processing, N number of server keeps accounts tasks carrying according to first income
Lock operation is robbed, the processing that keeps accounts is carried out to first avail data by first server, the first server is N number of clothes
The successful server of lock is robbed in business device.
With reference to second aspect, in the first possible implementation of second aspect, methods described also includes:
The delivery system detects whether the server newly added;
When detecting the server newly added, the delivery system issues timed task to the server of the new addition
Manager and income keep accounts configuration file used in processing routine.
With reference to second aspect, in second of possible implementation of second aspect, methods described also includes:
The delivery system is updated to the configuration file, and the configuration after being updated to the N number of server issue
File, updates the income according to the configuration file after the renewal respectively by N number of server in the machine and keeps accounts processing
Program.
The third aspect, the embodiment of the present invention also provides a kind of server, and the server is first server, described first
Server includes:
Receiving module, the timing task management device and income that N number of server is distributed to for receiving delivery system keeps accounts place
Configuration file used in reason program, the first server belongs to N number of server, and N is positive integer;
Starting module, keeps accounts processing routine for the income according to configuration file start by set date in the machine;
Lock module is robbed, the first income that N number of server is distributed to for receiving the delivery system keeps accounts task, with
And according to first income keep accounts tasks carrying rob lock operation, first income keep accounts task be used for indicate to the first income
Data carry out the processing that keeps accounts;
Keep accounts processing module, for when the first server is robbed and locked successfully, entering to first avail data
Account processing.
With reference to the first possible implementation of the third aspect, in second of possible implementation of the third aspect
In, the starting module, including:
Document processing module, for loading and parsing the configuration text in the machine according to the timing task management device
Part;
Module is checked, for checking the task legitimacy in the configuration file;
Judge module, for when task is legal in the configuration file, according to being configured in the configuration file for task
The execution time determines whether need to perform at current time;
Program starting module, if for needing execution task at current time, being started according to the timing task management device
The income keeps accounts processing routine.
With reference to the first possible implementation of the third aspect or the third aspect, the third in the third aspect is possible
It is described to rob lock module in implementation, specifically for creating a Zookeeper transient node in Zookeeper service ends, if
The first server, which successfully creates the Zookeeper transient nodes and then represents that the first server is robbed, locks successfully, if institute
State first server can not create the Zookeeper transient nodes then represent the first server rob lock failure.
With reference to the first possible implementation of the third aspect or the third aspect, the 4th kind in the third aspect is possible
In implementation, the first server also includes:
Expired processing module is locked, for when the first server is robbed and locked successfully, starting lock expired time;In the lock
When expired time is reached, if the first server does not complete the processing that keeps accounts to first avail data, abandon getting
Lock, other servers in N number of server in addition to the first server proceed to rob lock operation.
With reference to the first possible implementation of the third aspect or the third aspect, the 5th kind in the third aspect is possible
In implementation, the processing module that keeps accounts, including:
File declustering module, for carrying out deconsolidation process to first avail data, obtains M income subfile, the M
Value be natural number more than or equal to 2;
Subprocess creation module, for creating M subprocess in keeping accounts processing routine in the income;
Parallel processing module, for carrying out the parallel place that keeps accounts to the M income subfile by the M subprocess
Reason.
Fourth aspect, the embodiment of the present invention also provides a kind of delivery system, including:
First release module, is made for issuing timing task management device and the income processing routine that keeps accounts to N number of server
Configuration file, as N number of server, the income according to configuration file start by set date in the machine keeps accounts respectively
Processing routine, the N is positive integer;
Second release module, keeps accounts task for issuing the first income to the N number of server, and first income keeps accounts
Task is used to indicate that the first avail data is carried out to keep accounts processing, and N number of server keeps accounts task according to first income
Lock operation is robbed in execution, and the processing that keeps accounts is carried out to first avail data by first server, and the first server is the N
The successful server of lock is robbed in individual server.
With reference to fourth aspect, in the first possible implementation of fourth aspect, the delivery system also includes:
Dilatation processing module, for detecting whether there is the server newly added;When detecting the server newly added, to
The server issue timing task management device and income of the new addition keep accounts configuration file used in processing routine.
With reference to fourth aspect, in second of possible implementation of fourth aspect, the delivery system also includes:
Config update module, is issued after renewal for being updated to the configuration file, and to N number of server
Configuration file, updates the income according to the configuration file after the renewal respectively by N number of server in the machine and keeps accounts
Processing routine.
5th aspect, the embodiment of the present invention also provides the processing system that a kind of income keeps accounts, the processing that the income keeps accounts
System, including:Delivery system and N number of server,
Delivery system of the delivery system as any one of second aspect;
Include first server, the clothes of the first server such as any one of first aspect in N number of server
Business device.
6th aspect is stored with there is provided a kind of computer-readable recording medium in the computer-readable recording medium
Instruction, when run on a computer so that computer performs the method described in above-mentioned each side.
As can be seen from the above technical solutions, the embodiment of the present invention has advantages below:
In embodiments of the present invention, delivery system is distributed to the timing task management device and income of N number of server and kept accounts place
Configuration file used in reason program, first server belongs to N number of server, and first server is according to configuration file in the machine
Start by set date income keeps accounts processing routine.Delivery system be distributed to N number of server the first income keep accounts task when, first service
Device according to the first income keep accounts tasks carrying rob lock operation, the first income keep accounts task be used for indicate to the first avail data progress
Keep accounts processing, when first server, which is robbed, locks successfully, and first server carries out the processing that keeps accounts to the first avail data.It is of the invention real
Apply in example and delivery system is set in the processing system that income keeps accounts, the first income of delivery system issue keeps accounts after task, N number of
Server is carried out robbing lock operation, and the processing that keeps accounts of avail data could be performed by only robbing the successful server of lock, be changed existing
Have in technology each self-timings of multiple servers perform incomes keep accounts caused by task can not problem of management, the embodiment of the present invention can be with
The task that kept accounts to the income performed on server carries out precise management, improves the treatment effeciency that income keeps accounts.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those skilled in the art, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is the composition structural representation for the processing system that a kind of income provided in an embodiment of the present invention keeps accounts;
Fig. 2 is the process blocks schematic diagram for the processing method that a kind of income provided in an embodiment of the present invention keeps accounts;
Fig. 3 is the process blocks schematic diagram for the processing method that another income provided in an embodiment of the present invention keeps accounts;
Fig. 4 performs the schematic diagram for robbing lock operation for multiple servers provided in an embodiment of the present invention;
Fig. 5 is the execution mechanism schematic diagram of timed task processor provided in an embodiment of the present invention;
Fig. 6 is that the income program of keeping accounts provided in an embodiment of the present invention robs the process schematic that keeps accounts that lock is performed;
Fig. 7 is the split process schematic diagram of avail data provided in an embodiment of the present invention;
Fig. 8 is the processing procedure schematic diagram of income subfile provided in an embodiment of the present invention;
Fig. 9-a are a kind of composition structural representation of server provided in an embodiment of the present invention;
Fig. 9-b are a kind of composition structural representation of starting module provided in an embodiment of the present invention;
Fig. 9-c are the composition structural representation of another server provided in an embodiment of the present invention;
A kind of composition structural representation for processing module that keeps accounts that Fig. 9-d provide for inventive embodiments;
Figure 10-a are a kind of composition structural representation of delivery system provided in an embodiment of the present invention;
Figure 10-b are a kind of composition structural representation of delivery system provided in an embodiment of the present invention;
Figure 10-c are a kind of composition structural representation of delivery system provided in an embodiment of the present invention;
Figure 11 is the composition structural representation that the processing method that income provided in an embodiment of the present invention keeps accounts is applied to server
Figure.
Embodiment
The embodiments of the invention provide the treating method and apparatus and processing system that a kind of income keeps accounts, for service
The income performed on device the task that keeps accounts carries out precise management, improves the treatment effeciency that keeps accounts of fund product income.
To enable goal of the invention, feature, the advantage of the present invention more obvious and understandable, below in conjunction with the present invention
Accompanying drawing in embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that disclosed below
Embodiment be only a part of embodiment of the invention, and not all embodiments.Based on the embodiment in the present invention, this area
The every other embodiment that technical staff is obtained, belongs to the scope of protection of the invention.
Term " comprising " and " having " in description and claims of this specification and above-mentioned accompanying drawing and they
Any deformation, it is intended that covering is non-exclusive to be included, and so as to a series of process comprising units, method, system, product or is set
It is standby to be not necessarily limited to those units, but may include not listing clearly or solid for these processes, method, product or equipment
The other units having.
It is that the composition structure for the processing system that a kind of income provided in an embodiment of the present invention keeps accounts is shown referring initially to Fig. 1
It is intended to.A delivery system and multiple servers are provided with the processing system that income provided in an embodiment of the present invention keeps accounts,
Wherein the number of server is represented with N, and N is positive integer, the avail data that the number of server can be handled as needed
Quantity determines that the processing system that the income keeps accounts can be used for the change management of the logarithm value amount of money, for example, can be used for
Income to fund keeps accounts, and can be used for the amount of money change management to GID.As shown in figure 1, in the embodiment of the present invention
Be provided with delivery system in the processing system that income keeps accounts, the compartment system can to N number of server perform income keep accounts into
Row management, the delivery system can be used for keeping accounts used in processing routine to N number of server issue timing task management device, income
Configuration file and income keep accounts task, so that configuration and tasks carrying that N number of server can be issued according to delivery system are received
Benefit keeps accounts processing, and the tasks carrying progress of each server is controllable, and the income regularly performed on each server is entered
Account processing task is effectively managed, so as to improve the treatment effeciency that fund product income keeps accounts.
Next the processing kept accounts respectively from the angle of server and delivery system to income provided in an embodiment of the present invention
Method is illustrated, and the processing side that the income of server-side execution provided in an embodiment of the present invention keeps accounts is introduced first
Method, is referred to shown in Fig. 2, is illustrated by taking some server in N number of server as an example, for ease of description, is defined as " first
Server ", the processing method that the income that one embodiment of the invention is provided keeps accounts, may include steps of:
201st, first server, which receives delivery system and is distributed to the timing task management device and income of N number of server, keeps accounts place
Configuration file used in reason program, first server belongs to N number of server.
In embodiments of the present invention, delivery system issues timing task management device to N number of server first and income keeps accounts
First server in configuration file used in processing routine, N number of server receives timing task management device and income
Keep accounts configuration file used in processing routine, wherein, timing task management device is used to trigger timing mechanism, and delivery system is to N
Individual server issues timing task management device, so that the timed task of each server-side can pass through the timed task pipe
Device is managed to trigger.The income processing routine that keeps accounts is that server performs income and kept accounts the processing logic of task.In the embodiment of the present invention,
Timing task management device and the income configuration file used in processing routine that keeps accounts all are to be distributed to first service by delivery system
Device, so that first server keeps accounts to income, the execution of task is no longer independently determined by server native, but passes through issue
System can realize that the income of each server keeps accounts the real-time management of task.
202nd, according to configuration file, the start by set date income in the machine keeps accounts processing routine first server.
In embodiments of the present invention, first server from delivery system receive timing task management device and configuration file it
Afterwards, first server can under the triggering of timing task management device loading configuration file so that first server can timing
Start income to keep accounts processing routine.For example, timing task management device in first server every a period all
It can be kept accounts processing routine with loading configuration file so as to start income, the keep accounts implementation procedure of processing routine of income includes distribution
Formula robs lock mechanism, in a subtask issuing process, and lock is unique, and this hair can be performed by only robbing the successful server of lock
The task of cloth, remaining server exits execution task, refers to the illustration in subsequent step 203 and step 204.
In some embodiments of the invention, step 202 first server according to configuration file the start by set date in the machine
Income keeps accounts processing routine, including:
A1, first server load in the machine according to timing task management device and parse configuration file;
A2, first server check the task legitimacy in configuration file;
A3, when task is legal in configuration file, first server is according to the task execution time configured in configuration file
It is determined that whether needing to perform at current time;
If A4, needing execution task at current time, first server starts income according to timing task management device and kept accounts
Processing routine.
For example, timing task management device in first server can all load the machine every very short time
On configuration file, and the configuration file loaded in the machine is parsed, for example, reads the file content of configuration file, parsing
Process is relevant with attribute with the type of configuration file, does not limit herein.After first server parsing configuration file, inspection is matched somebody with somebody
Put the legitimacy of task in file, for example, detect whether first server has the authority of execution task, the time of tasks carrying is
It is no to meet the requirements.Then the execution time configured according to each task in configuration file judge the task current time whether
Need to perform, can start income if necessary to performing then timing task management device keeps accounts processing routine.
Further, in some embodiments of the invention, step 202 first server according to configuration file in the machine
Start by set date income keeps accounts processing routine, in addition to performing foregoing step A1 to A4, can also carry out following steps:
If A5, needing execution task at current time, first server first carries out random time delay, terminates in delay
When, then trigger to perform foregoing step A4 first servers and start income according to timing task management device and keep accounts processing routine.
Wherein, because the configuration file on different server is all identical, therefore these incomes keep accounts processing routine all
It can simultaneously start and rob lock, in order to avoid causing to own because clock used on each server has the reason such as inconsistent
Task all the time on part server perform, timing task management device determine execution task is needed at current time when,
First suspend several seconds at random, for example random pause 1-5 seconds, restart income and keep accounts processing routine.This random time delay
Strategy can ensure that all income tasks of keeping accounts are balancedly to be distributed on all servers to perform, and realize that income keeps accounts
The load balancing of task.
203rd, first server, which receives delivery system and is distributed to the first income of N number of server, keeps accounts task, and first
Server according to the first income keep accounts tasks carrying rob lock operation, the first income keep accounts task be used for indicate to the first avail data
Progress keeps accounts processing.
In embodiments of the present invention, delivery system keeps accounts batch processing task to N number of server issue income, and the income keeps accounts
Include multiple incomes in batch processing task to keep accounts task, such as delivery system, which can disposably issue multiple incomes and keep accounts, appoints
Business, some income next issued with delivery system keeps accounts the processing procedure of task (be defined as the first income keep accounts task)
Exemplified by illustrate, the first income that delivery system is distributed to N number of server keeps accounts task, refers in the first income keeps accounts task
It is shown with and the processing that keeps accounts is carried out to the first avail data.N number of server can receive first income respectively and keep accounts task, each service
Device receives first income and kept accounts after task, is required for execution to rob lock operation, in a subtask issuing process, lock is only
One, the task of this issue can be performed by only robbing the successful server of lock.For example, server in the embodiment of the present invention
On can dispose distribution and rob lock mechanism, can for example be realized by Zookeeper, affairs in database can also be passed through
Lock mechanism is completed.
In some embodiments of the invention, the first server in step 203 keeps accounts tasks carrying according to the first income
Lock operation is robbed, including:
B1, first server create a Zookeeper transient node in Zookeeper service ends, if first server
Successfully create Zookeeper transient nodes and then represent that first server is robbed and lock successfully, if first server can not be created
Zookeeper transient nodes then represent that first server robs lock failure.
Wherein, ZooKeeper is one distributed, the distributed application program coordination service of open source code, Ke Yiwei
Distributed Application, which provides each server on Consistency service, N number of server, can dispose a Zookeeper client, such as
The Zookeeper clients created in fruit first server, which are robbed, locks successfully, and first server can be on Zookeeper servers
A Zookeeper transient node is created, what the Chubby that the establishment processes of ZooKeeper transient nodes refers to Google increased income
Implementation.For example, so that the income of fund product keeps accounts as an example, because the income of the every fund product task that keeps accounts is daily
It need to only perform once, therefore in order to avoid the income that multiple servers start identical fund product keeps accounts task simultaneously, then need
Portion Zookeeper clients, its mesh are disposed on the server that deployment income keeps accounts processing routine and timing task management device
Be that the timing task management device for ensureing on multiple servers starts income and kept accounts after processing routine at the same time, arrive first
Zookeeper service ends are entered to rob lock operation, rob the successful income of the lock processing routine that keeps accounts and perform the issue of this delivery system
Income keeps accounts task, and the processing routine that keeps accounts of the income on other servers does not perform income and kept accounts logic.
204th, when first server, which is robbed, locks successfully, first server carries out the processing that keeps accounts to the first avail data.
In embodiments of the present invention, N number of server, which can carry out, robs lock operation, is locked successfully if first server is robbed, the
One server can carry out keeping accounts processing to the first avail data, remaining server in N number of server not perform this first
Income keeps accounts task.If first server robs lock failure, first server exits the first income of execution and kept accounts task.
In some embodiments of the invention, foregoing execution step B1 realize scene under, step 204 first server
The processing that keeps accounts is carried out to the first avail data, including:
C1, first server by income keep accounts processing routine by the first avail data store into avail data storehouse;
The income that C2, first server update the first avail data in avail data storehouse keeps accounts state to have completed;
C3, first server delete the Zookeeper transient nodes created in Zookeeper service ends.
Wherein, N number of server is all connected to avail data storehouse, and first server is robbed when locking successfully, and the first server will
Avail data storehouse is arrived in the first avail data storage that first income keeps accounts indicated by task.For example, first avail data
Corresponding is the first fund, then the income state of keeping accounts of the first fund can be updated to complete in avail data storehouse, due to
First server enters lock of robbing using Zookeeper transient nodes, therefore completes to enter the first avail data in first server
Row keeps accounts after processing, and first server deletes the Zookeeper transient nodes created in Zookeeper service ends.Work as hair
Distribution system issue again the second income keep accounts task when, N number of server can also Zookeeper service ends continue create
Zookeeper transient nodes, if Zookeeper transient nodes are created successfully, then it represents that rob and lock successfully.
In some embodiments of the invention, method provided in an embodiment of the present invention is in addition to performing abovementioned steps, originally
The method that inventive embodiments are provided can also comprise the following steps:
D1, when first server is robbed and locked successfully, first server start lock expired time;
D2, when locking expired time and reaching, if first server does not complete the processing that keeps accounts to the first avail data, the
One server abandons the lock got, and other servers in N number of server in addition to first server proceed to rob lock behaviour
Make.
For example, the income in first server keeps accounts, processing routine is robbed lock successfully after server fail cause receive
Benefit keeps accounts tasks interrupt, at this moment the lock of Zookeeper service ends or occupied state, the batch program on other servers
It can not rob and lock successfully and perform income and keep accounts task.In order to solve this problem, need to set after first server is robbed and locked successfully
With the lock expired time of Zookeeper service ends, once lock is expired, first server then can actively remove the lock got,
So as to which the processing routine that keeps accounts of the income on other servers can then re-execute and rob lock operation, so as to ensure that income keeps accounts task
It can be successfully executed.
In some embodiments of the invention, step 204 first server carries out the processing that keeps accounts, bag to the first avail data
Include:
E1, first server carry out deconsolidation process to the first avail data, obtain M income subfile, M value for more than
Or the natural number equal to 2;
E2, first server create M subprocess in income keeps accounts processing routine;
E3, first server carry out the parallel processing that keeps accounts by M subprocess to M income subfile.
Wherein, it is generally the case that a fund product has up to ten million bar avail datas, in the prior art can be all
User's avail data is all loaded into internal memory to be handled one by one, it is impossible to realize the parallel place of user's avail data in single income file
Reason.In existing scheme, if enabling the avail data in each file of multi-process parallel processing, because each income file is big
It is small to have hundreds of Mbytes, and the data space that subprocess can replicate parent process can then cause system memory resource rapidly depleting, from
And system memory failure is occurred.In order to solve the problems, such as the too fast caused memory failure of memory source consumption, the embodiment of the present invention
In the first original avail data can be split, it is parallel then to start multiple subprocess in income keeps accounts processing routine
Each subfile is handled, to improve the processing speed of user's avail data in each file.
Further, step 204 first server carries out the processing that keeps accounts to the first avail data, except step E1 to step
Outside E3, step 204 can also comprise the following steps:
E4, first server are carried out to the first avail data after deconsolidation process, and first server generates M income Ziwen
The corresponding encryption string of part difference.
Wherein, in order to ensure that each subfile after splitting is not tampered with, each income subfile can be set corresponding
Encryption string, each Ziwen is calculated for example with Message Digest Algorithm 5 (Message Digest Algorithm 5, MD5)
The encryption string of part, or each Ziwen is calculated using DEA (Data Encryption Standard, DES) algorithm
The encryption string of part, or using the encryption string of each subfile of RSA public key encryption algorithms calculating.
Perform step E4 realize scene under, step E3 first servers are by M subprocess to M income subfile
The parallel processing that keeps accounts is carried out, is specifically included:
E31, first server separately verify the legitimacy of M income subfile according to encryption string;
E32, first server are to the legal subfile that bears interest respectively by a subprocess while carrying out the place that keeps accounts
Reason.
Wherein, the encryption string of each subfile can be generated when splitting and obtaining M income subfile, then entered in establishment
Before the avail data of journey processing correspondence subfile, the legitimacy of string verification subfile, only legal son can be encrypted according to this
File can just be processed, and can so ensure the security of avail data in each subfile.In other implementations of the present invention
In example, first server can also carry out error message alarm to illegal mutual fund earnings subfile.
Description by above example to the embodiment of the present invention, delivery system is distributed to the timing of N number of server
Task manager and income keep accounts configuration file used in processing routine, and first server belongs to N number of server, first service
According to configuration file, the start by set date income in the machine keeps accounts processing routine device.Delivery system is distributed to the first of N number of server
Income keep accounts task when, first server according to the first income keep accounts tasks carrying rob lock operation, the first income keep accounts task use
In indicating the processing that kept accounts to the progress of the first avail data, when first server, which is robbed, locks successfully, first server is to the first income
Data carry out the processing that keeps accounts.Delivery system is set in the processing system that income keeps accounts in the embodiment of the present invention, the delivery system
Issue the first income to keep accounts after task, N number of server is carried out robbing lock operation, receipts could be performed by only robbing the successful server of lock
The processing that keeps accounts of beneficial data, change each self-timing of multiple servers in the prior art perform that income keeps accounts can not caused by task
Problem of management, the embodiment of the present invention income performed on server can be kept accounts task carry out precise management, improve income
The treatment effeciency kept accounts.
The processing method that previous embodiment keeps accounts from the angle of first server to income provided in an embodiment of the present invention is entered
Row for example, next introduce the processing method that the income that delivery system side provided in an embodiment of the present invention performs keeps accounts,
Refer to shown in Fig. 3, the processing method that the income that one embodiment of the invention is provided keeps accounts may include steps of:
301st, delivery system issues timing task management device to N number of server and income keeps accounts and matched somebody with somebody used in processing routine
File is put, start by set date income keeps accounts processing routine in the machine according to configuration file respectively by N number of server, and N is positive integer.
In embodiments of the present invention, delivery system issues timing task management device to N number of server first and income keeps accounts
First server in configuration file used in processing routine, N number of server receives timing task management device and income
Keep accounts configuration file used in processing routine, wherein, timing task management device is used to trigger timing mechanism, and delivery system is to N
Individual server issues timing task management device, so that the timed task of each server-side can pass through the timed task pipe
Device is managed to trigger.The income processing routine that keeps accounts is that server performs income and kept accounts the processing logic of task.In the embodiment of the present invention,
Timing task management device and the income configuration file used in processing routine that keeps accounts all are to be distributed to first service by delivery system
Device, so that first server keeps accounts to income, the execution of task is no longer independently determined by server native, but passes through issue
System can realize that the income of each server keeps accounts the real-time management of task.
302nd, delivery system is issued the first income to N number of server and kept accounts task, and the first income task that keeps accounts is used to indicate
First avail data is carried out to keep accounts processing, N number of server robs lock operation according to the first income tasks carrying that keeps accounts, and is taken by first
Business device carries out the processing that keeps accounts to the first avail data, and first server locks a successful server to be robbed in N number of server.
In embodiments of the present invention, delivery system keeps accounts batch processing task to N number of server issue income, and the income keeps accounts
Include multiple incomes in batch processing task to keep accounts task, such as delivery system, which can disposably issue multiple incomes and keep accounts, appoints
Business, some income next issued with delivery system keeps accounts the processing procedure of task (be defined as the first income keep accounts task)
Exemplified by illustrate, the first income that delivery system is distributed to N number of server keeps accounts task, refers in the first income keeps accounts task
It is shown with and the processing that keeps accounts is carried out to the first avail data.N number of server can receive first income respectively and keep accounts task, each service
Device receives first income and kept accounts after task, is required for execution to rob lock operation, in a subtask issuing process, lock is only
One, the task of this issue can be performed by only robbing the successful server of lock.For example, server in the embodiment of the present invention
On can dispose distribution and rob lock mechanism, can for example be realized by Zookeeper, affairs in database can also be passed through
Lock mechanism is completed.
In some embodiments of the invention, method provided in an embodiment of the present invention is in addition to performing abovementioned steps, originally
The method that inventive embodiments are provided can also comprise the following steps:
F1, delivery system detect whether the server newly added;
F2, when detecting the server newly added, delivery system issues timing task management to the server that newly adds
Device and income keep accounts configuration file used in processing routine.
Wherein, when the product quantity that the income of access keeps accounts is more and more, it is necessary to the processing task progress that kept accounts to income
Quick dilatation, is mainly realized by delivery system in embodiments of the present invention, what delivery system was detected whether in real time
Server is added, for the server newly added, and timing task management device, task configuration file and income are kept accounts processing
Program is published on new server simultaneously.After the completion of timed task issue, delivery system, which can reset automatically, regularly appoints
Business manager.
In some embodiments of the invention, method provided in an embodiment of the present invention is in addition to performing abovementioned steps, originally
The method that inventive embodiments are provided can also comprise the following steps:
G1, delivery system are updated to configuration file, and issue the configuration file after updating to N number of server, by N number of
Server updates income in the machine according to the configuration file after renewal and kept accounts processing routine respectively.
Wherein, delivery system can control the tasks carrying of N number of server, and delivery system passes through the processing journey that kept accounts to income
Configuration file is updated used in sequence, then the configuration file after updating is issued again to N number of server, so that N
Individual server can be loaded into the configuration file of latest edition in the machine.
Description by above example to the embodiment of the present invention, delivery system is distributed to the timing of N number of server
Task manager and income keep accounts configuration file used in processing routine, and first server belongs to N number of server, first service
According to configuration file, the start by set date income in the machine keeps accounts processing routine device.Delivery system is distributed to the first of N number of server
Income keep accounts task when, first server according to the first income keep accounts tasks carrying rob lock operation, the first income keep accounts task use
In indicating the processing that kept accounts to the progress of the first avail data, when first server, which is robbed, locks successfully, first server is to the first income
Data carry out the processing that keeps accounts.Delivery system is set in the processing system that income keeps accounts in the embodiment of the present invention, the delivery system
Issue the first income to keep accounts after task, N number of server is carried out robbing lock operation, receipts could be performed by only robbing the successful server of lock
The processing that keeps accounts of beneficial data, change each self-timing of multiple servers in the prior art perform that income keeps accounts can not caused by task
Problem of management, the embodiment of the present invention income performed on server can be kept accounts task carry out precise management, improve income
The treatment effeciency kept accounts.
For ease of being better understood from and implementing the such scheme of the embodiment of the present invention, corresponding application scenarios of illustrating below come
It is specifically described.
According to internet financing platform and the contract engagement of Fund Company, Fund Company typically can be in morning 3-4 points or so
Income file is provided, and manage money matters platform and user typically arrange 7 points or so of the morning and can check the income detailed data of yesterday.Mesh
The income of one fund product of pre-treatment keeps accounts and about takes 1-2 hour.Therefore, fund product income to be processed, which keeps accounts, appoints
Business is more but processing time that allow is shorter, and the income task that keeps accounts is time-consuming relatively long, can not just guarantee agreement when
Between before complete the incomes of all fund products and keep accounts.Primarily to realizing that internet financing platform is a large amount of in the embodiment of the present invention
The quick income of user keeps accounts, and realizes what different fund product incomes kept accounts using the timing task management device of multiserver is supported
Parallel processing and load balancing, and the parallel dilatation of server is realized by delivery system, in the specific base of every server process
During the income file of King Company first by income file declustering into multiple subfiles recycle multi-process technology parallel processing each
The data of subfile, so as to realize that the quick income of internet financing platform a large number of users keeps accounts.Can in the embodiment of the present invention
The avail data inspection of all fund products is completed before the time point arranged with user and is kept accounts, it is to avoid the complaint of user and use
Family is panic.
In the embodiment of the present invention, mainly fund product income is realized by supporting the timing task management device of multiserver
The parallel processing kept accounts, and quick dilatation and the disaster tolerance of system are realized by delivery system, delivery system is release processing income
Configuration file used in the batch program and batch program of file;And have one on the server of batch program daily
Part needs income file to be processed.The parallel place of user's avail data in single income file is realized by file declustering mechanism
Reason, so as to improve the efficiency that keeps accounts of income to the full extent and ensure the security of user's avail data.Wherein, income, which keeps accounts, is
Fund Company provides the income detailed data for holding the effective share user of the fund in each consecutive days to internet financing platform
File, updates it for each user after internet financing platform inspection data are errorless and holds the effective share of fund and daily income note
Record data.
Refer to shown in Fig. 4, be that multiple servers provided in an embodiment of the present invention perform the schematic diagram for robbing lock operation.Income
The task that keeps accounts generally regularly is issued by delivery system, by taking fund product as an example, and the income of the every fund product task that keeps accounts is every
It need to only be performed once, therefore in order to avoid the income that multiple servers start identical fund product keeps accounts task simultaneously, then be needed
Portion Zookeeper clients are disposed on the server that deployment income keeps accounts batch program and timing task management device,
ZooKeeper is a software project of Apache Software Foundation, and it provides the distribution increased income for large-scale distributed calculating
Configuration service, synchronous service etc., it is possible to which reliable distributed lock service is provided.Illustrate and have n server, respectively
For:Server 1, server 2 ..., server n, on each server respectively dispose a Zookeeper client, its mesh
Be that the income for ensureing timing task management device on multiple servers initial funding A at the same time keeps accounts after batch program, first
Enter to rob to Zookeeper service ends lock operation, rob and lock the successful income batch program that keeps accounts and perform fund A income and keep accounts
Logic, other batch programs do not perform income and kept accounts logic.
Next the System Expansion mechanism in the embodiment of the present invention is illustrated, when the fund product quantity of access is more next
The batch processing task progress quick dilatation that kept accounts to income is needed when more, mainly passes through delivery system in embodiments of the present invention
Come what is realized, i.e., timing task management device, the income configuration file used in task and batch program that keeps accounts are issued simultaneously
Onto new server.After the completion of timed task issue, delivery system can reset automatically timing task management device, timing
Task manager is per minute all to be loaded and parse automatically the configuration file in the machine and start times that current time needs to perform
Business.
Next timing task management device execution mechanism in the embodiment of the present invention is illustrated, refers to shown in Fig. 5, be
The execution mechanism schematic diagram of timed task processor provided in an embodiment of the present invention.Timing task management device is that a backstage is resided
Service, it is per minute all to perform once following logic:Timing task management device on every server can all add in each minute
The configuration file of latest edition in the machine is carried, and checks the legitimacy of task in configuration file, then according to every in configuration file
The execution time of individual task configuration judges whether the task needs execution at current time, if necessary to perform then timed task pipe
Reason device can create a fork subprocess and start corresponding task.In unix system, the method that user creates a new process
It is exactly that calling system calls fork, calls fork process referred to as parent process, and the process newly created is called subprocess.
Configuration file is the extensible markup language (eXtensible that the machine is published to by configuration center
Markup Language, XML) file, its form is identical with the form of crontab tasks, thus can be with fast transferring
Original task in contab, crontab tasks are typically utilized for setting week in Unix and class Unix operating system
The instruction that phase property is performed, user can configure needs the task of execution by minute, hour, day, the moon, week configuration, specifically adopts
Configuration is as follows:
Wherein, the fund product list that server 1 is distributed includes:1888008801、1888008802、
1888008803, in above order-m parameter is corresponding fund product code.
Referring to Fig. 6, robbing the process schematic that keeps accounts that lock is performed for the income program of keeping accounts provided in an embodiment of the present invention.By
All it is that being published to by delivery system in the machine, therefore Servers-all for task is matched somebody with somebody in the configuration file on every server
It is all identical to put file, in order to ensure the income of every fund keep accounts task only perform on one server, then need to lead to
Cross Zookeeper distributed lock mechanism to be controlled, the main logic of batch program is as follows on every server, with base
Golden A income keeps accounts exemplified by processing:
Fund A income keeps accounts after task start, and batch program can check fund A in mutual fund earnings database first
Whether the income of today task that keeps accounts has been completed, and execution is exited if having completed.The task if income of fund A today keeps accounts
Also it is not carried out, then can creates a transient node in Zookeeper service ends, its path is:Path/ funds A fund code/
Lock, Zookeeper can ensure that the batch program on only one of which server creates node success, if on server 1
Batch program establishment successful node success then represents that it is robbed and locked successfully, then the batch program on the server can just be held
Batch program on the service logic that row keeps accounts, other servers then exits execution.When the batch program on server 1 is held
After the completion of row, then fund A income keeps accounts state to have completed in renewal fund avail data storehouse, and before deleting
The Zookeeper transient nodes that Zookeeper service ends are created.
It should be noted that in embodiments of the present invention, the task configuration file on different server is all identical, because
This these batch program all can simultaneously start and rob lock, in order to avoid because system time is inconsistent etc., that reason causes is all
Task is all performed on part server all the time, meeting first random pause 1-5 seconds after timing task management device creates subprocess,
Restart batch program.This random time delay strategy can ensure that all fund tasks of keeping accounts are balancedly to be distributed in
Performed on all servers, realize that fund product income keeps accounts the load balancing of task, and when which part server
During failure, other servers, which can be robbed to lock, successfully and normally to be started income and keeps accounts task.
Next the setting that expired time is locked in the embodiment of the present invention is illustrated, it is assumed that the batch processing on server 1
Program is robbed lock successfully after server fail cause income to keep accounts tasks interrupt, at this moment the lock of Zookeeper service ends is still
Batch program on occupied state, other servers, which can not be robbed, to be locked successfully and performs income and keep accounts task.In order to solve to rob
Income caused by successful server fail is locked to keep accounts tasks interrupt problem, need to be from clothes after batch program is robbed and locked successfully
The machine time of business device starts setting up session (session) expired duration of a Zookeeper service end, once session is deposited
Exceed the expired duration in the time, the Zookeeper transient nodes that batch program is created before server then can be removed actively,
Batch program so on other servers can then re-execute batch program.Wherein, the setting of expired duration can be with
Selection fund A historical yield keeps accounts most long once perform the time twice in task.For example, each server itself has
Error is had between one clock, multiple servers, expired duration here is calculated according to period length, such as is taken
Business current time timing of the device from the machine, a length of 5 minutes when expired, then after five minutes, server will be removed actively
Zookeeper transient nodes.
Referring to Fig. 7, being the split process schematic diagram of avail data provided in an embodiment of the present invention.In the prior art,
If enabling the avail data in each file of multi-process parallel processing, because each income file size has hundreds of bytes, and
The data space that subprocess can replicate parent process can then cause system memory resource rapidly depleting, so that internal memory event occurs in system
Barrier.In order to solve the problems, such as to read original receipts first in the rapidly depleting caused memory failure of memory source, the embodiment of the present invention
The size of beneficial file, judges whether the size of original income file exceedes threshold value, right in the case where original income file is excessive
Original income file is split, and then starts multiple each Ziwens of subprocess parallel processing in income keeps accounts batch program
Part, to improve the processing speed of user's avail data in each file.Because server generates the encryption string for having each subfile,
So as to avoid after file declustering, distorted in the content of subfile before processing subfile by people's malice, the data of income file
The fund of user is directly affected, by being the encryption string of each subfile generation in the embodiment of the present invention, income text can be improved
The security of part.
Referring to Fig. 8, being the processing procedure schematic diagram of income subfile provided in an embodiment of the present invention.Splitting subfile
When can generate the encryption string of each subfile, then can according to this before the avail data of subprocess processing correspondence subfile is created
The legitimacy of the sub- income file of individual encryption string verification, just only legal subfile can be processed, this is to ensure every height
The security of avail data in file, if subfile is illegal, server can also be transmission error message alarm.In addition, wound
The number for building subprocess is determined according to the fractionation number of subfile, can so improve the processing effect of whole income file
Rate, it can also be ensured that the overall memory of system is using being rational.
By foregoing illustration, the embodiment of the present invention, which issues the income program of keeping accounts by delivery system, to be made
Configuration file, timing task management device and income keep accounts task, can quickly realize that income keeps accounts the dilatation of task, and in fact
The collection of existing configuration information neutralizes effective management.The embodiment of the present invention realizes that income keeps accounts regularly by Zookeeper distributed locks
The disaster tolerance of task and parallel execution, the distributed lock can also use the lock mechanism in db transaction to realize.By random
Time delay strategy ensures that the income task that keeps accounts is load balancing on multiple servers.Torn open in inventive embodiments by file
Divide method, the processing speed of each fund product income file can be improved, and ensure the reasonable employment of server memory.But
The problem of mechanism presence can not set lock expired time.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because
According to the present invention, some steps can be carried out sequentially or simultaneously using other.Secondly, those skilled in the art should also know
Know, embodiment described in this description belongs to preferred embodiment, involved action and module is not necessarily of the invention
It is necessary.
For ease of preferably implementing the such scheme of the embodiment of the present invention, the phase for implementing such scheme is also provided below
Close device.
Refer to shown in Fig. 9-a, a kind of server provided in an embodiment of the present invention, the server is first server
900, the first server 900 includes:Receiving module 901, starting module 902, rob lock module 903, keep accounts processing module
904, wherein,
Receiving module 901, the timing task management device and income that N number of server is distributed to for receiving delivery system keeps accounts
Configuration file used in processing routine, the first server belongs to N number of server;
Starting module 902, keeps accounts processing routine for the income according to configuration file start by set date in the machine;
Rob lock module 903, be distributed to for receiving the delivery system N number of server the first income keep accounts appoint
Business, and lock operation is robbed according to first income tasks carrying that keeps accounts, first income keep accounts task be used for indicate to the
One avail data carries out the processing that keeps accounts;
The processing module that keeps accounts 904, for when the first server is robbed and locked successfully, being carried out to first avail data
Keep accounts processing.
In some embodiments of the invention, refer to shown in Fig. 9-b, the starting module 902, including:
Document processing module 9021, for being loaded according to the timing task management device in the machine and parsing the configuration
File;
Module 9022 is checked, for checking the task legitimacy in the configuration file;
Judge module 9023, for when task is legal in the configuration file, according to what is configured in the configuration file
Task execution time determines whether need to perform at current time;
Program starting module 9024, if for needing execution task at current time, according to the timing task management device
Start the income to keep accounts processing routine.
In some embodiments of the invention, it is described to rob lock module 903, specifically for being created in Zookeeper service ends
One Zookeeper transient node, represents described if the first server successfully creates the Zookeeper transient nodes
First server, which is robbed, is locked successfully, and described is represented if the first server can not create the Zookeeper transient nodes
One server robs lock failure.
In some embodiments of the invention, refer to shown in Fig. 9-c, the first server 900 also includes:
Expired processing module 905 is locked, for when the first server is robbed and locked successfully, starting lock expired time;Institute
When stating lock expired time arrival, if the first server does not complete the processing that keeps accounts to first avail data, abandon
The lock got, other servers in N number of server in addition to the first server proceed to rob lock operation.
In some embodiments of the invention, refer to shown in Fig. 9-d, the processing module 904 that keeps accounts, including:
File declustering module 9041, for carrying out deconsolidation process to first avail data, obtains M income subfile,
The value of the M is the natural number more than or equal to 2;
Subprocess creation module 9042, for creating M subprocess in keeping accounts processing routine in the income;
Parallel processing module 9043, for entering by the way that the M subprocess is parallel to M income subfile progress
Account processing.
Description by above example to the embodiment of the present invention, delivery system is distributed to the timing of N number of server
Task manager and income keep accounts configuration file used in processing routine, and first server belongs to N number of server, first service
According to configuration file, the start by set date income in the machine keeps accounts processing routine device.Delivery system is distributed to the first of N number of server
Income keep accounts task when, first server according to the first income keep accounts tasks carrying rob lock operation, the first income keep accounts task use
In indicating the processing that kept accounts to the progress of the first avail data, when first server, which is robbed, locks successfully, first server is to the first income
Data carry out the processing that keeps accounts.Delivery system is set in the processing system that income keeps accounts in the embodiment of the present invention, the delivery system
Issue the first income to keep accounts after task, N number of server is carried out robbing lock operation, receipts could be performed by only robbing the successful server of lock
The processing that keeps accounts of beneficial data, change each self-timing of multiple servers in the prior art perform that income keeps accounts can not caused by task
Problem of management, the embodiment of the present invention income performed on server can be kept accounts task carry out precise management, improve income
The treatment effeciency kept accounts.
Refer to shown in Figure 10-a, a kind of delivery system 1000 provided in an embodiment of the present invention, the delivery system 1000
Including:First release module 1001 and the second release module 1002, wherein,
First release module 1001, keeps accounts processing routine for issuing timing task management device and income to N number of server
Used configuration file, as N number of server income according to configuration file start by set date in the machine respectively
Keep accounts processing routine, and the N is positive integer;
Second release module 1002, keeps accounts task, first income for issuing the first income to the N number of server
The task that keeps accounts is used to indicate the processing that keeps accounts to the progress of the first avail data, and N number of server keeps accounts according to first income
Tasks carrying robs lock operation, carries out the processing that keeps accounts to first avail data by first server, the first server is
The successful server of lock is robbed in N number of server.
In some embodiments of the invention, refer to shown in Figure 10-b, the delivery system 1000 also includes:
Dilatation processing module 1003, for detecting whether there is the server newly added;When detecting the server that newly adds
When, issue timing task management device and income to the server of the new addition and keep accounts configuration file used in processing routine.
In some embodiments of the invention, refer to shown in Figure 10-c, the delivery system 1000 also includes:
Config update module 1004, updates for being updated to the configuration file, and to N number of server issue
Configuration file afterwards, the income is updated by N number of server according to the configuration file after the renewal in the machine respectively
Keep accounts processing routine.
Description by above example to the embodiment of the present invention, delivery system is distributed to the timing of N number of server
Task manager and income keep accounts configuration file used in processing routine, and first server belongs to N number of server, first service
According to configuration file, the start by set date income in the machine keeps accounts processing routine device.Delivery system is distributed to the first of N number of server
Income keep accounts task when, first server according to the first income keep accounts tasks carrying rob lock operation, the first income keep accounts task use
In indicating the processing that kept accounts to the progress of the first avail data, when first server, which is robbed, locks successfully, first server is to the first income
Data carry out the processing that keeps accounts.Delivery system is set in the processing system that income keeps accounts in the embodiment of the present invention, the delivery system
Issue the first income to keep accounts after task, N number of server is carried out robbing lock operation, receipts could be performed by only robbing the successful server of lock
The processing that keeps accounts of beneficial data, change each self-timing of multiple servers in the prior art perform that income keeps accounts can not caused by task
Problem of management, the embodiment of the present invention income performed on server can be kept accounts task carry out precise management, improve income
The treatment effeciency kept accounts.
Figure 11 is a kind of server architecture schematic diagram provided in an embodiment of the present invention, and the server 1100 can be because of configuration or property
Energy is different and produces than larger difference, can include one or more central processing units (central processing
Units, CPU) 1122 (for example, one or more processors) and memory 1132, one or more storage applications
The storage medium 1130 (such as one or more mass memory units) of program 1142 or data 1144.Wherein, memory
1132 and storage medium 1130 can be it is of short duration storage or persistently storage.One can be included by being stored in the program of storage medium 1130
Individual or more than one module (diagram is not marked), each module can include operating the series of instructions in server.More enter
One step, central processing unit 1122 be could be arranged to communicate with storage medium 1130, and storage medium is performed on server 1100
Series of instructions operation in 1130.
Server 1100 can also include one or more power supplys 1126, one or more wired or wireless nets
Network interface 1150, one or more input/output interfaces 1158, and/or, one or more operating systems 1141, example
Such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
The income that the server of this in above-described embodiment 1100 can specifically perform the first server execution shown in Fig. 2 enters
The process method step of account, can also perform the process method step that the income of the execution of the delivery system shown in Fig. 3 keeps accounts.
In addition it should be noted that, device embodiment described above be only it is schematical, wherein it is described as separation
The unit of part description can be or may not be it is physically separate, the part shown as unit can be or
It can not be physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality
Some or all of module therein is selected to realize the purpose of this embodiment scheme the need for border.In addition, what the present invention was provided
In device embodiment accompanying drawing, the annexation between module represents there is communication connection between them, specifically can be implemented as one
Bar or a plurality of communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, you can with
Understand and implement.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention can be borrowed
Software is helped to add the mode of required common hardware to realize, naturally it is also possible to include application specific integrated circuit, specially by specialized hardware
Realized with CPU, private memory, special components and parts etc..Generally, all functions of being completed by computer program can
Easily realized with corresponding hardware, moreover, can also be a variety of many for the particular hardware structure for realizing same function
Sample, such as analog circuit, digital circuit or special circuit.But, it is more for the purpose of the present invention in the case of software program it is real
It is now more preferably embodiment.Understood based on such, technical scheme is substantially made to prior art in other words
The part of contribution can be embodied in the form of software product, and the computer software product is stored in the storage medium that can be read
In, such as floppy disk of computer, USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), random access memory
Device (RAM, Random Access Memory), magnetic disc or CD etc., including some instructions are to cause a computer to set
Standby (can be personal computer, server, or network equipment etc.) performs the method described in each embodiment of the invention.
In summary, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to upper
Embodiment is stated the present invention is described in detail, it will be understood by those within the art that:It still can be to upper
State the technical scheme described in each embodiment to modify, or equivalent substitution is carried out to which part technical characteristic;And these
Modification is replaced, and the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.
Claims (15)
1. the processing method that a kind of income keeps accounts, it is characterised in that including:
First server, which receives delivery system and is distributed to the timing task management device and income of N number of server, to keep accounts processing routine institute
The configuration file used, the first server belongs to N number of server, and N is positive integer;
First server income according to configuration file start by set date in the machine keeps accounts processing routine;
The first server receives the first income that the delivery system is distributed to N number of server and kept accounts task, and
The first server according to first income keep accounts tasks carrying rob lock operation, first income keep accounts task be used for refer to
Show and the processing that keeps accounts is carried out to the first avail data;
When the first server, which is robbed, locks successfully, the first server carries out the processing that keeps accounts to first avail data.
2. according to the method described in claim 1, it is characterised in that the first server is according to the configuration file in the machine
Income described in upper start by set date keeps accounts processing routine, including:
The first server loads in the machine according to the timing task management device and parses the configuration file;
The first server checks the task legitimacy in the configuration file;
When task is legal in the configuration file, the first server is according to the tasks carrying configured in the configuration file
Time determines whether need to perform at current time;
If needing execution task at current time, the first server starts the income according to the timing task management device
Keep accounts processing routine.
3. method according to claim 2, it is characterised in that the first server is according to the configuration file in the machine
Income described in upper start by set date keeps accounts processing routine, in addition to:
If needing execution task at current time, the first server first carries out random time delay, at the end of delay, then
Triggering performs following steps:The first server starts the income according to the timing task management device and kept accounts processing journey
Sequence.
4. according to the method in any one of claims 1 to 3, it is characterised in that the first server is according to described
One income keep accounts tasks carrying rob lock operation, including:
The first server creates a Zookeeper transient node in Zookeeper service ends, if the first server
Successfully create the Zookeeper transient nodes and then represent that the first server is robbed and lock successfully, if the first server without
Method creates the Zookeeper transient nodes and then represents that the first server robs lock failure.
5. method according to claim 4, it is characterised in that the first server is carried out to first avail data
Keep accounts processing, including:
The first server by the income keep accounts processing routine by first avail data storage arrive avail data storehouse
In;
The income that the first server updates the first avail data described in the avail data storehouse keeps accounts state to have completed;
The first server deletes the Zookeeper transient nodes created in Zookeeper service ends.
6. method according to any one of claim 1 to 4, it is characterised in that methods described also includes:
When the first server, which is robbed, locks successfully, the first server starts lock expired time;
When the lock expired time is reached, if the first server does not complete the place that keeps accounts to first avail data
Reason, the first server abandons the lock got, other services in N number of server in addition to the first server
Device proceeds to rob lock operation.
7. method according to any one of claim 1 to 4, it is characterised in that the first server is to described first
Avail data carries out the processing that keeps accounts, including:
The first server carries out deconsolidation process to first avail data, obtains M income subfile, the value of the M
For the natural number more than or equal to 2;
The first server creates M subprocess in the income keeps accounts processing routine;
The first server carries out the parallel processing that keeps accounts by the M subprocess to the M income subfile.
8. method according to claim 7, it is characterised in that the first server is carried out to first avail data
Keep accounts processing, in addition to:
The first server is carried out to first avail data after deconsolidation process, and the first server generates the M
Individual income subfile difference is corresponding to encrypt string;
The first server carries out the parallel processing that keeps accounts by the M subprocess to the M income subfile, specifically
Including:
The first server separately verifies the legitimacy of the M income subfile according to the encryption string;
The first server is to the legal subfile that bears interest respectively by a subprocess while carrying out the processing that keeps accounts.
9. the processing method that a kind of income keeps accounts, it is characterised in that including:
Delivery system is issued timing task management device and income to N number of server and kept accounts configuration file used in processing routine,
As N number of server, the income according to configuration file start by set date in the machine keeps accounts processing routine, the N respectively
For positive integer;
The delivery system is issued the first income to the N number of server and kept accounts task, and the first income task of keeping accounts is used for
Indicate that the first avail data is carried out to keep accounts processing, N number of server robs lock according to first income tasks carrying that keeps accounts
Operation, the processing that keeps accounts is carried out to first avail data by first server, and the first server is N number of server
In rob the successful server of lock.
10. method according to claim 9, it is characterised in that methods described also includes:
The delivery system detects whether the server newly added;
When detecting the server newly added, the delivery system issues timing task management to the server of the new addition
Device and income keep accounts configuration file used in processing routine.
11. method according to claim 9, it is characterised in that methods described also includes:
The delivery system is updated to the configuration file, and to the configuration file after N number of server issue renewal,
The income is updated in the machine by N number of server according to the configuration file after the renewal respectively to keep accounts processing routine.
12. a kind of server, it is characterised in that the server is first server, the first server includes:
Receiving module, the timing task management device and income that N number of server is distributed to for receiving delivery system keeps accounts processing journey
Configuration file used in sequence, the first server belongs to N number of server, and N is positive integer;
Starting module, keeps accounts processing routine for the income according to configuration file start by set date in the machine;
Lock module is robbed, the first income that N number of server is distributed to for receiving the delivery system keeps accounts task, Yi Jigen
According to first income keep accounts tasks carrying rob lock operation, first income keep accounts task be used for indicate to the first avail data
Progress keeps accounts processing;
Keep accounts processing module, for when the first server is robbed and locked successfully, the place that keeps accounts to be carried out to first avail data
Reason.
13. a kind of delivery system, it is characterised in that including:
First release module, for being kept accounts to N number of server issue timing task management device and income used in processing routine
Configuration file, as N number of server, the income according to configuration file start by set date in the machine keeps accounts processing respectively
Program, the N is positive integer;
Second release module, keeps accounts task for issuing the first income to the N number of server, and first income keeps accounts task
For indicating that the first avail data is carried out to keep accounts processing, N number of server keeps accounts tasks carrying according to first income
Lock operation is robbed, the processing that keeps accounts is carried out to first avail data by first server, the first server is N number of clothes
The successful server of lock is robbed in business device.
14. a kind of processing system that income keeps accounts, it is characterised in that the processing system that the income keeps accounts, including:Delivery system
With N number of server,
The delivery system delivery system as claimed in claim 13;
Include first server, the first server server as claimed in claim 12 in N number of server.
15. a kind of computer-readable recording medium, including instruction, when run on a computer so that computer is performed such as
Method described in claim 1-8 any one, or perform the method as described in claim 9-11 any one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710374823.4A CN107220897B (en) | 2017-05-24 | 2017-05-24 | Income posting processing method and device and processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710374823.4A CN107220897B (en) | 2017-05-24 | 2017-05-24 | Income posting processing method and device and processing system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107220897A true CN107220897A (en) | 2017-09-29 |
CN107220897B CN107220897B (en) | 2023-04-07 |
Family
ID=59945511
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710374823.4A Active CN107220897B (en) | 2017-05-24 | 2017-05-24 | Income posting processing method and device and processing system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107220897B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112116481A (en) * | 2019-06-21 | 2020-12-22 | 腾讯科技(深圳)有限公司 | Income posting processing method and device, alarm server and storage medium |
CN113220456A (en) * | 2021-05-21 | 2021-08-06 | 中国农业银行股份有限公司 | Bill data processing method and related device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103092698A (en) * | 2012-12-24 | 2013-05-08 | 中国科学院深圳先进技术研究院 | System and method of cloud computing application automatic deployment |
CN103997498A (en) * | 2014-05-27 | 2014-08-20 | 北京京东尚科信息技术有限公司 | Distributed lock service implementation method and component |
WO2015051690A1 (en) * | 2013-10-11 | 2015-04-16 | 北京奇虎科技有限公司 | Zookeeper-based information configuration method and device |
CN105100259A (en) * | 2015-08-18 | 2015-11-25 | 北京京东尚科信息技术有限公司 | Distributed timed task execution method and system |
US20150381516A1 (en) * | 2014-06-30 | 2015-12-31 | Electronic Arts Inc. | Resource access driven distributed transaction coordination system |
CN105656653A (en) * | 2014-11-14 | 2016-06-08 | 华为技术有限公司 | Network access method of newly added node in distributed coordination system, device and system |
CN105871649A (en) * | 2016-06-21 | 2016-08-17 | 上海帝联信息科技股份有限公司 | Node server, service side and configuration file updating method thereof and updating control method |
CN106484530A (en) * | 2016-09-05 | 2017-03-08 | 努比亚技术有限公司 | A kind of distributed task dispatching O&M monitoring system and method |
CN106685706A (en) * | 2016-12-14 | 2017-05-17 | 深圳中顺易金融服务有限公司 | Zookeeper based configuration update method and system |
-
2017
- 2017-05-24 CN CN201710374823.4A patent/CN107220897B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103092698A (en) * | 2012-12-24 | 2013-05-08 | 中国科学院深圳先进技术研究院 | System and method of cloud computing application automatic deployment |
WO2015051690A1 (en) * | 2013-10-11 | 2015-04-16 | 北京奇虎科技有限公司 | Zookeeper-based information configuration method and device |
CN106371932A (en) * | 2013-10-11 | 2017-02-01 | 北京奇虎科技有限公司 | Information configuration method and device based on zookeeper |
CN103997498A (en) * | 2014-05-27 | 2014-08-20 | 北京京东尚科信息技术有限公司 | Distributed lock service implementation method and component |
US20150381516A1 (en) * | 2014-06-30 | 2015-12-31 | Electronic Arts Inc. | Resource access driven distributed transaction coordination system |
CN105656653A (en) * | 2014-11-14 | 2016-06-08 | 华为技术有限公司 | Network access method of newly added node in distributed coordination system, device and system |
CN105100259A (en) * | 2015-08-18 | 2015-11-25 | 北京京东尚科信息技术有限公司 | Distributed timed task execution method and system |
CN105871649A (en) * | 2016-06-21 | 2016-08-17 | 上海帝联信息科技股份有限公司 | Node server, service side and configuration file updating method thereof and updating control method |
CN106484530A (en) * | 2016-09-05 | 2017-03-08 | 努比亚技术有限公司 | A kind of distributed task dispatching O&M monitoring system and method |
CN106685706A (en) * | 2016-12-14 | 2017-05-17 | 深圳中顺易金融服务有限公司 | Zookeeper based configuration update method and system |
Non-Patent Citations (1)
Title |
---|
秦东霞等: "基于Hadoop的云平台设计与实现", 《智能计算机与应用》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112116481A (en) * | 2019-06-21 | 2020-12-22 | 腾讯科技(深圳)有限公司 | Income posting processing method and device, alarm server and storage medium |
CN113220456A (en) * | 2021-05-21 | 2021-08-06 | 中国农业银行股份有限公司 | Bill data processing method and related device |
CN113220456B (en) * | 2021-05-21 | 2024-07-30 | 中国农业银行股份有限公司 | Bill data processing method and related device |
Also Published As
Publication number | Publication date |
---|---|
CN107220897B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7114469B2 (en) | Blockchain-implemented counting system and method used for secure voting and distribution | |
Collins et al. | Online payments by merely broadcasting messages | |
EP3785204A1 (en) | Maintaining blocks of a blockchain in a partitioned blockchain network | |
Lubachevsky et al. | Rollback sometimes works... if filtered | |
CN107667351A (en) | The system and method for the full data backup and resume for being automatically based upon cloud on mobile device | |
CN110457123A (en) | A kind of control method and device of block processes task | |
Skidanov et al. | Nightshade: Near protocol sharding design | |
US20200084041A1 (en) | Automated Blockchain Protocol Update | |
CN115118604B (en) | Dynamic capacity expansion data migration method, device, system and medium | |
CN111143828A (en) | Safety control method and device for Web page and service | |
CN104636878A (en) | Dispatching method and device of bank automatic processing task | |
CN107220897A (en) | Treating method and apparatus and processing system that a kind of income keeps accounts | |
CN109189431A (en) | A kind of client side upgrading method, device, equipment and readable storage medium storing program for executing | |
JP2022523217A (en) | Topology Driven Byzantine Fault Tolerant Consensus Protocol with Voting Aggregation | |
CN114281653B (en) | Application program monitoring method and device and computing equipment | |
CN111639309A (en) | Data processing method and device, node equipment and storage medium | |
CN114048201A (en) | Distributed stream computing engine Flink-based key field real-time deduplication method | |
CN111368008A (en) | Data processing method, device and equipment based on block chain and readable storage medium | |
CN106406997A (en) | A timer scheduling method and device | |
CN116737349B (en) | Stream data processing method, system and storage medium | |
CN115499442B (en) | Rapid deployment type cloud computing architecture based on container arrangement | |
CN111143463A (en) | Method and device for constructing bank data warehouse based on topic model | |
US10474500B2 (en) | Running complex workflows in distributed systems while protecting consistency and ensuring progress despite failures | |
CN114422358A (en) | API gateway configuration updating method and equipment | |
CN114298700A (en) | Block chain transaction method and device, terminal equipment and computer readable storage 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |