CN111583003B - Massive financial processing transaction parallel execution method in capital centralized control process - Google Patents

Massive financial processing transaction parallel execution method in capital centralized control process Download PDF

Info

Publication number
CN111583003B
CN111583003B CN202010381261.8A CN202010381261A CN111583003B CN 111583003 B CN111583003 B CN 111583003B CN 202010381261 A CN202010381261 A CN 202010381261A CN 111583003 B CN111583003 B CN 111583003B
Authority
CN
China
Prior art keywords
execution
vector
establishing
processnum
historytable
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.)
Active
Application number
CN202010381261.8A
Other languages
Chinese (zh)
Other versions
CN111583003A (en
Inventor
牛殿峰
赵合喜
王秀燕
张明辉
张娜
王珂
蔡雪梅
王冠男
关平
刘立明
孙春阳
裴洋
张宏达
李茜
谭秀秀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Electric Power Research Institute of State Grid Jilin Electric Power Co Ltd
State Grid Jilin Electric Power Corp
Original Assignee
Electric Power Research Institute of State Grid Jilin Electric Power Co Ltd
State Grid Jilin Electric Power Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Electric Power Research Institute of State Grid Jilin Electric Power Co Ltd, State Grid Jilin Electric Power Corp filed Critical Electric Power Research Institute of State Grid Jilin Electric Power Co Ltd
Priority to CN202010381261.8A priority Critical patent/CN111583003B/en
Publication of CN111583003A publication Critical patent/CN111583003A/en
Application granted granted Critical
Publication of CN111583003B publication Critical patent/CN111583003B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • G06Q40/125Finance or payroll
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply

Abstract

The invention provides a massive financial processing transaction parallel execution method in a capital centralized control process, which establishes a database transaction process mapping array and constructs a dynamic updating mechanism of the array, and a system can realize delegation of database transactions among processes according to the process mapping array, thereby realizing the massive financial processing transaction parallel execution method; the problems of interlocking waiting and deadlock are reduced through a plurality of processes, and the parallel efficiency is improved; on the other hand, the allocation mode of the invention is a dynamic self-adaptive mode, the mode can dynamically adjust the allocation mechanism along with the change of transaction processing, the operation balance among all processes is continuously adjusted along with the change of business processing, and the massive financial processing transaction efficiency in the process of fund centralized control can be well improved.

Description

Massive financial processing transaction parallel execution method in capital centralized control process
The technical field is as follows:
the invention relates to the field of parallel transaction execution methods, in particular to a massive financial processing transaction parallel execution method in a capital centralized control process, and belongs to the technical field of power grid financial management.
Background art:
some large-scale enterprises containing massive clients, multiple branches and multiple subsidiaries can adopt a fund centralized management and control mode in the financial management process, the mode concentrates accounts on a small number of accounts for unified management, and the enterprise can effectively monitor the income and expenditure conditions by utilizing the mode, so that the aim of efficiently and scientifically managing the financial affairs is fulfilled. Therefore, the mode has better practical value in enterprise management.
The huge number of clients, branches and subsidiaries also bring huge number of financial management operations, and each operation corresponds to an atomic transaction which is inseparable in the database for the completeness of the financial operation (all database operation statements corresponding to one transaction are either successful or failed in the whole). Due to the introduction of a capital centralized control process, massive operations are concentrated on a small number of database records corresponding to a few accounts, which results in inevitable locking and mutual exclusion relationships among transactions. For this case, the current solution is: firstly, performing parallel management by directly using a self-contained default mechanism of a large database without any special processing; the mode can cause queuing congestion due to interlocking of different transactions on the same object in a high-speed service stage, and even cause deadlock to cause the failure rate of transaction execution to be increased; therefore, in a high-traffic period, the mode can cause a system user to obviously feel long waiting time and even prompt execution failure after waiting. Secondly, the isolation level of database transactions is improved, serial synchronization is carried out on a specific database object (such as a certain account), the synchronization can effectively prevent deadlock, but a plurality of accounts can be involved in part of financial processing operations, so that a plurality of synchronization queues are arranged in certain database transactions at the same time, the parallel execution capacity of the system can be obviously reduced due to the queuing phenomenon, and the system execution efficiency is difficult to improve even if a top-level server is adopted in the face of more transactions. A plurality of processes are fixedly established, a specific database transaction (such as operation of a certain account) is dispatched to the corresponding process, the processes run in parallel during system operation, and the internal execution of one process is serial, which is more effective than the former two modes; however, since the execution process of the financial operation is periodically changed, the relatively fixed dispatching mode may cause that the specific operation is concentrated on a certain process in some time period, and the execution efficiency is not stable.
Therefore, it is necessary to provide a parallel execution method for database transactions aiming at the characteristics of massive financial processing transactions in the process of golden centralized control, so that the problems of interlocking waiting and deadlock are reduced, and the parallel efficiency is improved.
Disclosure of Invention
The invention provides a massive financial processing transaction parallel execution method in a capital centralized control process; the database transaction process mapping array is established, a dynamic updating mechanism of the array is established, the system can realize delegation of database transactions among processes according to the process mapping array, and the parallel execution method of massive financial processing transactions is realized.
The invention relates to a massive financial processing transaction parallel execution method in a capital centralized control process, which is characterized by comprising the following steps:
s1, inputting an AccountList of account names which need to participate in the process of controlling the fund centralization, and inputting the process number ProcessNum of the parallel execution database transaction; acquiring the AccountNum of the number of the centralized control accounts; establishing a database transaction process mapping array MapArray; establishing a transactioniArray of a database transaction array to be executed; establishing a dynamic execution historical characteristic table HistoryTable;
s101, inputting an account name list AccountList needing to participate in the fund centralized control process, wherein each element of the AccountList is a character string, and the character string corresponds to an account name;
s102, inputting the process number ProcessNum of the parallel execution database transaction, wherein the default value of the ProcessNum is 20;
s103, acquiring the number of the elements in the AccountList, wherein the AccountNum is the number of the elements in the centralized control account;
s104, establishing a database transaction process mapping array MapArray. MapArray is an array containing ProcessNum elements, and each element in the array is a vector with AccountNum dimension; at MapArray initialization, the value of each vector in MapArray is 0;
s105, establishing a transactioniArray to be executed database transaction array, wherein the transactioniArray is an array containing ProcessNum elements, and each element in the array is a queue. Upon initialization of the TransactionArray, each queue of the TransactionArray is an empty queue;
s106, establishing a dynamic execution history characteristic table, wherein the table comprises two fields:
HistoryTablefeature: dynamically executing historical characteristics, and storing a vector with AccountNum dimension;
HistoryTableExeTime: the dynamic execution consumes time, and is an integer variable;
s2, establishing a financial processing transaction description operator transactionDescripte, inputting the text content CommandText of the financial processing transaction execution command, and outputting the text content CommandText as a financial processing transaction description result vector transactionVector;
s201, a financial processing transaction description operator counter variable TransactionCounter is set to be 1, a financial processing transaction description result vector TransactionVector is set to be an AccountNum dimensional vector, and the content of each dimension of the vector is 0;
s202, the account name executeacontname to be analyzed is AccountList [ TransactionCounter ];
s203, searching the occurrence frequency of the character string ExecutionAccountName in the CommandText according to the execution frequency Executenem of the account to be analyzed;
s204, an execution characteristic variable TransactionFeture of the current dimension is tan h (Executenem/AccountNum), wherein tan h is a hyperbolic tangent value function;
S205,TransactionVector[TransactionCounter]=TransactionFeature;
s206, TransactionCounter is TransactionCounter +1, if TransactionCounter is larger than AccountNum, then S207 is switched to, otherwise S202 is switched to;
s207, outputting a value of Transactionvector;
s3, establishing ProcessNum database transaction execution processes, and executing financial processing transactions in the transactioniArray in sequence by each process;
s301, establishing ProcessNum database transaction execution processes from TPprocess [1] to TPprocess [ ProcessNum ], wherein the processes run in a daemon mode;
s302, repeatedly executing the operations from S303 to S309 on a kth database transaction execution process TPprocess [ k ], wherein k is the number of the database transaction execution process, and the value of k ranges from 1 to ProcessNum;
s303, process queue corresponding to the process is TransactionArray [ k ];
s304, if the content of the ProcessQueue is empty, waiting for 10 milliseconds and executing S304 again, otherwise, going to S305
S305, taking an element from the ProcessQueue as a financial transaction execution text content from the text to be processed;
s306, the content of the ProcessText is executed by utilizing the database system. Obtaining the execution duration ProcessExeTime of the ProcessText;
s307, executing a transactionDescripte operator, inputting CommandText as ProcessText by the transactionDescripte operator, and obtaining a result transactionVector;
s308, establishing a record for the HistoryTable, where the HistoryTable feature of the record is transactionivector, and the HistoryTable exetime is ProcessExeTime;
s309, go to S304;
s4, establishing a database transaction mapping management process MapProcess, receiving all the financial processing transaction execution text contents of the whole fund concentration management and control system, and storing the texts into a TransactionArray;
s401, establishing a database transaction mapping management process MapProcess, wherein the process runs in a daemon mode;
s402, MapProcesses wait for receiving the text content of the execution of the financial processing transaction and store the text content into a MapProcessText to be distributed after receiving the text content;
s403, executing a transactionDescripte operator, inputting CommandText as MapProcessText by the transactionDescripte operator, and obtaining a result transactionVector;
s404, mapping the management counter MapProcessCounter to 1, mapping the minimum distance MinFeature to 10000, and mapping the minimum position MinPos to-1;
s405, map alignment vector mapfactor ═ MapArray [ MapProcessCounter ];
s406, compare the distance compandedis | compandevector-transactivator |, where | operates to compute the l2 norm (l) of the vector2-norm);
S407, if the compandedis is less than MinFeature, execute MinFeature ═ compandedis, MinPos ═ MapProcessCounter;
s408, MapProcessCounter ═ MapProcessCounter +1, go to S409 if MapProcessCounter is greater than ProcessNum, otherwise go to S405;
s409, the target allocates the queue MapProcessTargetQueue as the queue in TransactionArray MinPos
S410, adding MapProcessText into MapProcessTargetQueue;
s411, go to 402;
s5, establishing a process mapping array to dynamically update the process ActiveMapProcess, and dynamically adjusting MapArray according to the content of HistoryTable;
s501, establishing a process mapping array dynamic updating process ActiveMapProcess, wherein the process runs in a daemon mode;
s502, acquiring the number of entries of the data stored in the HistoryTable, turning to S503 if the number of entries is greater than 10000, and otherwise, waiting for 20 seconds and executing S502 again;
s503, calculating an execution time average AvgTime as an average of the HistoryTableExeTime fields in the HistoryTable, and calculating a standard deviation StdTime as a standard deviation of the HistoryTableExeTime fields in the HistoryTable; s504, for the content of the HistoryTableExeTime field in the HistoryTable, performs:
HistoryTableExeTime=((HistoryTableExeTime-(AvgTime-2×StdTime))/(4×StdTime);
wherein Round is rounded to Round;
s505, deleting all records of the HistoryTableExeTime field more than 1 or less than 0 in the HistoryTable; s506, a history feature vector list historyvectoretlist that participates in analysis is a list in which all recorded HistoryTableExeTime fields in the HistoryTable are taken out to form a vector;
s506, number distribution threshold value ThresholdNum ═ (number of elements in historyvectoretlist)/ProcessNum;
s507, dynamically updating the counter ActiveMapCounter to 1;
s508, clustering is carried out on the HistoryVectorList by using a K-Means algorithm, the number of the clusters of the K-Means algorithm is set to be (ProcessNum-ActiveMapCounter) multiplied by 2+2, and an array CenterRarray formed by the cluster central point vectors is obtained after the algorithm is operated; a first screening center point vector FirstVector ═ centragrarrray [0 ];
s509, screening the first ThresholdNum vectors nearest to the FirstVector from the HistoryVectorList;
s510, deleting all contents listed by the selected vector from the HistoryVectorList;
s511, the dynamic vector mean value activeavgvvector is the mean value of all contents of the selected vector;
S512,MapArray[ActiveMapCounter]=ActiveAvgVector;
s513, if the ActiveMapCounter is greater than the ProcessNum, then the step goes to S514, otherwise, the step goes to S508;
s514, emptying the content in the HistoryTable;
s515, wait 20 seconds and go to S502.
The invention has the positive effects that: the database transaction process mapping array is established, a dynamic updating mechanism of the array is established, the system can realize delegation of database transactions among processes according to the process mapping array, and the parallel execution method of massive financial processing transactions is realized. The method has the advantages that on one hand, the problems of interlocking waiting and deadlock are reduced through a plurality of processes, and meanwhile, the parallel efficiency is improved; on the other hand, the dispatching mode of the invention is a dynamic self-adapting mode, which can dynamically adjust the dispatching mechanism along with the change of the transaction processing and continuously adjust the operation balance among the processes along with the change of the business processing. The method can well improve the efficiency of mass financial processing transactions in the process of centralized control of capital.
Detailed Description
The present invention is further illustrated by the following examples, which do not limit the present invention in any way, and any modifications or changes that can be easily made by a person skilled in the art to the present invention will fall within the scope of the claims of the present invention without departing from the technical solution of the present invention.
Example 1
Taking a fund control system of a certain power company limited in the north as an example:
s1, inputting an AccountList of account names which need to participate in the process of controlling the fund centralization, and inputting the process number ProcessNum of the parallel execution database transaction; acquiring the AccountNum of the number of the centralized control accounts; establishing a database transaction process mapping array MapArray; establishing a transactioniArray of a database transaction array to be executed; establishing a dynamic execution historical characteristic table HistoryTable;
AccountList is a list of account names, the contents of which are shown below
Figure BDA0002482153500000051
Figure BDA0002482153500000061
ProcessNum is 20;
AccountNum is 17;
the content of MapArray is an array of 20 elements, each element in the array is a 17-dimensional vector, and all dimensions of all vectors have a value of 0:
(0,0,0,.....,0)
(0,0,0,.....,0)
(0,0,0,.....,0)
....
(0,0,0,.....,0)
the content of the TransactionArray is an array of 20 elements, and each element in the array is an empty queue
{ empty queue }
{ empty queue }
{ empty queue }
....
{ empty queue }
The HistoryTable contains two fields, including 0 records at HistoryTable initialization:
HistoryTableFeature HistoryTableExeTime
s2, establishing a financial processing transaction description operator transactionDescripte, inputting the text content CommandText of the financial processing transaction execution command, and outputting the text content CommandText as a financial processing transaction description result vector transactionVector;
s201, a financial processing transaction description operator counter variable TransactionCounter is set to be 1, a financial processing transaction description result vector TransactionVector is set to be an AccountNum dimensional vector, and the content of each dimension of the vector is 0;
s202, the account name executeacontname to be analyzed is AccountList [ TransactionCounter ];
s203, searching the occurrence frequency of the character string ExecutionAccountName in the CommandText according to the execution frequency Executenem of the account to be analyzed;
s204, an execution characteristic variable TransactionFeture of the current dimension is tan h (Executenem/AccountNum), wherein tan h is a hyperbolic tangent value function;
S205,TransactionVector[TransactionCounter]=TransactionFeature;
s206, TransactionCounter is TransactionCounter +1, if TransactionCounter is larger than AccountNum, then S207 is switched to, otherwise S202 is switched to;
s207, outputting a value of Transactionvector;
s3, establishing ProcessNum database transaction execution processes, and executing financial processing transactions in the transactioniArray in sequence by each process;
s301, establishing ProcessNum database transaction execution processes from TPprocess [1] to TPprocess [ ProcessNum ], wherein the processes run in a daemon mode;
s302, repeatedly executing the operations from S303 to S309 on a kth database transaction execution process TPprocess [ k ], wherein k is the number of the database transaction execution process, and the value of k ranges from 1 to ProcessNum;
TPprocesses [1] to TPprocesses [10] are the daemon processes in the continuously resident system in the step. Continuously extracting tasks from the corresponding queues and executing the tasks; the process is a cyclic reciprocating process which is continuously executed all the time. Such as:
the first queue of the TransactionArray contains a task, its contents may be:
Figure BDA0002482153500000071
s303, process queue corresponding to the process is TransactionArray [1 ];
s304, the content of the ProcessQueue is not transferred to S305;
s305, taking an element from the ProcessQueue as a financial transaction execution text content from the text to be processed;
process text ═ update summary set (select from volatile computing environment ═ Factory103112'WHERE FID ═ 13) +5WHERE account name ═ VPCustomer 9003'; s306, executing the content of the ProcessText by using the database system; obtaining the execution duration ProcessExeTime of the ProcessText as 12 ms;
s308, executing transactiondescriptor, which inputs CommandText, and obtains result TransactionVector (0.059,0,0,0,0,0,0,0,0,0,0,0,0, 0.059);
s309, creating a record for HistoryTable, where the HistoryTable feature of the record is transactionivector, and the HistoryTable exetime is ProcessExeTime;
s310, turning to S304;
s4, establishing a database transaction mapping management process MapProcess, receiving all the financial processing transaction execution text contents of the whole fund concentration management and control system, and storing the texts into a TransactionArray;
s401, establishing a database transaction mapping management process MapProcess, wherein the process runs in a daemon mode;
at the moment, the MapProcess process runs in a daemon form, and S402 to S411 are repeatedly executed;
s402, the MapProcesss waits for receiving the text content of the execution of the financial transaction, and sets the MapProcessText as "delete from summary portable local environment" (select from a transactional WHERE account name: ' Factory103113' WHERE FID ═ 13) and account name ═ VPCustomer9002 '; insert intra lovable values (602, 'Factory103113', 'remove') ";
the content of MapArray is an array of 20 elements, and each element in the array is a 17-dimensional vector
(0,0,0,.....,0)
(0,0,0,.....,0)
(0,0,0,.....,0)
....
(0,0,0,.....,0)
S403, executing transactiondescriptor, which inputs CommandText to MapProcessText, and obtains result TransactionVector (0,0.117,0,0,0,0,0,0,0,0,0,0, 0.059, 0);
s404, mapping the management counter MapProcessCounter to 1, mapping the minimum distance MinFeature to 10000, and mapping the minimum position MinPos to-1;
s405, map alignment vector mapfactor ═ MapArray [ MapProcessCounter ];
s406, compare the distance compandedis | compandevector-transactivator |, where | operates to compute the l2 norm (l) of the vector2-norm);
S407, if the compandedis is less than MinFeature, execute MinFeature ═ compandedis, MinPos ═ MapProcessCounter;
s408, MapProcessCounter ═ MapProcessCounter +1, go to S409 if MapProcessCounter is greater than ProcessNum, otherwise go to S405;
via 408, MinPos stores the minimum location of the mapping in the current loop, where MinPos is 1;
s409, allocating a queue in the MapProcessTargetQueue as transactioniarray [ MinPos ];
since MinPos is 1, MapProcessTargetQueue corresponds to the first queue of the transactioniarray;
s410, adding MapProcessText into MapProcessTargetQueue;
the TransactionArray structure becomes:
Figure BDA0002482153500000091
s411, go to 402.
S5, establishing a process mapping array to dynamically update the process ActiveMapProcess, and dynamically adjusting MapArray according to the content of HistoryTable;
s501, establishing a process mapping array dynamic updating process ActiveMapProcess, wherein the process runs in a daemon mode;
at this time, the ActiveMapProcess process runs in a daemon form, and S502 to S515 are repeatedly executed;
s502, acquiring the number of entries of the data stored in the HistoryTable, turning to S503 if the number of entries is greater than 10000, and otherwise, waiting for 20 seconds and executing S502 again;
s503, calculating an execution time average AvgTime as an average of the HistoryTableExeTime fields in the HistoryTable, and calculating a standard deviation StdTime as a standard deviation of the HistoryTableExeTime fields in the HistoryTable; s504, for the content of the HistoryTableExeTime field in the HistoryTable, performs:
HistoryTableExeTime ═ ((HistoryTableExeTime- (AvgTime-2 × StdTime))/(4 × StdTime)/(where Round is rounding off);
s505, deleting all records of the HistoryTableExeTime field more than 1 or less than 0 in the HistoryTable; s506, a history feature vector list historyvectoretlist that participates in analysis is a list in which all recorded HistoryTableExeTime fields in the HistoryTable are taken out to form a vector;
s506, number distribution threshold value ThresholdNum ═ (number of elements in historyvectoretlist)/ProcessNum;
s507, dynamically updating the counter ActiveMapCounter to 1;
s508, clustering is carried out on the HistoryVectorList by using a K-Means algorithm, the number of the clusters of the K-Means algorithm is set to be (ProcessNum-ActiveMapCounter) multiplied by 2+2, and an array CenterRarray formed by the cluster central point vectors is obtained after the algorithm is operated; a first screening center point vector FirstVector ═ centragrarrray [0 ];
s509, screening the first ThresholdNum vectors nearest to the FirstVector from the HistoryVectorList;
s510, deleting all contents listed by the selected vector from the HistoryVectorList;
s511, the dynamic vector mean value activeavgvvector is the mean value of all contents of the selected vector;
S512,MapArray[ActiveMapCounter]=ActiveAvgVector;
s513, if the ActiveMapCounter is greater than the ProcessNum, then the step goes to S514, otherwise, the step goes to S508;
s514, emptying the content in the HistoryTable;
at this time, the MapArray updating is completed once, and the content of the MapArray after the updating is according to the content in the HistoryTable
(0.03,0.03,0.09,0.09,0.01,0.07,0.05,0.00,0.04,0.05,0.06,0.09,0.02,0.03,0.07,0.07,0.03)
(0.01,0.03,0.03,0.11,0.02,0.03,0.10,0.00,0.10,0.02,0.06,0.07,0.05,0.12,0.08,0.01,0.00)
(0.04,0.05,0.06,0.05,0.05,0.12,0.11,0.02,0.06,0.02,0.02,0.03,0.02,0.04,0.01,0.05,0.01)
(0.08,0.01,0.09,0.02,0.00,0.09,0.01,0.08,0.12,0.05,0.02,0.10,0.05,0.07,0.08,0.06,0.08)
(0.02,0.08,0.03,0.07,0.06,0.08,0.03,0.09,0.03,0.04,0.06,0.09,0.06,0.01,0.02,0.11,0.09)
(0.12,0.12,0.12,0.00,0.10,0.05,0.09,0.09,0.02,0.06,0.08,0.02,0.08,0.11,0.02,0.07,0.01)
(0.04,0.08,0.01,0.12,0.04,0.11,0.12,0.03,0.09,0.06,0.10,0.05,0.12,0.06,0.08,0.07,0.08)
(0.12,0.07,0.09,0.10,0.04,0.00,0.02,0.12,0.09,0.09,0.01,0.06,0.03,0.12,0.09,0.07,0.07)
(0.04,0.12,0.02,0.12,0.09,0.03,0.05,0.03,0.05,0.11,0.11,0.09,0.06,0.11,0.12,0.08,0.05)
(0.05,0.11,0.10,0.04,0.03,0.04,0.01,0.05,0.02,0.04,0.01,0.06,0.09,0.04,0.01,0.01,0.09)
After one round of adjustment, the adjustment results are as follows:
s515, wait 20 seconds and go to S502.
Example 2
Taking the capital management and control system of a certain power company in north as an example, under the same hardware system, in 5 consecutive days during the peak period of business, 9 early every day: 00 to 11: 00, comparing the number of financial processing transactions completed in each minute, wherein the comparison result is as follows:
Figure BDA0002482153500000111
it can be seen that by using the invention, higher efficiency of parallelism can be achieved, while the number of transactions processed is much higher than other methods. The invention reduces the problems of interlocking waiting and deadlock through a plurality of processes and improves the parallel efficiency at the same time; on the other hand, the dispatching mode of the invention is a dynamic self-adapting mode, which can dynamically adjust the dispatching mechanism along with the change of the transaction processing and continuously adjust the operation balance among the processes along with the change of the business processing. The method can well improve the efficiency of mass financial processing transactions in the process of centralized control of capital.

Claims (1)

1. A massive financial processing affair parallel execution method in a capital centralized control process is characterized by comprising the following steps:
s1, inputting an AccountList of account names which need to participate in the process of controlling the fund centralization, and inputting the process number ProcessNum of the parallel execution database transaction; acquiring the AccountNum of the number of the centralized control accounts; establishing a database transaction process mapping array MapArray; establishing a transactioniArray of a database transaction array to be executed; establishing a dynamic execution historical characteristic table HistoryTable;
s101, inputting an account name list AccountList needing to participate in the fund centralized control process, wherein each element of the AccountList is a character string, and the character string corresponds to an account name;
s102, inputting the process number ProcessNum of the parallel execution database transaction, wherein the default value of the ProcessNum is 20;
s103, acquiring the number of the elements in the AccountList, wherein the AccountNum is the number of the elements in the centralized control account;
s104, establishing a database transaction process mapping array MapArray, wherein the MapArray is an array containing ProcessNum elements, and each element in the array is a vector with AccountNum dimension; at MapArray initialization, the value of each vector in MapArray is 0;
s105, establishing a TransactionArray of the database to be executed, wherein the TransactionArray is an array containing ProcessNum elements, each element in the array is a queue, and each queue of the TransactionArray is an empty queue when the TransactionArray is initialized;
s106, establishing a dynamic execution history characteristic table, wherein the table comprises two fields:
HistoryTablefeature: dynamically executing historical characteristics, and storing a vector with AccountNum dimension;
HistoryTableExeTime: the dynamic execution consumes time, and is an integer variable;
s2, establishing a financial processing transaction description operator transactionDescripte, inputting the text content CommandText of the financial processing transaction execution command, and outputting the text content CommandText as a financial processing transaction description result vector transactionVector;
s201, a financial processing transaction description operator counter variable TransactionCounter is set to be 1, a financial processing transaction description result vector TransactionVector is set to be an AccountNum dimensional vector, and the content of each dimension of the vector is 0;
s202, the account name executeacontname to be analyzed is AccountList [ TransactionCounter ];
s203, searching the occurrence frequency of the character string ExecutionAccountName in the CommandText according to the execution frequency Executenem of the account to be analyzed;
s204, an execution characteristic variable TransactionFeture of the current dimension is tan h (Executenem/AccountNum), wherein tan h is a hyperbolic tangent value function;
S205,TransactionVector[TransactionCounter]=TransactionFeature;
s206, TransactionCounter is TransactionCounter +1, if TransactionCounter is larger than AccountNum, then S207 is switched to, otherwise S202 is switched to;
s207, outputting a value of Transactionvector;
s3, establishing ProcessNum database transaction execution processes, and executing financial processing transactions in the transactioniArray in sequence by each process;
s301, establishing ProcessNum database transaction execution processes from TPprocess [1] to TPprocess [ ProcessNum ], wherein the processes run in a daemon mode;
s302, repeatedly executing the operations from S303 to S309 on a kth database transaction execution process TPprocess [ k ], wherein k is the number of the database transaction execution process, and the value of k ranges from 1 to ProcessNum;
s303, process queue corresponding to the process is TransactionArray [ k ];
s304, if the content of the ProcessQueue is empty, waiting for 10 milliseconds and executing S304 again, otherwise, going to S305
S305, taking an element from the ProcessQueue as a financial transaction execution text content from the text to be processed;
s306, executing the content of the ProcessText by using the database system and obtaining the execution duration ProcessExeTime of the ProcessText;
s307, executing a transactionDescripte operator, inputting CommandText as ProcessText by the transactionDescripte operator, and obtaining a result transactionVector;
s308, establishing a record for the HistoryTable, where the HistoryTable feature of the record is transactionivector, and the HistoryTable exetime is ProcessExeTime;
s309, go to S304;
s4, establishing a database transaction mapping management process MapProcess, receiving all the financial processing transaction execution text contents of the whole fund concentration management and control system, and storing the texts into a TransactionArray;
s401, establishing a database transaction mapping management process MapProcess, wherein the process runs in a daemon mode;
s402, MapProcesses wait for receiving the text content of the execution of the financial processing transaction and store the text content into a MapProcessText to be distributed after receiving the text content;
s403, executing a transactionDescripte operator, inputting CommandText as MapProcessText by the transactionDescripte operator, and obtaining a result transactionVector;
s404, mapping the management counter MapProcessCounter to 1, mapping the minimum distance MinFeature to 10000, and mapping the minimum position MinPos to-1;
s405, map alignment vector mapfactor ═ MapArray [ MapProcessCounter ];
s406, compare the distance compandedis | compandevector-transactivator |, where | operates to compute the l2 norm (l) of the vector2-norm);
S407, if the compandedis is less than MinFeature, execute MinFeature ═ compandedis, MinPos ═ MapProcessCounter;
s408, MapProcessCounter ═ MapProcessCounter +1, go to S409 if MapProcessCounter is greater than ProcessNum, otherwise go to S405;
s409, allocating a queue in the MapProcessTargetQueue as transactioniarray [ MinPos ]; s410, adding MapProcessText into MapProcessTargetQueue;
s411, go to 402;
s5, establishing a process mapping array to dynamically update the process ActiveMapProcess, and dynamically adjusting MapArray according to the content of HistoryTable;
s501, establishing a process mapping array dynamic updating process ActiveMapProcess, wherein the process runs in a daemon mode;
s502, acquiring the number of entries of the data stored in the HistoryTable, turning to S503 if the number of entries is greater than 10000, and otherwise, waiting for 20 seconds and executing S502 again;
s503, calculating an execution time average AvgTime as an average of the HistoryTableExeTime fields in the HistoryTable, and calculating a standard deviation StdTime as a standard deviation of the HistoryTableExeTime fields in the HistoryTable;
s504, for the content of the HistoryTableExeTime field in the HistoryTable, performs:
HistoryTableExeTime ═ ((HistoryTableExeTime- (AvgTime-2 × StdTime))/(4 × StdTime)/(where Round is rounding off);
s505, deleting all records of the HistoryTableExeTime field more than 1 or less than 0 in the HistoryTable;
s506, a history feature vector list historyvectoretlist that participates in analysis is a list in which all recorded HistoryTableExeTime fields in the HistoryTable are taken out to form a vector;
s506, number distribution threshold value ThresholdNum ═ (number of elements in historyvectoretlist)/ProcessNum;
s507, dynamically updating the counter ActiveMapCounter to 1;
s508, clustering is carried out on the HistoryVectorList by using a K-Means algorithm, the number of the clusters of the K-Means algorithm is set to be (ProcessNum-ActiveMapCounter) multiplied by 2+2, and an array CenterRarray formed by the cluster central point vectors is obtained after the algorithm is operated; a first screening center point vector FirstVector ═ centragrarrray [0 ];
s509, screening the first ThresholdNum vectors nearest to the FirstVector from the HistoryVectorList;
s510, deleting all contents listed by the selected vector from the HistoryVectorList;
s511, the dynamic vector mean value activeavgvvector is the mean value of all contents of the selected vector;
S512,MapArray[ActiveMapCounter]=ActiveAvgVector;
s513, if the ActiveMapCounter is greater than the ProcessNum, then the step goes to S514, otherwise, the step goes to S508;
s514, emptying the content in the HistoryTable;
s515, wait 20 seconds and go to S502.
CN202010381261.8A 2020-05-08 2020-05-08 Massive financial processing transaction parallel execution method in capital centralized control process Active CN111583003B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010381261.8A CN111583003B (en) 2020-05-08 2020-05-08 Massive financial processing transaction parallel execution method in capital centralized control process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010381261.8A CN111583003B (en) 2020-05-08 2020-05-08 Massive financial processing transaction parallel execution method in capital centralized control process

Publications (2)

Publication Number Publication Date
CN111583003A CN111583003A (en) 2020-08-25
CN111583003B true CN111583003B (en) 2022-03-29

Family

ID=72122879

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010381261.8A Active CN111583003B (en) 2020-05-08 2020-05-08 Massive financial processing transaction parallel execution method in capital centralized control process

Country Status (1)

Country Link
CN (1) CN111583003B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252309B (en) * 2023-11-15 2024-02-13 青岛海信信息科技股份有限公司 Automatic timing execution method for office business process

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216783A (en) * 2007-12-29 2008-07-09 中国建设银行股份有限公司 Process for optimizing ordering processing for multiple affairs
CN102929707A (en) * 2012-11-06 2013-02-13 无锡江南计算技术研究所 Parallel task dynamical allocation method
CN105874435A (en) * 2013-10-31 2016-08-17 慧与发展有限责任合伙企业 Non-blocking registration in distributed transactions
CN108513658A (en) * 2016-12-30 2018-09-07 华为技术有限公司 A kind of transaction methods and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10210200B2 (en) * 2015-10-01 2019-02-19 Futurewei Technologies, Inc. Action-based routing of a transaction in an online transaction processing system
US10649770B2 (en) * 2017-01-31 2020-05-12 Facebook, Inc. κ-selection using parallel processing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216783A (en) * 2007-12-29 2008-07-09 中国建设银行股份有限公司 Process for optimizing ordering processing for multiple affairs
CN102929707A (en) * 2012-11-06 2013-02-13 无锡江南计算技术研究所 Parallel task dynamical allocation method
CN105874435A (en) * 2013-10-31 2016-08-17 慧与发展有限责任合伙企业 Non-blocking registration in distributed transactions
CN108513658A (en) * 2016-12-30 2018-09-07 华为技术有限公司 A kind of transaction methods and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
事务存储系统:事务冲突与事务并行;曾坤;《中国博士学位论文全文数据库 信息科技辑》;20120715(第07期);第I137-17页 *

Also Published As

Publication number Publication date
CN111583003A (en) 2020-08-25

Similar Documents

Publication Publication Date Title
Kiefer et al. On the characteristics of the general queueing process, with applications to random walk
US10585881B2 (en) Adaptively routing transactions to servers
CN107395669A (en) A kind of collecting method and system based on the real-time distributed big data of streaming
CN104834558B (en) A kind of method and system of data processing
Alfarrarjeh et al. Scalable spatial crowdsourcing: A study of distributed algorithms
CN109885397A (en) The loading commissions migration algorithm of time delay optimization in a kind of edge calculations environment
EP3198494B1 (en) Communication for efficient re-partitioning of data
US20200081903A1 (en) Splitting transaction and analysis queries
CN106557471A (en) Method for scheduling task and device
CN111583003B (en) Massive financial processing transaction parallel execution method in capital centralized control process
US6978458B1 (en) Distributing data items to corresponding buckets for use in parallel operations
CN111324453B (en) Method for block chain platform resource scheduling
CN110515969A (en) Data query processing method, electronic device, computer equipment and storage medium
CN108900626A (en) Date storage method, apparatus and system under a kind of cloud environment
Subekti et al. The 3 steps of best data warehouse model design with leaning implementation for sales transaction in franchise restaurant
US20170359832A1 (en) Method for providing m2m data
CN115145953A (en) Data query method
Fetai et al. Workload-driven adaptive data partitioning and distribution—The Cumulus approach
CN107451211B (en) A kind of download system based on RabbitMQ and MongoDB
US8108340B2 (en) Search engine configured to minimize performance degradation under high load
CN111260288B (en) Order management method, device, medium and electronic equipment
CN107038072B (en) Method for scheduling task and device based on Hadoop system
US20210004675A1 (en) Predictive apparatus and method for predicting workload group metrics of a workload management system of a database system
CN108304253A (en) Map method for scheduling task based on cache perception and data locality
Hamdi et al. Dynamic management of materialized views in real-time data warehouses

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