Disclosure of Invention
In view of this, the present invention provides an account checking method, system, computer device and storage medium, which can implement flexible configuration of account checking information, perform rolling account checking on in-doubt data, and improve account checking efficiency and accuracy.
According to one aspect of the invention, a reconciliation method is provided, which periodically executes a reconciliation task according to a configured reconciliation period, and comprises the following steps: acquiring a first data source, a second data source and a current account checking period to be checked; respectively acquiring each bill data in the current reconciliation period from the first data source and the second data source, and generating a first data table and a second data table; traversing a cache data table, and respectively moving the bill data belonging to the first data source and the second data source in the cache data table to the first data table and the second data table; comparing each bill data in the first data table and the second data table, and screening out first type bill data which are correspondingly present in the first data table and the second data table but are not matched as abnormal data; and screening out second type bill data only existing in the first data table or the second data table, and storing the second type bill data into the cache data table for at least comparison in the next reconciliation period.
Preferably, the reconciliation method further comprises: periodically screening the bill data in the cache data table; and when bill data with the comparison times exceeding a preset value exists in the cache data table, taking the bill data as abnormal data, and moving out the cache data table.
Preferably, in the reconciliation method, each piece of billing data includes a transaction serial number and a transaction amount, the first type of billing data is billing data in which the transaction serial number exists in both the first data table and the second data table but the transaction amount is different, and the second type of billing data is billing data in which the transaction serial number exists only in the first data table or the second data table.
Preferably, in the above reconciliation method, the comparing of each billing data in the first data table and the second data table includes: analyzing each bill data in the first data table and the second data table; and traversing and comparing each piece of bill data in the first data table and the second data table by taking the transaction serial number as an identifier, and searching the first type of bill data and the second type of bill data.
Preferably, in the reconciliation method, SQL-join or Redis-sdiff is used for traversing and comparing the billing data.
Preferably, in the above reconciliation method, before periodically executing the reconciliation task according to the configured reconciliation cycle, the method further includes: and acquiring configured account checking information, and periodically generating an account checking task, wherein the account checking information at least comprises a data source to be checked and an account checking period.
Preferably, the reconciliation method further comprises: and generating a reconciliation result report at least comprising the exception notification of the exception data.
According to another aspect of the present invention, there is provided a reconciliation system, including a task execution module for periodically executing a reconciliation task according to a configured reconciliation period, the task execution module including: the account checking information acquisition module is used for acquiring a first data source, a second data source and a current account checking period to be checked; a comparison data acquisition module, configured to acquire each piece of billing data in the current reconciliation period from the first data source and the second data source, respectively, and generate a first data table and a second data table; the rolling data acquisition module is used for traversing a cache data table and respectively moving the bill data belonging to the first data source and the second data source in the cache data table to the first data table and the second data table; the comparison screening module is used for comparing each bill data in the first data table and the second data table, screening out first bill data which are correspondingly present in the first data table and the second data table but not matched, and using the first bill data as abnormal data; and screening out second type bill data only existing in the first data table or the second data table, and storing the second type bill data into the cache data table for at least comparison in the next reconciliation period.
Preferably, the reconciliation system further comprises: and the configuration module is used for providing a visual configuration page of the reconciliation information, and the configuration of the reconciliation information at least comprises the configuration of a data source to be reconciled and the configuration of a reconciliation period.
According to another aspect of the present invention, there is provided a computer apparatus comprising: a processor; a memory having stored therein executable instructions of the processor; wherein the processor is configured to perform the steps of the reconciliation method described above via execution of the executable instructions.
According to another aspect of the present invention, there is provided a computer readable storage medium storing a program which, when executed, performs the steps of the reconciliation method described above.
The beneficial effects of the invention at least comprise:
the invention takes the in-doubt data only existing in the first data table or the second data table as the second type of bill data capable of rolling reconciliation, so that the second type of bill data can continue to participate in the comparison of the later reconciliation period after the current reconciliation period is finished, thereby realizing that the in-doubt data generated due to time difference automatically rolls the reconciliation without manual participation processing, and improving the efficiency and precision of the reconciliation;
meanwhile, the invention can realize flexible configuration of the account checking information, and the user can configure the account checking information such as a data source, an account checking period and the like according to the requirement, thereby improving the flexibility of account checking.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus their repetitive description will be omitted.
The reconciliation method is suitable for data reconciliation of a payment platform, mainly is used for reconciliation of transaction data, can liberate manual line-by-line reconciliation of finance, compares data in a period based on a configurable rule, and generates a related report and an exception list needing manual offline processing of the finance. Repeated programming of research personnel can be liberated, each data source and the comparison mode can be flexibly configured, and related data processing codes do not need to be hard coded after each data source is added.
Fig. 1 shows a schematic step diagram of the reconciliation method in an embodiment, and referring to fig. 1, before performing the reconciliation, a reconciliation person, for example, a finance person, may configure the reconciliation information on a visualization page provided by the system, that is, perform step S10. The configuration of the account checking information comprises the following steps: the configuration of the data sources comprises the configuration of the acquisition mode, the analysis mode and the field format of each data source, the comparison fields and the comparison rules among the data sources and the like. A configured data source comprises a name, an acquisition mode (such as HTTP/FTP or other protocols), a file type (such as csv, xls, txt and the like), and a field format (comprising a field name, a field type and a field maximum length). By providing a visualization page configured for each data source, the system can automatically perform data processing using configured rules without human intervention or hard coding development. The configuration of the account checking information also comprises the configuration of account checking accounts, which accounts can be configured to participate in the account checking and the data comparison is carried out; and the configuration of the account checking task can configure the account checking period, the account checking time, the comparison rule, the rolling rule and the like of the account checking task. After the configuration of the reconciliation information is completed, S20 is executed, and the reconciliation task is executed periodically, that is, the reconciliation is performed every configured reconciliation period. And executing S30 after the execution of the reconciliation task is completed every time, and generating a reconciliation result report which comprises a reconciliation result summary of each configuration task and configuration account, an exception list and a processing mode of each configuration task and configuration account, and the like.
The reconciliation period can be configured as required, for example, the reconciliation period is configured to be 1 day, and then the billing data generated on the previous day is reconciled every day by taking the day as a unit. Fig. 2 is a schematic diagram illustrating an execution of a reconciliation task in an embodiment, and referring to fig. 2, the periodically executing the reconciliation task according to a configured reconciliation cycle includes:
s220, acquiring a first data source to be checked, a second data source and a current checking period.
The first data source and the second data source to be checked out are determined according to configuration, for example, when the bill data between the order system of the company and the third-party payment platform needs to be checked out, the first data source can be configured as the order system database of the company, and the second data source can be configured as the third-party payment platform database. In one embodiment, according to the configured reconciliation cycle, before periodically executing the reconciliation task, the method further includes: and acquiring configured account checking information, and periodically generating account checking tasks, wherein the account checking information at least comprises a data source to be checked and an account checking period.
And S230, obtaining each bill data in the current reconciliation period from the first data source and the second data source respectively, and generating a first data table and a second data table.
In one embodiment, for example, if the current reconciliation period is 2019-06-20 (i.e. 2019, 6 and 20 days), each piece of billing data generated by 2019-06-20 is obtained from the first data source, and a first data table is generated; and acquiring each bill data generated by 2019-06-20 from a second data source to generate a second data table. The billing data may be obtained using HTTP/FTP or other protocols as described above.
S240, traversing the cache data table, and respectively moving the bill data belonging to the first data source and the second data source in the cache data table to the first data table and the second data table.
The cache data table is used for storing the bill data which is used for displaying the previous account checking result in doubt but does not need to be manually processed. The type of data suitable for storing in the cache data table may be configured as required, for example, in the second reconciliation period, the billing data existing in the first data table but not existing in the second data table, or the billing data existing in the second data table but not existing in the first data table, in the two compared data tables may be configured to be stored in the cache data table, so that the billing data may participate in the subsequent reconciliation until the comparison is successful or the comparison is failed due to violation of the rolling rule. Through the scheme of rolling account checking, inconsistent data generated in each account checking period and caused by edge time can participate in comparison of the later account checking periods, manual participation processing is not needed, and account checking efficiency and accuracy are improved.
S250, comparing each bill data in the first data table and the second data table, and screening out first type bill data which exist in the first data table and the second data table correspondingly but are not matched as abnormal data; and screening out second type bill data only existing in the first data table or the second data table, and storing the second type bill data into a cache data table for comparison in at least the next reconciliation period.
In this embodiment, the first type of billing data is billing data that exists in the first data table and the second data table at the same time but cannot be matched with each other; the second type of billing data is billing data that is present in the first data table but not present in the second data table, or present in the second data table but not present in the first data table. In one embodiment, each of the bill data includes a transaction serial number and a transaction amount, and the first type of bill data is bill data in which the transaction serial number exists in both the first data table and the second data table but the transaction amount is different. For example, the transaction amount recorded in the first data table for the bill data with the transaction serial number of "123456789" is 1000 yuan, and the transaction amount recorded in the second data table is 800 yuan, which usually requires manual checking because of an error in the system where the first data source or the second data source is located. Therefore, the first type bill data are screened out as abnormal data. The second type of billing data is billing data in which the transaction serial number exists only in the first data table or the second data table. For example, the presence of billing data for the transaction flow number "987654321" in the first data table and the absence of billing data in the second data table is typically due to system delays, or differences in data records due to time differences between order placement and payment, and marginal time of reconciliation period. The second bill data are screened out and stored in a cache data table for at least comparison in the next reconciliation period.
In one embodiment, the first data source is the order system database of the company, the second data source is the third party payment platform database, and the current reconciliation period is 2019-06-20. An order is generated at 2019-06-2023: 59:00 and paid at 2019-06-2100: 01:00, the corresponding billing data for the order is recorded in the first data source for the period 2019-06-20 and in the second data source for the period 2019-06-21. In the current reconciliation period, the bill data of the order only exist in the first data table, so that the bill data are screened out as the second type of bill data and stored in the cache data table. When the account checking task of the next account checking period is executed, the bill data of the order can be matched with the bill data recorded in the second data source, so that the comparison is successful, and the difference is eliminated.
The data types of the first type of billing data and the second type of billing data can also be configured as required to screen out the billing data meeting the reconciliation requirement.
In one embodiment, the step of comparing the billing data in the first data table and the second data table comprises: analyzing each bill data in the first data table and the second data table, for example, converting the bill data in the first data table and the second data table into a data format convenient for comparison; and traversing and comparing each piece of bill data in the first data table and the second data table by taking the transaction serial number as an identifier, and searching the first type of bill data and the second type of bill data. Specifically, SQL-join or Redis-sdiff can be used for traversal alignment of the bill data according to the data volume.
In one embodiment, when the amount of data to be compared does not exceed 100 ten thousand, SQL is used for comparison. Suppose there is a need to compare the transaction serial number, transaction amount, and amount in and out direction of the billing data of the first data source (data source a) and the second data source (data source B). Two temporary tables ds _ a and ds _ B are newly created for the data source a and the data source B, respectively, and the bill data that the data source a and the data source B need to compare are respectively stored in the temporary tables ds _ a and ds _ B. Using SQL-join, it is convenient to find that there is a second type of billing data in ds _ a but not in ds _ B, but not in ds _ a, and a first type of billing data in which both ds _ a and ds _ B are present but the transaction amounts are not consistent. In one embodiment, when the amount of data to be aligned exceeds 100 ten thousand, Redis alignment is used. Similarly, suppose that the data source A and the data source B need to be compared, and the field transaction serial number O, the amount in-out direction D and the transaction amount M need to be compared. Two Redis Set are respectively created for the data source A and the data source B, a character string (O _ D _ M) list is constructed for the data, and the first type of bill data and the second type of bill data can be conveniently screened out by using the sdiff method of Redis.
In a preferred embodiment, the reconciliation method further includes: periodically screening the bill data in the cache data table; and when bill data with the comparison times exceeding a preset value exists in the cache data table, taking the bill data as abnormal data, and moving out of the cache data table. For example, a 3-day rolling reconciliation is configured for the billing data in the cache data table, and if one billing data in the cache data table cannot be matched after being compared for 3 days (3 times when the reconciliation period is 1 day), it indicates that there is a great possibility of error in the billing data, and therefore, the billing data is taken as abnormal data, is moved out of the cache data table, and does not participate in the rolling reconciliation, and manual processing and checking are required, or the system performs the next processing operation.
Further, after the execution of the reconciliation task is completed, the method also comprises the following steps: generating a reconciliation result report at least comprising the exception notification of the exception data, and displaying the reconciliation result in detail, wherein the reconciliation result report comprises the following steps: the account checking flow number, the account checking date, the total number of successful account checking, the total amount of successful account checking, the total number of failed account checking, the total amount of failed account checking, the statement and file of successful account checking, the statement and file of failed account checking, and the like.
The reconciliation method can realize flexible configuration of the reconciliation information, and the configuration of the reconciliation information such as a data source, a reconciliation period and the like is carried out through the visual page, so that the system can automatically carry out data reconciliation according to the configured reconciliation information without manual intervention or hard coding research and development, and the reconciliation flexibility is also improved; and the rolling reconciliation of the second type of bill data can be realized, so that the second type of bill data continuously participates in the comparison of the later reconciliation period after the current reconciliation period is finished, the automatic rolling reconciliation of the doubt data generated due to time difference is realized, manual participation processing is not needed, and the reconciliation efficiency and precision are improved.
The embodiment of the invention also provides an account checking system. Referring to fig. 3, the reconciliation system of the present invention comprises a configuration module 10, a task execution module 20, a result presentation module 30, and the like. The configuration module 10 is configured to provide a visual configuration window of reconciliation information, where the configuration of the reconciliation information at least includes the configuration of the data source to be reconciled and the configuration of the reconciliation period in the foregoing reconciliation method embodiment. The task execution module 20 is configured to periodically execute the reconciliation task according to the configured reconciliation cycle, and specifically includes:
the reconciliation information obtaining module 220 is configured to obtain a first data source, a second data source and a current reconciliation period to be reconciled. For example, the reconciliation information acquisition module 220 can be configured to execute step S220 described in any of the embodiments of the reconciliation method described above.
The comparison data obtaining module 230 is configured to obtain each piece of billing data in the current reconciliation period from the first data source and the second data source, respectively, and generate a first data table and a second data table. For example, the comparison data obtaining module 230 may be configured to perform step S230 described in any of the embodiments of the reconciliation method described above.
And the rolling data obtaining module 240 is configured to traverse the cache data table, and move the bill data belonging to the first data source and the second data source in the cache data table to the first data table and the second data table, respectively. For example, the rolling data acquisition module 240 may be configured to perform step S240 described in any of the reconciliation method embodiments described above.
The comparison screening module 250 is used for comparing each bill data in the first data table and the second data table, screening out first bill data which are correspondingly present in the first data table and the second data table but are not matched, and using the first bill data as abnormal data; and screening out second type bill data only existing in the first data table or the second data table, and storing the second type bill data into a cache data table for comparison in at least the next reconciliation period. For example, the reconciliation screening module 250 can be configured to perform step S250 described in any of the reconciliation method embodiments above.
The result displaying module 30 mainly displays the reconciliation result report. The account checking system can also comprise an abnormal data processing module and the like, and can be specifically configured by a user.
The reconciliation system realizes flexible configuration of the reconciliation information through the configuration module 10, and configures the reconciliation information such as a data source, a reconciliation period and the like through the visual page, so that the system can automatically perform data reconciliation according to the configured reconciliation information without manual intervention or hard coding research and development, and the reconciliation flexibility is also improved. The automatic comparison of the bill data is realized through the task execution module 20, and the rolling reconciliation of the second type of bill data is realized, so that the second type of bill data continuously participates in the comparison of the later reconciliation period after the current reconciliation period is finished, the automatic rolling reconciliation of the in-doubt data generated due to time difference is realized, manual participation processing is not needed, and the reconciliation efficiency and precision are improved. And the detailed display of the account checking result is realized through the result display module 30.
Embodiments of the present invention further provide a computer device, including a processor and a memory, where the memory stores executable instructions, and the processor is configured to execute the steps of the reconciliation method in the foregoing embodiments by executing the executable instructions.
As described above, the computer device of the present invention can implement flexible configuration of reconciliation information, and configure the reconciliation information such as a data source and a reconciliation period through a visual page, so that a system can automatically perform data reconciliation according to the configured reconciliation information without manual intervention or hard coding research and development, and the reconciliation flexibility is also improved; and the rolling reconciliation of the second type of bill data can be realized, so that the second type of bill data continuously participates in the comparison of the later reconciliation period after the current reconciliation period is finished, the automatic rolling reconciliation of the doubt data generated due to time difference is realized, manual participation processing is not needed, and the reconciliation efficiency and precision are improved.
Fig. 4 is a schematic structural diagram of a computer device in an embodiment of the present invention, and it should be understood that fig. 4 only schematically illustrates various modules, which may be virtual software modules or actual hardware modules, and the combination, the splitting, and the addition of the remaining modules of these modules are within the scope of the present invention.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" platform.
The computer device 400 of the present invention is described below with reference to fig. 4. The computer device 400 shown in fig. 4 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present invention.
As shown in fig. 4, computer device 400 is in the form of a general purpose computing device. The components of computer device 400 may include, but are not limited to: at least one processing unit 410, at least one memory unit 420, a bus 430 connecting different platform components (including memory unit 420 and processing unit 410), a display unit 440, and the like.
Wherein the storage unit stores a program code, which can be executed by the processing unit 410, so that the processing unit 410 performs the steps of the reconciliation method described in the above embodiments. For example, the processing unit 410 may perform the steps as shown in fig. 1 and 2.
The storage unit 420 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)4201 and/or a cache memory unit 4202, and may further include a read only memory unit (ROM) 4203.
The storage unit 420 may also include a program/utility 4204 having a set (at least one) of program modules 4205, such program modules 4205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 430 may be any bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The computer device 400 may also communicate with one or more external devices 500 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the computer device 400, and/or with any devices (e.g., router, modem, etc.) that enable the computer device 400 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 450. Moreover, computer device 400 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via network adapter 460. Network adapter 460 may communicate with other modules of computer device 400 via bus 430. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
The embodiment of the present invention further provides a computer-readable storage medium, which is used for storing a program, and when the program is executed, the steps of the reconciliation method described in the above embodiment are implemented. In some possible embodiments, the various aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps of the reconciliation method described in the preceding embodiments, when the program product is run on the terminal device.
As described above, the computer-readable storage medium of the present invention can implement flexible configuration of reconciliation information, and perform configuration of reconciliation information such as data source and reconciliation period through the visual page, so that the system can automatically perform data reconciliation according to the configured reconciliation information without manual intervention or hard coding research and development, and the reconciliation flexibility is also improved; and the rolling reconciliation of the second type of bill data can be realized, so that the second type of bill data continuously participates in the comparison of the later reconciliation period after the current reconciliation period is finished, the automatic rolling reconciliation of the doubt data generated due to time difference is realized, manual participation processing is not needed, and the reconciliation efficiency and precision are improved.
Fig. 5 is a schematic structural diagram of a computer-readable storage medium of the present invention. Referring to fig. 5, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.