Reconciliation method, device and equipment and readable storage medium
By comparing and filtering the date fields of business data and transaction data and matching the target fields, the problem of inefficient large-scale data processing in the existing technology is solved, and an efficient and flexible reconciliation process is achieved, which improves the accuracy and scalability of reconciliation.
Patent Information
- Application Number
- CN202411751497.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-25
AI Technical Summary
The existing technology is inefficient when processing large-scale data, and it is difficult to cope with complex and changeable business scenarios, and cannot meet the needs of modern enterprises for data consistency verification of financial systems.
By obtaining business data and transaction data, comparing business date fields and transaction date fields, eliminating transaction data that does not meet the conditions based on preset filtering conditions, obtaining the filtered transaction data, and matching the target field to obtain the reconciliation results. Use Redis's intersection and difference set commands to accurately identify and process data matching and differences.
It improves reconciliation efficiency and accuracy, can flexibly adapt to different business scenarios and needs, simplifies the setting and management of reconciliation processes, enhances the flexibility and maintainability of the system, and has good scalability.
Smart Images

Figure CN119693167A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a reconciliation method, device, equipment and readable storage medium. Background Art
[0002] The financial system is the nerve center of corporate operations, and the accuracy of its data is directly related to the quality and efficiency of corporate decision-making. In modern enterprises, the synchronization of capital flow and business activities is increasingly required, which requires the financial system to not only be able to record and track every transaction, but also to ensure the consistency of these transactions with the business ledger.
[0003] The current reconciliation method usually extracts data from the business ledger and cash flow respectively, and then verifies the consistency of the data through simple summation and matching. However, although this method is intuitive, with the expansion of business and the surge in data volume, the above reconciliation method is difficult to meet the growing business needs, is inefficient when processing large-scale data, and is difficult to cope with complex and changing business scenarios. Summary of the invention
[0004] The present invention provides a reconciliation method, device, equipment and readable storage medium to solve the defects of the prior art in that large-scale data processing is inefficient and difficult to cope with complex and changeable business scenarios. It can flexibly adapt to different business scenarios and needs, simplifies the setting and management of the reconciliation process, and greatly improves the flexibility and maintainability of the system, and has good scalability.
[0005] The present invention provides a reconciliation method, comprising: acquiring business data and transaction data; comparing a business date field in the business data with a transaction date field in the transaction data, and based on the comparison result meeting a preset screening condition, eliminating the transaction data corresponding to the comparison result meeting the preset screening condition to obtain screened transaction data; matching the business data with the screened transaction data by target fields, and obtaining a reconciliation result based on the matching result.
[0006] According to a reconciliation method provided by the present invention, business data and transaction data are obtained, including: obtaining business original data and transaction original data; using the SINTER command of the remote dictionary service Redis to traverse the business original data and the transaction original data to obtain matching fields, where the matching fields are used to characterize the intersection of the business original data and the transaction original data; using the SDIFF command of Redis to find the difference between the business original data and the transaction original data, and eliminating the corresponding unmatched business original data and transaction original data according to the difference to obtain the business data and the transaction data.
[0007] According to a reconciliation method provided by the present invention, corresponding unmatched business original data and transaction original data are eliminated according to a difference set to obtain business data and transaction data, including: eliminating corresponding unmatched business original data and transaction original data according to the difference set to obtain matched business original data and transaction original data; extracting matching fields of the matched business original data and transaction original data and concatenating them to obtain a string key key; extracting the full fields of the matched business original data and transaction original data; and obtaining corresponding business data and transaction data according to the string key key and the full fields.
[0008] According to a reconciliation method provided by the present invention, corresponding unmatched business original data and transaction original data are eliminated according to a difference set to obtain business data and transaction data, including: obtaining a data set collection from Redis, the data set collection is first established based on a string key key, the string key is obtained by concatenating matching fields of extracted matching business original data and transaction original data, and the matching business original data and transaction original data are obtained by eliminating corresponding unmatched business original data and transaction original data according to the difference set; obtaining a hash set from Redis, the hash set is first established based on a full field, the key of the hash set is a string key, and the full field is extracted based on the matching business original data and transaction original data; according to the data set collection and the hash set, the corresponding business data and transaction data are obtained.
[0009] According to a reconciliation method provided by the present invention, business original data and transaction original data are obtained, including: calling a hypertext transfer protocol HTTP interface to obtain corresponding business original data and transaction original data from a business database and a transaction database respectively; or, using a preset programming language application program interface JDBC, accessing the database ports of the business database and the transaction database, and executing a pre-configured structured query SQL statement to obtain corresponding business original data and transaction original data; wherein the SQL statement is obtained by specifying a query range, conditions and operations based on preset keywords and clauses; or, using an advanced template class MongoTemplate, accessing the database ports of the business database and the transaction database, and executing a pre-configured MQL query language to obtain corresponding business original data and transaction original data; wherein the MQL query language is obtained based on constructing a query object to specify the query conditions.
[0010] According to a reconciliation method provided by the present invention, target fields are matched between business data and filtered transaction data, and a reconciliation result is obtained based on the matching result, including: matching the transaction value measurement field in the business data with the transaction value measurement field in the filtered transaction data; if the match is successful, the reconciliation is successful; otherwise, the reconciliation fails.
[0011] According to a reconciliation method provided by the present invention, after obtaining the reconciliation result based on the matching result, the method includes: using the distributed publish-subscribe message system Kafka to send the reconciliation result to the message queue to notify other consumers who have subscribed previously.
[0012] The present invention also provides a reconciliation device, including: a data acquisition module, which acquires business data and transaction data; a comparison module, which compares the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset filtering condition, eliminates the transaction data corresponding to the comparison result meeting the preset filtering condition to obtain the filtered transaction data; and a reconciliation module, which matches the business data and the filtered transaction data with the target field, and obtains the reconciliation result based on the matching result.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the above-described reconciliation methods is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the reconciliation method as described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned reconciliation methods.
[0016] The reconciliation method, device, equipment and readable storage medium provided by the present invention compare the business date field in the acquired business data with the transaction date field in the acquired transaction data, and eliminate the non-compliant transaction data according to the preset screening conditions to ensure that the data involved in the reconciliation are consistent in time range, which helps to avoid erroneous reconciliation results caused by time mismatch, reduce the workload of subsequent target field matching, and further verify the consistency of the data by matching the target fields of the business data and the screened transaction data, so as to facilitate the rapid discovery of data inconsistencies, make adjustments and corrections in time, improve reconciliation efficiency and accuracy, can flexibly adapt to different business scenarios and needs, simplify the setting and management of the reconciliation process, and greatly improve the flexibility and maintainability of the system, and have good scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is one of the flow charts of the reconciliation method provided by the present invention; Figure 2 This is the second flow chart of the reconciliation method provided by the present invention; Figure 3 It is a structural schematic diagram of the account reconciliation device provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] Figure 1 : is a flow chart of the reconciliation method provided by the present invention, the method comprising: S11, obtaining business data and transaction data; S12, comparing the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset screening condition, eliminating the transaction data corresponding to the comparison result meeting the preset screening condition, to obtain the screened transaction data; S13, target field matching is performed on the business data and the filtered transaction data, and a reconciliation result is obtained based on the matching result.
[0021] It should be noted that the step numbers "S11-S13" in this manual do not represent the order of the reconciliation method. Figure 2 The account reconciliation method of the present invention is described.
[0022] Step S11, obtaining business data and transaction data.
[0023] In this embodiment, reference Figure 2, obtain business data and transaction data, including: obtaining business original data and transaction original data; using the remote dictionary service Redis SINTER command to traverse the business original data and transaction original data to obtain matching fields, where the matching fields are used to represent the intersection of the business original data and the transaction original data; using the Redis SDIFF command to find the difference between the business original data and the transaction original data, and according to the difference, eliminate the corresponding unmatched business original data and transaction original data to obtain the business data and transaction data.
[0024] It should be noted that by using the SINTER command and SDIFF command of Redis, the obtained business data and transaction data are intersected and differed, so as to accurately identify the truly matching data and unmatched data in the business original data and transaction original data, so that after eliminating the unmatched business original data and transaction original data, the obtained business data and transaction data are cleaner and more accurate, providing a more reliable basis for subsequent reconciliation.
[0025] In addition, the matching fields found by the intersection operation can be used to quickly determine the common parts between business data and transaction data, thereby checking the consistency of the data. If the intersection result does not meet expectations, it may indicate that there is a problem with the data and further inspection and processing is required. The difference operation can help find which data exists in one data source but not in another, which helps to promptly detect missing or inconsistent data so that appropriate measures can be taken to repair it.
[0026] Specifically, obtaining the business original data and the transaction original data includes: calling a hypertext transfer protocol HTTP interface to obtain the corresponding business original data and the transaction original data from the business database and the transaction database respectively; or, using a preset programming language application program interface JDBC to access the database ports of the business database and the transaction database, and executing a previously configured structured query SQL statement to obtain the corresponding business original data and the transaction original data; wherein the SQL statement is obtained based on preset keywords and clauses to specify the query range, conditions and operations; or, using the advanced template class MongoTemplate to access the database ports of the business database and the transaction database, and execute a previously configured MQL query language to obtain the corresponding business original data and the transaction original data; wherein the MQL query language is obtained based on constructing a query object to specify the query conditions.
[0027] Specifically, calling the Hypertext Transfer Protocol (HTTP) interface to obtain the corresponding business original data and transaction original data from the business database and the transaction database respectively includes: creating and sending an HTTP request, wherein the request method of the HTTP request is set according to the HTTP interface address, request method and required authentication information provided by the previously determined business database and transaction database, and the request method can usually be GET or POST; receiving a server response and checking a response status code; if the status code indicates success, parsing the response content and obtaining the corresponding business original data and transaction original data.
[0028] In an optional embodiment, obtaining the business original data and the transaction original data includes: calling the interface accordingly according to the paging parameters provided by the interface to obtain the business original data and the transaction original data. It should be added that the paging parameters such as page number, amount of data per page, etc. can be specifically configured according to actual paging requirements and are not further limited here.
[0029] In addition, the preset programming language application interface JDBC is used to access the database ports of the business database and the transaction database, and execute the previously configured structured query SQL statements to obtain the corresponding business original data and transaction original data, including: obtaining the database type and connection information of the business database and the transaction database; according to the database type, adding the response JDBC driver to the project's dependencies, and loading the corresponding JDBC driver; establishing a database connection with the corresponding database according to the connection information; executing SQL statements based on the previously created statement object (Statement) or precompiled statement object (PreparedStatement) to obtain the corresponding business original data and transaction original data.
[0030] It should be noted that the database type includes MySQL, Oracle or SQL Server, and the connection information includes the host name, port number, database name, user name and password.
[0031] In addition, before using the advanced template class MongoTemplate to access the database ports of the business database and the transaction database and execute the previously configured MQL query language to obtain the corresponding business original data and transaction original data, it includes: based on the business database and the transaction database being the document database MongoDB, or the data of the business database and the transaction database being imported into MongoDB, obtaining the connection information of MongoDB corresponding to the business database and the transaction database respectively, the connection information includes the host address, port number, and database name; introducing the MongoDB programming language Java driver and the Spring Data MongoDB module (Spring Data MongoDB) dependency into the project; configuring MongoTemplate according to the connection information; injecting MongoTemplate into the target class; and constructing query conditions using MongoDB's query language according to business needs to obtain the MQL query language.
[0032] It should be added that Spring Data MongoDB is a module in the Spring framework for operating MongoDB databases, which provides convenient programming models and tools, making it easier and more efficient to interact with MongoDB databases in Spring applications. The target class can be determined according to the class actually required, and no further restrictions are made here.
[0033] In an optional embodiment, before using the remote dictionary service Redis's SINTER command to traverse the business original data and the transaction original data, and before using the Redis's SDIFF command to find the difference between the business original data and the transaction original data, it includes: storing the business original data and the transaction original data in Redis collections respectively.
[0034] It should be noted that by storing data in Redis memory to achieve very fast search and comparison operations, frequent disk read and write operations are avoided, greatly improving the speed of data processing.
[0035] In an optional embodiment, the business data and transaction data are obtained by eliminating the corresponding unmatched business original data and transaction original data according to the difference set, including: eliminating the corresponding unmatched business original data and transaction original data according to the difference set to obtain the matched business original data and transaction original data; extracting the matching fields of the matched business original data and transaction original data and concatenating them to obtain the string key key; extracting the full fields of the matched business original data and transaction original data; and obtaining the corresponding business data and transaction data according to the string key key and the full fields.
[0036] In another optional embodiment, the business data and transaction data are obtained by eliminating the corresponding unmatched business original data and transaction original data according to the difference set, including: obtaining a data set collection from Redis, the data set collection is first established based on the string key key, the string key is obtained by concatenating the matching fields of the extracted matching business original data and transaction original data, and the matching business original data and transaction original data are obtained by eliminating the corresponding unmatched business original data and transaction original data according to the difference set; obtaining a hash set from Redis, the hash set is first established based on the full field, the key of the hash set is the string key, and the full field is extracted based on the matching business original data and transaction original data; according to the data set collection and the hash set, the corresponding business data and transaction data are obtained.
[0037] It should be noted that the data set is an unordered data structure in Redis that does not contain duplicate elements. There is no order between elements, and each element is unique. In addition, the data set includes set key key and set value value. The set key includes setkey0 corresponding to business data and setkey1 corresponding to transaction data. The setvalue is the string key.
[0038] In addition, the Hash set includes Rediskey, field key (fieldkey) and field value (fieldvalue). Rediskey includes Hashkey0 corresponding to business data and Hashkey1 corresponding to transaction data. Rediskey is used to distinguish whether fieldkey and fieldvalue come from business data or transaction data. Fieldkey includes string key, and the fieldvalue of string key is the full field.
[0039] Step S12, comparing the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset screening condition, eliminating the corresponding transaction data to obtain screened transaction data.
[0040] Furthermore, the business date field in the business data and the transaction date field in the transaction data are compared, and based on the comparison result meeting the preset screening condition, the corresponding transaction data is eliminated, including: subtracting the transaction date field in the transaction data from the business date field in the business data to obtain the difference; determining whether the absolute value of the difference meets the preset screening condition, and if so, eliminating the corresponding transaction data; wherein the preset meeting condition can be set according to actual screening requirements, for example, the difference between the business date field in the business data and the transaction date field in the transaction data can be less than or equal to a preset value, and the preset value can be 1 day, which can be specifically set according to actual reconciliation requirements and is not further limited here.
[0041] It should be noted that, in the actual process, step S12 can be implemented by configuring matching rules, and the matching rules include a first aggregation function, a first column, an arithmetic operator, a second aggregation function, a second column, a relational operator and a corresponding reference value. For example, the first aggregation function is no aggregation, the first column is the business date biz_date field, the arithmetic operator is subtraction, the second aggregation function is filtering, the second column is the transaction date tradeDate field, the relational operator is absolute value less than or equal to, and the reference value is 1. The specific settings can be based on actual design requirements.
[0042] Step S13, target field matching is performed on the business data and the filtered transaction data, and a reconciliation result is obtained based on the matching result.
[0043] In this embodiment, target field matching is performed on the business data and the filtered transaction data, and a reconciliation result is obtained based on the matching result, including: matching the transaction value metric field in the business data with the transaction value metric field in the filtered transaction data; if the match is successful, the reconciliation is successful; otherwise, the reconciliation fails.
[0044] Furthermore, the transaction value metric field in the business data and the transaction value metric field in the filtered transaction data are matched, including: subtracting the transaction value metric field in the filtered transaction data from the transaction value metric field in the business data. If the difference is 0, the match is successful, otherwise, the match fails.
[0045] It should be noted that, in the actual process, step S13 can be implemented by configuring matching rules, and the matching rules include a first aggregation function, a first column, an arithmetic operator, a second aggregation function, a second column, a relational operator and a corresponding reference value. For example, the first aggregation function is no aggregation, the first column is the transaction value measurement amount field, the arithmetic operator is subtraction, the second aggregation function is no aggregation, the second column is the transaction value measurement income field, the relational operator is absolute value equal to, and the reference value is 0. The specific settings can be based on actual design requirements.
[0046] In addition, based on the matching results, the reconciliation results are obtained, including: obtaining a reconciliation task table according to the task identifier code, task execution time, amount of successful reconciliation data, and amount of failed reconciliation data executed by the reconciliation; storing corresponding data according to the reconciliation status, if the reconciliation is successful, storing the business data primary key and the transaction data primary key, otherwise, storing the reason for the reconciliation failure of the corresponding data, and obtaining a reconciliation detail table; obtaining the reconciliation result according to the reconciliation task table and the reconciliation detail table.
[0047] It should be noted that the primary key refers to a unique identifier used to identify a record in the corresponding business database and transaction database for reconciliation, such as a key field or field combination. The corresponding data primary key is recorded for subsequent query or further processing.
[0048] In an optional embodiment, after obtaining the reconciliation result based on the matching result, the method includes: utilizing the distributed publish-subscribe messaging system Kafka to send the reconciliation result to a message queue to notify other consumers who have subscribed previously.
[0049] Furthermore, the distributed publish-subscribe messaging system Kafka is used to send the reconciliation results to the message queue, including: converting the format of the reconciliation results according to the preset sending format, and using the key information in the reconciliation results as the key of the message and the detailed content of the reconciliation results as the value of the message to construct a Kafka message object; using the previously configured Kafka producer instance to send the message to the Kafka topic message queue.
[0050] In summary, the embodiment of the present invention compares the business date field in the acquired business data with the transaction date field in the acquired transaction data, and eliminates non-compliant transaction data according to preset screening conditions to ensure that the data involved in the reconciliation are consistent in time range, which helps to avoid erroneous reconciliation results caused by time mismatch, reduces the workload of subsequent target field matching, and further verifies the consistency of the data by matching the target fields of the business data and the filtered transaction data, thereby facilitating the rapid discovery of data inconsistencies, making timely adjustments and corrections, improving reconciliation efficiency and accuracy, and being able to flexibly adapt to different business scenarios and needs, simplifying the setting and management of the reconciliation process, and greatly improving the flexibility and maintainability of the system, with good scalability.
[0051] The following is a description of the account reconciliation device provided by the present invention. The account reconciliation device described below and the account reconciliation method described above can be referenced to each other.
[0052] Figure 3 A schematic diagram of the structure of a reconciliation device is shown, the device comprising: A data acquisition module 31, which acquires business data and transaction data; A comparison module 32 compares the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset screening condition, removes the transaction data corresponding to the comparison result meeting the preset screening condition, thereby obtaining the screened transaction data; The reconciliation module 33 performs target field matching on the business data and the filtered transaction data, and obtains a reconciliation result based on the matching result.
[0053] In this embodiment, the data acquisition module 31 includes: a data acquisition unit, which acquires business original data and transaction original data; an intersection unit, which uses the intersection SINTER command of the remote dictionary service Redis to traverse the business original data and the transaction original data to obtain matching fields, and the matching fields are used to characterize the intersection of the business original data and the transaction original data; a difference unit, which uses the difference SDIFF command of Redis to find the difference between the business original data and the transaction original data, and eliminates the corresponding unmatched business original data and transaction original data according to the difference to obtain the business data and the transaction data.
[0054] Specifically, the data acquisition unit includes: an interface calling subunit, calling a hypertext transfer protocol HTTP interface to obtain corresponding business original data and transaction original data from a business database and a transaction database respectively; or, a statement execution subunit, using a preset programming language application program interface JDBC, accessing the database ports of the business database and the transaction database, and executing a previously configured structured query SQL statement to obtain corresponding business original data and transaction original data; wherein the SQL statement is obtained based on preset keywords and clauses to specify the query range, conditions and operations; or, a language execution subunit, using an advanced template class MongoTemplate, accessing the database ports of the business database and the transaction database, and executing a previously configured MQL query language to obtain corresponding business original data and transaction original data; wherein the MQL query language is obtained based on constructing a query object to specify the query conditions.
[0055] Specifically, the interface calling subunit is used to: create and send an HTTP request, the request method of which is set according to the HTTP interface address, request method and required authentication information provided by the previously determined business database and transaction database, and the request method can usually be GET or POST; receive the server response and check the response status code; if the status code indicates success, parse the response content and obtain the corresponding business original data and transaction original data.
[0056] In an optional embodiment, the data acquisition unit is further used to: call the interface accordingly according to the paging parameters provided by the interface to obtain the business original data and the transaction original data. It should be added that the paging parameters such as page number, amount of data per page, etc. can be specifically configured according to actual paging requirements and are not further limited here.
[0057] In addition, the statement execution sub-unit includes: an information acquisition grandchild unit, which obtains the database type and connection information of the business database and the transaction database; a configuration grandchild unit, which adds the response JDBC driver to the project's dependencies according to the database type, and loads the corresponding JDBC driver; a connection establishment grandchild unit, which establishes a database connection with the corresponding database according to the connection information; a statement execution grandchild unit, which executes SQL statements based on the previously created statement object (Statement) or precompiled statement object (PreparedStatement) to obtain the corresponding business original data and transaction original data.
[0058] In addition, the data acquisition module 31 also includes: an information acquisition unit, which uses the advanced template class MongoTemplate to access the database ports of the business database and the transaction database, and executes the previously configured MQL query language to obtain the corresponding business original data and transaction original data. Based on the business database and the transaction database being the document database MongoDB, or the data of the business database and the transaction database being imported into MongoDB, the connection information of the MongoDB corresponding to the business database and the transaction database is obtained, and the connection information includes the host address, port number, and database name; a dependency configuration unit, which introduces the dependency of the MongoDB programming language Java driver and the Spring Data MongoDB module (Spring Data MongoDB) into the project; a class configuration unit, which configures MongoTemplate according to the connection information; an injection unit, which injects MongoTemplate into the target class; and a language configuration unit, which uses the query language of MongoDB to construct query conditions according to business needs to obtain the MQL query language.
[0059] In an optional embodiment, the data acquisition module 31 further includes: a data storage unit, which stores the business original data and the transaction original data in a Redis collection respectively before using the SINTER command of the remote dictionary service Redis to traverse the business original data and the transaction original data, and before using the SDIFF command of Redis to find the difference between the business original data and the transaction original data.
[0060] In an optional embodiment, the difference set obtaining unit includes: a paired data obtaining subunit, which eliminates the corresponding unmatched business original data and transaction original data according to the difference set to obtain the matched business original data and transaction original data; a field splicing subunit, which extracts the matching fields of the matched business original data and transaction original data and splices them to obtain the string key key; a field extraction subunit, which extracts the full fields of the matched business original data and transaction original data; and a data obtaining subunit, which obtains the corresponding business data and transaction data according to the string key key and the full fields.
[0061] In another optional embodiment, the difference set obtaining unit also includes: a first set obtaining subunit, obtaining a data set set from Redis, the data set set is first established based on the string key key, the string key is obtained by concatenating the matching fields of the extracted matching business original data and the transaction original data, the matching business original data and the transaction original data are obtained by eliminating the corresponding unmatched business original data and the transaction original data according to the difference set; a second set obtaining subunit, obtaining a hash set from Redis, the hash set is first established based on the full field, the key of the hash set is the string key, and the full field is obtained by extracting the matching business original data and the transaction original data; the data obtaining subunit obtains the corresponding business data and transaction data according to the data set set and the hash set.
[0062] The comparison module 32 includes: a difference making unit, which subtracts the transaction date field in the transaction data from the business date field in the business data to obtain a difference; a screening unit, which determines whether the absolute value of the difference meets the preset screening condition, and if so, eliminates the corresponding transaction data; wherein the preset meeting condition can be set according to actual screening requirements, for example, the difference between the business date field in the business data and the transaction date field in the transaction data can be less than or equal to a preset value, and the preset value can be 1 day, which can be set according to actual reconciliation requirements and is not further limited here.
[0063] The reconciliation module 33 includes: a matching unit, which matches the transaction value measurement field in the business data with the transaction value measurement field in the filtered transaction data; if the match is successful, the reconciliation is successful; otherwise, the reconciliation fails.
[0064] Furthermore, the matching unit is used to: subtract the transaction value measurement field in the filtered transaction data from the transaction value measurement field in the business data. If the difference is 0, the match is successful; otherwise, the match fails.
[0065] In addition, the comparison module 32 also includes: a first information recording unit, which obtains a reconciliation task table according to the task identifier code, task execution time, amount of successful reconciliation data and amount of failed reconciliation data of the reconciliation execution; a second information recording unit, which stores corresponding data according to the reconciliation status, and if the reconciliation is successful, stores the business data primary key and the transaction data primary key; otherwise, stores the reason for the reconciliation failure of the corresponding data to obtain a reconciliation detail table; and a result acquisition unit, which obtains the reconciliation result according to the reconciliation task table and the reconciliation detail table.
[0066] In an optional embodiment, the device further includes: a message publishing module, after obtaining the reconciliation result based on the matching result, uses the distributed publish-subscribe message system Kafka to send the reconciliation result to the message queue to notify other consumers who have subscribed previously.
[0067] Furthermore, the message publishing module includes: an object construction unit, which converts the format of the reconciliation result according to a preset sending format, and uses the key information in the reconciliation result as the key of the message and the detailed content of the reconciliation result as the value of the message to construct a Kafka message object; an information sending unit, which uses the previously configured Kafka producer instance to send the message to the Kafka topic message queue.
[0068] To summarize, the embodiment of the present invention compares the business date field in the business data acquired by the data acquisition module and the transaction date field in the acquired transaction data through the comparison module, and eliminates the non-compliant transaction data according to the preset screening conditions to ensure that the data involved in the reconciliation are consistent in time range, which helps to avoid erroneous reconciliation results caused by time mismatch, reduces the workload of subsequent target field matching, and further performs target field matching on the business data and the filtered transaction data through the reconciliation module, which can further verify the consistency of the data, thereby facilitating the rapid discovery of data inconsistencies, making timely adjustments and corrections, improving reconciliation efficiency and accuracy, and being able to flexibly adapt to different business scenarios and needs, simplifying the setting and management of the reconciliation process, and greatly improving the flexibility and maintainability of the system, with good scalability.
[0069] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the reconciliation method, which includes: obtaining business data and transaction data; comparing the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset screening condition, eliminating the transaction data corresponding to the comparison result meeting the preset screening condition to obtain the filtered transaction data; matching the business data with the filtered transaction data for the target field, and obtaining the reconciliation result based on the matching result.
[0070] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0071] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the reconciliation method provided by the above-mentioned methods, which includes: obtaining business data and transaction data; comparing the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset filtering condition, eliminating the transaction data corresponding to the comparison result meeting the preset filtering condition to obtain the filtered transaction data; matching the business data and the filtered transaction data with the target field, and obtaining the reconciliation result based on the matching result.
[0072] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the reconciliation method provided by the above-mentioned methods, the method comprising: acquiring business data and transaction data; comparing the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset filtering condition, eliminating the transaction data corresponding to the comparison result meeting the preset filtering condition to obtain the filtered transaction data; performing target field matching on the business data and the filtered transaction data, and obtaining the reconciliation result based on the matching result.
[0073] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A reconciliation method, characterized in that: include: Obtain business data and transaction data; Comparing the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset screening condition, eliminating the transaction data corresponding to the comparison result meeting the preset screening condition, to obtain screened transaction data; The business data and the filtered transaction data are matched with target fields, and a reconciliation result is obtained based on the matching result.
2. The reconciliation method according to claim 1, characterized in that: The obtaining of business data and transaction data includes: Obtain original business data and original transaction data; Using the SINTER command of the remote dictionary service Redis, traverse the business original data and the transaction original data to obtain a matching field, where the matching field is used to represent the intersection of the business original data and the transaction original data; The difference set SDIFF command of the Redis is used to find the difference set of the business original data and the transaction original data, and the corresponding unmatched business original data and the transaction original data are eliminated according to the difference set to obtain the business data and the transaction data.
3. The reconciliation method according to claim 2, characterized in that: Eliminating the unmatched business original data and the transaction original data according to the difference set to obtain business data and transaction data includes: Eliminate the corresponding unmatched business original data and transaction original data according to the difference set to obtain matched business original data and transaction original data; Extract the matching fields of the matching business original data and transaction original data and concatenate them to obtain a string key key; Extracting all fields of the matching business original data and transaction original data; According to the string key key and the full field, the corresponding business data and transaction data are obtained.
4. The reconciliation method according to claim 2, characterized in that: Eliminating the unmatched business original data and the transaction original data according to the difference set to obtain business data and transaction data includes: Obtain a data set from the Redis, wherein the data set is previously established based on a string key key, wherein the string key is obtained by concatenating matching fields of extracted matching business original data and transaction original data, wherein the matching business original data and transaction original data are obtained by eliminating corresponding unmatched business original data and transaction original data according to the difference set; Obtain a hash set from the Redis, where the hash set is previously established based on the full field, the key of the hash set is the string key, and the full field is extracted based on the matched business original data and the transaction original data; According to the data set and the hash set, corresponding business data and transaction data are obtained.
5. The reconciliation method according to claim 2, characterized in that: The obtaining of original business data and original transaction data includes: Calling a Hypertext Transfer Protocol HTTP interface to obtain corresponding business original data and transaction original data from a business database and a transaction database respectively; or, Using a preset programming language application program interface JDBC, access the database ports of the business database and the transaction database, and execute a pre-configured structured query SQL statement to obtain the corresponding business original data and transaction original data; wherein the SQL statement is obtained based on preset keywords and clauses to specify the query range, conditions and operations; or, The advanced template class MongoTemplate is used to access the database ports of the business database and the transaction database, and the previously configured MQL query language is executed to obtain the corresponding business original data and transaction original data; wherein, the MQL query language is obtained based on constructing a query object to specify the query conditions.
6. The reconciliation method according to claim 1, characterized in that: The business data and the filtered transaction data are matched against target fields, and based on the matching results, a reconciliation result is obtained, including: Matching the transaction value metric field in the business data with the transaction value metric field in the filtered transaction data; If the match is successful, the reconciliation is successful; otherwise, the reconciliation fails.
7. The reconciliation method according to claim 1, characterized in that: After obtaining the reconciliation result based on the matching result, the following steps are included: The distributed publish-subscribe messaging system Kafka is used to send the reconciliation result to the message queue to notify other consumers who have subscribed previously.
8. A reconciliation device, characterized in that: include: Data acquisition module, which acquires business data and transaction data; A comparison module, which compares the business date field in the business data with the transaction date field in the transaction data, and based on the comparison result meeting the preset screening condition, removes the transaction data corresponding to the comparison result meeting the preset screening condition, to obtain the screened transaction data; The reconciliation module performs target field matching on the business data and the filtered transaction data, and obtains a reconciliation result based on the matching result.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the reconciliation method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the reconciliation method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Analysis system and analysis method based on Redis and MQL
CN121636543A