WO2022127675A1 - 账户额度数据的处理方法、装置及电子设备 - Google Patents
账户额度数据的处理方法、装置及电子设备 Download PDFInfo
- Publication number
- WO2022127675A1 WO2022127675A1 PCT/CN2021/136572 CN2021136572W WO2022127675A1 WO 2022127675 A1 WO2022127675 A1 WO 2022127675A1 CN 2021136572 W CN2021136572 W CN 2021136572W WO 2022127675 A1 WO2022127675 A1 WO 2022127675A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- quota
- batch
- account
- transaction
- data
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title abstract 2
- 238000000034 method Methods 0.000 claims abstract description 60
- 230000003068 static effect Effects 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 14
- 238000004590 computer program Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 230000008859 change Effects 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
Images
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/02—Banking, e.g. interest calculation or account maintenance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- 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/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Definitions
- the present application relates to the technical field of financial services, and in particular, to a method, device and electronic device for processing account limit data.
- the distributed account system can solve the problem of hot accounts under high concurrent transaction requests, it also brings new problems.
- it comes to account transactions it is necessary to consider how to do day-end and accounting, the existing day-end and day-end
- the quota calculation scheme can only be applied to a centralized database, and cannot be applied to a distributed account system, and some banks or financial institutions may not accept transactions for part of the time due to the large amount of data, or the transaction times out or rejects.
- the embodiments of the present application provide a method, device and electronic device for processing account limit data, so as to realize accurate calculation of data such as the end-of-day limit of a distributed account system.
- an embodiment of the present application provides a method for processing account limit data, which is executed by a transaction server, wherein a database server associated with the transaction server stores account limit data corresponding to multiple quota batches, so
- the methods described include:
- each transaction batch and quota batch respectively correspond to a predetermined time interval.
- the account quota data corresponding to each quota batch includes account batch quota and quota batch number, which are stored in the quota account master table of the database server, and the determination is associated with the transaction batch requested by the account transaction.
- the quota batches include:
- the content of the account quota data operation request includes: modifying the account batch quota corresponding to the quota batch number determined in the quota account master table according to the transaction content included in the account transaction request.
- the content of the account quota data operation request includes:
- the database server is provided with a quota account table and a batch and final quota table of the account,
- the dynamic data of the current quota batch and the dynamic data of the previous quota batch are stored in the quota account table, and the static data of the historical quota batch is recorded in the final quota table;
- the dynamic data of the last quota batch may be stored in the final batch quota table as a group of static data of historical quota batches when a preset time condition is satisfied.
- the method further includes:
- an account limit data operation request containing at least the following contents is generated and sent to the database server:
- the quota batch number and account batch quota in the dynamic data of the previous quota batch are replaced with the quota batch number and account batch quota in the dynamic data of the current quota batch;
- the determining the quota batches associated with the transaction batches of the account transaction request includes:
- the transaction batch number is consistent with the quota batch number, the current quota batch is used as the associated quota batch;
- the content of the account quota data operation request at least includes: modifying the account batch quota in the dynamic data of the current quota batch according to the transaction content included in the account transaction request.
- the determining the quota batches associated with the transaction batches of the account transaction request further includes:
- both the current quota batch and the previous quota batch are regarded as the associated quota batch;
- the content of the account limit data operation request at least includes: according to the transaction content included in the account transaction request, the account batch limit in the dynamic data of the current quota batch, and the account in the dynamic data of the previous quota batch Batch quotas are modified.
- the determining the quota batches associated with the transaction batches of the account transaction request further includes:
- both the current quota batch and the previous quota batch are regarded as the associated quota batch;
- the content of the account limit data operation request at least includes:
- the database server is provided with a transaction flow meter for storing the content of the account limit data operation request;
- the content of the account quota data operation request includes: account number, transaction serial number, quota batch number, account batch quota adjustment quantity, and account batch quota adjustment form.
- the account limit data stored in the database server can be used to check balances and/or provide external bills.
- an embodiment of the present application further provides an apparatus for processing account limit data, which is applied to a transaction server, wherein the apparatus is used to implement any one of the aforementioned methods.
- an embodiment of the present application also provides an electronic device, including:
- a memory arranged to store computer-executable instructions which, when executed, cause the processor to perform any of the methods described above.
- embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and the one or more programs are executed by an electronic device including multiple application programs , causing the electronic device to execute any one of the aforementioned methods.
- the method for processing account limit data in the embodiment of the present application can be executed by a separately deployed transaction server, and the transaction server corresponds to a database server, wherein Account quota data corresponding to multiple quota batches is stored as the basis for processing the account quota data.
- the transaction server Before processing the account quota data, the transaction server will receive the account transaction request, and then can determine the quota batch associated with it in the database server according to the transaction batch of the account transaction request; then, according to the determined quota batch , generate an account limit data operation request for the corresponding account limit data; finally, send the account limit data operation request to the database server, so that the database server can adjust the corresponding account limit data according to the account limit data operation request.
- the method for processing account limit data according to the embodiment of the present application can process high-concurrency and uninterrupted transaction requests without suspending business transactions, which ensures the continuous execution of transactions; Accurate quota data for each batch is obtained, which meets the data reliability requirements of the financial industry, and provides an accurate data basis for subsequent balance checking and external billing.
- FIG. 1 is a schematic structural diagram of a distributed account system according to an embodiment of the application.
- FIG. 2 is a flowchart of a method for processing account limit data according to an embodiment of the application
- FIG. 3 is a number axis diagram of adjusting the account batch quota according to an embodiment of the application
- FIG. 4 is a schematic structural diagram of an apparatus for processing account limit data according to an embodiment of the application.
- FIG. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
- the distributed account system includes multiple data centers (Internet Data Center, IDC for short) distributed in different regions, and each data center has unified data
- IDC Internet Data Center
- the distributed account system allocates the quota to a large number of accounts, and these accounts are scattered in different account quota databases, so that the transaction processing program can evenly distribute the transactions on different accounts, and then adjust the account quota of the corresponding account, The processing efficiency of transaction requests is greatly improved.
- the account limit data is dynamically adjusted to ensure the accuracy and reliability of the data.
- an embodiment of the present application provides a method for processing account limit data, which is executed by a transaction server, wherein a database server associated with the transaction server stores account limit data corresponding to multiple limit batches, such as As shown in FIG. 2, the method includes the following steps S210 to S230:
- Step S210 Determine the quota batches associated with the transaction batches of the account transaction request.
- the method for processing account limit data in this embodiment of the present application may be performed by a separate transaction server, and a database server corresponds to the transaction server, and the database server stores account limit data corresponding to multiple quota batches, that is, this application
- the account limit data to be processed Before processing the account limit data, the transaction server will receive the user's account transaction request.
- the account transaction request may be a batch of high concurrent account transaction requests received, or a small amount or a single account transaction request. It may be a debit request for a certain account or a repayment request.
- the type of the specific requested transaction can be flexibly set by those skilled in the art according to the actual situation, which is not specifically limited here.
- the account transaction request usually carries the time stamp of the transaction request, which can be understood as the server time that accepts the account transaction request, and the transaction batch of the account transaction request can be set according to the time interval in which the time is located.
- the time period between the start time point and the end time point of each hour can be used as a time batch, for example, 9:00 to 9:59 is divided into the 9th batch, and 10:00 to 10 Point 59 is divided into the tenth batch....
- the transaction batch of the account transaction request can be recorded as the eleventh batch.
- a business date transaction can be divided into 24 batches.
- the essence of the quota batch is also a time interval, which can be understood as the quota batch determined according to the transaction batch of the account transaction request received in real time. For example, during initialization, the time when the first account transaction request is received is At 9:00, the corresponding transaction batch is the ninth batch. At this time, it is considered that the transaction data of the ninth batch has been received one after another, and the current quota batch is recorded as the ninth batch.
- This embodiment of the present application subdivides the statistics of account quota data into multiple time batches, so that accurate quota data for each time batch can be obtained subsequently.
- those skilled in the art can also flexibly set other dividing manners according to actual needs, which are not specifically limited here.
- the quota batches associated therewith can be determined.
- the "association" here can be understood as the account transaction request will carry transaction batches, and the transaction batches will affect the quota batches that need to adjust the quota, and because the database server stores data corresponding to multiple quota batches as mentioned above
- the account quota data that is, the account quota data corresponds to multiple quota batches, so the account quota data of which quota batches to be modified can be determined, and the quota batches corresponding to these account quota data are considered to be the same as The batch associated with the transaction batch.
- each quota batch records the result of processing the quota according to the corresponding transaction batch, so it is easy to understand that each time a new quota batch is processed, the initial quota is the same as the previous quota batch. The final amount is the same.
- the 12th batch of quota batches may be reached, but the account transaction request of the 11th batch of transaction batches is received. At this time, the account batch quota of the 11th batch of quota batches needs to be adjusted. But not only that, since the account batch quota of the 12th batch of quota batches is inherited from the 11th batch, the adjustment should also be inherited, that is, the account batch quota of the 12th batch should be adjusted accordingly. And so on.
- Step S220 according to the determined quota batches, generate an account quota data operation request for the corresponding account quota data.
- an account quota data operation request for the account quota data of the corresponding quota batch may be generated according to the determined quota batch.
- the account limit data operation request here can be understood as a request to adjust the account limit data of the associated quota batches, and the corresponding adjustment methods may be different for the determined associated quota batches.
- Step S230 sending the account limit data operation request to the database server, so that the database server modifies the corresponding account limit data.
- the account limit data operation request is sent to the database server for corresponding data adjustment and other processing, so that the processed account limit data meets the requirements of data accuracy and reliability in the financial business industry.
- the method for processing account limit data can process high-concurrency and uninterrupted transaction requests without suspending business transactions, which ensures the continuous execution of transactions; Accurate quota data for each batch is obtained, which meets the data reliability requirements of the financial industry, and provides an accurate data basis for subsequent balance checking and external billing.
- the account quota data corresponding to each quota batch includes an account batch quota and a quota batch number, which are stored in the quota account summary table of the database server.
- the quota batch associated with the transaction batch includes: determining a quota batch number not less than the transaction batch number of the account transaction request; the content of the account quota data operation request includes: according to the transaction content included in the account transaction request, Modify the account batch quota corresponding to the quota batch number determined in the quota account summary table.
- the account quota data in the embodiment of the present application may be managed uniformly by a quota account master table in the database server, and the quota account master table may include account quota data such as quota batch numbers and corresponding account batch quotas. Then as mentioned above, if the account transaction request is generated at 11:15, then it corresponds to the 11th batch of transactions, which will inevitably affect the account batch quota of the 11th batch of quota batches. It may also affect the account batch quota (if any) of the 12th batch, the 13th batch ... quota batch. Then you only need to find the quota batch number of the transaction batch not less than the 11th batch in the quota account summary table, and modify the corresponding account batch quota.
- account quota data such as quota batch numbers and corresponding account batch quotas.
- the content of the account quota data operation request includes: in the quota account
- the account quota data corresponding to the new quota batch is generated in the general table, wherein the transaction batch number is used as the quota batch number of the new quota batch, and the latest quota batch in the quota account general table is used as the quota batch number.
- the account batch quota and the transaction content included in the account transaction request determine the account batch quota of the new quota batch.
- the data operation request can be to generate the account quota data corresponding to the new quota batch in the quota account master table, use the currently received transaction batch number as the quota batch number of the new quota batch, and use the quota account master table as the quota batch number of the new quota batch.
- the account batch quota of the latest quota batch and the transaction content included in the account transaction request determine the account batch quota of the new quota batch.
- the maximum value of the quota batch number stored in the quota account summary table is batch 11, and the received transaction batch number is batch 12.
- the 12th batch of quota batch can be created in the quota account summary table.
- the account quota of the 12th batch here may be determined according to the account quota of the 11th batch and the amount of quota adjustment in the currently received account transaction request.
- the database server is provided with an account quota account table and a batch final quota table
- the quota account table stores the dynamic data of the current quota batch and the dynamic data of the previous quota batch.
- Data, the batch final quota table records the static data of the historical quota batch; the dynamic data of the previous quota batch can be saved as a group of historical quota batch static data when the preset time condition is met. in the batch final quota table.
- the account limit data stored in the database server of the embodiment of the present application can also be managed by a plurality of data tables with different functions, for example, it can include a limit account table and a batch-end limit table, as shown in Tables 1 and 1 below. shown in Table 2.
- the quota account table in Table 1 is mainly used to record the dynamic data of the current quota batch and the previous quota batch, including the account number, the current quota batch and the account batch quota of the previous quota batch.
- the quota table is mainly used to record the static data of each quota batch, including the account number and the final quota data of each quota batch. The advantage of this is that only the quota account table needs to be modified according to each transaction, while the batch and final quota table can be modified regularly without frequent access, which ensures data stability.
- the time difference between the servers is usually not more than 5 seconds. Therefore, in order to obtain accurate final batch quota data, the last batch quota in the quota account table can be saved to the batch final quota table at the 30th minute of each hour. , at this time, it is considered that the batch quota of the quota batch will basically not change again.
- the specific time node selected to synchronize the last batch of quota data in the quota account table to the final batch quota table can be flexibly set by those skilled in the art according to the actual situation, which is not specifically limited here.
- the method further includes: if no account transaction request is received within a predetermined time interval, generating an account limit data operation request containing at least the following content and sending it to the database server : Replace the quota batch number and account batch quota in the dynamic data of the previous quota batch in the quota account table with the quota batch number and account batch quota in the dynamic data of the current quota batch; The quota batch number in the dynamic data of the current quota batch is replaced with the quota batch number corresponding to the current time.
- the dynamic data of the current quota batch and the previous quota batch in the above quota account table can be generated.
- the operation request for batch switching is sent to the database server for processing.
- the current quota batch is the 11th batch, and no new account transaction requests are received during the time interval corresponding to the quota batch from 11:00 to 11:59.
- the database server can be notified to transfer the current quota
- the batch is switched from the original 11th batch to the 12th batch, and the previous quota batch is switched from the original 10th batch to the 11th batch, so that batch switching can be automatically completed to facilitate the processing of subsequent batch data.
- the determining the quota batches associated with the transaction batches of the account transaction request includes: the transaction batch number of the account transaction request and the quota batches in the dynamic data of the current quota batches If the transaction batch number is consistent with the quota batch number, the current quota batch is used as the associated quota batch; the content of the account quota data operation request at least includes: according to the account The transaction content contained in the transaction request modifies the account batch quota in the dynamic data of the current quota batch.
- the dynamic data of the current quota batch and the dynamic data of the previous quota batch are stored in the quota account table.
- the transaction batch number of the account transaction request can be compared with the transaction batch number of the account transaction request. Compare the quota batch numbers in the dynamic data of the current quota batch to determine the associated quota batch. If the transaction batch number is equal to the determined quota batch number, it means that the received account transaction request is for the current quota batch.
- the account batch quota in the dynamic data of the current quota batch can be adjusted directly according to the transaction content included in the account transaction request, such as adjustment quota, etc.
- the determining the quota batches associated with the transaction batches of the account transaction request further includes: if the transaction batch number is smaller than the quota batch number, setting the current quota batches and the previous quota batch are regarded as associated quota batches; the content of the account quota data operation request at least includes: according to the transaction content included in the account transaction request, the account batch in the dynamic data of the current quota batch is processed. The current quota and the account batch quota in the dynamic data of the previous quota batch are modified.
- the transaction batch number is less than the quota batch number, it means that the quota data of the previous quota batch of the current quota batch has not been completely processed due to the time difference of the server, and the account quota data of the previous quota batch needs to be adjusted. And since the quota data of the current quota batch is related to the quota data of the previous quota batch, it will change with the change of the quota data of the previous quota batch. Therefore, if the transaction batch number is less than the quota batch number , the account data of the current quota batch will also be adjusted.
- the specific adjustment method may be to adjust the account batch quota in the dynamic data of the current quota batch and the previous quota batch at the same time according to the transaction content included in the account transaction request, such as adjustment quota, etc.
- the corresponding transaction batch number is batch 11
- the request for deduction is 2000
- the current quota batch number is batch 12
- the corresponding account quota is 9000
- the batch number of the previous quota is batch 11
- the corresponding account quota is 10,000
- the account quota of the 12th batch and the 11th batch can be deducted through the database server respectively, and the quota batch number of batch 12 can be obtained.
- a number line diagram for adjusting the account batch quota is provided. Specifically, a transaction on a business date can be divided into 24 batches. If the batch number of the current quota is batch 12, then for the received account transaction request of batch 12, only the account of the 12th batch needs to be adjusted. Quota, for the received account transaction request of batch 11, the account quota of batch 11 and batch 12 needs to be adjusted.
- the determining the quota batches associated with the transaction batches of the account transaction request further includes: if the transaction batch number is greater than the quota batch number, setting the current quota batches and the previous quota batch are regarded as the associated quota batch; the content of the account quota data operation request at least includes: replacing the quota batch number and account batch quota in the dynamic data of the previous quota batch with The quota batch number and account batch quota in the dynamic data of the current quota batch; modify the account batch quota in the dynamic data of the current quota batch according to the transaction content included in the account transaction request; The quota batch number in the dynamic data of the batch is replaced with the transaction batch number.
- the transaction batch number is greater than the quota batch number, it means that the account quota data of the transaction batch number has not been stored in the quota account table.
- the quota batch number and account batch quota of the current quota batch can be switched to upper The quota batch number and account batch quota of a quota batch, and then the account of the current quota batch is determined according to the account batch quota of the previous quota batch and the transaction content in the currently received account transaction request, such as adjustment quota, etc. batch amount.
- NTP Network Time Protocol
- the time difference based on the server is relatively short, so generally only the quota data of adjacent quota batches will be affected, and almost no cross-quota batches will occur. That is to say, if the account transaction request after 12:00 has been received currently , it is unlikely that the account transaction request of 10 points will be received later.
- the database server is provided with a transaction flow table, which is used to store the content of the account limit data operation request; the content of the account limit data operation request includes: the account number of the account, the transaction flow number, quota batch number, account batch quota adjustment quantity, account batch quota adjustment form.
- the database server in the embodiment of the present application may also store a transaction flow table for recording transaction flow information.
- the transaction flow table may specifically include account numbers, Information such as transaction serial number, quota batch number, adjustment quota and adjustment type can be obtained from the received account transaction request.
- the account limit data stored in the database server can be used to check the balance and/or provide an external bill.
- the account limit data of each batch obtained in the above-mentioned embodiment can also be used for checking the balance and providing bills to the outside world.
- the amount incurred can be understood as the sum of all current payments made by a certain business on the debit or credit side within a certain period of time.
- the batch-end quota of each account and the batch-end quota difference between the two batches are compared, so as to check whether the amount of each batch is accurate.
- it can also provide transaction flow details according to the batch dimension, and provide the requester with the sum of all account approval quotas of the corresponding batch to meet the requester's different business needs.
- the numbering rules for batch numbers mentioned in the above embodiments are only a simplified form for the convenience of description. In practical application scenarios, more complex numbering rules can be set according to different business requirements, such as 2020.
- the transaction batch number can be 202009010010, and the last two digits can be represented as the tenth batch of transaction batches.
- the specific setting can be flexibly selected by those skilled in the art according to actual needs, as long as each transaction batch or quota batch can be distinguished for each business date.
- the embodiment of the present application also provides an apparatus 400 for processing account quota data, which is applied to a transaction server, wherein the database server associated with the transaction server stores account quota data corresponding to multiple quota batches, as shown in FIG. 4, the device 400 includes:
- a determination unit 410 configured to determine the quota batches associated with the transaction batches of the account transaction request
- the sending unit 430 is configured to send the account limit data operation request to the database server, so that the database server modifies the corresponding account limit data.
- FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
- the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory.
- the memory may include memory, such as high-speed random-access memory (Random-Access Memory, RAM), or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
- RAM Random-Access Memory
- non-volatile memory such as at least one disk memory.
- the electronic equipment may also include hardware required for other services.
- the processor, network interface and memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Component Interconnect Standard) bus. Industry Standard Architecture, extended industry standard structure) bus, etc.
- the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one bidirectional arrow is shown in FIG. 5, but it does not mean that there is only one bus or one type of bus.
- the program may include program code, and the program code includes computer operation instructions.
- the memory may include memory and non-volatile memory and provide instructions and data to the processor.
- the processor reads the corresponding computer program from the non-volatile memory into the memory and then executes it, forming a processing device for account limit data on a logical level.
- the processor executes the program stored in the memory, and is specifically used to perform the following operations:
- the above-mentioned method executed by the apparatus for processing account limit data disclosed in the embodiment shown in FIG. 4 of the present application may be applied to a processor, or implemented by a processor.
- a processor may be an integrated circuit chip with signal processing capabilities.
- each step of the above-mentioned method can be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
- the electronic device can also execute the method performed by the apparatus for processing account limit data in FIG. 4 , and implement the functions of the apparatus for processing account limit data in the embodiment shown in FIG.
- the embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and the one or more programs include instructions, and the instructions are executed by an electronic device including multiple application programs.
- the electronic device can be made to execute the method executed by the device for processing account limit data in the embodiment shown in FIG. 4 , and is specifically used to execute:
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
- the apparatus implements the functions specified in the flow or flows of the flowcharts and/or the block or blocks of the block diagrams.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- Memory may include forms of non-persistent memory, random access memory (RAM) and/or non-volatile memory in computer readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
- RAM random access memory
- ROM read only memory
- flash RAM flash memory
- Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology.
- Information may be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
- computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
- the embodiments of the present application may be provided as a method, a system or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
- computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请公开了一种账户额度数据的处理方法、装置及电子设备,由交易服务器执行,与交易服务器关联的数据库服务器中存储有与多个额度批次对应的账户额度数据,该方法包括:确定与账户交易请求的交易批次相关联的额度批次;根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求;将账户额度数据操作请求发送至数据库服务器,以使数据库服务器对相应账户额度数据进行修改。本申请可对高并发无间断的交易请求进行处理,无需暂停业务交易,保证了交易的持续进行;此外,通过从批次维度将交易和额度进行隔离,可以得到各批次准确的账户额度数据,满足了金融行业数据可靠性的需求,为后续的发生额核对、对外提供账单提供了准确的数据基础。
Description
相关申请的交叉引用
本申请要求于2020年12月17日提交中国专利局,申请号为202011494088.9,发明名称为“一种账户额度数据的处理方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及金融业务技术领域,尤其涉及一种账户额度数据的处理方法、装置及电子设备。
在金融业务场景下,对于实时扣款交易,扣减账户额度是一个核心功能点。传统的银行或者其他金融机构一般采用集中式数据库,通过悲观锁的方式更新账户日期并获取账户额度,为了解决高并发交易请求下的热点账户问题,现有技术中还采用了分布式账户系统来处理实时扣款交易。
然而,分布式账户系统虽然可以解决高并发交易请求下的热点账户问题,但同时也带来了新的问题,涉及到账户交易就要考虑如何日终和核算,现有的日切及日终额度的计算方案仅能应用在集中式数据库,无法应用于分布式账户系统,并且有部分银行或金融机构由于数据量过大,导致出现有部分时间不受理交易或者交易超时、拒绝等情况。
发明内容
本申请实施例提供了一种账户额度数据的处理方法、装置及电子设备,以实现对分布式账户系统的日终额度等数据的准确计算。
本申请实施例采用下述技术方案:
第一方面,本申请实施例提供一种账户额度数据的处理方法,由交易服务器执行,其中,与所述交易服务器关联的数据库服务器中存储有与多个额度批次对应的账户额度数据,所述方法包括:
确定与账户交易请求的交易批次相关联的额度批次;
根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求;
将所述账户额度数据操作请求发送至所述数据库服务器,以使所述数据库服务器对相应账户额度数据进行修改。
可选地,每个交易批次和额度批次分别对应一个预定的时间区间。
可选地,各额度批次对应的账户额度数据包括账户批次额度和额度批次号,存储在所述数据库服务器的额度账户总表中,所述确定与账户交易请求的交易批次相关联的额度批次包括:
确定不小于账户交易请求的交易批次号的额度批次号;
所述账户额度数据操作请求的内容包括:根据所述账户交易请求包含的交易内容,对额度账户总表中确定的额度批次号对应的账户批次额度进行修改。
可选地,若所述额度账户总表中已存储的额度批次号均小于所述交易批次号,则所述账户额度数据操作请求的内容包括:
在所述额度账户总表中生成与新额度批次对应的账户额度数据,其中,以所述交易批次号作为该新额度批次的额度批次号,以所述额度账户总表中最近一次额度批次的账户批次额度和所述账户交易请求包含的交易内容确定该新额度批次的账户批次额度。
可选地,所述数据库服务器中设置有账户的额度账户表和批终额度表,
所述额度账户表中存储有当前额度批次的动态数据和上一额度批次的动态数据,所述批终额度表中记录有历史额度批次的静态数据;
所述上一额度批次的动态数据在满足预设时间条件时可作为一组历史额度批次的静态数据被保存至所述批终额度表中。
可选地,该方法还包括:
若在某个预定的时间区间内未接收到账户交易请求,则生成至少包含下述内容的账户额度数据操作请求并发送至所述数据库服务器:
将所述额度账户表中,上一额度批次的动态数据中的额度批次号和账户批次额度替换为当前额度批次的动态数据中的额度批次号和账户批次额度;
将当前额度批次的动态数据中的额度批次号替换为与当前时间对应的额度批次号。
可选地,所述确定与账户交易请求的交易批次相关联的额度批次包括:
对账户交易请求的交易批次号和当前额度批次的动态数据中的额度批次号进 行比较;
若所述交易批次号和所述额度批次号一致,则将当前额度批次作为相关联的额度批次;
所述账户额度数据操作请求的内容至少包括:根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度进行修改。
可选地,所述确定与账户交易请求的交易批次相关联的额度批次还包括:
若所述交易批次号小于所述额度批次号,则将当前额度批次和上一额度批次均作为相关联的额度批次;
所述账户额度数据操作请求的内容至少包括:根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度,以及上一额度批次的动态数据中的账户批次额度均进行修改。
可选地,所述确定与账户交易请求的交易批次相关联的额度批次还包括:
若所述交易批次号大于所述额度批次号,则将当前额度批次和上一额度批次均作为相关联的额度批次;
所述账户额度数据操作请求的内容至少包括:
将上一额度批次的动态数据中的额度批次号和账户批次额度,替换为当前额度批次的动态数据中的额度批次号和账户批次额度;
根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度进行修改;
将当前额度批次的动态数据中的额度批次号替换为所述交易批次号。
可选地,所述数据库服务器中设置有交易流水表,用于存储所述账户额度数据操作请求的内容;
所述账户额度数据操作请求的内容包括:账户的账号,交易流水号,额度批次号,账户批次额度调整数量,账户批次额度调整形式。
可选地,所述数据库服务器中存储的账户额度数据可以用于核对发生额和/或提供对外账单。
第二方面,本申请实施例还提供一种账户额度数据的处理装置,应用于交易服务器,其中,所述装置用于实现前述之任一所述方法。
第三方面,本申请实施例还提供一种电子设备,包括:
处理器;以及
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行前述之任一所述方法。
第四方面,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行前述之任一所述方法。
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:本申请实施例的账户额度数据的处理方法可以由单独部署的交易服务器来执行,与该交易服务器对应的还有数据库服务器,其中存储有与多个额度批次对应的账户额度数据,作为对账户额度数据进行处理的基础。在对账户额度数据进行处理前,交易服务器会接收到账户交易请求,然后可以根据该账户交易请求的交易批次,确定数据库服务器中与之相关联的额度批次;之后根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求;最后将账户额度数据操作请求发送至数据库服务器,以使数据库服务器可以根据账户额度数据操作请求对相应的账户额度数据进行调整。本申请实施例的账户额度数据的处理方法可以对高并发无间断的交易请求进行处理,无需暂停业务交易,保证了交易的持续进行;此外,通过从批次维度将交易和额度进行隔离,可以得到各批次准确的额度数据,满足了金融行业数据可靠性的需求,并且为后续的发生额核对、对外提供账单等功能提供了准确的数据基础。
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本申请实施例的一种分布式账户系统的结构示意图;
图2为本申请实施例的一种账户额度数据的处理方法的流程图;
图3为本申请实施例的一种对账户批次额度进行调整的数轴图;
图4为本申请实施例的一种账户额度数据的处理装置的结构示意图;
图5为本申请实施例中一种电子设备的结构示意图。
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例 及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下结合附图,详细说明本申请各实施例提供的技术方案。
如图1所示,提供了一种分布式账户系统的结构示意图,分布式账户系统包括分布在不同区域的多个数据中心(Internet Data Center,简称IDC),每个数据中心均有统一的数据接入模块以及账户额度管理模块,每个账户额度管理模块可以管理一个或多个账户额度数据库。分布式账户系统通过将额度分配至大量的账号中,这些账号分散在不同的账户额度数据库中,使得处理交易的程序可以将交易均匀的分散在不同的账号上,进而调整相应账号的账户额度,大大提高了对交易请求的处理效率。
然而,由于账户额度数据是实时变化的,且不同服务器之间存在时间差,为了能够得到各业务日期或者各时间批次内的准确的额度数据,需要对每个业务日期或者每个时间批次内的账户额度数据进行动态调整,以保证数据的准确性和可靠性。
基于此,本申请实施例提供了一种账户额度数据的处理方法,由交易服务器执行,其中,与所述交易服务器关联的数据库服务器中存储有与多个额度批次对应的账户额度数据,如图2所示,所述方法包括如下步骤S210至步骤S230:
步骤S210,确定与账户交易请求的交易批次相关联的额度批次。
本申请实施例的账户额度数据的处理方法可以由单独的交易服务器来执行,与交易服务器对应的还有数据库服务器,数据库服务器中存储有与多个额度批次对应的账户额度数据,即本申请所要处理的账户额度数据。在对账户额度数据进行处理之前,交易服务器会接收到用户的账户交易请求,该账户交易请求可以是接收到的批量的高并发账户交易请求,也可以是少量的或单次的账户交易请求,可以是针对某个账户的扣款请求,也可以是还款请求,具体请求交易的类型本领域技术人员可根据实际情况灵活设置,在此不作具体限定。
具体实施时,账户交易请求中通常会携带交易请求的时间戳,即可以理解为是受理该账户交易请求的服务器时间,根据该时间所处的时间区间可以设定该账户交易请求的交易批次,这里可以以每个小时的起始时间点到终止时间点之间的时间段作为一个时间批次,例如,9点00分至9点59分为第9批次,10点00分至10点 59分为第10批次……,假设服务器受理某账户交易请求的时间为11点15分,则该账户交易请求的交易批次即可以记为第11批次。一个业务日期的交易可以被划分为24个批次。
额度批次的本质也是一个时间区间,可以理解为是根据实时接收到的账户交易请求的交易批次而确定的额度批次,例如,在初始化时,接收到第一个账户交易请求的时间为9点00分,对应的交易批次为第9批,此时认为第9批的交易数据已经开始陆续被接收到,则将当前的额度批次记为第9批。本申请实施例将账户额度数据的统计细分到多个时间批次,以便后续可以得到每个时间批次的准确的额度数据。当然,除了按照上述的每个小时划分批次,本领域技术人员也可以根据实际需求灵活设置其他的划分方式,在此不做具体限定。
因此,在得到上述账户交易请求中的交易批次后,可以确定与之相关联的额度批次。这里的“相关联”可以理解为,账户交易请求中会携带交易批次,交易批次会影响需要调整额度的额度批次,且由于前面提到数据库服务器中存储有与多个额度批次对应的账户额度数据,也即账户额度数据是与多个额度批次对应的,因此要修改哪些额度批次的账户额度数据也就可以确定了,这些账户额度数据对应的额度批次就认为是与交易批次相关联的批次。
举例说明,每个额度批次记录的是根据相应的交易批次对额度处理后的结果,那么容易理解,每开始一个新的额度批次的数据处理,初始的额度都是与上一个额度批次的最终额度相同的。但是由于服务器存在时间差,导致可能到了第12批的额度批次,但是却接收到了第11批的交易批次的账户交易请求,此时需要调整第11批的额度批次的账户批次额度,但不仅如此,由于第12批的额度批次的账户批次额度是从第11批继承而来,所以该调整也应当被继承,也就是还要相应调整第12批次的账户批次额度,以此类推。
步骤S220,根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求。
在得到与当前接收到的账户交易请求的交易批次相关联的额度批次后,可以根据确定的额度批次,生成对相应额度批次的账户额度数据的账户额度数据操作请求。这里的账户额度数据操作请求可以理解为是对相关联的额度批次的账户额度数据进行调整的请求,确定的相关联的额度批次不同,对应的调整方式也可能不同。
步骤S230,将所述账户额度数据操作请求发送至所述数据库服务器,以使所 述数据库服务器对相应账户额度数据进行修改。
在得到上述账户额度数据操作请求后,将该账户额度数据操作请求发送至数据库服务器进行相应数据的调整等处理,使得处理后的账户额度数据满足金融业务行业数据准确性和可靠性的要求。
本申请实施例的账户额度数据的处理方法可以对高并发无间断的交易请求进行处理,无需暂停业务交易,保证了交易的持续进行;此外,通过从批次维度将交易和额度进行隔离,可以得到各批次准确的额度数据,满足了金融行业数据可靠性的需求,并且为后续的发生额核对、对外提供账单等功能提供了准确的数据基础。
在本申请的一个实施例中,各额度批次对应的账户额度数据包括账户批次额度和额度批次号,存储在所述数据库服务器的额度账户总表中,所述确定与账户交易请求的交易批次相关联的额度批次包括:确定不小于账户交易请求的交易批次号的额度批次号;所述账户额度数据操作请求的内容包括:根据所述账户交易请求包含的交易内容,对额度账户总表中确定的额度批次号对应的账户批次额度进行修改。
本申请实施例的账户额度数据可以由数据库服务器中的一个额度账户总表统一进行管理,该额度账户总表中可以包括额度批次号及对应的账户批次额度等账户额度数据。那么如前所述,如果账户交易请求是在11点15分产生的,那么它对应的就是第11批的交易批次,必然会影响的是第11批的额度批次的账户批次额度,还可能影响第12批、第13批……额度批次的账户批次额度(如果有)。那么就只需要在额度账户总表中找到不小于第11批的交易批次的额度批次号,对相应的账户批次额度进行修改即可。
当然根据前面的分析,因为服务器之间存在时间差的原因,会出现额度账户总表中不存在对应的额度批次号的情况,那就需要新建额度批次,例如下述实施例。
在本申请的一个实施例中,若所述额度账户总表中已存储的额度批次号均小于所述交易批次号,则所述账户额度数据操作请求的内容包括:在所述额度账户总表中生成与新额度批次对应的账户额度数据,其中,以所述交易批次号作为该新额度批次的额度批次号,以所述额度账户总表中最近一次额度批次的账户批次额度和所述账户交易请求包含的交易内容确定该新额度批次的账户批次额度。
如果当前接收到的交易批次号大于额度账户总表中已存储的额度批次号的最大值,说明当前的额度账户总表中还没有存储该交易批次的额度数据,因此对应的账户额度数据操作请求可以是在额度账户总表中生成与新额度批次对应的账户额 度数据,将当前接收到的交易批次号作为该新额度批次的额度批次号,将额度账户总表中最近一次额度批次的账户批次额度和账户交易请求包含的交易内容确定该新额度批次的账户批次额度。
例如,额度账户总表中已存储的额度批次号最大值为批次11,而接收到的交易批次号是批次12,此时可以在额度账户总表中新建第12批的额度批次,这里的第12批的账户额度可以根据第11批的账户额度以及当前接收到的账户交易请求中的额度调整数量等来确定。
在本申请的一个实施例中,所述数据库服务器中设置有账户的额度账户表和批终额度表,所述额度账户表中存储有当前额度批次的动态数据和上一额度批次的动态数据,所述批终额度表中记录有历史额度批次的静态数据;所述上一额度批次的动态数据在满足预设时间条件时可作为一组历史额度批次的静态数据被保存至所述批终额度表中。
与上述实施例不同的是,本申请实施例的数据库服务器中存储的账户额度数据也可以由多个不同功能的数据表分别管理,例如可以包括额度账户表和批终额度表,如下表1和表2所示。表1的额度账户表主要用于记录当前额度批次的和上一额度批次的动态数据,包括账号、当前额度批次和上一额度批次的账户批次额度等,表2的批终额度表主要用于记录各额度批次的静态数据,包括账号以及每一额度批次最终的额度数据等。这样的优势在于,只有额度账户表需要根据每一笔交易进行修改,而批终额度表可以定期修改,不需要频繁访问,保证了数据稳定性。
服务器的时间差通常不会超过5秒钟,因此为了可以得到准确的批终额度数据,可以在每个小时的第30分钟,将额度账户表中的上一批次额度保存至批终额度表中,此时认为该额度批次的批次额度基本不会再发生变化。当然,具体选择哪个时间节点将额度账户表中的上一批次额度数据同步至批终额度表中,本领域技术人员可根据实际情况灵活设置,在此不做具体限定。
表1
表2
在本申请的一个实施例中,该方法还包括:若在某个预定的时间区间内未接收到账户交易请求,则生成至少包含下述内容的账户额度数据操作请求并发送至所述数据库服务器:将所述额度账户表中,上一额度批次的动态数据中的额度批次号和账户批次额度替换为当前额度批次的动态数据中的额度批次号和账户批次额度;将当前额度批次的动态数据中的额度批次号替换为与当前时间对应的额度批次号。
在实际的金融业务场景下,可能会出现在一个时间批次内没有接收到账户交易请求的情况,此时可以生成将上述额度账户表中的当前额度批次和上一额度批次的动态数据进行批次切换的操作请求,发送至数据库服务器进行处理。例如,当前额度批次为第11批,在该额度批次对应的11点整至11点59分的时间区间内,没有接收到新的账户交易请求,此时可以告知数据库服务器,将当前额度批次由原来的第11批切换为第12批,上一额度批次由原来的第10批切换为第11批,由此可以自动完成批次切换,以便于进行后续批次数据的处理。
在本申请的一个实施例中,所述确定与账户交易请求的交易批次相关联的额度批次包括:对账户交易请求的交易批次号和当前额度批次的动态数据中的额度批次号进行比较;若所述交易批次号和所述额度批次号一致,则将当前额度批次作为相 关联的额度批次;所述账户额度数据操作请求的内容至少包括:根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度进行修改。
如前所述,在额度账户表中存储有当前额度批次的动态数据和上一额度批次的动态数据,在接收到新的账户交易请求后,可以将账户交易请求的交易批次号与当前额度批次的动态数据中的额度批次号进行比较,以确定相关联的额度批次,如果交易批次号和确定的额度批次号相等,则说明接收到的账户交易请求是对当前额度批次的账户额度数据进行调整的请求,则可以直接根据账户交易请求包含的交易内容如调整额度等,对当前额度批次的动态数据中的账户批次额度进行调整。
例如,假设当前接收到一个账户交易请求x1,对应的交易批次号为批次12,请求扣款1000,当前额度批次号也为批次12,对应的账户额度为10000,则可以通过数据库服务器对第12批的账户额度进行扣减,得到额度批次号为批次12的账户额度为10000-1000=9000。
在本申请的一个实施例中,所述确定与账户交易请求的交易批次相关联的额度批次还包括:若所述交易批次号小于所述额度批次号,则将当前额度批次和上一额度批次均作为相关联的额度批次;所述账户额度数据操作请求的内容至少包括:根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度,以及上一额度批次的动态数据中的账户批次额度均进行修改。
如果交易批次号小于额度批次号,说明由于服务器的时间差导致当前额度批次的上一额度批次的额度数据还没有完全处理完,需要对上一额度批次的账户额度数据进行调整,且由于当前额度批次的额度数据与上一额度批次的额度数据是相关联的,会随着上一额度批次的额度数据的变化而变化,因此如果交易批次号小于额度批次号,对于当前额度批次的账户数据也会进行调整。具体调整的方式可以是根据账户交易请求包含的交易内容如调整额度等,对当前额度批次和上一额度批次的动态数据中的账户批次额度同时进行调整。
例如,基于上述实施例,假设当前又接收到一个账户交易请求x2,对应的交易批次号为批次11,请求扣款2000,当前额度批次号为批次12,对应的账户额度为9000,上一额度批次号为批次11,对应的账户额度为10000,则可以通过数据库服务器对第12批和第11批的账户额度分别进行扣减,得到额度批次号为批次12的账户额度为9000-2000=7000,额度批次号为批次11的账户额度为10000-2000=8000。
为了便于对上述实施例的理解,如图3所示,提供了一种对账户批次额度进行调整的数轴图。具体地,一个业务日期的交易可以被划分为24个批次,若当前额度批次号为批次12,则对于接收到的批次12的账户交易请求,仅需调整第12批次的账户额度,对于接收到的批次11的账户交易请求,则需要调整第11批次和第12批次的账户额度。
在本申请的一个实施例中,所述确定与账户交易请求的交易批次相关联的额度批次还包括:若所述交易批次号大于所述额度批次号,则将当前额度批次和上一额度批次均作为相关联的额度批次;所述账户额度数据操作请求的内容至少包括:将上一额度批次的动态数据中的额度批次号和账户批次额度,替换为当前额度批次的动态数据中的额度批次号和账户批次额度;根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度进行修改;将当前额度批次的动态数据中的额度批次号替换为所述交易批次号。
如果交易批次号大于额度批次号,说明额度账户表中还没存储该交易批次号的账户额度数据,此时可以将当前额度批次的额度批次号和账户批次额度切换为上一额度批次的额度批次号和账户批次额度,然后根据上一额度批次的账户批次额度以及当前接收到的账户交易请求中的交易内容如调整额度等确定当前额度批次的账户批次额度。
例如,交易批次号为批次12,请求扣款2000,额度批次号为批次11,对应的账户批额度为7000,此时可以将额度账户表中的当前额度批次由第11批切换为第12批,将上一额度批次由第10批切换为第11批,对应的账户额度为7000,然后根据第11批的账户额度以及当前接收到的账户交易请求中的交易内容如调整额度,可以确定第12批的账户额度为7000-2000=5000。
需要说明的是,实际应用场景下,会对服务器之间的时间差通过时钟服务器(Network Time Protocol,简称NTP)进行校验,如果时间差超过预设时间差如5秒就会告警,将时间差较大的服务器剔除,进而可以保证本申请技术方案涉及的服务器时间差不会超过5秒。
基于服务器的时间差较为短暂,因此一般只是相邻额度批次的额度数据会受影响,几乎不会出现跨额度批次的情况,也就是说,如果当前已经开始接收到12点之后的账户交易请求,后面是不太可能还会接收到10点的账户交易请求的。
在本申请的一个实施例中,所述数据库服务器中设置有交易流水表,用于存储 所述账户额度数据操作请求的内容;所述账户额度数据操作请求的内容包括:账户的账号,交易流水号,额度批次号,账户批次额度调整数量,账户批次额度调整形式。
本申请实施例的数据库服务器中除了存储有额度账户表和批终额度表,还可以存储有交易流水表,用于记录交易流水信息,如下表3所示,交易流水表中具体可以包括账号、交易流水号、额度批次号、调整额度以及调整类型等信息,这些交易流水信息可以从接收到的账户交易请求中获得。
表3
在本申请的一个实施例中,所述数据库服务器中存储的账户额度数据可以用于核对发生额和/或提供对外账单。
通过上述各实施例的账户额度数据的处理流程,最终可以得到各批次准确可靠的账户额度数据,以此为基础,可以根据实际业务需求选择其中某一个批次的最终额度(批终额度)作为一个业务日期的最终额度(日终额度),进而实现对分布式账户系统的日切。例如,将9月1日22点的批终额度作为9月1日的日终额度,那么9月1日22点之后的额度数据将作为下一个业务日期9月2日的额度数据。
在实际业务场景下,上述实施例得到的各批次的账户额度数据还可以用于发生额的核对和对外提供账单等。发生额可以理解为是在一定的时期内某项业务在借方或贷方所发生的所有往来款项的总和,在本申请实施例中,可以将所有同一批次的交易流水进行汇总轧差,分别与各个账户的批终额度,以及两个批次之间的批终额度差值进行对比,进而可以核对各批次的发生额是否准确。此外,还可以按照批次的维度提供交易流水明细,将相应批次的所有账户批终额度之和提供给请求方,满足请求方不同的业务需求。
需要说明的是,上述各实施例中提及的批次号的编号规则仅是为了描述方便而简化的形式,实际应用场景下,可以根据不同的业务需求设置更加复杂的编号规则,例如2020年9月1日上午10点10分接收到的账户交易请求,则交易批次号可以编号为202009010010,其中最后两位可以表示为第10批的交易批次。具体如何设置,本领域技术人员可根据实际需求灵活选择,只要能够区分开每个业务日期的每个交易批次或额度批次即可。
本申请实施例还提供了一种账户额度数据的处理装置400,应用于交易服务器,其中,与所述交易服务器关联的数据库服务器中存储有与多个额度批次对应的账户额度数据,如图4所示,所述装置400包括:
确定单元410,用于确定与账户交易请求的交易批次相关联的额度批次;
生成单元420,用于根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求;
发送单元430,用于将所述账户额度数据操作请求发送至所述数据库服务器,以使所述数据库服务器对相应账户额度数据进行修改。
图5是本申请的一个实施例电子设备的结构示意图。请参考图5,在硬件层面,该电子设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该电子设备还可能包括其他业务所需要的硬件。
处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(Extended Industry Standard Architecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。
存储器,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可以包括内存和非易失性存储器,并向处理器提供指令和数据。
处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成账户额度数据的处理装置。处理器,执行存储器所存放的程序,并具体 用于执行以下操作:
确定与账户交易请求的交易批次相关联的额度批次;
根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求;
将所述账户额度数据操作请求发送至所述数据库服务器,以使所述数据库服务器对相应账户额度数据进行修改。
上述如本申请图4所示实施例揭示的账户额度数据的处理装置执行的方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
该电子设备还可执行图4中账户额度数据的处理装置执行的方法,并实现账户额度数据的处理装置在图4所示实施例的功能,本申请实施例在此不再赘述。
本申请实施例还提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序,该一个或多个程序包括指令,该指令当被包括多个应用程序的电子设备执行时,能够使该电子设备执行图4所示实施例中账户额度数据的处理装置执行的方法,并具体用于执行:
确定与账户交易请求的交易批次相关联的额度批次;
根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求;
将所述账户额度数据操作请求发送至所述数据库服务器,以使所述数据库服务器对相应账户额度数据进行修改。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记 忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。
Claims (14)
- 一种账户额度数据的处理方法,由交易服务器执行,其中,与所述交易服务器关联的数据库服务器中存储有与多个额度批次对应的账户额度数据,所述方法包括:确定与账户交易请求的交易批次相关联的额度批次;根据确定的额度批次,生成对相应账户额度数据的账户额度数据操作请求;将所述账户额度数据操作请求发送至所述数据库服务器,以使所述数据库服务器对相应账户额度数据进行修改。
- 如权利要求1所述方法,其中,每个交易批次和额度批次分别对应一个预定的时间区间。
- 如权利要求2所述方法,其中,各额度批次对应的账户额度数据包括账户批次额度和额度批次号,存储在所述数据库服务器的额度账户总表中,所述确定与账户交易请求的交易批次相关联的额度批次包括:确定不小于账户交易请求的交易批次号的额度批次号;所述账户额度数据操作请求的内容包括:根据所述账户交易请求包含的交易内容,对额度账户总表中确定的额度批次号对应的账户批次额度进行修改。
- 如权利要求3所述方法,其中,若所述额度账户总表中已存储的额度批次号均小于所述交易批次号,则所述账户额度数据操作请求的内容包括:在所述额度账户总表中生成与新额度批次对应的账户额度数据,其中,以所述交易批次号作为该新额度批次的额度批次号,以所述额度账户总表中最近一次额度批次的账户批次额度和所述账户交易请求包含的交易内容确定该新额度批次的账户批次额度。
- 如权利要求2所述方法,其中,所述数据库服务器中设置有账户的额度账户表和批终额度表,所述额度账户表中存储有当前额度批次的动态数据和上一额度批次的动态数据,所述批终额度表中记录有历史额度批次的静态数据;所述上一额度批次的动态数据在满足预设时间条件时可作为一组历史额度批次的静态数据被保存至所述批终额度表中。
- 如权利要求5所述方法,其中,该方法还包括:若在某个预定的时间区间内未接收到账户交易请求,则生成至少包含下述内容的账户额度数据操作请求并发送至所述数据库服务器:将所述额度账户表中,上一额度批次的动态数据中的额度批次号和账户批次额度替换为当前额度批次的动态数据中的额度批次号和账户批次额度;将当前额度批次的动态数据中的额度批次号替换为与当前时间对应的额度批次号。
- 如权利要求5所述方法,其中,所述确定与账户交易请求的交易批次相关联的额度批次包括:对账户交易请求的交易批次号和当前额度批次的动态数据中的额度批次号进行比较;若所述交易批次号和所述额度批次号一致,则将当前额度批次作为相关联的额度批次;所述账户额度数据操作请求的内容至少包括:根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度进行修改。
- 如权利要求5所述方法,其中,所述确定与账户交易请求的交易批次相关联的额度批次还包括:若所述交易批次号小于所述额度批次号,则将当前额度批次和上一额度批次均作为相关联的额度批次;所述账户额度数据操作请求的内容至少包括:根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度,以及上一额度批次的动态数据中的账户批次额度均进行修改。
- 如权利要求5所述方法,其中,所述确定与账户交易请求的交易批次相关联的额度批次还包括:若所述交易批次号大于所述额度批次号,则将当前额度批次和上一额度批次均作为相关联的额度批次;所述账户额度数据操作请求的内容至少包括:将上一额度批次的动态数据中的额度批次号和账户批次额度,替换为当前额度批次的动态数据中的额度批次号和账户批次额度;根据所述账户交易请求包含的交易内容,对当前额度批次的动态数据中的账户批次额度进行修改;将当前额度批次的动态数据中的额度批次号替换为所述交易批次号。
- 如权利要求1所述方法,其中,所述数据库服务器中设置有交易流水表,用于存储所述账户额度数据操作请求的内容;所述账户额度数据操作请求的内容包括:账户的账号,交易流水号,额度批次号,账户批次额度调整数量,账户批次额度调整形式。
- 如权利要求1所述方法,其中,所述数据库服务器中存储的账户额度数据可以用于核对发生额和/或提供对外账单。
- 一种账户额度数据的处理装置,应用于交易服务器,其中,与所述交易服务器关联的数据库服务器中存储有与多个额度批次对应的账户额度数据,所述装置用于实现权利要求1~11之任一所述方法。
- 一种电子设备,包括:处理器;以及被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行所述权利要求1~11之任一所述方法。
- 一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行所述权利要求1~11之任一所述方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011494088.9A CN114648402A (zh) | 2020-12-17 | 2020-12-17 | 一种账户额度数据的处理方法、装置及电子设备 |
CN202011494088.9 | 2020-12-17 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022127675A1 true WO2022127675A1 (zh) | 2022-06-23 |
Family
ID=81990809
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/136572 WO2022127675A1 (zh) | 2020-12-17 | 2021-12-08 | 账户额度数据的处理方法、装置及电子设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114648402A (zh) |
WO (1) | WO2022127675A1 (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080021831A1 (en) * | 2006-07-19 | 2008-01-24 | Andrew Blaikie | Methods of processing a check in a payee positive pay system |
CN109166045A (zh) * | 2018-10-19 | 2019-01-08 | 中国银行股份有限公司 | 一种交易处理方法、装置及电子设备 |
US20200242673A1 (en) * | 2019-01-28 | 2020-07-30 | Walmart Apollo, Llc | Methods and apparatus for anomaly detections |
CN111507699A (zh) * | 2020-04-03 | 2020-08-07 | 浙江省新华书店集团信息技术有限公司 | 一种供货商平台付款系统 |
CN112053241A (zh) * | 2020-08-27 | 2020-12-08 | 中信银行股份有限公司 | 交易清算方法、装置、电子设备及计算机可读存储介质 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106934025B (zh) * | 2017-03-13 | 2020-06-16 | 阿里巴巴(中国)有限公司 | 一种账户数据管理方法、装置及服务器 |
US20190050831A1 (en) * | 2017-08-03 | 2019-02-14 | Liquineq AG | System and method for multi-tiered distributed network transactional database |
CN107657448B (zh) * | 2017-08-16 | 2022-03-04 | 创新先进技术有限公司 | 一种账户创建、账户充值、数据同步方法及设备 |
US20190354978A1 (en) * | 2018-05-17 | 2019-11-21 | Mastercard International Incorporated | Server and method for managing an authorization amount over a plurality of payments |
US20200302433A1 (en) * | 2018-11-27 | 2020-09-24 | Its, Inc. | Distributed ledger settlement transactions |
CN111353781B (zh) * | 2020-03-12 | 2023-04-07 | 网银在线(北京)科技有限公司 | 一种交易数据处理方法及系统 |
CN111612991A (zh) * | 2020-06-05 | 2020-09-01 | 中国银行股份有限公司 | 一种atm维护方法及装置 |
-
2020
- 2020-12-17 CN CN202011494088.9A patent/CN114648402A/zh active Pending
-
2021
- 2021-12-08 WO PCT/CN2021/136572 patent/WO2022127675A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080021831A1 (en) * | 2006-07-19 | 2008-01-24 | Andrew Blaikie | Methods of processing a check in a payee positive pay system |
CN109166045A (zh) * | 2018-10-19 | 2019-01-08 | 中国银行股份有限公司 | 一种交易处理方法、装置及电子设备 |
US20200242673A1 (en) * | 2019-01-28 | 2020-07-30 | Walmart Apollo, Llc | Methods and apparatus for anomaly detections |
CN111507699A (zh) * | 2020-04-03 | 2020-08-07 | 浙江省新华书店集团信息技术有限公司 | 一种供货商平台付款系统 |
CN112053241A (zh) * | 2020-08-27 | 2020-12-08 | 中信银行股份有限公司 | 交易清算方法、装置、电子设备及计算机可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN114648402A (zh) | 2022-06-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2021157836A (ja) | ブロックチェーンの決済処理方法、装置、機器及び媒体 | |
TW201800994A (zh) | 資源處理方法及裝置 | |
TWI677837B (zh) | 業務資訊處理方法及裝置 | |
WO2020134575A1 (zh) | 基于区块链的资源分配方法、装置和电子设备 | |
WO2021104452A1 (zh) | 云服务用量包的计费方法、装置及相关设备 | |
TWI684944B (zh) | 記帳的方法及裝置 | |
CN110489418B (zh) | 一种数据聚合方法和系统 | |
WO2020042764A1 (zh) | 一种金额结算系统及方法 | |
US20150032620A1 (en) | Communication network for collecting data and executing electronic transaction services | |
CN110297837B (zh) | 一种数据更新方法和装置、数据查询方法和装置 | |
WO2022060390A1 (en) | System and method for data provider tracking and monetization | |
WO2019037449A1 (zh) | 基于资金归集的余额计算方法、装置、终端设备及介质 | |
CN111179090A (zh) | 一种交易数据处理方法、装置及设备 | |
CN110033154B (zh) | 资源调配方法、装置及设备 | |
WO2022127675A1 (zh) | 账户额度数据的处理方法、装置及电子设备 | |
CN107194712B (zh) | 共享账户变动信息记录方法及装置、内部账户补账方法及系统 | |
US20150032600A1 (en) | Communication network for collecting data and executing electronic transaction services | |
CN110349016A (zh) | 客户授信额度测算方法及系统 | |
US20150032619A1 (en) | Communication network for collecting data and executing electronic transaction services | |
TWM592546U (zh) | 提供應用主機介接以進行電子支付之系統 | |
CN110930013A (zh) | 一种数据处理方法、装置、服务器及存储介质 | |
WO2022127674A1 (zh) | 账户额度的核对方法、装置及核对系统、存储介质 | |
US20240231961A1 (en) | Event fanning platform for streaming network event data to consumer applications | |
US20240249279A1 (en) | Network registry for payment networks | |
TWI502532B (zh) | Account batch instant processing system and account batch instant processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21905604 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21905604 Country of ref document: EP Kind code of ref document: A1 |