CN112184368A - Transaction data processing method and device and server - Google Patents

Transaction data processing method and device and server Download PDF

Info

Publication number
CN112184368A
CN112184368A CN202010986267.8A CN202010986267A CN112184368A CN 112184368 A CN112184368 A CN 112184368A CN 202010986267 A CN202010986267 A CN 202010986267A CN 112184368 A CN112184368 A CN 112184368A
Authority
CN
China
Prior art keywords
data
transaction data
transaction
target attribute
group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010986267.8A
Other languages
Chinese (zh)
Inventor
贾天福
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Rockwell Technology Co Ltd
Original Assignee
Beijing Rockwell Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Rockwell Technology Co Ltd filed Critical Beijing Rockwell Technology Co Ltd
Priority to CN202010986267.8A priority Critical patent/CN112184368A/en
Publication of CN112184368A publication Critical patent/CN112184368A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting
    • G06Q40/125Finance or payroll

Abstract

The invention discloses a transaction data processing method, a transaction data processing device and a server. The transaction data processing method comprises the following steps: extracting a plurality of groups of transaction data from different sources, wherein the plurality of groups of transaction data are sequentially generated according to the sequence of transaction execution; comparing each set of the transaction data with a respective set of the transaction data in a subsequent order; and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result. According to the transaction data processing method provided by the embodiment of the invention, each group of transaction data is compared with the respective transaction data in sequence according to the sequence of transaction execution, and the last group of data is compared with the first group of data, so that the transaction data from different sources can be compared quickly, efficiently and accurately, the wrong data can be found in time, and the loss can be stopped in time.

Description

Transaction data processing method and device and server
Technical Field
The invention relates to the field of data processing, in particular to a transaction data processing method, a transaction data processing device and a server.
Background
The existing e-commerce system has a plurality of service systems, each transaction service corresponds to a series of transaction data, the upstream and downstream systems of the series of transaction data are complex, the conditions of inconsistent transaction states and data numbers in the series of transaction data may exist, the transaction times of the system are large, the data size is huge, tracking and finding are not easy, the transaction data comprise transaction amount, if the transaction amount is inconsistent, the problems of more withholding, less withholding, repeated withholding and the like may occur, if tracking and finding are not timely, losses of merchants or purchased users are easily caused, and purchasing disputes occur, so that whether the transaction data are mistaken or not is timely and accurately compared, the problem of discovering transactions in the system is timely, and disputes are avoided.
Disclosure of Invention
Objects of the invention
The invention aims to provide a transaction data processing method, a transaction data processing device and a server side.
(II) technical scheme
To solve the above problem, a first aspect of the present invention provides a transaction data processing method, including: extracting a plurality of groups of transaction data from different sources, wherein the plurality of groups of transaction data are sequentially generated according to the sequence of transaction execution; comparing each set of the transaction data with a respective set of the transaction data in a subsequent order; and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result.
According to the transaction data processing method provided by the embodiment of the invention, each group of transaction data is compared with the respective transaction data in sequence according to the sequence of transaction execution, and the last group of data is compared with the first group of data, so that the transaction data from different sources can be compared quickly, efficiently and accurately, the wrong data can be found in time, and the loss can be stopped in time.
In some embodiments, each set of the transaction data comprises a plurality of target attribute features; each set of the transaction data and the respective transaction data in the next order have at least two corresponding target attribute characteristics; the comparing each set of the transaction data with a respective set of transaction data in a subsequent order comprises: comparing the target attribute characteristics of each group of transaction data with the corresponding target attribute characteristics of the respective next sequence; and when at least one target attribute feature is not matched with the corresponding target attribute feature in the next sequence, determining that the comparison result is that two sets of transaction data have errors.
In some embodiments, the plurality of sets of transaction data sequentially include work order data, and payment data according to a sequence of transaction execution; wherein the plurality of target attribute features of the work order data comprise: the order number, the transaction amount, the order generation time and the transaction state; the plurality of target attribute characteristics of the order data include: a work order number, an order number, a transaction amount, order generation time, payment completion time and payment state; the plurality of target attribute features of the payment data comprises: order number, transaction amount, payment completion time, and transaction status.
In some embodiments, after extracting the plurality of sets of transaction data, before comparing each set of the transaction data with a respective set of transaction data in a subsequent order, further comprising: performing data filtering on the plurality of sets of transaction data, the data filtering including one or more of: deleting repeated transaction data in the multiple groups of transaction data and keeping the transaction data to be one; or deleting the transaction data which do not meet the preset conditions.
In some embodiments, after data filtering the plurality of sets of transaction data, before comparing each set of transaction data with a respective set of transaction data in a subsequent order, further comprising: converting the target attribute characteristics of each group of transaction data into a preset format; or converting the target attribute characteristics of each group of the transaction data and the target attribute characteristics of a group of the transaction data in the subsequent sequence into the same format.
In some embodiments, the transaction data processing method further includes: and sending the comparison result to a mailbox or an APP software account of the target task corresponding to each group of transaction data.
In some embodiments, the transaction data processing method further includes: and executing a transaction data comparison method at preset time intervals.
According to a second aspect of the present invention, there is provided a transaction data processing apparatus comprising: the data acquisition module extracts a plurality of groups of transaction data from different sources, wherein the plurality of groups of transaction data are sequentially generated according to the sequence of transaction execution; the data comparison module is used for comparing each group of transaction data with a group of transaction data in the respective subsequent sequence; and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result.
In some embodiments, each set of the transaction data comprises a plurality of target attribute features; each set of the transaction data and the respective transaction data in the next order have at least two corresponding target attribute characteristics; the data comparison module is used for comparing the target attribute characteristics of each group of transaction data with the corresponding target attribute characteristics of the respective next sequence; and when at least one target attribute feature is not matched with the corresponding target attribute feature in the next sequence, determining that the comparison result is that two sets of transaction data have errors.
In some embodiments, the sets of transaction data extracted by the data extraction module include work order data, and payment data; wherein the plurality of target attribute features of the work order data comprise: the order number, the transaction amount, the order generation time and the transaction state; the plurality of target attribute characteristics of the order data include: a work order number, an order number, a transaction amount, order generation time, payment completion time and payment state; the plurality of target attribute features of the payment data comprises: order number, transaction amount, payment completion time, and transaction status.
In some embodiments, further comprising: and the data filtering module is used for performing data filtering on the multiple groups of transaction data, wherein the data filtering comprises deleting repeated transaction data in the multiple groups of transaction data, and keeping the transaction data to be one or deleting the transaction data which do not meet preset conditions.
In some embodiments, the transaction data processing apparatus further includes: and the data cleaning module is used for converting the target attribute characteristics of each group of transaction data into a preset format or converting the target attribute characteristics of each group of transaction data and the target attribute characteristics of a group of transaction data in the subsequent sequence into the same format.
In some embodiments, the transaction data processing apparatus further includes: and the comparison result sending module is used for sending the comparison result to the mailbox or the APP software account of the target task corresponding to each group of transaction data.
In some embodiments, the transaction data processing apparatus further includes: the clock module is used for indicating the data extraction module to extract a plurality of groups of transaction data from different sources at intervals of preset time so that the data comparison module compares each group of transaction data with a group of transaction data in a respective subsequent sequence at intervals of the preset time; and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result.
According to a third aspect of the present invention, there is also provided a server, including a processor, where the processor performs transaction data processing by using the method provided in the first aspect.
According to a fourth aspect of the present invention, there is provided a computer storage medium having a computer program stored thereon, which when executed by a processor, implements the method provided by the first aspect to perform transaction data processing.
According to an eighth aspect of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of the first aspect to perform transaction data processing when executing the program.
(III) advantageous effects
The technical scheme of the invention has the following beneficial technical effects:
according to the transaction data processing method provided by the embodiment of the invention, each group of transaction data is compared with the respective transaction data in sequence according to the sequence of transaction execution, and the last group of data is compared with the first group of data, so that the transaction data from different sources can be compared quickly, efficiently and accurately, the wrong data can be found in time, and the loss can be stopped in time.
Drawings
FIG. 1 is a schematic flow chart of a transaction data processing method according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a transaction data processing device according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Before discussing the transaction data processing method provided by the first embodiment of the present invention in detail, the sequence of transaction execution will be described.
Typically, to facilitate a single transaction, a transaction system will typically include multiple subsystems, such as a work order system, an order generation system, and a payment system.
The user can apply for the work order by the work order system, the work order system generates work order data, and the work order data comprises a work order number, transaction amount, transaction state and work order data generation time.
Then, the work order system calls an order system based on the generated work order, and the order system generates corresponding order data. The order data includes an order number, a work order number corresponding to the order, time of order generation, a payment state, and the like.
After the order system generates order data, calling a payment system, and generating payment data by the payment system, wherein the payment data comprises: the payment serial number, the order number corresponding to the payment, the payment amount, the payment completion time and the transaction state.
After the work order payment item is paid, the payment system can acquire a payment state, if the payment state is the state of payment, the payment system can inform the order system of the payment completion state, the order system modifies the transaction state into transaction completion, then the order system can inform the work order system of the transaction completion state, and the work order system can modify the transaction state of the work order into the payment state.
Generally, the simple payment scenario needs three systems, namely work order, order and transaction, and each system stores respective data in a respective server. The three systems have business relations between the upstream and downstream, and the data of the upstream and downstream business systems are not in a communication relation with each other.
It can be seen that, in the above payment system, the processing link of multiple sets of transaction data belonging to one transaction is relatively long, and for the interior of an enterprise, subsystems of multiple services are set, so that the processing link of transaction data becomes longer and longer, and a piece of data generated from the most upstream business system to the most downstream consumption system often needs to go through several or even dozens of service subsystems with different sizes and different functions. Therefore, there is an increasing demand for comparing and checking data in multi-party streams, and finding out missing errors or repetition in time. The requirements for looking up the source of the business data from the top stream and tracking the consumption data of the bottom stream are urgent.
The following will discuss in detail the transaction data processing method according to the first embodiment of the present invention.
Fig. 1 is a schematic flow chart of a transaction data processing method according to a first embodiment of the present invention.
As shown in fig. 1, the transaction data processing method includes: step S101-step S103, wherein,
step S101, extracting multiple sets of transaction data from different sources, wherein the multiple sets of transaction data are sequentially generated according to the sequence of transaction execution.
And completing a transaction by combining the above description, wherein the transaction comprises a plurality of groups of transaction data such as work order data, transaction data and the like, and each group of transaction data respectively stores different servers. Therefore, in this step, a plurality of sets of transaction data from different sources are extracted, so as to be ready for the next data comparison.
In one embodiment, the extracting the plurality of sets of transaction data from different sources further comprises:
the method includes the steps of firstly synchronizing a plurality of groups of transaction data of different sources into a TIDB database, and then extracting the plurality of groups of transaction data of different sources stored in the TIDB database.
It can be understood that there may be differences in database types of multiple sets of transaction data from different sources, and each database may have different requirements for extracting data, some databases may be directly extracted by sending a script, and some databases may be extracted by calling an interface, so that, in order to facilitate uniform extraction, transaction data from different sources are synchronized into a TIDB database, and thus, when multiple sets of transaction data are subsequently extracted, SQL script may be uniformly used for reading, and when the types of the extracted transaction data change or the attribute characteristics of the transaction data change, dynamic adjustment may be implemented by dynamically configuring SQL script, and the SQL script may take effect in real time without adjusting the code of the transaction system each time. The steps of extracting multiple sets of transaction data from different sources are simplified.
Step S102, comparing each group of transaction data with a group of transaction data in the respective subsequent sequence.
In one embodiment, each set of the transaction data includes a plurality of target attribute features; each set of the transaction data and the transaction data of the respective next sequence have at least two corresponding target attribute characteristics
The comparing each set of the transaction data with a respective set of transaction data in a subsequent order comprises: comparing the target attribute characteristics of each group of transaction data with the corresponding target attribute characteristics of the respective next sequence; and when at least one target attribute feature is not matched with the corresponding target attribute feature in the next sequence, determining that the comparison result is that two sets of transaction data have errors.
Further, in this embodiment, according to the sequence of executing transactions, the plurality of sets of transaction data sequentially include work order data, and payment data.
Wherein the plurality of target attribute features of the work order data comprise: order number, transaction amount, order generation time, and transaction status.
The plurality of target attribute characteristics of the order data include: a work order number, an order number, a transaction amount, an order generation time, a payment completion time, and a payment status.
The plurality of target attribute features of the payment data comprises: order number, transaction amount, payment completion time, and transaction status.
Specifically, in the present embodiment, the order of execution of the transaction is first to generate the order data, and then the order data and the payment data.
Comparing the target attribute features of each set of transaction data with the corresponding target attribute features of the respective next sequence, including:
comparing the work order data with the order data; and comparing the order data with the payment data, and comparing the payment data with the work order data.
Specifically, comparing the work order data with the order data includes: comparing the number of the work order included in the work order data with the number of the work order included in the order data, comparing the transaction amount included in the work order data with the transaction amount included in the order data, and comparing the time of generating the order in the work order data with the time of generating the order in the order data.
Comparing the order data with the payment data, comprising: comparing the order number in the order data with the order number in the payment data, comparing the transaction amount in the order data with the transaction amount in the payment data, and comparing the payment completion time in the order data with the payment completion time in the payment data.
Comparing the payment data with the work order data, comprising: and comparing the transaction amount in the work order data with the transaction amount in the payment data, and comparing the transaction state in the work order data with the transaction state in the payment data.
It can be understood that, by performing the comparison in sequence according to the above embodiments of the present invention, the comparison of the three sets of transaction data can be completed to obtain the comparison result.
In a specific embodiment, when the target attribute features of the two sets of transaction data are compared, if there is no match, it is determined that the comparison result is that both sets of transaction data have errors.
The fact that the target attribute features of the two sets of transaction data are not matched means that one target attribute feature exists in the set of transaction data, and the attribute feature corresponding to the target attribute feature is not compared in the next set of transaction data. For example, when the transaction amount in the work order data and the transaction amount in the payment data are compared, the attribute feature that the transaction amount does not exist in the work order data is found, and the error of the work order data and the payment data in the transaction is confirmed. More specifically, it is determined that the attribute feature of the transaction amount of the worksheet data and the attribute feature of the transaction amount of the payment data are both wrong in the transaction.
Or, the target attribute feature of the two sets of transaction data is not matched, for example, the target attribute feature in the set of transaction data is different from the attribute feature corresponding to the target attribute feature in the next set of transaction data. For example, when comparing the transaction amount in the work order data with the transaction amount in the payment data, it is found that the transaction amount of the work order data is different from the transaction amount of the payment data, for example, the transaction amount of the work order data is 10000, and the transaction amount of the payment data is 1000, and it is determined that the work order data and the payment data are wrong in the transaction. More specifically, it is determined that the attribute feature of the transaction amount of the worksheet data and the attribute feature of the transaction amount of the payment data are both wrong in the transaction.
In one embodiment, after extracting the plurality of sets of transaction data, before comparing each set of transaction data with a respective set of transaction data in a subsequent order, the method further comprises: performing data filtering on the plurality of sets of transaction data, the data filtering including one or more of: deleting repeated transaction data in the multiple groups of transaction data and keeping the transaction data to be one; or deleting the transaction data which do not meet the preset conditions.
In this embodiment, in some cases, the data is called from the TIDB database by using the sql script, and there may be duplication of the called data or inaccuracy of the called data, so that the data is filtered before the comparison, and the data processing amount of the comparison is reduced.
Of course, the transaction data may also be filtered according to preset conditions, such as deleting data that is not generated on a certain day or deleting data that is not generated for a certain period of time.
In one embodiment, after the data filtering is performed on the plurality of sets of transaction data, before each set of transaction data is compared with a respective set of transaction data in a subsequent order, the method further includes: converting the target attribute characteristics of each group of transaction data into a preset format; or converting the target attribute characteristics of each group of the transaction data and the target attribute characteristics of a group of the transaction data in the subsequent sequence into the same format.
It should be noted that, in this embodiment, because the data sources of the several sets of transaction data to be compared are different, the formats of the data storage in each set may be different, for example, the format of the previous set of transaction data for the time storage is one field, and the format of the previous set of transaction data for the time storage is one field, so that the target attribute of the extracted time includes two fields, while the format of the other set of transaction data for the time storage is one field, and if the formats of the previous set of transaction data for the time storage are not converted to be consistent, the two sets of transaction data cannot be compared.
For another example, the data format of the former group of transaction data for amount is Chinese capital figure, such as one ten thousand zero five hundred yuan, while the format of the latter group of transaction data for amount is Arabic figure, such as 10500 yuan, and if the amounts are not unified into one format, the comparison is difficult.
For another example, sometimes there is much information in each group of transaction data, for example, there may be information of a user name, a user mobile phone number, a remark of placing an order, and the like in the work order data, and some information may not need to be compared, although only a few specific target attribute features of each group of transaction data are required to be extracted during extraction, sometimes there may be an sql script that erroneously extracts other attribute features, and therefore, data cleaning in this step is set, or non-target attribute features in each group of data may be deleted, that is, missing and missing are made for each group of transaction data extracted in the first step.
In one embodiment, the transaction data processing method further includes: and step S104, sending the comparison result to a target mailbox or a target APP software account corresponding to each group of transaction data.
In this embodiment, the data with the comparison error may be sent to the target mailbox or the target APP software account, so that the person with the corresponding account can solve the problem of the data error in time. It is understood that the target mailbox is, for example, a mailbox of a person in charge corresponding to two sets of transaction data with comparison errors. Wherein the person in charge corresponding to each set of transaction data is, for example, the person in charge corresponding to each transaction system.
In one embodiment, the method further comprises: step S105, executing a transaction data comparison method every preset time.
Specifically, the comparison processing may be performed on the transaction data every other day.
According to the transaction data processing method provided by the embodiment of the invention, each group of transaction data is compared with the respective transaction data in sequence according to the sequence of transaction execution, and the last group of data is compared with the first group of data, so that the transaction data from different sources can be compared quickly, efficiently and accurately, the wrong data can be found in time, and the loss can be stopped in time.
Fig. 2 is a transaction data processing device according to a second embodiment of the present invention.
As shown in fig. 2, the transaction data processing apparatus includes: the device comprises a data acquisition module and a data comparison module.
The data acquisition module is used for extracting multiple sets of transaction data from different sources, and the multiple sets of transaction data are sequentially generated according to the sequence of transaction execution.
And completing a transaction by combining the above description, wherein the transaction comprises a plurality of groups of transaction data such as work order data, transaction data and the like, and each group of transaction data respectively stores different servers. Therefore, in this step, a plurality of sets of transaction data from different sources are extracted, so as to be ready for the next data comparison.
In one embodiment, the data acquisition module synchronizes multiple sets of transaction data from different sources to a TIDB database, and then extracts multiple sets of transaction data from different sources stored in the TIDB database.
It can be understood that there may be differences in database types of multiple sets of transaction data from different sources, and each database may have different requirements for extracting data, some databases may be directly extracted by sending a script, and some databases may be extracted by calling an interface, so that, in order to facilitate uniform extraction, transaction data from different sources are synchronized into a TIDB database, and thus, when multiple sets of transaction data are subsequently extracted, SQL script may be uniformly used for reading, and when the types of the extracted transaction data change or the attribute characteristics of the transaction data change, dynamic adjustment may be implemented by dynamically configuring SQL script, and the SQL script may take effect in real time without adjusting the code of the transaction system each time. The steps of extracting multiple sets of transaction data from different sources are simplified.
The data comparison module is used for comparing each group of transaction data with a group of transaction data in the respective subsequent sequence.
In one embodiment, each set of the transaction data includes a plurality of target attribute features; each set of the transaction data has at least two corresponding target attribute characteristics with respective next sequential transaction data.
The data comparison module is used for comparing the target attribute characteristics of each group of transaction data with the corresponding target attribute characteristics of the respective next sequence; and when at least one target attribute feature is not matched with the corresponding target attribute feature in the next sequence, determining that the comparison result is that two sets of transaction data have errors.
Further, in this embodiment, according to the sequence of executing transactions, the plurality of sets of transaction data sequentially include work order data, and payment data.
Wherein the plurality of target attribute features of the work order data comprise: order number, transaction amount, order generation time, and transaction status.
The plurality of target attribute characteristics of the order data include: a work order number, an order number, a transaction amount, an order generation time, a payment completion time, and a payment status.
The plurality of target attribute features of the payment data comprises: order number, transaction amount, payment completion time, and transaction status.
Specifically, in the present embodiment, the order of execution of the transaction is first to generate the order data, and then the order data and the payment data.
The data comparison module is used for comparing the work order data with the order data, comparing the order data with the payment data and comparing the payment data with the work order data.
Specifically, the data comparison module compares the work order data with the order data, and includes: comparing the number of the work order included in the work order data with the number of the work order included in the order data, comparing the transaction amount included in the work order data with the transaction amount included in the order data, and comparing the time of generating the order in the work order data with the time of generating the order in the order data.
The data comparison module compares the order data with the payment data, and comprises the following steps: comparing the order number in the order data with the order number in the payment data, comparing the transaction amount in the order data with the transaction amount in the payment data, and comparing the payment completion time in the order data with the payment completion time in the payment data.
The data comparison module compares the payment data with the work order data, and comprises the following steps: and comparing the transaction amount in the work order data with the transaction amount in the payment data, and comparing the transaction state in the work order data with the transaction state in the payment data.
It can be understood that, by performing the comparison in sequence according to the above embodiments of the present invention, the comparison of the three sets of transaction data can be completed to obtain the comparison result.
In a specific embodiment, when the target attribute features of the two sets of transaction data are compared, if there is no match, it is determined that the comparison result is that both sets of transaction data have errors.
The fact that the target attribute features of the two sets of transaction data are not matched means that one target attribute feature exists in the set of transaction data, and the attribute feature corresponding to the target attribute feature is not compared in the next set of transaction data. For example, when the transaction amount in the work order data and the transaction amount in the payment data are compared, the attribute feature that the transaction amount does not exist in the work order data is found, and the error of the work order data and the payment data in the transaction is confirmed. More specifically, it is determined that the attribute feature of the transaction amount of the worksheet data and the attribute feature of the transaction amount of the payment data are both wrong in the transaction.
Or, the target attribute feature of the two sets of transaction data is not matched, for example, the target attribute feature in the set of transaction data is different from the attribute feature corresponding to the target attribute feature in the next set of transaction data. For example, when comparing the transaction amount in the work order data with the transaction amount in the payment data, it is found that the transaction amount of the work order data is different from the transaction amount of the payment data, for example, the transaction amount of the work order data is 10000, and the transaction amount of the payment data is 1000, and it is determined that the work order data and the payment data are wrong in the transaction. More specifically, it is determined that the attribute feature of the transaction amount of the worksheet data and the attribute feature of the transaction amount of the payment data are both wrong in the transaction.
In one embodiment, the transaction data processing module further includes: the data filtering module is used for performing data filtering on the multiple groups of transaction data, and the data filtering module performs data filtering and comprises one or more of the following steps: deleting repeated transaction data in the multiple groups of transaction data and keeping the transaction data to be one; or deleting the transaction data which do not meet the preset conditions.
In this embodiment, in some cases, the data is called from the TIDB database by using the sql script, and there may be duplication of the called data or inaccuracy of the called data, so that the data is filtered before the comparison, and the data processing amount of the comparison is reduced.
Of course, the transaction data may also be filtered according to preset conditions, such as deleting data that is not generated on a certain day or deleting data that is not generated for a certain period of time.
In one embodiment, the transaction data processing apparatus further includes: the data cleaning module is used for converting the target attribute characteristics of each group of transaction data into a preset format; or converting the target attribute characteristics of each group of the transaction data and the target attribute characteristics of a group of the transaction data in the subsequent sequence into the same format.
It should be noted that, in this embodiment, because the data sources of the several sets of transaction data to be compared are different, the formats of the data storage in each set may be different, for example, the format of the previous set of transaction data for the time storage is one field, and the format of the previous set of transaction data for the time storage is one field, so that the target attribute of the extracted time includes two fields, while the format of the other set of transaction data for the time storage is one field, and if the formats of the previous set of transaction data for the time storage are not converted to be consistent, the two sets of transaction data cannot be compared.
For another example, the data format of the former group of transaction data for amount is Chinese capital figure, such as one ten thousand zero five hundred yuan, while the format of the latter group of transaction data for amount is Arabic figure, such as 10500 yuan, and if the amounts are not unified into one format, the comparison is difficult.
For another example, sometimes there is much information in each group of transaction data, for example, there may be information of a user name, a user mobile phone number, a remark of placing an order, and the like in the work order data, and some information may not need to be compared, although only a few specific target attribute features of each group of transaction data are required to be extracted during extraction, sometimes there may be an sql script that erroneously extracts other attribute features, and therefore, data cleaning in this step is set, or non-target attribute features in each group of data may be deleted, that is, missing and missing are made for each group of transaction data extracted in the first step.
In one embodiment, the transaction data processing apparatus further includes: and the comparison result sending module is used for sending the comparison result to the mailbox or the APP software account of the target task corresponding to each group of transaction data.
In this embodiment, the data with the comparison error may be sent to the target mailbox or the target APP software account, so that the person with the corresponding account can solve the problem of the data error in time. It is understood that the target mailbox is, for example, a mailbox of a person in charge corresponding to two sets of transaction data with comparison errors. Wherein the person in charge corresponding to each set of transaction data is, for example, the person in charge corresponding to each transaction system.
In one embodiment, the transaction data processing apparatus further comprises: the clock module is used for indicating the data extraction module to extract a plurality of groups of transaction data from different sources at intervals of preset time so that the data comparison module compares each group of transaction data with a group of transaction data in a respective subsequent sequence at intervals of the preset time; and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result.
Specifically, the comparison processing may be performed on the transaction data every other day.
According to the transaction data processing method and device provided by the embodiment of the invention, each group of transaction data is compared with the respective transaction data in sequence according to the sequence of transaction execution, and the last group of data is compared with the first group of data, so that the transaction data from different sources can be compared quickly, efficiently and accurately, the error data can be found in time, and the loss can be stopped in time.
In an embodiment of the present invention, there is further provided a server, including a processor, configured to process transaction data, where the transaction data processing step includes: the transaction data processing method comprises the following steps: step S101-step S103, wherein,
step S101, extracting multiple sets of transaction data from different sources, wherein the multiple sets of transaction data are sequentially generated according to the sequence of transaction execution.
And completing a transaction by combining the above description, wherein the transaction comprises a plurality of groups of transaction data such as work order data, transaction data and the like, and each group of transaction data respectively stores different servers. Therefore, in this step, a plurality of sets of transaction data from different sources are extracted, so as to be ready for the next data comparison.
In one embodiment, the extracting the plurality of sets of transaction data from different sources further comprises:
the method includes the steps of firstly synchronizing a plurality of groups of transaction data of different sources into a TIDB database, and then extracting the plurality of groups of transaction data of different sources stored in the TIDB database.
It can be understood that there may be differences in database types of multiple sets of transaction data from different sources, and each database may have different requirements for extracting data, some databases may be directly extracted by sending a script, and some databases may be extracted by calling an interface, so that, in order to facilitate uniform extraction, transaction data from different sources are synchronized into a TIDB database, and thus, when multiple sets of transaction data are subsequently extracted, SQL script may be uniformly used for reading, and when the types of the extracted transaction data change or the attribute characteristics of the transaction data change, dynamic adjustment may be implemented by dynamically configuring SQL script, and the SQL script may take effect in real time without adjusting the code of the transaction system each time. The steps of extracting multiple sets of transaction data from different sources are simplified.
Step S102, comparing each group of transaction data with a group of transaction data in the respective subsequent sequence.
In one embodiment, each set of the transaction data includes a plurality of target attribute features; each set of the transaction data and the transaction data of the respective next sequence have at least two corresponding target attribute characteristics
The comparing each set of the transaction data with a respective set of transaction data in a subsequent order comprises: comparing the target attribute characteristics of each group of transaction data with the corresponding target attribute characteristics of the respective next sequence; and when at least one target attribute feature is not matched with the corresponding target attribute feature in the next sequence, determining that the comparison result is that two sets of transaction data have errors.
Further, in this embodiment, according to the sequence of executing transactions, the plurality of sets of transaction data sequentially include work order data, and payment data.
Wherein the plurality of target attribute features of the work order data comprise: order number, transaction amount, order generation time, and transaction status.
The plurality of target attribute characteristics of the order data include: a work order number, an order number, a transaction amount, an order generation time, a payment completion time, and a payment status.
The plurality of target attribute features of the payment data comprises: order number, transaction amount, payment completion time, and transaction status.
Specifically, in the present embodiment, the order of execution of the transaction is first to generate the order data, and then the order data and the payment data.
Comparing the target attribute features of each set of transaction data with the corresponding target attribute features of the respective next sequence, including:
comparing the work order data with the order data; and comparing the order data with the payment data, and comparing the payment data with the work order data.
Specifically, comparing the work order data with the order data includes: comparing the number of the work order included in the work order data with the number of the work order included in the order data, comparing the transaction amount included in the work order data with the transaction amount included in the order data, and comparing the time of generating the order in the work order data with the time of generating the order in the order data.
Comparing the order data with the payment data, comprising: comparing the order number in the order data with the order number in the payment data, comparing the transaction amount in the order data with the transaction amount in the payment data, and comparing the payment completion time in the order data with the payment completion time in the payment data.
Comparing the payment data with the work order data, comprising: and comparing the transaction amount in the work order data with the transaction amount in the payment data, and comparing the transaction state in the work order data with the transaction state in the payment data.
It can be understood that, by performing the comparison in sequence according to the above embodiments of the present invention, the comparison of the three sets of transaction data can be completed to obtain the comparison result.
In a specific embodiment, when the target attribute features of the two sets of transaction data are compared, if there is no match, it is determined that the comparison result is that both sets of transaction data have errors.
The fact that the target attribute features of the two sets of transaction data are not matched means that one target attribute feature exists in the set of transaction data, and the attribute feature corresponding to the target attribute feature is not compared in the next set of transaction data. For example, when the transaction amount in the work order data and the transaction amount in the payment data are compared, the attribute feature that the transaction amount does not exist in the work order data is found, and the error of the work order data and the payment data in the transaction is confirmed. More specifically, it is determined that the attribute feature of the transaction amount of the worksheet data and the attribute feature of the transaction amount of the payment data are both wrong in the transaction.
Or, the target attribute feature of the two sets of transaction data is not matched, for example, the target attribute feature in the set of transaction data is different from the attribute feature corresponding to the target attribute feature in the next set of transaction data. For example, when comparing the transaction amount in the work order data with the transaction amount in the payment data, it is found that the transaction amount of the work order data is different from the transaction amount of the payment data, for example, the transaction amount of the work order data is 10000, and the transaction amount of the payment data is 1000, and it is determined that the work order data and the payment data are wrong in the transaction. More specifically, it is determined that the attribute feature of the transaction amount of the worksheet data and the attribute feature of the transaction amount of the payment data are both wrong in the transaction.
In one embodiment, after extracting the plurality of sets of transaction data, before comparing each set of transaction data with a respective set of transaction data in a subsequent order, the method further comprises: performing data filtering on the plurality of sets of transaction data, the data filtering including one or more of: deleting repeated transaction data in the multiple groups of transaction data and keeping the transaction data to be one; or deleting the transaction data which do not meet the preset conditions.
In this embodiment, in some cases, the data is called from the TIDB database by using the sql script, and there may be duplication of the called data or inaccuracy of the called data, so that the data is filtered before the comparison, and the data processing amount of the comparison is reduced.
Of course, the transaction data may also be filtered according to preset conditions, such as deleting data that is not generated on a certain day or deleting data that is not generated for a certain period of time.
In one embodiment, after the data filtering is performed on the plurality of sets of transaction data, before each set of transaction data is compared with a respective set of transaction data in a subsequent order, the method further includes: converting the target attribute characteristics of each group of transaction data into a preset format; or converting the target attribute characteristics of each group of the transaction data and the target attribute characteristics of a group of the transaction data in the subsequent sequence into the same format.
It should be noted that, in this embodiment, because the data sources of the several sets of transaction data to be compared are different, the formats of the data storage in each set may be different, for example, the format of the previous set of transaction data for the time storage is one field, and the format of the previous set of transaction data for the time storage is one field, so that the target attribute of the extracted time includes two fields, while the format of the other set of transaction data for the time storage is one field, and if the formats of the previous set of transaction data for the time storage are not converted to be consistent, the two sets of transaction data cannot be compared.
For another example, the data format of the former group of transaction data for amount is Chinese capital figure, such as one ten thousand zero five hundred yuan, while the format of the latter group of transaction data for amount is Arabic figure, such as 10500 yuan, and if the amounts are not unified into one format, the comparison is difficult.
For another example, sometimes there is much information in each group of transaction data, for example, there may be information of a user name, a user mobile phone number, a remark of placing an order, and the like in the work order data, and some information may not need to be compared, although only a few specific target attribute features of each group of transaction data are required to be extracted during extraction, sometimes there may be an sql script that erroneously extracts other attribute features, and therefore, data cleaning in this step is set, or non-target attribute features in each group of data may be deleted, that is, missing and missing are made for each group of transaction data extracted in the first step.
In one embodiment, the transaction data processing method further includes: and step S104, sending the comparison result to a target mailbox or a target APP software account corresponding to each group of transaction data.
In this embodiment, the data with the comparison error may be sent to the target mailbox or the target APP software account, so that the person with the corresponding account can solve the problem of the data error in time. It is understood that the target mailbox is, for example, a mailbox of a person in charge corresponding to two sets of transaction data with comparison errors. Wherein the person in charge corresponding to each set of transaction data is, for example, the person in charge corresponding to each transaction system.
In one embodiment, the method further comprises: step S105, executing a transaction data comparison method every preset time.
Specifically, the comparison processing may be performed on the transaction data every other day.
According to the transaction data processing method provided by the embodiment of the invention, each group of transaction data is compared with the respective transaction data in sequence according to the sequence of transaction execution, and the last group of data is compared with the first group of data, so that the transaction data from different sources can be compared quickly, efficiently and accurately, the wrong data can be found in time, and the loss can be stopped in time.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.
The invention has been described above with reference to embodiments thereof. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. The scope of the invention is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the invention, and these alternatives and modifications are intended to be within the scope of the invention.
Although the embodiments of the present invention have been described in detail, it should be understood that various changes, substitutions, and alterations can be made hereto without departing from the spirit and scope of the invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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, and the like) having computer-usable program code embodied therein.

Claims (15)

1. A transaction data processing method, comprising:
extracting a plurality of groups of transaction data from different sources, wherein the plurality of groups of transaction data are sequentially generated according to the sequence of transaction execution;
comparing each set of the transaction data with a respective set of the transaction data in a subsequent order;
and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result.
2. The transaction data processing method of claim 1, wherein each set of the transaction data includes a plurality of target attribute features; each set of the transaction data and the respective transaction data in the next order have at least two corresponding target attribute characteristics;
the comparing each set of the transaction data with a respective set of transaction data in a subsequent order comprises:
comparing the target attribute characteristics of each group of transaction data with the corresponding target attribute characteristics of the respective next sequence;
and when at least one target attribute feature is not matched with the corresponding target attribute feature in the next sequence, determining that the comparison result is that two sets of transaction data have errors.
3. The transaction data processing method according to claim 2,
according to the sequence of transaction execution, the transaction data groups sequentially comprise work order data, order data and payment data;
wherein the plurality of target attribute features of the work order data comprise: the order number, the transaction amount, the order generation time and the transaction state;
the plurality of target attribute characteristics of the order data include: a work order number, an order number, a transaction amount, order generation time, payment completion time and payment state;
the plurality of target attribute features of the payment data comprises: order number, transaction amount, payment completion time, and transaction status.
4. The transaction data processing method of claim 1, wherein after extracting the plurality of sets of transaction data, before comparing each set of transaction data with a respective set of transaction data in a subsequent order, further comprising:
performing data filtering on the plurality of sets of transaction data, the data filtering including one or more of:
deleting repeated transaction data in the multiple groups of transaction data and keeping the transaction data to be one; alternatively, the first and second electrodes may be,
and deleting the transaction data which do not meet the preset conditions.
5. The transaction data processing method of claim 4, wherein after data filtering the plurality of sets of transaction data, before comparing each set of transaction data with a respective set of transaction data in a subsequent order, further comprising:
converting the target attribute characteristics of each group of transaction data into a preset format; or
And converting the target attribute characteristics of each group of the transaction data and the target attribute characteristics of the next sequential group of the transaction data into the same format.
6. The transaction data processing method of claim 1, further comprising: and sending the comparison result to a target mailbox or a target APP software account corresponding to each group of transaction data.
7. The transaction data processing method according to claim 1,
and executing a transaction data comparison method at preset time intervals.
8. A transaction data processing apparatus, comprising:
the data acquisition module is used for extracting a plurality of groups of transaction data from different sources, and the plurality of groups of transaction data are sequentially generated according to the sequence of transaction execution;
the data comparison module is used for comparing each group of transaction data with a group of transaction data in the respective subsequent sequence; and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result.
9. The transactional data processing apparatus of claim 8, wherein each set of said transactional data comprises a plurality of target attribute features; each set of the transaction data and the respective transaction data in the next order have at least two corresponding target attribute characteristics;
the data comparison module is used for comparing the target attribute characteristics of each group of transaction data with the corresponding target attribute characteristics of the respective next sequence; and when at least one target attribute feature is not matched with the corresponding target attribute feature in the next sequence, determining that the comparison result is that two sets of transaction data have errors.
10. The transaction data processing device of claim 9,
the transaction data extracted by the data extraction module comprise work order data, order data and payment data;
wherein the plurality of target attribute features of the work order data comprise: the order number, the transaction amount, the order generation time and the transaction state;
the plurality of target attribute characteristics of the order data include: a work order number, an order number, a transaction amount, order generation time, payment completion time and payment state;
the plurality of target attribute features of the payment data comprises: order number, transaction amount, payment completion time, and transaction status.
11. The transaction data processing device of claim 8, further comprising:
and the data filtering module is used for performing data filtering on the multiple groups of transaction data, wherein the data filtering comprises deleting repeated transaction data in the multiple groups of transaction data, and keeping the transaction data to be one or deleting the transaction data which do not meet preset conditions.
12. The transaction data processing device of claim 11, further comprising:
and the data cleaning module is used for converting the target attribute characteristics of each group of transaction data into a preset format or converting the target attribute characteristics of each group of transaction data and the target attribute characteristics of a group of transaction data in the subsequent sequence into the same format.
13. The transaction data processing device of claim 8, further comprising:
and the comparison result sending module is used for sending the comparison result to the mailbox or the APP software account of the target task corresponding to each group of transaction data.
14. The transaction data processing device of claim 8, further comprising:
the clock module is used for indicating the data extraction module to extract a plurality of groups of transaction data from different sources at intervals of preset time so that the data comparison module compares each group of transaction data with a group of transaction data in a respective subsequent sequence at intervals of the preset time; and comparing the last group of transaction data of the transaction execution sequence with the first group of transaction data to obtain a comparison result.
15. A server comprising a processor that performs transaction data processing using the method of any of claims 1-8.
CN202010986267.8A 2020-09-18 2020-09-18 Transaction data processing method and device and server Pending CN112184368A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010986267.8A CN112184368A (en) 2020-09-18 2020-09-18 Transaction data processing method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010986267.8A CN112184368A (en) 2020-09-18 2020-09-18 Transaction data processing method and device and server

Publications (1)

Publication Number Publication Date
CN112184368A true CN112184368A (en) 2021-01-05

Family

ID=73920129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010986267.8A Pending CN112184368A (en) 2020-09-18 2020-09-18 Transaction data processing method and device and server

Country Status (1)

Country Link
CN (1) CN112184368A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859025A (en) * 2019-01-24 2019-06-07 上海蔚来汽车有限公司 A kind of automatic account checking method and electronic equipment
CN109993651A (en) * 2019-04-11 2019-07-09 软通动力信息技术(集团)有限公司 Data calculate service order collection method of calibration, device, computer equipment and medium
CN110059077A (en) * 2019-04-19 2019-07-26 深圳乐信软件技术有限公司 A kind of verification of data method, apparatus, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859025A (en) * 2019-01-24 2019-06-07 上海蔚来汽车有限公司 A kind of automatic account checking method and electronic equipment
CN109993651A (en) * 2019-04-11 2019-07-09 软通动力信息技术(集团)有限公司 Data calculate service order collection method of calibration, device, computer equipment and medium
CN110059077A (en) * 2019-04-19 2019-07-26 深圳乐信软件技术有限公司 A kind of verification of data method, apparatus, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107464151B (en) Order data processing method and device for high-concurrency service
CN105989059B (en) Data record checking method and device
CN104156832A (en) Intersystem data verification method and device
CN108805632B (en) Charging method and device
CN105530272A (en) Method and device for application data synchronization
CN110321339B (en) Data migration method, device, equipment and storage medium
CN111343241B (en) Graph data updating method, device and system
CN107153646B (en) Data processing method and equipment
CN110264332A (en) The method, apparatus and electronic equipment that account is entered an item of expenditure in the accounts
CN106250501A (en) Report processing method and reporting system
CN112907336A (en) Method and server for realizing order state synchronization based on mybatis interceptor
CN110046172B (en) Online computing data processing method and system
CN112184368A (en) Transaction data processing method and device and server
CN110427399A (en) Real-time data acquisition method, system, device and storage medium
CN112256978B (en) Data processing method, device and medium based on data model
CN112181817B (en) Test method and test device for SOA architecture platform
CN114356454A (en) Account checking data processing method, account checking data processing device, account checking data storage medium and program product
CN113011869A (en) Test data generation method and device and computer readable storage medium
CN110517010A (en) A kind of data processing method, system and storage medium
CN104574183A (en) Cross-system information processing method and cross-system information processing device
CN110309211A (en) A kind of method and relevant device positioning ETL Process Problems
CN109376141A (en) A kind of data migration method and device
CN115665674B (en) 5G message processing method, device, equipment and storage medium
CN113590717A (en) Additional entry processing method and device under high concurrent transaction amount
CN112559610A (en) Method and device for generating account checking file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination